Example #1
0
def parse_arguments(defaultdb, usedbcache):
    args = argparse2.parse_arguments(defaultdb=defaultdb)
    # Parse arguments
    args = argparse2.fix_args_with_cache(args)
    if usedbcache:
        if args.vdd:
            helpers.vd(args.dbdir)
            args.vdd = False
    params.args = args
    # Preload process args
    if args.delete_global:
        io.delete_global_cache()
    return args
Example #2
0
def main(defaultdb='NAUTS', usedbcache=False, default_load_all=True):
    import matplotlib
    matplotlib.use('Qt4Agg')
    imports()
    from hscom import argparse2
    from hscom import helpers
    from hotspotter import HotSpotterAPI as api
    args = argparse2.parse_arguments(defaultdb=defaultdb)
    # Parse arguments
    args = argparse2.fix_args_with_cache(args)
    if usedbcache:
        load_all, cids = preload_args_process(args)
    else:
        args = argparse2.fix_args_shortnames(args)
        load_all = helpers.get_flag('--load-all', default_load_all)

    # Preload process args
    if args.delete_global:
        from hscom import fileio as io
        io.delete_global_cache()

    # --- Build HotSpotter API ---
    hs = api.HotSpotter(args)
    setcfg = args.setcfg
    if setcfg is not None:
        import experiment_harness
        print('[main] setting cfg to %r' % setcfg)
        varried_list = experiment_harness.get_varried_params_list([setcfg])
        cfg_dict = varried_list[0]
        #print(cfg_dict)
        hs.prefs.query_cfg.update_cfg(**cfg_dict)
        hs.prefs.save()
        #hs.prefs.printme()
        # load default preferences
        hs.default_preferences()

    # Load all data if needed now, otherwise be lazy
    try:
        hs.load(load_all=load_all)
        from hscom import fileio as io
        #imported from wrong module
        #from hotspotter import fileio as io
        db_dir = hs.dirs.db_dir
        io.global_cache_write('db_dir', db_dir)
    except ValueError as ex:
        print('[main] ValueError = %r' % (ex, ))
        if hs.args.strict:
            raise
    return hs
Example #3
0
def parse_arguments(defaultdb, usedbcache):
    args = argparse2.parse_arguments(defaultdb=defaultdb)
    # Parse arguments
    args = argparse2.fix_args_with_cache(args)
    if usedbcache:
        if args.vdd:
            helpers.vd(args.dbdir)
            args.vdd = False
        if helpers.inIPython() or '--cmd' in sys.argv:
            args.nosteal = True
    params.args = args
    # Preload process args
    if args.delete_global:
        io.delete_global_cache()
    return args
Example #4
0
def main(defaultdb='NAUTS', usedbcache=False, default_load_all=True):
    import matplotlib
    matplotlib.use('Qt4Agg')
    imports()
    from hscom import argparse2
    from hscom import helpers
    from hotspotter import HotSpotterAPI as api
    args = argparse2.parse_arguments(defaultdb=defaultdb)
    # Parse arguments
    args = argparse2.fix_args_with_cache(args)
    if usedbcache:
        load_all, cids = preload_args_process(args)
    else:
        args = argparse2.fix_args_shortnames(args)
        load_all = helpers.get_flag('--load-all', default_load_all)

    # Preload process args
    if args.delete_global:
        from hscom import fileio as io
        io.delete_global_cache()

    # --- Build HotSpotter API ---
    hs = api.HotSpotter(args)
    setcfg = args.setcfg
    if setcfg is not None:
        import experiment_harness
        print('[main] setting cfg to %r' % setcfg)
        varried_list = experiment_harness.get_varried_params_list([setcfg])
        cfg_dict = varried_list[0]
        #print(cfg_dict)
        hs.prefs.query_cfg.update_cfg(**cfg_dict)
        hs.prefs.save()
        #hs.prefs.printme()
        #hs.default_preferences()

    # Load all data if needed now, otherwise be lazy
    try:
        hs.load(load_all=load_all)
        from hotspotter import fileio as io
        db_dir = hs.dirs.db_dir
        io.global_cache_write('db_dir', db_dir)
    except ValueError as ex:
        print('[main] ValueError = %r' % (ex,))
        if hs.args.strict:
            raise
    return hs
Example #5
0
def parse_arguments(defaultdb, usedbcache):
    from hscom import argparse2
    from hscom import params
    from hscom import helpers as util
    from hscom import fileio as io
    import sys
    args = argparse2.parse_arguments(defaultdb=defaultdb)
    # Parse arguments
    args = argparse2.fix_args_with_cache(args)
    if usedbcache:
        if args.vdd:
            util.vd(args.dbdir)
            args.vdd = False
        if util.inIPython() or '--cmd' in sys.argv:
            args.nosteal = True
    params.args = args
    # Preload process args
    if args.delete_global:
        io.delete_global_cache()
    return args
Example #6
0
 def delete_global_prefs(hs):
     io.delete_global_cache()
Example #7
0
 def delete_global_prefs(hs):
     io.delete_global_cache()