geterrobj()
The error object contains all information that defines the error handling behavior in NumPy. geterrobj
is used internally by the other functions that get and set error handling behavior (geterr
, seterr
, geterrcall
, seterrcall
).
For complete documentation of the types of floating-point exceptions and treatment options, see seterr
.
The error object, a list containing three elements: [internal numpy buffer size, error mask, error callback function].
The error mask is a single integer that holds the treatment information on all four floating point errors. The information for each error type is contained in three bits of the integer. If we print it in base 8, we can see what treatment is set for "invalid", "under", "over", and "divide" (in that order). The printed string can be interpreted with
Return the current object that defines floating-point error handling.
>>> np.geterrobj() # first get the defaults [8192, 521, None]
>>> def err_handler(type, flag):
... print("Floating point error (%s), with flag %s" % (type, flag)) ...
>>> old_bufsize = np.setbufsize(20000)
... old_err = np.seterr(divide='raise')
... old_handler = np.seterrcall(err_handler)
... np.geterrobj() [8192, 521, <function err_handler at 0x91dcaac>]
>>> old_err = np.seterr(all='ignore')
... np.base_repr(np.geterrobj()[1], 8) '0'
>>> old_err = np.seterr(divide='warn', over='log', under='call',See :
... invalid='print')
... np.base_repr(np.geterrobj()[1], 8) '4351'
The following pages refer to to this document either explicitly or contain code examples using this.
numpy.geterrobj
numpy.seterrobj
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