RunManifest

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

class RunManifest(spec_payload: ~typing.Mapping[str, ~typing.Any], provenance: ~habit.contracts.provenance.Provenance, subject_outcomes: ~typing.Mapping[str, str] = <factory>, started_at: str | None = None, finished_at: str | None = None)[source]

Bases: object

Everything needed to describe and audit one completed analysis.

Assembled from the Provenance records that travelled with the data, so it reports what actually ran rather than what was requested. That distinction is the whole point: a methods paragraph derived from a configuration file would describe intent, while this one describes fact, including subjects that failed and were excluded.

spec_payload

Serialised specification of the analysis that ran.

Type:

Mapping[str, Any]

provenance

Root provenance of the primary result.

Type:

habit.contracts.provenance.Provenance

subject_outcomes

Per-subject success or failure, keyed by subject id. Values are "success" or an error summary.

Type:

Mapping[str, str]

started_at

ISO-8601 start timestamp.

Type:

str | None

finished_at

ISO-8601 completion timestamp.

Type:

str | None

software_versions() → Mapping[str, str][source]

Return HABIT and dependency versions captured at execution time.

random_seeds() → Mapping[str, int][source]

Return the seed used by each stochastic component in the DAG.

describe_methods(style: str = 'radiology') → str[source]

Render the executed analysis as a manuscript methods paragraph.

The text states only steps that actually executed, derived from the provenance DAG, plus the recorded specification, software versions, seeds, and excluded subjects. Generating plausible but unexecuted methods text would make the whole reporting feature untrustworthy.

Parameters:

style – Target venue convention. "radiology" opens with the software sentence; "nature" closes with it. Ordering and wording only – the stated facts are identical.

Returns:

English prose that states only steps that actually executed.

Raises:

HABITAPIError – On an unknown style.

checklist(standard: str) → DataFrame[source]

Return an item-by-item compliance table for a reporting standard.

Parameters:

standard – One of "IBSI", "CLEAR", "METRICS", "TRIPOD+AI".

Returns:

One row per checklist item of that standard with the value HABIT can evidence and, where it cannot, an explicit statement that the item needs a human answer. Silently marking unverifiable items as satisfied would make the whole feature untrustworthy.

Raises:

HABITAPIError – On an unknown standard.

to_json(path: str | Path | None = None) → str[source]

Serialise the manifest, optionally writing it to disk.

Parameters:

path – Destination file. When None the JSON text is only returned.

Returns:

The JSON text.

__init__(spec_payload: ~typing.Mapping[str, ~typing.Any], provenance: ~habit.contracts.provenance.Provenance, subject_outcomes: ~typing.Mapping[str, str] = <factory>, started_at: str | None = None, finished_at: str | None = None) → None