Commit 04c4dc8
Fix test cases that test for equality of NaNs of ml_dtypes floats under NumPy 2.4.3.
NumPy 2.4.3 changed its criterion for when numpy.testing.assert_array_equal will use "equal NaN" semantics. Currently ml_dtypes floats don't appear to be numeric types to NumPy, so NaNs no longer compare as equal. This is actually a helpful change in the future since once ml_dtypes migrates to NumPy 2's user dtype APIs we will be able to declare our types as such.
For now, just cast types to float32 before testing for equality in tests.
PiperOrigin-RevId: 8825419511 parent c45a3dd commit 04c4dc8
1 file changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
| 903 | + | |
| 904 | + | |
903 | 905 | | |
904 | | - | |
905 | | - | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
906 | 910 | | |
907 | 911 | | |
908 | 912 | | |
909 | 913 | | |
910 | 914 | | |
911 | | - | |
912 | | - | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
913 | 919 | | |
914 | 920 | | |
915 | | - | |
916 | | - | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
917 | 925 | | |
918 | 926 | | |
919 | 927 | | |
| |||
0 commit comments