scijit.integrate.IntegrationWarning¶
- exception scijit.integrate.IntegrationWarning¶
Bases:
UserWarningWarning category emitted on a soft failure during integration.
Raised at two conditions: a soft QUADPACK failure (
ierin 1, 2, 3, 4, 5, 7) withfull_outputfalse, andpointsgiven together withweight. The message carries thelimitsubstituted into theier = 1text, and separate wording forier1, 4 and 7 on the cos/sin route to infinity, where a subdivision is a cycle.See also
scipy.integrate.IntegrationWarningThe scipy category this mirrors.
Notes
This is a DIFFERENT CLASS OBJECT from
scipy.integrate. IntegrationWarning, with the same name and the same base. A filter naming this class selects it, and so does one namingUserWarningor a barewarnings.catch_warnings(record=True). A filter naming scipy’s class does NOT:simplefilter('error', scipy.integrate.IntegrationWarning)leaves this warning as a warning, andexcept scijit.integrate.IntegrationWarningdoes not catch a scipy one. Ported code that turns scipy’s class into an exception names this one as well.Examples
The warning is emitted by
quad(); the filter that catches it is Python-level, sincewarnings.catch_warningsdoes not run inside@njit:>>> import numpy as np >>> import warnings >>> from numba import njit >>> import scijit.integrate as si >>> @njit ... def f(x): ... return np.cos(x) >>> with warnings.catch_warnings(record=True) as w: ... warnings.simplefilter('always') ... v, e = si.quad(f, 0.0, 1.0, (), False, 1.49e-8, 1.49e-8, 50, ... np.array([0.5]), 'cos', 1.0) >>> issubclass(w[0].category, si.IntegrationWarning) True