prophys.diagnostics

prophys.diagnostics#

Unified diagnostics with marked, coded feedback.

Every check in prophys that can fail reports a Diagnostic with a stable code, a severity, a location and a hint. The same format is used for layer dimensions of network surrogates, training convergence, licence limits, symbolic surrogates and the physics primitives, so problems read the same wherever they arise. Errors raise ProphysError, warnings are issued as ProphysWarning and every report object carries its diagnostics.

A diagnostic renders like a compiler message, the severity and code in brackets followed by the message, then an arrow line with the location and an equals line with the hint.

Classes

Diagnostic

One finding with a stable code, a severity, a location and a hint.

Diagnostics

A list of Diagnostic findings with severity filters and rendering.

Functions

emit

Report findings: raise ProphysError on errors, issue a ProphysWarning per warning, and return them.

error

Create a Diagnostic of severity "error".

warning

Create a Diagnostic of severity "warning".

info

Create a Diagnostic of severity "info".

Exceptions

ProphysError

Raised when a check reports errors.

ProphysWarning

Warning category issued for warning findings.

Constants and objects

CODES

NN (network surrogates), LIC (licence), CAL (calibration), SUR (symbolic surrogates), PHY (physics primitives), TREE (tree ensembles) and AMO (operational surrogates from amortize).