def parse_argv(): parser = argparse.ArgumentParser() parser.add_argument('path', help='path to statistics.csv') parser.add_argument( '--params', metavar='col_name', nargs='+', default=None, help='plot the forground of the graph with averaged data') parser.add_argument('-q', '--quiet', action='store_true', help='not showing figure, just save them') parser.add_argument('-t', '--trans', dest='facecolor', action='store_true', help='use transparent background') parser.add_argument('-s', '--focus', action='store_true', help='show only range with first hit') parser.add_argument('--dark', action='store_true', help='use dark mode') args = parser.parse_args() if args.dark: c.dark_mode() args.facecolor = c.transparent if args.facecolor else c.facecolor return args
def parse_argv(): parser = argparse.ArgumentParser() parser.add_argument('path', help='path to statistics.csv') parser.add_argument( '--params', metavar='col_name', nargs='+', default=None, help='plot the forground of the graph with averaged data') parser.add_argument('-q', '--quiet', action='store_true', help='not showing figure, just save them') parser.add_argument('-t', '--trans', dest='facecolor', action='store_true', help='use transparent background') parser.add_argument('--style', choices=['line', 'dot'], default='dot', help='plot with "line" or "dot"') parser.add_argument('--max', action='store_true', help='plot with accumulated max accuracy') parser.add_argument('--dark', action='store_true', help='use dark mode') args = parser.parse_args() if args.dark: c.dark_mode() args.facecolor = c.transparent if args.facecolor else c.facecolor return args
def parse_argv(): parser = argparse.ArgumentParser() parser.add_argument('path', help='path to statistics.csv') parser.add_argument( '--params', metavar='col_name', nargs='+', default=None, help='plot the forground of the graph with averaged data') parser.add_argument('-q', '--quiet', action='store_true', help='not showing figure, just save them') parser.add_argument('--avg', action='store_true', help='plot averaged startup_time for each model') parser.add_argument('-t', '--trans', dest='facecolor', action='store_true', help='use transparent background') parser.add_argument('--3d', dest='mode', action='store_const', const='3d', help='plot the figure in "3D"') parser.add_argument('--2d', dest='mode', action='store_const', const='2d', help='plot the figure in "2D" (default behavior)') parser.add_argument('--drop', metavar='type', nargs='*', type=str, default=[], help='ignore certain type(s) of neuron') parser.add_argument('--dark', action='store_true', help='use dark mode') args = parser.parse_args() if args.dark: c.dark_mode() args.facecolor = c.transparent if args.facecolor else c.facecolor args.mode = '2d' if args.mode is None else args.mode return args
def read_config(path): config = _get_default_config() with open(path, 'r') as stream: user_config = yaml.safe_load(stream) config.update(user_config) for host in config['hosts']: if config['hosts'][host]['params'] == 'Auto': config['hosts'][host]['params'] = None if config['figure']['dark_mode']: c.dark_mode() if config['figure']['transparent']: config['figure']['facecolor'] = c.transparent else: config['figure']['facecolor'] = c.facecolor if config['figure']['path'] == 'Auto': fname = os.path.basename(path).rsplit('.', 1)[0] config['figure']['path'] = f'first_hit_cross_{fname}.png' return config