cleverly.DiagnosticReport#

class cleverly.DiagnosticReport(items: tuple[AssessmentItem, ...], include_refits: bool = False, include_retargets: bool = False, backend: str | None = None)[source]#

Collect statuses from a combined diagnostic or sensitivity run.

Parameters:
itemstuple of AssessmentItem

Results for the requested operations.

include_refitsbool

Whether the run allowed operations that refit nuisance models.

include_retargetsbool

Whether the run allowed moderate retargets, beyond the default cheap retargets.

backendstr or None

Dataframe backend used by to_frame() when data is omitted.

See also

ValidationReport

The battery that reads stored artifacts only.

cleverly.assessment.DiagnosticsFacade

What produces this report.

cleverly.AssessmentCapability

The declaration behind one item.

Notes

A skipped or refused item remains in the report. Caller-deferred work has its own status. A capability known to be unsupported is an omission. A refusal raised during an aggregate run remains unavailable, and later operations still run.

Examples

>>> from cleverly import AssessmentStatus, DiagnosticReport
>>> from cleverly.assessment import AssessmentItem
>>> item = AssessmentItem("support", AssessmentStatus.PASSED, "no material warning")
>>> report = DiagnosticReport(items=(item,))
>>> report["support"].status == AssessmentStatus.PASSED
True

Methods#

DiagnosticReport.next_steps() → tuple[str, ...][source]#

Return de-duplicated next steps in report order.

Returns:
tuple of str

Suggested follow-up actions in their first-seen order.

DiagnosticReport.report(name: str) → Any[source]#

Return the retained object for an operation that ran.

Parameters:
namestr

Operation name.

Returns:
Any

The operation’s retained report or dataframe.

Raises:
KeyError

If the operation did not run.

DiagnosticReport.reports() → dict[str, Any][source]#

Return retained objects for operations that ran.

Returns:
dict of str to Any

Operation names mapped to their retained reports.

DiagnosticReport.summary() → str[source]#

Return a printable table of operation statuses.

Returns:
str

A printable table, one line per requested operation.

DiagnosticReport.to_frame(data: Any = None) → Any[source]#

Return report items as a dataframe.

Parameters:
dataAny

Optional dataframe whose backend selects the output type.

Returns:
Any

A pandas or Polars dataframe with one row per operation.

Attributes#

DiagnosticReport.backend: str | None = None#
DiagnosticReport.include_refits: bool = False#

The two cost classes a caller can opt into, declared separately because they are disjoint: refute and benchmark refit nuisances without retargeting, and truncation_curve, missingness and tipping_gamma retarget cached nuisances without refitting any. Folding them into one flag made whichever class it did not name a silent rider on the other.

DiagnosticReport.include_retargets: bool = False#
DiagnosticReport.items: tuple[AssessmentItem, ...]#