fill_value handling has changed in numpy=2.4.0
#303
Merged
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.
Description
In numpy=2.4.0 a one-element np.ndarray missing_value is not accepted anymore once the fill_value is a float, and tosses a ValueError: setting an element with a sequence, and as of numpy/numpy#29421 and numpy/numpy#29423 it only accepts floats and strings. This comes from a now-enforced Deprecation that allows only 0-dim arrays to be converted to scalars:
TypeError: only 0-dimensional arrays can be converted to Python scalarsSee numpy/numpy#30591
The MRE I posted at numpy:
Before you get started
Checklist