Skip to content

Commit

Permalink
Bump test version of numcodecs (#2114)
Browse files Browse the repository at this point in the history
* Bump test version of numcodecs

* Fix test for numcodecs 0.13
  • Loading branch information
dstansby authored Aug 26, 2024
1 parent 35e8106 commit 025e103
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion requirements_dev_minimal.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# library requirements
asciitree==0.3.3
fasteners==0.19
numcodecs==0.12.1
numcodecs==0.13.0
msgpack-python==0.5.6
setuptools-scm==8.1.0
# test requirements
Expand Down
34 changes: 13 additions & 21 deletions zarr/tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,36 +282,28 @@ def test_encode_decode_array_dtype_shape_v3(cname):
fill_value=None,
chunk_memory_layout="C",
)

meta_json = (
"""{
meta_expected = {
"attributes": {},
"chunk_grid": {
"chunk_shape": [10],
"separator": "/",
"type": "regular"
},
"chunk_grid": {"chunk_shape": [10], "separator": "/", "type": "regular"},
"chunk_memory_layout": "C",
"compressor": {
"""
+ f"""
"codec": "https://purl.org/zarr/spec/codec/{cname}/1.0",
"""
+ """
"configuration": {
"level": 1
}
"codec": f"https://purl.org/zarr/spec/codec/{cname}/1.0",
"configuration": {"level": 1},
},
"data_type": "<f8",
"extensions": [],
"fill_value": null,
"shape": [100, 10, 10 ]
}"""
)
"fill_value": None,
"shape": [100, 10, 10],
}

if cname == "zstd":
meta_expected["compressor"]["configuration"]["checksum"] = False

meta_expected_json = json.dumps(meta_expected)

# test encoding
meta_enc = Metadata3.encode_array_metadata(meta)
assert_json_equal(meta_json, meta_enc)
assert_json_equal(meta_enc, meta_expected_json)

# test decoding
meta_dec = Metadata3.decode_array_metadata(meta_enc)
Expand Down

0 comments on commit 025e103

Please sign in to comment.