-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use zarr-python 2.18.4 for Zarr V2 string compatibility tests
- Loading branch information
Showing
8 changed files
with
77 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env -S uv run | ||
# /// script | ||
# requires-python = ">=3.12" | ||
# dependencies = [ | ||
# "zarr==2.18.4", | ||
# ] | ||
# /// | ||
|
||
import zarr | ||
|
||
path_out = "tests/data/zarr_python_compat/str_v2_fv_0.zarr" | ||
array = zarr.open( | ||
path_out, | ||
dtype=str, | ||
shape=(5,), | ||
chunks=(2,), | ||
compressor=None, | ||
mode='w', | ||
) | ||
array[0] = "a" | ||
array[1] = "bb" | ||
array[2] = "" | ||
print(array.info) | ||
print(array[:]) | ||
assert (array[:] == ["a", "bb", "", "0", "0"]).all() | ||
|
||
path_out = "tests/data/zarr_python_compat/str_v2_fv_null.zarr" | ||
array = zarr.open( | ||
path_out, | ||
dtype=str, | ||
shape=(5,), | ||
chunks=(2,), | ||
fill_value = None, | ||
compressor=None, | ||
mode='w', | ||
) | ||
array[0] = "a" | ||
array[1] = "bb" | ||
array[2] = "" | ||
print(array.info) | ||
print(array[:]) | ||
assert (array[:] == ["a", "bb", "", "", None]).all() # Yikes |
File renamed without changes.
33 changes: 16 additions & 17 deletions
33
zarrs/tests/data/zarr_python_compat/str_v2_fv_0.zarr/.zarray
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
{ | ||
"shape": [ | ||
5 | ||
], | ||
"chunks": [ | ||
2 | ||
], | ||
"fill_value": 0, | ||
"order": "C", | ||
"filters": [ | ||
{ | ||
"id": "vlen-utf8" | ||
} | ||
], | ||
"dimension_separator": ".", | ||
"compressor": null, | ||
"zarr_format": 2, | ||
"dtype": "|O" | ||
"chunks": [ | ||
2 | ||
], | ||
"compressor": null, | ||
"dtype": "|O", | ||
"fill_value": "0", | ||
"filters": [ | ||
{ | ||
"id": "vlen-utf8" | ||
} | ||
], | ||
"order": "C", | ||
"shape": [ | ||
5 | ||
], | ||
"zarr_format": 2 | ||
} |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
33 changes: 16 additions & 17 deletions
33
zarrs/tests/data/zarr_python_compat/str_v2_fv_null.zarr/.zarray
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
{ | ||
"shape": [ | ||
5 | ||
], | ||
"chunks": [ | ||
2 | ||
], | ||
"fill_value": null, | ||
"order": "C", | ||
"filters": [ | ||
{ | ||
"id": "vlen-utf8" | ||
} | ||
], | ||
"dimension_separator": ".", | ||
"compressor": null, | ||
"zarr_format": 2, | ||
"dtype": "|O" | ||
"chunks": [ | ||
2 | ||
], | ||
"compressor": null, | ||
"dtype": "|O", | ||
"fill_value": null, | ||
"filters": [ | ||
{ | ||
"id": "vlen-utf8" | ||
} | ||
], | ||
"order": "C", | ||
"shape": [ | ||
5 | ||
], | ||
"zarr_format": 2 | ||
} |
1 change: 0 additions & 1 deletion
1
zarrs/tests/data/zarr_python_compat/str_v2_fv_null.zarr/.zattrs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters