pyphi.partition.PartitionRegistry#

class pyphi.partition.PartitionRegistry[source]#

Bases: Registry

Storage for mechanism-level partition schemes registered with PyPhi.

Schemes registered here yield mechanism-level partitions (pyphi.protocols.MechanismPartition instances) for each (mechanism, purview) pair. Used by System.find_mip to enumerate partitions during MIP search.

Users can define custom partitions and use them by setting pyphi.config["iit.mechanism_partition_scheme"] = 'NONE'.

Registered objects are validated at registration: they must be callable and their signature must accept a (mechanism, purview) call, so wrong-shape registrations fail at import rather than at the bottom of a phi computation.

Examples

>>> @partition_types.register('NONE')
... def no_partitions(mechanism, purview):
...    return []
register(name)[source]#

Decorator that validates and registers a partition scheme.