def add_subparser(subparsers): parser = subparsers.add_parser( "reproduce", help="Print subcommands to reproduce a run or runs. This command " "does not have side-effects (besides printing).", ) add_query_args(parser, with_sort=False) parser.add_argument( "--path", type=PurePath, default=None, help="This is for cases when you want to run the reproduced command on a new path.", ) parser.add_argument( "--description", type=str, default=None, help="Description to be assigned to new run. If None, use the same description as " "the run being reproduced.", ) parser.add_argument( "--prefix", type=str, help="String that would be prepended to commands, and should therefore be " "excluded from the reproduce command ", ) parser.add_argument( "--porcelain", action="store_true", help="Eliminate any explanatory text so that output can be run in a script.", ) return parser
def add_subparser(subparsers): parser = subparsers.add_parser( "mv", help="Move a run from OLD to NEW. " "Functionality is identical to Linux `mv` except that non-existent dirs" "are created and empty dirs are removed automatically.", ) default_args = deepcopy(DEFAULT_QUERY_ARGS) del default_args["--descendants"] add_query_args(parser, with_sort=False, default_args=default_args) parser.add_argument( "--no-descendants", dest="descendants", action="store_false", help="Don't move descendants of search pattern.", ) parser.add_argument("destination", help="New name for run." + path_clarification, type=str) parser.add_argument( "--kill-tmux", action="store_true", help="Kill tmux session instead of renaming it.", ) return parser
def add_subparser(subparsers): parser = subparsers.add_parser( "args", help="Print args whose cross-product correspond to the queried runs.") add_query_args(parser, with_sort=False) parser.add_argument("--delimiter", default="=", help="Delimiter for arg patterns.") return parser
def add_subparser(subparsers): parser = subparsers.add_parser( "change-description", help="Edit description of run." ) default_args = deepcopy(DEFAULT_QUERY_ARGS) default_args["patterns"].update( help="Name of run whose description you want to edit." ) add_query_args(parser, with_sort=False, default_args=default_args) parser.add_argument("description", help="New description to assign to paths") return parser
def add_subparser(subparsers): parser = subparsers.add_parser( "rm", help="Delete runs from the database (and all associated tensorboard " "and checkpoint files).", ) default_args = deepcopy(DEFAULT_QUERY_ARGS) default_args["patterns"].update( help= "This script will only delete entries in the database whose names are a complete " "(not partial) match of this sql pattern.") add_query_args(parser, with_sort=False, default_args=default_args) return parser
def add_subparser(subparsers): parser = subparsers.add_parser( "lookup", help="Lookup specific value associated with database entry." ) parser.add_argument( "key", choices=RunEntry.fields() + ("all",), help="Key that value is associated with.", ) add_query_args(parser, with_sort=True) parser.add_argument( "--porcelain", action="store_true", help="Print value only (for use with scripts)", ) return parser
def add_subparser(subparsers): parser = subparsers.add_parser("ls", help="Print paths in run database.") add_query_args(parser, with_sort=True, default_args=DEFAULT_QUERY_ARGS) parser.add_argument( "--show-attrs", action="store_true", help="Print run attributes in addition to names.", ) parser.add_argument("--depth", type=int, help="Depth of path to print.") parser.add_argument( "--pprint", action="store_true", help="format list of path names as tree " "formatting.", ) return parser
def add_subparser(subparsers): parser = subparsers.add_parser( "to-json", help="Print json spec that reproduces crossproduct " "of args in given patterns.", ) parser.add_argument( "--prefix", type=str, help= "String to prepend to all main subcommands, for example, sourcing a " "virtualenv", ) parser.add_argument("--exclude", nargs="*", default=set(), help="Keys of args to exclude.") add_query_args(parser, with_sort=False) return parser
def add_subparser(subparsers): parser = subparsers.add_parser("correlate", help="Rank args by Pearson correlation.") add_query_args(parser, with_sort=False) parser.add_argument( "--value-path", required=True, type=Path, help="The command will look for a file at this path containing " "a scalar value. It will calculate the pearson correlation between " "args and this value. The keyword <path> will be replaced " "by the path of the run.", ) parser.add_argument( "--prefix", type=str, help= "String to prepend to all main subcommands, for example, sourcing a " "virtualenv", ) return parser
def add_subparser(subparsers): parser = subparsers.add_parser("kill", help="Kill selected TMUX sessions.") default_args = deepcopy(DEFAULT_QUERY_ARGS) default_args["patterns"].update(help="Pattern of runs to kill") add_query_args(parser, with_sort=False, default_args=default_args) return parser