You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
np.long breaks choice(p=...) and permutation(int) on NumPy 1.26 #194
mkl_random/mklrand.pyx uses np.long at lines 2829, 2844 and 7100, but np.long does not exist in NumPy 1.24-1.26; it was only reintroduced in NumPy 2.0. The runtime floor in pyproject.toml is numpy >=1.26.4, so an installation satisfying our own requirements fails:
choice(5, 3, p=[0.2] * 5) -> AttributeError: module 'numpy' has no attribute 'long'
permutation(5) -> AttributeError: module 'numpy' has no attribute 'long'
CI does not catch this because its matrix starts at NumPy 2.2. Fix by replacing np.long with an explicit C-long dtype, or by raising the NumPy floor to 2.0.
Activity
Link the changelog entries to this PR