validate¶
Methods for validating common types of input.
-
exception
pyphi.validate.StateUnreachableError(state, message)¶ Raised when the current state cannot be reached from any past state.
-
pyphi.validate.direction(direction)¶ Validate that the given direction is one of the allowed constants.
-
pyphi.validate.tpm(tpm)¶ Validate a TPM.
-
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.perturb_vector(pv, size)¶ Validate a network’s pertubation vector.
-
pyphi.validate.network(n)¶ Validate a
Network.Checks the TPM, connectivity matrix, and perturbation vector.
-
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.
If
constrained_nodesis provided, then nodes not inconstrained_nodeswill be left free (their state will not considered restricted by the TPM). Otherwise, any nodes without inputs will be left free.
-
pyphi.validate.cut(cut, node_indices)¶ Check that the cut is for only the given nodes.
-
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.