pyphi.provenance#

Provenance record attached to top-level result objects.

A Provenance captures how, when, and by what code a result was computed: the pyphi version and source revision, a timestamp and wall-clock duration, the RNG seed when one was used, and the Python / numpy / scipy versions and platform. It is a sibling to pyphi.conf.ConfigSnapshot (which records the configuration), so a saved result is self-describing.

Functions

format_stem(name[, params, run_label])

Build a filename stem encoding a script's parameters.

read_metadata(path)

Read the provenance and params embedded in a writer's output file.

save_dataframe(df, directory, name, *[, ...])

Write df to a self-describing, non-clobbering parquet file.

save_json(data, directory, name, *[, ...])

Write data to a self-describing, non-clobbering JSON file.

save_npz(arrays, directory, name, *[, ...])

Write arrays to a self-describing, non-clobbering .npz file.

stamp_wall_time(result, elapsed)

Set elapsed seconds on result.provenance if it has one.

unique_path(directory, stem, suffix)

Return a non-clobbering path: stem+suffix, else stem_v2+suffix, ...

Classes

HasProvenance()

Mixin for result types that carry a Provenance record.

Provenance(pyphi_version, git_sha, ...[, ...])

Immutable record of how, when, and by what code a result was computed.