pyphi.direction.Direction#

class pyphi.direction.Direction(*values)[source]#

Bases: IntEnum

Constant that parametrizes cause and effect methods.

Accessed using Direction.CAUSE and Direction.EFFECT, etc.

order(mechanism, purview)[source]#

Order the mechanism and purview in time.

For CAUSE the purview lies one step earlier than the mechanism: the purview is at t − 1 and the mechanism at t. For EFFECT the purview lies one step later: the mechanism is at t and the purview at t + 1.

Parameters:
  • mechanism (tuple[int, ...]) – Node indices of the mechanism (at time t).

  • purview (tuple[int, ...]) – Node indices of the purview.

Returns:

tuple[tuple[int, …], tuple[int, …]] – The pair ordered from earlier to later in time: (purview, mechanism) for CAUSE and (mechanism, purview) for EFFECT.

Raises:

ValueError – If the direction is neither CAUSE nor EFFECT (for example BIDIRECTIONAL).

Return type:

tuple[tuple[int, …], tuple[int, …]]

flip()[source]#

Return the other direction.

Return type:

Direction