numpy / numpy

The fundamental package for scientific computing with Python.
https://numpy.org
Other
28.15k stars 10.15k forks source link

ENH: Make sure the _xerbla error callback is being used by blas functions #12472

Open mattip opened 5 years ago

mattip commented 5 years ago

In working on mamtul, it became apparent that the numpy/core/src/common/python_xerbla.c error handler, which should be registered when linking with OpenBLAS, is not being called. This should be used as it turns the default "print to stderr" to "raise a nice Python exception" when input to one of the blas routines is malformed.

rgommers commented 1 year ago

Hmm, this is a bit of a mess. We have two copies of python_xerbla.c; only the one in numpy/linalg/lapack_lite/ is tested, and that test is silently skipped when it's failing:

$ spin test -- -k xerbla --verbose

numpy/linalg/tests/test_linalg.py::test_xerbla_override SKIPPED (Numpy xerbla not linked in.)       [100%]