pyphi.validate.direction#

pyphi.validate.direction(direction, allow_bi=False)[source]#

Validate that the given direction is one of the allowed constants.

Parameters:
  • direction (Direction) – Direction to validate.

  • allow_bi (bool) – Whether the bidirectional arrow is also allowed.

Returns:

bool – True if the direction is valid.

Raises:

ValueError – If the direction is not one of the allowed constants.

Return type:

bool