cleverly.AssessmentCapability#

class cleverly.AssessmentCapability(operation: str, result_family: str, methods: tuple[str, ...], available: bool, status: AssessmentStatus, required_artifacts: tuple[str, ...], execution: Literal['summarize', 'retarget', 'refit'], deterministic_from_saved: bool, interpretation: str, cost: Literal['cheap', 'moderate', 'expensive'], refusal: Refusal | None = None, requires_arguments: tuple[str, ...] = (), accepts_random_state: bool = False, requires_replay: str | None = None)[source]#

Describe whether and how a result supports one assessment operation.

Parameters:
operationstr

Public operation name on a diagnostics or sensitivity facade.

result_familystr

Result family for which the declaration applies.

methodstuple of str

Estimation methods covered by the declaration.

availablebool

Whether the operation can run on the result family.

statusAssessmentStatus

Status to report when the operation cannot run. DEFERRED means that the caller lifts the refusal by passing every name in requires_arguments.

required_artifactstuple of str

Fitted artifacts that the operation reads.

execution{“summarize”, “retarget”, “refit”}

Most expensive work the operation performs.

deterministic_from_savedbool

Whether saved artifacts determine the result without a refit.

interpretationstr

Statistical question that the operation answers.

cost{“cheap”, “moderate”, “expensive”}

Relative cost category used by combined reports.

refusalRefusal or None

The record of why the operation is not available: its reason code, the failed condition and the alternative. reason is its text, and a raise of the operation carries the same record.

requires_argumentstuple of str

Arguments the caller must pass. An entry either has no default, or has a default that the operation refuses on this result family.

accepts_random_statebool

Whether a combined run can forward its top-level seed.

requires_replaystr or None

Name of the Replayability field the operation needs. None means the operation reads stored artifacts only.

Methods#

Attributes#

AssessmentCapability.accepts_random_state: bool = False#
AssessmentCapability.reason#

The text of refusal, or None when the row declares none.

AssessmentCapability.refusal: Refusal | None = None#
AssessmentCapability.requires_arguments: tuple[str, ...] = ()#

Arguments the caller must supply, so a combined report cannot run this operation. An entry covers two cases: the operation has no default for it, or the operation refuses its own default on this fit. simulated_confounding is the second case, because a continuous fit refuses the bare estimand="ate" default. Declared here rather than special-cased by name in run_all, which knows nothing about any particular operation.

AssessmentCapability.requires_replay: str | None = None#

The Replayability field this operation needs from the stored result. One declaration per row, applied once in _CapabilityFacade._capability_map(), because two facades each patching their own rows left refute claiming available=True on a result with no estimator while truncation_curve, benchmark and simulated_confounding beside it reported the truth.

AssessmentCapability.operation: str#
AssessmentCapability.result_family: str#
AssessmentCapability.methods: tuple[str, ...]#
AssessmentCapability.available: bool#
AssessmentCapability.status: AssessmentStatus#
AssessmentCapability.required_artifacts: tuple[str, ...]#
AssessmentCapability.execution: Literal['summarize', 'retarget', 'refit']#
AssessmentCapability.deterministic_from_saved: bool#
AssessmentCapability.interpretation: str#
AssessmentCapability.cost: Literal['cheap', 'moderate', 'expensive']#