spacr.regression_failure

Describe and persist actionable regression failures.

Reports include the stage reached, available design dimensions, the original exception, and a suggested remedy when the failure is recognized. The same text is returned for the console and written beside the run results.

Failure reporting does not raise. If part of the diagnostic cannot be collected or written, the report retains the information that is available.

Functions

describe_failure(→ str)

The report, as text. Never raises.

write_failure_report(→ Optional[str])

Write the report beside the run and return its path, or None.

Module Contents

spacr.regression_failure.describe_failure(error: BaseException, *, stage: str = '', settings: Mapping[str, Any] | None = None, frame: Any = None, include_traceback: bool = True) → str[source]

The report, as text. Never raises.

Parameters:

error – regression exception to explain and, optionally, trace.

spacr.regression_failure.write_failure_report(res_folder, error: BaseException, *, stage: str = '', settings: Mapping[str, Any] | None = None, frame: Any = None) → str | None[source]

Write the report beside the run and return its path, or None.

Parameters:
  • res_folder – run-results directory in which to write the report.

  • error – regression exception to report.

None when there is nowhere to write it – a failure early enough to have no destination folder is still reported to the console by the caller.