fill_value handling has changed in numpy=2.4.0#303
Merged
valeriupredoi merged 3 commits intomainfrom Jan 7, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #303 +/- ##
==========================================
+ Coverage 86.00% 86.04% +0.04%
==========================================
Files 7 7
Lines 643 645 +2
==========================================
+ Hits 553 555 +2
Misses 90 90 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
Hang on! Only just reviewing this now .... The |
Collaborator
Author
|
@davidhassell ah snap, sorry! Let me open a PR with that fix, I thought the missing value is always a single float |
5 tasks
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.
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