Skip to content

Commit

Permalink
fixed pep8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily Wang committed Nov 7, 2018
1 parent 228cc88 commit 7e100b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def sync(self):
def open_zarr(store, group=None, synchronizer=None, chunks='auto',
decode_cf=True, mask_and_scale=True, decode_times=True,
concat_characters=True, decode_coords=True,
drop_variables=None, overwrite_encoded_chunks=False,
drop_variables=None, overwrite_encoded_chunks=False,
**kwargs):
"""Load and decode a dataset from a Zarr store.
Expand Down Expand Up @@ -403,9 +403,9 @@ def open_zarr(store, group=None, synchronizer=None, chunks='auto',
"""
if 'auto_chunk' in kwargs:
auto_chunk = kwargs.pop('auto_chunk')
if auto_chunk == True:
if auto_chunk:
chunks = 'auto' # maintain backwards compatibility
elif auto_chunk == False:
else:
chunks = None

warnings.warn("auto_chunk is deprecated. Use chunks='auto' instead.",
Expand Down
10 changes: 5 additions & 5 deletions xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,27 +1380,27 @@ def test_manual_chunk(self):

assert_identical(actual, auto)
assert_identical(actual.load(), auto.load())

def test_deprecate_auto_chunk(self):
original = create_test_data().chunk()
with pytest.warns(FutureWarning):
with self.roundtrip(
original, open_kwargs={'auto_chunk': True}) as actual:
original, open_kwargs={'auto_chunk': True}) as actual:
for k, v in actual.variables.items():
# only index variables should be in memory
assert v._in_memory == (k in actual.dims)
# chunk size should be the same as original
assert v.chunks == original[k].chunks

with pytest.warns(FutureWarning):
with self.roundtrip(
original, open_kwargs={'auto_chunk': False}) as actual:
original, open_kwargs={'auto_chunk': False}) as actual:
for k, v in actual.variables.items():
# only index variables should be in memory
assert v._in_memory == (k in actual.dims)
# there should be no chunks
assert v.chunks is None


def test_write_uneven_dask_chunks(self):
# regression for GH#2225
Expand Down

0 comments on commit 7e100b5

Please sign in to comment.