Skip to content

Commit

Permalink
Fix test for numcodecs 0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Aug 24, 2024
1 parent 897d4c3 commit 12ef3e5
Showing 1 changed file with 13 additions and 21 deletions.
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 12ef3e5

Please sign in to comment.