-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fill_value serialization of NaN; add property-based tests
- Loading branch information
1 parent
a52048d
commit 9048d79
Showing
3 changed files
with
75 additions
and
3 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
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,22 @@ | ||
from hypothesis import strategies as st | ||
import hypothesis.extra.numpy as npst | ||
|
||
from zarr.testing.strategies import v2_dtypes | ||
|
||
@st.composite | ||
def array_metadata_v2_inputs(draw): | ||
dims = draw(st.integers(min_value=1, max_value=10)) | ||
shape = draw(st.lists(st.integers(min_value=1, max_value=100), min_size=dims, max_size=dims)) | ||
chunks = draw(st.lists(st.integers(min_value=1, max_value=100), min_size=dims, max_size=dims)) | ||
dtype = draw(v2_dtypes()) | ||
fill_value = draw(st.one_of([st.none(), npst.from_dtype(dtype)])) | ||
order = draw(st.sampled_from(["C", "F"])) | ||
dimension_separator = draw(st.sampled_from([".", "/"])) | ||
return { | ||
"shape": shape, | ||
"dtype": dtype, | ||
"chunks": chunks, | ||
"fill_value": fill_value, | ||
"order": order, | ||
"dimension_separator": dimension_separator, | ||
} |
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