pnps.exceptions#

The exception and warning hierarchies.

Every error raised by this package is a PnpsError and every warning it emits is a PnpsWarning, so callers can catch or filter the whole family with one clause and still tell the cases apart. Each error also derives from the built-in exception it refines (ValueError for a bad argument, RuntimeError for a failed run), so code written against the built-ins keeps working. Raise the most specific subclass; never raise a bare Exception.

solprop’s own errors (solprop.exceptions.SolpropError) pass through unchanged: they describe the engine, not the instrument.

Exceptions

ConfigError

A configuration this package cannot build or run: a bad or missing setting.

DelayError

A delay that is not a scalar, or that lies outside the protected headroom.

EngineError

A run on solprop that went wrong: a broken invariant or a missing part.

GridError

A time or transverse grid that cannot be built from the given limits.

GridRuleError

The grids solprop builds no longer reproduce this package's grids.

InstrumentError

An instrument part (beam, mask hole, collection window) that is not valid.

MaterialError

A material model asked for outside what it can evaluate.

PnpsError

Base class of every error this package raises.

PnpsWarning

Base class of every warning this package emits.

PulseError

An input pulse that cannot be built, prepared or measured.

PulseFileError

A pulse file whose datasets are missing or of the wrong kind.

ReductionError

A saved plane that cannot be reduced to the observables as asked.

ScanError

A scan, shard selection or scan file that is not consistent.

ThreadBindingWarning

OpenMP thread binding had confined the process's main thread to one CPU.

UnsupportedError

A feature this package does not provide (yet); the message says why.

WindowOverlapWarning

An exact collection window overlaps the far field of an input hole.

exception pnps.exceptions.ConfigError[source]#

Bases: PnpsError, ValueError

A configuration this package cannot build or run: a bad or missing setting.

exception pnps.exceptions.DelayError[source]#

Bases: PnpsError, TypeError, ValueError

A delay that is not a scalar, or that lies outside the protected headroom.

exception pnps.exceptions.EngineError[source]#

Bases: PnpsError, RuntimeError

A run on solprop that went wrong: a broken invariant or a missing part.

exception pnps.exceptions.GridError[source]#

Bases: PnpsError, ValueError

A time or transverse grid that cannot be built from the given limits.

exception pnps.exceptions.GridRuleError[source]#

Bases: GridError

The grids solprop builds no longer reproduce this package’s grids.

exception pnps.exceptions.InstrumentError[source]#

Bases: PnpsError, ValueError

An instrument part (beam, mask hole, collection window) that is not valid.

exception pnps.exceptions.MaterialError[source]#

Bases: PnpsError, ValueError

A material model asked for outside what it can evaluate.

exception pnps.exceptions.PnpsError[source]#

Bases: Exception

Base class of every error this package raises.

exception pnps.exceptions.PnpsWarning[source]#

Bases: UserWarning

Base class of every warning this package emits.

exception pnps.exceptions.PulseError[source]#

Bases: PnpsError, ValueError

An input pulse that cannot be built, prepared or measured.

exception pnps.exceptions.PulseFileError[source]#

Bases: PulseError, TypeError

A pulse file whose datasets are missing or of the wrong kind.

exception pnps.exceptions.ReductionError[source]#

Bases: PnpsError, ValueError

A saved plane that cannot be reduced to the observables as asked.

exception pnps.exceptions.ScanError[source]#

Bases: PnpsError, ValueError

A scan, shard selection or scan file that is not consistent.

exception pnps.exceptions.ThreadBindingWarning[source]#

Bases: PnpsWarning

OpenMP thread binding had confined the process’s main thread to one CPU.

With OMP_PROC_BIND set, starting solprop’s native backend binds the main thread to its first place; numba’s pool and solprop’s march then run on that one CPU. This package restores the thread’s CPUs and emits this warning; leave OMP_PROC_BIND and OMP_PLACES unset to avoid both (see the manual’s clusters page).

exception pnps.exceptions.UnsupportedError[source]#

Bases: PnpsError, NotImplementedError

A feature this package does not provide (yet); the message says why.

exception pnps.exceptions.WindowOverlapWarning[source]#

Bases: PnpsWarning

An exact collection window overlaps the far field of an input hole.

With Config.exact_windows a window collects only the nonlinear part of the field, so the transmitted input light a detector behind that window would also see is left out of its spectra.