Skip to content

Commit

Permalink
x == y or z == yy in (x, z)
Browse files Browse the repository at this point in the history
Suggested by refurb.
  • Loading branch information
DimitriPapadopoulos committed Sep 24, 2023
1 parent e353f5e commit d0b3416
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bench/ndarray/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def open_zarr(year, month, datestart, dateend, dset):
datestring = "era5-pds/zarr/{year}/{month:02d}/data/".format(year=year, month=month)
s3map = s3fs.S3Map(datestring + dset + ".zarr/", s3=fs)
arr = xr.open_dataset(s3map, engine="zarr")
if dset[:3] == "air" or dset[:3] == "sno" or dset[:3] == "eas":
if dset[:3] in ("air", "sno", "eas"):
arr = arr.sel(time0=slice(np.datetime64(datestart), np.datetime64(dateend)))
else:
arr = arr.sel(time1=slice(np.datetime64(datestart), np.datetime64(dateend)))
Expand Down
2 changes: 1 addition & 1 deletion tests/ndarray/test_empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_empty_minimal(shape, dtype):
a = blosc2.empty(shape, dtype=dtype)

dtype = np.dtype(dtype)
assert a.shape == shape or a.shape[0] == shape
assert shape in (a.shape, a.shape[0])
assert a.chunks is not None
assert a.blocks is not None
assert all(c >= b for c, b in zip(a.chunks, a.blocks))
Expand Down
2 changes: 1 addition & 1 deletion tests/ndarray/test_struct_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_scalar(shape, dtype, urlpath):
assert np.array_equal(a[:], b)

dtype = np.dtype(dtype)
assert a.shape == shape or a.shape[0] == shape
assert shape in (a.shape, a.shape[0])
assert a.dtype == dtype
assert a.schunk.typesize == dtype.itemsize
assert a.shape == b.shape
Expand Down
2 changes: 1 addition & 1 deletion tests/ndarray/test_zeros.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_zeros_minimal(shape, dtype):
assert np.array_equal(a[:], b)

dtype = np.dtype(dtype)
assert a.shape == shape or a.shape[0] == shape
assert shape in (a.shape, a.shape[0])
assert a.chunks is not None
assert a.blocks is not None
assert all(c >= b for c, b in zip(a.chunks, a.blocks))
Expand Down

0 comments on commit d0b3416

Please sign in to comment.