Skip to content

Commit

Permalink
FIX: pre-commit pass
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 19ca56a commit c43d917
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
13 changes: 7 additions & 6 deletions xbatcher/generators.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""Classes for iterating through xarray datarrays / datasets in batches."""

import itertools
import warnings
import json

import warnings
from operator import itemgetter
from typing import Any, Dict, Hashable, Iterator, List, Optional, Sequence, Union

Expand Down Expand Up @@ -285,9 +284,11 @@ def to_json(self):
out_member_dict = {}
member_keys = [x for x in member.keys()]
for member_key in member_keys:
out_member_dict[member_key] = {'start': member[member_key].start,
'stop': member[member_key].stop,
'step': member[member_key].step}
out_member_dict[member_key] = {
"start": member[member_key].start,
"stop": member[member_key].stop,
"step": member[member_key].step,
}
out_dict["selector"] = out_member_dict
return json.dumps(out_dict)

Expand All @@ -301,7 +302,7 @@ def to_file(self, out_file_name: str):
The path to the json file to write to.
"""
out_json = self.to_json()
out_file = open(out_file_name, mode='w')
out_file = open(out_file_name, mode="w")
out_file.write(out_json)
out_file.close()

Expand Down
5 changes: 3 additions & 2 deletions xbatcher/tests/test_generators.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import json
import tempfile

import numpy as np
import pytest
import xarray as xr
import tempfile
import json

from xbatcher import BatchGenerator, BatchSchema
from xbatcher.testing import (
Expand Down

0 comments on commit c43d917

Please sign in to comment.