The exception behavior of `scipy.linalg` functions for `ndim > 2` inputs

Hi everyone,

Over RFC:linalg: nD-array accepting functions to return partially completed work instead of discarding all and throwing an exception · Issue #22476 · scipy/scipy · GitHub we are discussing how to manage errors that might occur while processing an array that is higher dimensional. I’m summarizing the GH issue here for quick reference:

Say you are using, scipy.linalg.solve and you supply (m, n, n) shaped array. All went OK nicely, except the k-th (n, n) slice turned out to be exactly singular so now what to do? Currently we throw everything out the window and raise an exception because that’s what happened with 2D case so we generalized the behavior.

Should we discard the whole operation which already solved m-1 slices? Or should we raise a warning and return NaN filled slice or anything else?

We are discussing it in the linked RfC. Evgeni, Matt already provided very nice remarks that fleshed things out a bit more. It would be great to hear from non-SciPy devs or users over there. All feedback welcome.