Skip to main content

sf.seterr(all=None, *, over=None, under=None, divide=None, invalid=None)

Set the error policy for the current thread. Each value is "raise", "warn" or "ignore". Returns the previous policy as a dict, so it can be restored with sf.seterr(**old). Defaults: over="raise", under="warn", divide="raise", invalid="raise".

sf.geterr()

The current policy as a dict.

sf.errstate(all=None, **kw)

A scoped policy change. Context manager, or decorator on plain and async def functions. Thread and asyncio-task local.

sf.config(**kw)

Runtime options for the device path. A plain call sets them for the thread; as a context manager or decorator they are scoped. Thread and task local. Invalid values raise ValueError. See Configuration for the semantics.

sf.getconfig()

The current options as a dict.

sf.SFStatus

int | None
Outputs that saturated; None when unknown.
int
Divisions by zero (exact, decided before launch).
int
Invalid inputs (exact, decided before launch).
bool
Whether saturated is a fact rather than a bound or unknown.
int
Outputs at ±max, the raw scan.
bool | None
True if nothing happened, False if something did, None if unknown.
bool
True when no field is unknown.
The repr shows the kind of count: saturated=0, saturated<=3 for a bound, saturated=unknown (outputs_at_max=16) for a reduction. Reading status →