validation#
- class ChecksumResult(target: str, point_name: str, point: Mapping[str, float | complex], reference: float | complex | None, value: float | complex | None, difference: float, passed: bool, diagnostic: str | None = None)[source]#
Bases:
objectStructured result of evaluating one serialized checksum.
A failed result has a diagnostic explaining the failure. Its
valueisNoneif evaluation did not complete, and itsreferenceisNoneif the serialized reference could not be converted to a number.
- validate_checksums(workspace_or_compiled: Workspace | CompiledWorkspace, *, backend: str = 'jax', atol: float = 1e-10, rtol: float = 1e-07) tuple[ChecksumResult, ...][source]#
Evaluate serialized checksums without aborting on individual failures.
A checksum passes when
abs(value - reference) <= atol + rtol * abs(reference). Compilation, point conversion, evaluation, and non-finite output failures are returned as failed records with diagnostics.- Parameters:
workspace_or_compiled – Symbolic workspace to compile on demand, or a previously compiled workspace.
backend – Numerical backend used when compiling a symbolic workspace.
atol – Absolute tolerance for the checksum comparison.
rtol – Relative tolerance, scaled by the absolute reference value.
- Returns:
An immutable result tuple in serialized checksum order.