コード例 #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))
コード例 #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
コード例 #3
0
def get_paths(usr=1, root=root):
    vc = read_vc(usr)
    paths = __get_paths_csv__(vc, usr, root)
    return paths
コード例 #4
0
 def transform_core(self, _):
     vc = read_vc(usr=self.usr)
     return vc
コード例 #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))
コード例 #6
0
 def vc(self) -> pd.DataFrame:
     try:
         return self.__vc__
     except:
         self.__vc__ = read_vc(usr=self.usr)
         return self.__vc__
コード例 #7
0
 def test_read_vc_u2_versNone(self):
     vc = read_vc(usr=usr2, vers=None)
     self.assertEqual(vc_cols_c, len(vc.columns))
コード例 #8
0
 def test_read_vc_default(self):
     vc = read_vc()
     self.assertEqual(vc_cols_c, len(vc.columns))