File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 11import os
2- from typing import Optional , Tuple , List
2+ from typing import List , Optional , Tuple
33
44import cloudpickle
55import h5py
66import numpy as np
77
8-
98group_dict = {
109 "fn" : "function" ,
1110 "args" : "input_args" ,
@@ -108,7 +107,8 @@ def get_cache_data(cache_directory: str) -> List[dict]:
108107 with h5py .File (os .path .join (cache_directory , file_name ), "r" ) as hdf :
109108 file_content_dict = {
110109 key : cloudpickle .loads (np .void (hdf ["/" + key ]))
111- for key in group_dict .values () if key in hdf
110+ for key in group_dict .values ()
111+ if key in hdf
112112 }
113113 file_content_dict ["filename" ] = file_name
114114 file_lst .append (file_content_dict )
Original file line number Diff line number Diff line change 55from executorlib import Executor
66
77try :
8-
98 from executorlib .standalone .hdf import get_cache_data
109
1110 skip_h5py_test = False
@@ -25,8 +24,10 @@ def test_cache_data(self):
2524
2625 cache_lst = get_cache_data (cache_directory = cache_directory )
2726 self .assertEqual (sum ([c ["output" ] for c in cache_lst ]), sum (result_lst ))
28- self .assertEqual (sum ([sum (c ["input_args" ][0 ]) for c in cache_lst ]), sum (result_lst ))
27+ self .assertEqual (
28+ sum ([sum (c ["input_args" ][0 ]) for c in cache_lst ]), sum (result_lst )
29+ )
2930
3031 def tearDown (self ):
3132 if os .path .exists ("cache" ):
32- shutil .rmtree ("cache" )
33+ shutil .rmtree ("cache" )
You can’t perform that action at this time.
0 commit comments