diff --git a/bench/ndarray/download_data.py b/bench/ndarray/download_data.py index 3c3f6f66..ed60e6ca 100644 --- a/bench/ndarray/download_data.py +++ b/bench/ndarray/download_data.py @@ -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))) diff --git a/tests/ndarray/test_empty.py b/tests/ndarray/test_empty.py index 67ee7dec..058f68d9 100644 --- a/tests/ndarray/test_empty.py +++ b/tests/ndarray/test_empty.py @@ -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)) diff --git a/tests/ndarray/test_struct_dtype.py b/tests/ndarray/test_struct_dtype.py index 3028e133..82017c7b 100644 --- a/tests/ndarray/test_struct_dtype.py +++ b/tests/ndarray/test_struct_dtype.py @@ -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 diff --git a/tests/ndarray/test_zeros.py b/tests/ndarray/test_zeros.py index 5524d9c3..f32af87c 100644 --- a/tests/ndarray/test_zeros.py +++ b/tests/ndarray/test_zeros.py @@ -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))