-
-
Notifications
You must be signed in to change notification settings - Fork 336
Fix fill_value handling for complex dtypes #2200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dcherian
merged 12 commits into
zarr-developers:v3
from
dcherian:fix-prop-test-fillvalue
Sep 25, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
206c726
Fix fill_value handling for complex & datetime dtypes
dcherian 5d6d8d6
cleanup
dcherian 4857a67
more cleanup
dcherian ddcb61f
more cleanup
dcherian efcf1f5
Fix default fill_value
dcherian e31cb6f
Fixes
dcherian 6db8225
Add booleans
dcherian 1688c86
Add v2, v3 specific dtypes
dcherian 2a973b0
Add version.py to gitignore
dcherian a49bd32
cleanpu
dcherian b387820
Merge branch 'v3' into fix-prop-test-fillvalue
dcherian 1b9e818
style: pre-commit fixes
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -84,3 +84,5 @@ fixture/ | |
.DS_Store | ||
tests/.hypothesis | ||
.hypothesis/ | ||
|
||
zarr/version.py |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -464,9 +464,14 @@ def __repr__(self) -> str: | |
|
||
def all_equal(self, other: Any, equal_nan: bool = True) -> bool: | ||
"""Compare to `other` using np.array_equal.""" | ||
if other is None: | ||
# Handle None fill_value for Zarr V2 | ||
return False | ||
# use array_equal to obtain equal_nan=True functionality | ||
data, other = np.broadcast_arrays(self._data, other) | ||
result = np.array_equal(self._data, other, equal_nan=equal_nan) | ||
result = np.array_equal( | ||
self._data, other, equal_nan=equal_nan if self._data.dtype.kind not in "US" else False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also needed for V2 |
||
) | ||
return result | ||
|
||
def fill(self, value: Any) -> None: | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.