Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 5
0
 def test_get_paths(self):
     paths = get_paths()
     vc = read_vc()
     vc_l = len(vc.index)
     print(paths)
     self.assertEqual(vc_l, len(paths))
Ejemplo n.º 6
0
 def vc(self) -> pd.DataFrame:
     try:
         return self.__vc__
     except:
         self.__vc__ = read_vc(usr=self.usr)
         return self.__vc__
Ejemplo n.º 7
0
 def test_read_vc_u2_versNone(self):
     vc = read_vc(usr=usr2, vers=None)
     self.assertEqual(vc_cols_c, len(vc.columns))
Ejemplo n.º 8
0
 def test_read_vc_default(self):
     vc = read_vc()
     self.assertEqual(vc_cols_c, len(vc.columns))