pyphi.models.distinctions.Distinctions#

class pyphi.models.distinctions.Distinctions(distinctions=())[source]#

Bases: Displayable, Orderable, Sequence, ToPandasMixin, Serializable

Base class for a collection of distinctions.

Holds the read-only operations shared by UnresolvedDistinctions and ResolvedDistinctions. Instantiable directly for the rare cases where the resolution status is genuinely unknown (e.g. deserializing a stored fixture); construct one of the marker subtypes instead so that passing the result to a function requiring a specific resolution status is checked at the type level.

Parameters:

distinctions (Iterable)

filter(predicate)[source]#

Return the distinctions satisfying predicate.

Preserves the runtime subtype, so filtering a ResolvedDistinctions yields a ResolvedDistinctions.

Return type:

Distinctions

order_by()[source]#

Return a list of values to compare for ordering.

The first value in the list has the greatest priority; if the first objects are equal the second object is compared, etc.

property flat#

An iterator over causes and effects (one MICE per direction per concept), for callers that want to operate at the MICE level rather than the concept level.

property phis: tuple[float, ...]#

The φ of each distinction, in order.

Type:

tuple[float, …]

property mechanisms: tuple#

The mechanism of each distinction, in order.

Type:

tuple

purviews(direction)[source]#

Return the purview of each distinction in the given direction.

Parameters:

direction (Direction or Iterable[Direction]) – The direction, or several directions, whose purviews to collect.

Returns:

tuple – The purviews in distinction order; for several directions, all purviews of the first direction, then all of the next.

Return type:

tuple

property labeled_mechanisms#

The labeled mechanism of each concept.

purview_inclusion(max_order=None)[source]#

Return a mapping:

{order: {frozenset[Unit]: {distinctions whose cause/effect purview

union includes those Units}}}

resolve_congruence(system_state)[source]#

Resolve each distinction’s tied readings against system_state, per the Albantakis et al. 2023 S1 Text.

Congruence with the system’s specified cause-effect state is a requirement: non-congruent readings are dropped, and a distinction with no congruent reading in either direction is excluded from the structure. Ties among congruent readings are resolved jointly across distinctions by the Composition appeal — selecting the combination of readings that maximizes the structure integrated information Φ (Σφ_d is invariant across readings, so the comparison is over the analytical Σφ_r) — with residual Φ-ties closed by the Determinism convention (lexicographic purviews and states). Beyond _JOINT_READING_BOUND combinations, a greedy per-distinction pass approximates the joint maximum and a PyPhiWarning is emitted.

Returns a ResolvedDistinctions regardless of the input subtype — calling on an already-resolved bag is well-defined and just refilters.

Parameters:

system_state (SystemStateSpecification)

Return type:

ResolvedDistinctions