-
-
Notifications
You must be signed in to change notification settings - Fork 12k
DEP: Raise TypeError on attempt to convert array with ndim > 0 to…
#29841
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
Conversation
seberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks a lot @hpkfft, I think Matti agreed it's about time, so I think we can give this a shot.
If someone finds this PR and has a larger fallout, please let us know, in theory we could e.g. escalate to a VisibleDeprecationWarning (but in practice, I think users also tend to ignore warnings either way).
NumPy 1.25 was 2.5 years ago (by the time this is released), which seems OK for this.
(We are not good about timely expiring, but this was always a noisy one, so I think it had to be well above 1 year of deprecation.)
| assert_equal(6.0, float_func(np.bytes_(b'6'))) | ||
| assert_equal(6.1, float_func(np.bytes_(b'6.1'))) | ||
| assert_equal(7.0, float_func(np.str_('7'))) | ||
| assert_equal(7.1, float_func(np.str_('7.1'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests? I don't say no to new tests ever :). (I think float and __float__ is a bit double, since float just calls __float__, but OK.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I thought it best to be careful.
Since Python 3.8, float() will fall back to __index__():
For a general Python object
x,float(x)delegates tox.__float__(). If__float__()is not defined then it falls back to__index__().
|
Windows FP16 seems to be very broken on some hardware or so, restarted CI, but whatever is going on, it is unrelated to this PR anyway. |
… scalar (numpy#29841) This PR removes deprecated functionality, as requested in numpygh-29835. The functionality will be deprecated for about 2.5 years (NumPy 1.25).
… scalar (numpy#29841) This PR removes deprecated functionality, as requested in numpygh-29835. The functionality will be deprecated for about 2.5 years (NumPy 1.25).
* Updated environment lockfiles * Adapt tests for NumPy 2.4 scalar conversion - numpy/numpy#29841 . --------- Co-authored-by: Lockfile bot <noreply@github.com>
This PR removes deprecated functionality, as requested in #29835