pymixef.provenance module

Run provenance, environment capture, and deterministic fingerprints.

pymixef.provenance.environment_snapshot(*, redact_host=True)[source]

Capture calculation-relevant environment metadata without telemetry.

Parameters:

redact_host (bool)

Return type:

dict[str, Any]

pymixef.provenance.fingerprint_data(data)[source]

Create a deterministic data fingerprint for common columnar inputs.

Parameters:

data (Any)

Return type:

str

pymixef.provenance.fingerprint_model_ir(model_ir)[source]

Hash the exact semantic payload of a model IR object or document.

Archived IR documents are hashed as stored rather than migrated first. This keeps legacy documents verifiable against the manifest produced when they were captured while ensuring a ModelIR object and its to_dict() payload have identical fingerprints.

Parameters:

model_ir (Any)

Return type:

str

class pymixef.provenance.RunManifest(manifest_schema_version, package_version, created_at_utc, model_ir_hash, data_hash, engine, method, settings, seeds, reproducibility_class, environment, elapsed_seconds=None, output_hashes=<factory>, source=<factory>, convergence=<factory>, warnings=())[source]

Bases: object

Complete, serializable description of a PyMixEF execution.

Parameters:
  • manifest_schema_version (str)

  • package_version (str)

  • created_at_utc (str)

  • model_ir_hash (str)

  • data_hash (str)

  • engine (str)

  • method (str)

  • settings (Mapping[str, Any])

  • seeds (Mapping[str, int])

  • reproducibility_class (str)

  • environment (Mapping[str, Any])

  • elapsed_seconds (float | None)

  • output_hashes (Mapping[str, str])

  • source (Mapping[str, Any])

  • convergence (Mapping[str, Any])

  • warnings (tuple[Mapping[str, Any], ...])

manifest_schema_version: str
package_version: str
created_at_utc: str
model_ir_hash: str
data_hash: str
engine: str
method: str
settings: Mapping[str, Any]
seeds: Mapping[str, int]
reproducibility_class: str
environment: Mapping[str, Any]
elapsed_seconds: float | None
output_hashes: Mapping[str, str]
source: Mapping[str, Any]
convergence: Mapping[str, Any]
warnings: tuple[Mapping[str, Any], ...]
classmethod capture(*, model_ir, data, engine, method, settings=None, seeds=None, reproducibility_class=ReproducibilityClass.DETERMINISTIC_TOLERANCE, elapsed_seconds=None, source=None, convergence=None, warnings=())[source]
Parameters:
  • model_ir (Any)

  • data (Any)

  • engine (str)

  • method (str)

  • settings (Mapping[str, Any] | None)

  • seeds (Mapping[str, int] | None)

  • reproducibility_class (ReproducibilityClass | str)

  • elapsed_seconds (float | None)

  • source (Mapping[str, Any] | None)

  • convergence (Mapping[str, Any] | None)

  • warnings (Sequence[Mapping[str, Any]])

Return type:

RunManifest

with_outputs(outputs)[source]

Return an immutable copy carrying hashes of named result components.

Parameters:

outputs (Mapping[str, Any])

Return type:

RunManifest

classmethod from_dict(value)[source]
Parameters:

value (Mapping[str, Any])

Return type:

RunManifest

to_dict()[source]
Return type:

dict[str, Any]

class pymixef.provenance.RunTimer[source]

Bases: object

Monotonic context timer used when constructing run manifests.