prophys.export

prophys.export#

Standardized export of a compiled model, with provenance.

ModelPackage is the interchange format (see prophys.export.model_package), and RunManifest is the record of what produced it (see prophys.export.manifest).

Classes

ModelPackage

Versioned export of a compiled model's distributions as JSON, with provenance.

AttributeExport

The exported marginal distribution of one model attribute.

RunManifest

Provenance record of an exported result: versions, model structure, parameters and settings.

Functions

export_model

Export a compiled model's attribute distributions as a ModelPackage.

build_manifest

Build the provenance record (RunManifest) of a run of a compiled model.

manifest_from_dict

Rebuild a RunManifest from its dict form (the inverse of RunManifest.to_dict).

structure_hash

Compute a stable SHA-256 digest of a probability model's structure.

structure_description

Describe the model structure that structure_hash() digests, as a readable dict.

verify

Check that a compiled model is the one a manifest was produced from.

reproduce

Recompile a model with the settings a manifest records, after checking its structure.

Exceptions

ReproducibilityError

Raised when a model does not match the run manifest it is checked against.

Constants and objects

FORMAT_VERSION

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

SUPPORTED_VERSIONS

Build an immutable unordered collection of unique elements.

MANIFEST_VERSION

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str