Skip to content

Commit

Permalink
STY: Pep8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Jackson authored and Robert Jackson committed Jan 13, 2023
1 parent a78b780 commit 19ca56a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions xbatcher/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ def to_json(self):
batch_selector_dict = {}
for i in self.selectors.keys():
batch_selector_dict[i] = self.selectors[i]
list_index = 0
for member in batch_selector_dict[i]:
out_member_dict = {}
member_keys = [x for x in member.keys()]
Expand All @@ -307,7 +306,6 @@ def to_file(self, out_file_name: str):
out_file.close()



def _gen_slices(*, dim_size: int, slice_size: int, overlap: int = 0) -> List[slice]:
# return a list of slices to chop up a single dimension
if overlap >= slice_size:
Expand Down
3 changes: 2 additions & 1 deletion xbatcher/tests/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def test_input_overlap_exceptions(sample_ds_1d):
BatchGenerator(sample_ds_1d, input_dims={"x": 10}, input_overlap={"x": 20})
assert len(e) == 1


@pytest.mark.parametrize("input_size", [5, 10])
def test_to_json(sample_ds_3d, input_size):
x_input_size = 20
Expand All @@ -371,4 +372,4 @@ def test_to_json(sample_ds_3d, input_size):
in_dict = json.load(out_file)
assert in_dict["input_dims"]["time"] == input_size
assert in_dict["input_dims"]["x"] == x_input_size
out_file.close()
out_file.close()

0 comments on commit 19ca56a

Please sign in to comment.