From cf4d2f288e8ea42452e0fa893de977ef3411c1e8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:58:30 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- virtualizarr/tests/test_manifests/test_array.py | 2 +- virtualizarr/tests/test_readers/test_kerchunk.py | 2 +- virtualizarr/zarr.py | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/virtualizarr/tests/test_manifests/test_array.py b/virtualizarr/tests/test_manifests/test_array.py index f1c85ea7..89ba019c 100644 --- a/virtualizarr/tests/test_manifests/test_array.py +++ b/virtualizarr/tests/test_manifests/test_array.py @@ -46,7 +46,7 @@ def test_create_manifestarray_from_kerchunk_refs(self): assert marr.chunks == (2, 3) assert marr.dtype == np.dtype("int64") assert marr.zarray.compressor is None - assert marr.zarray.fill_value is 0 + assert marr.zarray.fill_value == 0 assert marr.zarray.filters is None assert marr.zarray.order == "C" diff --git a/virtualizarr/tests/test_readers/test_kerchunk.py b/virtualizarr/tests/test_readers/test_kerchunk.py index 3b6819d0..455e1dbf 100644 --- a/virtualizarr/tests/test_readers/test_kerchunk.py +++ b/virtualizarr/tests/test_readers/test_kerchunk.py @@ -37,7 +37,7 @@ def test_dataset_from_df_refs(): assert da.data.zarray.compressor is None assert da.data.zarray.filters is None - assert da.data.zarray.fill_value is 0 + assert da.data.zarray.fill_value == 0 assert da.data.zarray.order == "C" assert da.data.manifest.dict() == { diff --git a/virtualizarr/zarr.py b/virtualizarr/zarr.py index af996602..f98c0e09 100644 --- a/virtualizarr/zarr.py +++ b/virtualizarr/zarr.py @@ -72,7 +72,7 @@ def __post_init__(self) -> None: self.fill_value = "NaN" elif self.fill_value is np.inf: self.fill_value = "Infinity" - elif self.fill_value is -np.inf: # TODO: does this work? + elif self.fill_value is -np.inf: # TODO: does this work? self.fill_value = "-Infinity" # TODO: Handle other data types (complex, etc.) @@ -207,9 +207,10 @@ def _v3_codec_pipeline(self) -> list: # https://github.com/zarr-developers/zarr-python/pull/1944#issuecomment-2151994097 # "If no ArrayBytesCodec is supplied, we can auto-add a BytesCodec" bytes = dict( - name="bytes", configuration={ + name="bytes", + configuration={ "endian": "little" # TODO need to handle endianess configuration, but little is a sensible default for now - } + }, ) # The order here is significant!