ENH: Test ._is_numeric not .char in np.testing.assert_equal#30879
ENH: Test ._is_numeric not .char in np.testing.assert_equal#30879seberg merged 2 commits intonumpy:mainfrom
Conversation
This PR makes assert_equal correctly handle NaN tests for user-defined float types.
|
Hmmm, maybe we can use That might be a bit more robust (i.e. should work even if you use a random character) -- although, I am not sure if you need something around |
@hawkinsp FWIW I added This is very load-bearing code in the ecosystem so I'm a little nervous about changing behavior for legacy dtypes. But we can always add a check for an |
|
Thanks, let's try with this, since Nathan also thought it should be a good solution. |
Co-authored-by: Sebastian Berg <[email protected]>
Co-authored-by: Sebastian Berg <[email protected]>
ENH: Test .kind not .char in np.testing.assert_equal (#30879)
This PR makes assert_equal correctly handle NaN tests for user-defined float types.
This fixes an issue found when attempting to port ml_dtypes to use the NumPy 2 user dtype APIs (jax-ml/ml_dtypes#360).
@seberg