def test_detect_images_auto(self): d = TestDetector() res = d.detect_images_auto() vc = read_vc() vc_l = len(vc.index) print(res) self.assertEqual(vc_l, len(res.index))
def get_paths_cached(usr=1, root=root): cache_path = "{root}/tmp/paths_dict_{usr}.pkl".format(root=root, usr=str(usr)) is_in_cache = Path(cache_path).exists() if is_in_cache: with open(cache_path, 'rb') as f: paths = pickle.load(f) else: vc = read_vc(usr) paths = __get_paths_csv__(vc, usr, root) with open(cache_path, 'wb') as f: pickle.dump(paths, f) return paths
def get_paths(usr=1, root=root): vc = read_vc(usr) paths = __get_paths_csv__(vc, usr, root) return paths
def transform_core(self, _): vc = read_vc(usr=self.usr) return vc
def test_get_paths(self): paths = get_paths() vc = read_vc() vc_l = len(vc.index) print(paths) self.assertEqual(vc_l, len(paths))
def vc(self) -> pd.DataFrame: try: return self.__vc__ except: self.__vc__ = read_vc(usr=self.usr) return self.__vc__
def test_read_vc_u2_versNone(self): vc = read_vc(usr=usr2, vers=None) self.assertEqual(vc_cols_c, len(vc.columns))
def test_read_vc_default(self): vc = read_vc() self.assertEqual(vc_cols_c, len(vc.columns))