Esempio n. 1
0
def add_subparser(subparsers):
    parser = subparsers.add_parser('change-description', help='Edit description of run.')
    default_flags = copy(DEFAULT_QUERY_FLAGS)
    default_flags['patterns'].update(
        help='Name of run whose description you want to edit.')
    add_query_flags(parser, with_sort=False, default_flags=default_flags)
    parser.add_argument('description', help='New description to assign to paths')
    return parser
Esempio n. 2
0
def add_subparser(subparsers):
    parser = subparsers.add_parser('correlate',
                                   help='Rank flags by Pearson correlation.')
    add_query_flags(parser, with_sort=False)
    parser.add_argument(
        'path_to_value',
        type=Path,
        help='The command will look for a file at this path containing '
        'a scalar value. It will calculate the pearson correlation between '
        'flags and this value. The keyword <path> will be replaced '
        'by the path of the run.')
    return parser
Esempio n. 3
0
def add_subparser(subparsers):
    parser = subparsers.add_parser(
        'rm',
        help="Delete runs from the database (and all associated tensorboard "
        "and checkpoint files).")
    default_flags = copy(DEFAULT_QUERY_FLAGS)
    default_flags['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_flags(parser, with_sort=False, default_flags=default_flags)
    return parser
Esempio n. 4
0
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_flags(parser, with_sort=True)
    parser.add_argument(
        '--porcelain',
        action='store_true',
        help='Print value only (for use with scripts)')
    return parser
Esempio n. 5
0
def add_subparser(subparsers):
    parser = subparsers.add_parser('ls', help='Print paths in run database.')

    default_flags = copy(DEFAULT_QUERY_FLAGS)
    default_flags['patterns'].update(default='%', nargs='*')
    add_query_flags(parser, with_sort=True, default_flags=default_flags)

    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
Esempio n. 6
0
def add_subparser(subparsers):
    parser = subparsers.add_parser(
        'reproduce',
        help='Print commands to reproduce a run or runs. This command '
        'does not have side-effects (besides printing).')
    add_query_flags(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.")
    return parser
Esempio n. 7
0
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_flags = copy(DEFAULT_QUERY_FLAGS)
    del default_flags['--descendants']
    add_query_flags(parser, with_sort=False, default_flags=default_flags)

    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=PurePath)
    parser.add_argument('--kill-tmux',
                        action='store_true',
                        help='Kill tmux session instead of renaming it.')
    return parser
Esempio n. 8
0
def add_subparser(subparsers):
    parser = subparsers.add_parser(
        'table', help='Display contents of run database as a table.')
    add_query_flags(parser, with_sort=True)
    parser.add_argument(
        '--columns',
        nargs='*',
        default=None,
        help='Comma-separated list of columns to display in table. Default is {}'
        .format(' '.join(DEFAULT_COLUMNS)))
    parser.add_argument(
        '--column-width',
        type=int,
        default=100,
        help='Maximum width of table columns. Longer values will '
        'be truncated and appended with "...".')
    parser.add_argument(
        '--porcelain',
        action='store_true',
        help=
        'This option toggles csv print out (as opposed to formatted print from tabulate)'
    )
    return parser
Esempio n. 9
0
def add_subparser(subparsers):
    parser = subparsers.add_parser(
        'flags', help='Print flags whose cross-product correspond to the queried runs.')
    add_query_flags(parser, with_sort=False)
    parser.add_argument('--delimiter', default='=', help='Delimiter for flag patterns.')
    return parser
Esempio n. 10
0
def add_subparser(subparsers):
    parser = subparsers.add_parser('kill', help="Kill selected TMUX sessions.")
    default_flags = copy(DEFAULT_QUERY_FLAGS)
    default_flags['patterns'].update(help='Pattern of runs to kill')
    add_query_flags(parser, with_sort=False, default_flags=default_flags)
    return parser