diagnostics.report#
Diagnostic report types.
Defines the Severity, Diagnostic, and DiagnosticReport types produced by optiland.diagnostics.check_system. This module contains no logic that inspects an Optic — that lives in checks.py.
Kramer Harrison, 2026
Classes
|
A single diagnostic finding produced by a system check. |
|
The result of running check_system on an Optic. |
|
Severity level of a diagnostic finding. |
- class Diagnostic(severity: Severity, code: str, message: str, fix: str, where: int | str | None = None, doc_url: str | None = None)[source]#
A single diagnostic finding produced by a system check.
- Variables:
severity (diagnostics.report.Severity) – How serious the finding is.
code (str) – Stable identifier for the check that produced this finding, e.g.
"OPT001".message (str) – What is wrong, stating the offending object and value.
fix (str) – What to do about it, as a runnable line of code where possible.
where (int | str | None) – The surface index or object reference the finding concerns, or
Noneif it applies to the system as a whole.doc_url (str | None) – Deep link into the documentation for this check.
- class DiagnosticReport(diagnostics: list[Diagnostic])[source]#
The result of running check_system on an Optic.
- Variables:
diagnostics – All findings, in the order the checks ran.
- property errors: list[Diagnostic]#
Findings with Severity.ERROR.
- Type:
- property ok: bool#
True if no error-severity findings were reported.
Warnings do not affect this — a system with only warnings is considered usable, if imperfect.
- Type:
- property warnings: list[Diagnostic]#
Findings with Severity.WARNING.
- Type: