DEP: Raise TypeError on attempt to convert array with ndim > 0 to…#29841
DEP: Raise TypeError on attempt to convert array with ndim > 0 to…#29841seberg merged 1 commit intonumpy:mainfrom
TypeError on attempt to convert array with ndim > 0 to…#29841Conversation
seberg
left a comment
There was a problem hiding this comment.
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.
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.
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 <[email protected]>
* room.py: wrap high-pass filtered RIR in np.ascontiguousarray * Fix CI failure due to expiration of the deprecation warning from numpy/numpy#10615 for NumPy v2.4 numpy/numpy#29841 (https://numpy.org/doc/stable/release/2.4.0-notes.html#raise-typeerror-on-attempt-to-convert-array-with-ndim-0-to-scalar)
|
In case anyone is curious of the history of the original deprecation, it can be found at #10615 |
This PR removes deprecated functionality, as requested in #29835