pyphi.measures.protocols#
Protocol types for measure callables.
Four Protocol classes capture the shape diversity in pyphi’s measure machinery. Each registered measure satisfies exactly one of these Protocols; the registries are typed against the corresponding Protocol.
DistributionMeasure: (p, q) -> float | DistanceResult. Distribution-to-distribution distance. Symmetric or asymmetric (seeasymmetricattribute). Most implementations return a plain float, but several (ID, AID, L1, EMD, etc.) return DistanceResult.StateAwareMeasure: (p, state) -> float | DistanceResult. Pointwise probability at a specified state. INTRINSIC_DIFFERENTIATION returns DistanceResult.CompositeMeasure: (forward, partitioned, selectivity, *, state) -> DistanceResult. Multi-input measure returning rich metadata; used by GID / INTRINSIC_INFORMATION / INTRINSIC_SPECIFICATION at the system level.StatefulDistributionMeasure: (p, q, state) -> float | DistanceResult. Two-distribution measure evaluated at a specified state. Both distributions contribute to the result. IIT_4.0_SMALL_PHI variants return DistanceResult.
Plain functions don’t carry the class-level name/asymmetric
attributes the runtime-checkable Protocols declare, so isinstance
returns False for them. The satisfies_* helpers below capture the
structural intent by inspecting parameter names with
inspect.signature; the typed registries use these at registration
time.
Functions
Return True if |
|
Return True if |
|
Return True if |
|
Return True if |
Classes
|
Multi-input measure returning DistanceResult metadata. |
|
Distribution-to-distribution distance. |
|
Pointwise probability at a specified state. |
|
Two-distribution measure evaluated at a specified state. |