gmarkall · GitHub

added 13 commits

January 3, 2023 15:45
I believe this was written in error and should always have been float16.
This test only checked for a plain match when comparing outputs.
However, in some cases a reconstruction check can be necessary, as in
`test_linalg_svd`.
Setting an array element with a sequence is removed in NumPy 1.24.
The modified regex matches the existing message produced by NumPy <
1.24, and the new improved message in 1.24.
This always produced invalid results (though they were consistent
between Numba and NumPy) but now this fails in NumPy 1.24 with an
exception:
```
TypeError: The `dtype` and `signature` arguments to ufuncs only select
the general DType and not details such as the byte order or time unit.
You can avoid this error by using the scalar types `np.float64` or the
dtype string notation.
```
Note that the exception message is misleading, and using the dtype
string notation does not provide a workaround.
np.bool was removed in NumPy 1.24.
The API version has long since been greater than 0x7 / 0x8 for any
supported NumPy.
If an unexpected ufunc method was encountered, `init_ufunc_dispatch()`
would return an error code indicating failure without setting an
exception, leading to errors like
```
SystemError: initialization of _internal failed without raising an
exception
```
as reported in Issue numba#8615.
This commit fixes the issue by setting an appropriate exception in this
case.
NumPy 1.24 adds a new method, `resolve_dtypes()`, and a private method
`_resolve_dtypes_and_context()`. We handle these by just ignoring them
(ignoring all private methods in general) in order to provide the same
level of functionality in Numba as for NumPy 1.23.
There is further room to build new functionality on top of this:
- Providing an implementation of `resolve_dtypes()` for `DUFunc`
  objects.
- Using the `resolve_dtypes()` method in place of logic in Numba that
  implements a similar dtype resolution process.
This results in the following output from `print_azure_matrix()`:
```
NumPy | Python | Count
-----------------------
 1.21 |  3.8   |   4
 1.22 |  3.8   |   4
 1.22 |  3.9   |   1
 1.23 |  3.8   |   2
 1.23 |  3.9   |   2
 1.23 |  3.10  |   1
 1.24 |  3.10  |   3
 1.24 |  3.8   |   1
 1.24 |  3.9   |   1
```
There are 19 slices, so the aim was to have five slices for each NumPy
version (1.21, 1.22, 1.23, 1.24) except for 1.21 which has 4 slices.

@gmarkall

This was referenced

Jan 3, 2023

Closed

Closed

Merged

7 tasks

Open

Open

stuartarchibald

@gmarkall

Merged

12 tasks

raphaelquast added a commit to raphaelquast/EOmaps that referenced this pull request

Mar 1, 2023

Merged

1 task

@gmarkall

stuartarchibald

@sklam sklam changed the title NumPy 1.24 (PR for review) NumPy 1.24

Mar 6, 2023

@sklam

Closed

@bdice bdice mentioned this pull request

Mar 7, 2023

Merged

6 tasks

@esc esc mentioned this pull request

Mar 10, 2023

Closed

Closed

Merged

Closed

2 tasks

Merged

Closed

shaneahmed added a commit to TissueImageAnalytics/tiatoolbox that referenced this pull request

May 3, 2023
- np.int, np.bool, np.float is depreciated in v1.20 in favour of np.int_, np.bool_, np.float_
Waiting on some dependencies to update:
- numba not yet compatible with numpy 1.24
  >   from numba.np.ufunc import _internal
  E   SystemError: initialization of _internal failed without raising an exception
   - numba/numba#8464
   - numba/numba#8691
   - numba/numba#8841
   - https://github.com/numba/numba/milestone/63
- [x] Waiting for next numba release with numpy 1.24 support.
---------
Co-authored-by: John Pocock <John-P@users.noreply.github.com>

Read the original on github.com ↗