Repository navigation
DEP: Deprecate numpy.linalg.lapack_lite module - #32015
Conversation
50acb4c to
2b7853c
Compare
jorenham
left a comment
There was a problem hiding this comment.
it would be nice if we could slap some @typing_extensions.deprecated onto the functions in https://github.com/numpy/numpy/blob/cda64f0cf4584aa9e735d46ba27874296501333a/numpy/linalg/lapack_lite.pyii . That way static type-checkers will warn you if you use it at type-check-time.
|
Thanks for pointing that out I was unaware of |
jorenham
left a comment
There was a problem hiding this comment.
stub changes look good; thanks 👍
|
If there are people using this module for real code, then the whole premise of this issue and PR are less correct ( i.e. wrong) and we shouldn’t deprecate it. |
rgommers
left a comment
There was a problem hiding this comment.
Deprecating LGTM, this isn't meant to be public. One test should be removed before merging.
… and remove subprocess test
There was a problem hiding this comment.
I asked an AI model to search for open-source uses of this module and it found two cases that aren't covered by the advice here:
- astra-toolbox/astra-toolbox: imports numpy.linalg.lapack_lite from C++ purely as a RTLD_DEEPBIND side-effect to stop MATLAB's MKL from clashing with numpy's LAPACK. It calls no routine at all.
- BLAS/Fortran introspection recipes — e.g. simomarsili/ndd uses
numpy.linalg.lapack_lite.__file__to locate the .so and run ldd on it; the _ilp64 attribute is used elsewhere to detect 64-bit BLAS.
The former could use numpy.linalg._umath_linalg instead. I'm not sure if we need to explicitly document that though because it's an unusual thing to do. Maybe one of us could send in a PR to astra-toolbox and reference this PR?
The latter could use np.show_config() instead. We should probably explicitly suggest np.show_confg() in the deprecation warning for people who are using the module for introspection.
|
Thanks @prathamhole14 |
PR summary
As titled, based on: #31928 (comment)
Note:
If a user simply
import numpy.linalg.lapack_liteit will not give warning, it will warn only if used in test (run via pytest) or with-Wflag with python3/python.CC: @seberg @mattip
AI Disclosure
To write release note - it LGTM but someone please check it again. And to find the best way to write test for module dep.