def delete_cache(hs): print('[hs] DELETE CACHE') computed_dir = hs.dirs.computed_dir hs.unload_all() #[hs.unload_cxdata(cx) for cx in hs.get_valid_cxs()] helpers.remove_files_in_dir(computed_dir, recursive=True, verbose=True, dryrun=False)
def delete_ciddata(hs, cid): cid_str_list = ['cid%d_' % cid, 'qcid=%d.npz' % cid, ] hs.clear_lru_caches() for cid_str in cid_str_list: dpath = hs.dirs.computed_dir pat = '*' + cid_str + '*' helpers.remove_files_in_dir(dpath, pat, recursive=True, verbose=True, dryrun=False)
def delete_queryresults_dir(hs): qres_dir = hs.dirs.qres_dir hs.unload_all() #[hs.unload_cxdata(cx) for cx in hs.get_valid_cxs()] helpers.remove_files_in_dir(qres_dir, recursive=True, verbose=True, dryrun=False)
def clear_feature_cache(hs): feat_cfg = hs.prefs.feat_cfg feat_dir = hs.dirs.feat_dir cache_dir = hs.dirs.cache_dir feat_uid = feat_cfg.get_uid() print('[fc2] clearing feature cache: %r' % feat_dir) helpers.remove_files_in_dir(feat_dir, '*' + feat_uid + '*', verbose=True, dryrun=False) helpers.remove_files_in_dir(cache_dir, '*' + feat_uid + '*', verbose=True, dryrun=False) pass
def delete_ciddata(hs, cid): cid_str_list = [ 'cid%d_' % cid, 'qcid=%d.npz' % cid, ] hs.clear_lru_caches() for cid_str in cid_str_list: dpath = hs.dirs.computed_dir pat = '*' + cid_str + '*' helpers.remove_files_in_dir(dpath, pat, recursive=True, verbose=True, dryrun=False)
def clean(): assert exists('setup.py'), 'must be run in hotspotter directory' assert exists('../hotspotter/setup.py'), 'must be run in hotspotter directory' assert exists('../hotspotter/hotspotter'), 'must be run in hotspotter directory' assert exists('_setup'), 'must be run in hotspotter directory' cwd = normpath(realpath(dirname(__file__))) print('[setup] Current working directory: %r' % cwd) helpers.remove_files_in_dir(cwd, '*.pyc', recursive=True) helpers.remove_files_in_dir(cwd, '*.prof', recursive=True) helpers.remove_files_in_dir(cwd, '*.prof.txt', recursive=True) helpers.remove_files_in_dir(cwd, '*.lprof', recursive=True) helpers.remove_files_in_dir(cwd, 'HotSpotterApp.*.pkg', recursive=False) helpers.remove_files_in_dir(cwd + '/hotspotter', '*.so', recursive=False) helpers.remove_files_in_dir(cwd + '/hotspotter', '*.c', recursive=False) helpers.delete(join(cwd, 'dist')) helpers.delete(join(cwd, 'build')) helpers.delete(join(cwd, "'")) # idk where this file comes from
def clean(): assert exists('setup.py'), 'must be run in hotspotter directory' assert exists( '../hotspotter/setup.py'), 'must be run in hotspotter directory' assert exists( '../hotspotter/hotspotter'), 'must be run in hotspotter directory' assert exists('_setup'), 'must be run in hotspotter directory' cwd = normpath(realpath(dirname(__file__))) print('[setup] Current working directory: %r' % cwd) helpers.remove_files_in_dir(cwd, '*.pyc', recursive=True) helpers.remove_files_in_dir(cwd, '*.prof', recursive=True) helpers.remove_files_in_dir(cwd, '*.prof.txt', recursive=True) helpers.remove_files_in_dir(cwd, '*.lprof', recursive=True) helpers.remove_files_in_dir(cwd, 'HotSpotterApp.*.pkg', recursive=False) helpers.remove_files_in_dir(cwd + '/hotspotter', '*.so', recursive=False) helpers.remove_files_in_dir(cwd + '/hotspotter', '*.c', recursive=False) helpers.delete(join(cwd, 'dist')) helpers.delete(join(cwd, 'build')) helpers.delete(join(cwd, "'")) # idk where this file comes from