-
Notifications
You must be signed in to change notification settings - Fork 1.3k
python-numpy: Update to 2.4.0 #26966
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
base: master
Are you sure you want to change the base?
Conversation
|
I've pushed numba update so the check should pass soon |
|
The check fails even with numba 0.63.1: |
|
the best way to ensure is trying script with numba. if there is such requirement, ImportError will be raised update: there is no maximum required version https://github.com/numba/numba/blob/main/numba%2F__init__.py#L34-L40 |
That's only on the main branch. However, if you take a look at the tagged version, then things look different: https://github.com/numba/numba/blob/7484a86bd9ce4d7dbc386da887f62a7bd54be597/numba/__init__.py#L42-L45 There's a hard-coded requirement for NumPy 2.3 or less. This requirement was added in commit numba/numba@be9b583. Looks like the numba folks pin their dependencies before a release is made / tagged to certain upper versions, but they don't seem to do that on the main branch. We could revert that (it will probably work with NumPy 2.4, too), or we wait for the next numba release which will hopefully support NumPy 2.4.x, or we convince the numba developers to not pin their dependencies in that way anymore. |
|
I tried some small examples and they failed, so looks like it is incompatible. Let's wait a bit then. |
|
even with patched numpy requirements? |
|
yes import numpy as np
from numba import jit
# Numba-accelerated function
@jit(nopython=True)
def matrix_multiply_numba(A, B):
"""Matrix multiplication with Numba JIT compilation"""
m, n = A.shape
n, p = B.shape
C = np.zeros((m, p))
for i in range(m):
for j in range(p):
for k in range(n):
C[i, j] += A[i, k] * B[k, j]
return C
A = np.random.rand(500, 500)
B = np.random.rand(500, 500)
matrix_multiply_numba(A[:10, :10], B[:10, :10]) File "C:/msys64/clang64/lib/python3.12/site-packages/numba/np/arraymath.py", line 2225, in <module>
@overload(np.trapz)
^^^^^^^^
File "C:/msys64/clang64/lib/python3.12/site-packages/numpy/__init__.py", line 792, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
AttributeError: module 'numpy' has no attribute 'trapz'. Did you mean: 'trace'? |
|
maybe backport this numba/numba#10329 ? that just leads to: edit: upstream issue for 2.4: numba/numba#10263 |
10ecd0e to
2e26dd3
Compare
No description provided.