Пример #1
0
 def unload_all(hs):
     print('[hs] Unloading all data')
     hs.feats = ds.HotspotterChipFeatures()
     hs.cpaths = ds.HotspotterChipPaths()
     hs.qdat.unload_data()
     hs.clear_lru_caches()
     print('[hs] finished unloading all data')
Пример #2
0
 def __init__(hs, args=None, db_dir=None):
     super(HotSpotter, hs).__init__(child_exclude_list=['prefs', 'args'])
     #printDBG('[\hs] Creating HotSpotter API')
     # TODO Remove args / integrate into prefs
     hs.args = args
     hs.callbacks = {}
     hs.tables = None
     hs.dirs = None
     hs.feats = ds.HotspotterChipFeatures()
     hs.cpaths = ds.HotspotterChipPaths()
     #
     hs.train_sample_cx = None
     hs.test_sample_cx = None
     hs.indexed_sample_cx = None
     #
     pref_fpath = join(io.GLOBAL_CACHE_DIR, 'prefs')
     hs.prefs = Pref('root', fpath=pref_fpath)
     if hs.args.nocache_prefs:
         hs.default_preferences()
     else:
         hs.load_preferences()
     #if args is not None:
     #hs.prefs.N = args.N if args is not None
     #args_dict = vars(args)
     #hs.update_preferences(**args_dict)
     hs.query_history = [(None, None)]
     hs.qdat = ds.QueryData()  # Query Data
     if db_dir is not None:
         hs.load_tables(db_dir=db_dir)