pyphi.provenance.Provenance#

class pyphi.provenance.Provenance(pyphi_version, git_sha, git_dirty, timestamp, python_version, numpy_version, scipy_version, platform, wall_time=None, seed=None, note=None, estimator=None)[source]#

Bases: object

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

Parameters:
  • pyphi_version (str)

  • git_sha (str | None)

  • git_dirty (bool | None)

  • timestamp (str)

  • python_version (str)

  • numpy_version (str)

  • scipy_version (str)

  • platform (str)

  • wall_time (float | None)

  • seed (int | None)

  • note (str | None)

  • estimator (dict[str, Any] | None)

estimator: dict[str, Any] | None = None#

Structured record of how an estimated input was produced (data regime, estimator model, prior, sample counts). None for results computed from an exactly specified substrate.

classmethod capture(*, wall_time=None, seed=None, estimator=None)[source]#

Capture the current environment into a Provenance.

wall_time (seconds) is supplied by the compute entry point; seed is supplied only by code paths that consumed an RNG; estimator is supplied only by estimation entry points. All default to None for deterministic, directly-constructed results.

Parameters:
Return type:

Provenance

with_wall_time(wall_time)[source]#

Return a copy with wall_time set (the record is frozen).

Parameters:

wall_time (float)

Return type:

Provenance

display_rows()[source]#

Return (label, value) pairs for the display layer.

Return type:

list[tuple[str, str]]