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: object

Structured result of evaluating one serialized checksum.

A failed result has a diagnostic explaining the failure. Its value is None if evaluation did not complete, and its reference is None if the serialized reference could not be converted to a number.

target: str[source]#
point_name: str[source]#
point: Mapping[str, float | complex][source]#
reference: float | complex | None[source]#
value: float | complex | None[source]#
difference: float[source]#
passed: bool[source]#
diagnostic: str | None = None[source]#
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.