Set treatment for all type of special-function errors at once. The options are:
'ignore' Take no action when the error occurs
'warn' Print a SpecialFunctionWarning
when the error occurs (via the Python warnings
module)
'raise' Raise a SpecialFunctionError
when the error occurs.
The default is to not change the current behavior. If behaviors for additional categories of special-function errors are specified, then all
is applied first, followed by the additional categories.
Treatment for singularities.
Treatment for underflow.
Treatment for overflow.
Treatment for slow convergence.
Treatment for loss of accuracy.
Treatment for failing to find a result.
Treatment for an invalid argument to a function.
Treatment for an invalid parameter to a function.
Treatment for an unknown error.
Dictionary containing the old settings.
Set how special-function errors are handled.
errstate
context manager for special-function error handling
geterr
get the current way of handling special-function errors
numpy.seterr
similar numpy function for floating-point errors
>>> import scipy.special as sc
... from pytest import raises
... sc.gammaln(0) inf
>>> olderr = sc.seterr(singular='raise')
... with raises(sc.SpecialFunctionError):
... sc.gammaln(0) ...
>>> _ = sc.seterr(**olderr)
We can also raise for every category except one.
>>> olderr = sc.seterr(all='raise', singular='ignore')
... sc.gammaln(0) inf
>>> with raises(sc.SpecialFunctionError):
... sc.spence(-1) ...
>>> _ = sc.seterr(**olderr)See :
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.special._ufuncs.geterr
scipy.special._ufuncs.seterr
scipy.special._ufuncs.errstate
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them