Fix of #4237 : 'ValueError: Input array must be contiguous' when *cas… - #4238
Open
raphaeljolivet wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4238 +/- ##
=======================================
Coverage 93.99% 93.99%
=======================================
Files 91 91
Lines 12792 12792
=======================================
Hits 12024 12024
Misses 768 768
🚀 New features to boost your workflow:
|
Use np.ascontiguousarray before calling cast-value-rs, and add regression tests for cast_value + transpose filter orderings. Fixes zarr-developers#4237
raphaeljolivet
force-pushed
the
bugfix/4237-cast-value-transpose-input-aray-should-be-contiguous
branch
from
August 5, 2026 11:06
212fd4a to
f8564b1
Compare
d-v-b
reviewed
Aug 5, 2026
| arr = chunk_array.as_ndarray_like() | ||
| target_native = self.dtype.to_native_dtype() | ||
|
|
||
| result = self._do_cast( |
Contributor
There was a problem hiding this comment.
can you move the fix into _do_cast?
d-v-b
reviewed
Aug 5, 2026
|
|
||
| import numpy as np | ||
| import pytest | ||
| from numpy.ma.testutils import assert_array_equal |
Contributor
There was a problem hiding this comment.
Suggested change
| from numpy.ma.testutils import assert_array_equal | |
| from numpy.testing import assert_array_equal |
d-v-b
reviewed
Aug 5, 2026
| ] | ||
| ) | ||
|
|
||
| # Write should be ok |
Contributor
There was a problem hiding this comment.
not sure we need these comments -- the entire test should pass, right?
Contributor
|
thank you for this! can you add a release note? |
…should-be-contiguous
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix of #4237 with unit test.