pyphi.provenance.HasProvenance#

class pyphi.provenance.HasProvenance[source]#

Bases: object

Mixin for result types that carry a Provenance record.

Provides with_provenance() so a user can record their own context (a free-form note, the seed they controlled) on a computed result.

with_provenance(**fields)[source]#

Update this result’s provenance record in place and return self.

fields are merged into the existing record, e.g. result.with_provenance(note="run 1", seed=42). Unknown field names raise TypeError. Provenance is metadata, not part of the result’s value, so the update never affects equality, diffs, or stored goldens; updating in place (rather than copying the whole result) keeps that explicit.

Parameters:

fields (Any)

Return type:

HasProvenance