validate

Methods for validating common types of input.

pyphi.validate.direction(direction)

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

pyphi.validate.tpm(tpm)

Validate a TPM.

The TPM can be in

  • \(2\)-\(D\) state-by-state form,
  • \(2\)-\(D\) state-by-node form, or
  • \(N\)-\(D\) state-by-node form.
pyphi.validate.conditionally_independent(tpm)

Validate that the TPM is conditionally independent.

pyphi.validate.connectivity_matrix(cm)

Validate the given connectivity matrix.

pyphi.validate.node_labels(node_labels, node_indices)

Validate that there is a label for each node.

pyphi.validate.network(n)

Validate a Network.

Checks the TPM and connectivity matrix.

pyphi.validate.is_network(network)

Validate that the argument is a Network.

pyphi.validate.node_states(state)

Check that the state contains only zeros and ones.

pyphi.validate.state_length(state, size)

Check that the state is the given size.

pyphi.validate.state_reachable(subsystem)

Return whether a state can be reached according to the network’s TPM.

pyphi.validate.cut(cut, node_indices)

Check that the cut is for only the given nodes.

pyphi.validate.subsystem(s)

Validate a Subsystem.

Checks its state and cut.

pyphi.validate.time_scale(time_scale)

Validate a macro temporal time scale.

pyphi.validate.partition(partition)

Validate a partition - used by blackboxes and coarse grains.

pyphi.validate.coarse_grain(coarse_grain)

Validate a macro coarse-graining.

pyphi.validate.blackbox(blackbox)

Validate a macro blackboxing.

pyphi.validate.blackbox_and_coarse_grain(blackbox, coarse_grain)

Validate that a coarse-graining properly combines the outputs of a blackboxing.

pyphi.validate.measure(value)

Validate a distance measure.