Skip to content

Commit cf7bce5

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d1e72c4 commit cf7bce5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

executorlib/standalone/hdf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import os
2-
from typing import Optional, Tuple, List
2+
from typing import List, Optional, Tuple
33

44
import cloudpickle
55
import h5py
66
import numpy as np
77

8-
98
group_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)

tests/test_cache_executor_interactive.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from executorlib import Executor
66

77
try:
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")

0 commit comments

Comments
 (0)