pyphi.conf.infrastructure.InfrastructureConfig#

class pyphi.conf.infrastructure.InfrastructureConfig(parallel=False, parallel_complex_evaluation=<factory>, parallel_partition_evaluation=<factory>, parallel_distinction_evaluation=<factory>, parallel_purview_evaluation=<factory>, parallel_mechanism_partition_evaluation=<factory>, parallel_relation_evaluation=<factory>, parallel_macro_system_evaluation=<factory>, parallel_workers=-1, parallel_backend='local', memory_ceiling_percentage=50, memory_ceiling_bytes=None, cache_repertoires=True, cache_potential_purviews=True, cache_macro_construction=True, clear_system_caches_after_computing_sia=False, disk_cache_results=False, progress_bars=True, repr_verbosity=2, repr_max_table_rows=50, print_fractions=True, label_separator='', welcome_off=False, agent_note_off=False, validate_system_states=True, validate_conditional_independence=True, validate_connectivity=True, validate_phi_bounds=False, validate_config=True)[source]#

Bases: object

Infrastructure-scoped configuration.

Knobs in this layer don’t change PyPhi’s mathematical output — they affect performance, caching policy, logging, presentation, and validation. Frozen dataclass; replace via dataclasses.replace() or top-level write on the global config.

Parameters:
  • parallel (bool)

  • parallel_complex_evaluation (Mapping[str, Any])

  • parallel_partition_evaluation (Mapping[str, Any])

  • parallel_distinction_evaluation (Mapping[str, Any])

  • parallel_purview_evaluation (Mapping[str, Any])

  • parallel_mechanism_partition_evaluation (Mapping[str, Any])

  • parallel_relation_evaluation (Mapping[str, Any])

  • parallel_macro_system_evaluation (Mapping[str, Any])

  • parallel_workers (int)

  • parallel_backend (str)

  • memory_ceiling_percentage (int)

  • memory_ceiling_bytes (int | None)

  • cache_repertoires (bool)

  • cache_potential_purviews (bool)

  • cache_macro_construction (bool)

  • clear_system_caches_after_computing_sia (bool)

  • disk_cache_results (bool)

  • progress_bars (bool)

  • repr_verbosity (int)

  • repr_max_table_rows (int)

  • print_fractions (bool)

  • label_separator (str)

  • welcome_off (bool)

  • agent_note_off (bool)

  • validate_system_states (bool)

  • validate_conditional_independence (bool)

  • validate_connectivity (bool)

  • validate_phi_bounds (bool)

  • validate_config (bool)

parallel: bool = False#

Master switch for parallel computation (default False). False runs every level sequentially; True permits the levels whose own parallel_*_evaluation mapping has parallel set. See Run computations in parallel.

parallel_complex_evaluation: Mapping[str, Any]#

a mapping with the keys parallel (whether this level may run in parallel; False by default), sequential_threshold (workloads with fewer items than this run sequentially regardless), chunksize (items per task), and progress (show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switch parallel must also be on. See Run computations in parallel.

Type:

Parallelism for the candidate systems of a complexes search

parallel_partition_evaluation: Mapping[str, Any]#

a mapping with the keys parallel (whether this level may run in parallel; False by default), sequential_threshold (workloads with fewer items than this run sequentially regardless), chunksize (items per task), and progress (show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switch parallel must also be on. See Run computations in parallel.

Type:

Parallelism for the system partitions of a system irreducibility analysis

parallel_distinction_evaluation: Mapping[str, Any]#

a mapping with the keys parallel (whether this level may run in parallel; False by default), sequential_threshold (workloads with fewer items than this run sequentially regardless), chunksize (items per task), and progress (show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switch parallel must also be on. See Run computations in parallel.

Type:

Parallelism for the mechanisms of a cause-effect structure

parallel_purview_evaluation: Mapping[str, Any]#

a mapping with the keys parallel (whether this level may run in parallel; False by default), sequential_threshold (workloads with fewer items than this run sequentially regardless), chunksize (items per task), and progress (show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switch parallel must also be on. See Run computations in parallel.

Type:

Parallelism for the candidate purviews of a mechanism

parallel_mechanism_partition_evaluation: Mapping[str, Any]#

a mapping with the keys parallel (whether this level may run in parallel; False by default), sequential_threshold (workloads with fewer items than this run sequentially regardless), chunksize (items per task), and progress (show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switch parallel must also be on. See Run computations in parallel.

Type:

Parallelism for the partitions of a mechanism and purview

parallel_relation_evaluation: Mapping[str, Any]#

Parallelism for the relations of a Φ-structure under concrete relation computation: a mapping with the keys parallel (whether this level may run in parallel; False by default), sequential_threshold (workloads with fewer items than this run sequentially regardless), chunksize (items per task), and progress (show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switch parallel must also be on. See Run computations in parallel.

parallel_macro_system_evaluation: Mapping[str, Any]#

a mapping with the keys parallel (whether this level may run in parallel; False by default), sequential_threshold (workloads with fewer items than this run sequentially regardless), chunksize (items per task), and progress (show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switch parallel must also be on. See Run computations in parallel.

Type:

Parallelism for the candidate macro systems of a grain search

parallel_workers: int = -1#

Number of worker processes or threads; -1 (default) uses every core.

parallel_backend: str = 'local'#

"local" (default; a pool of processes), "thread" (a pool of threads), or "auto" (threads on a free-threaded interpreter, processes otherwise). Cluster schedulers are configured through pyphi.parallel and the cluster extra.

Type:

Where parallel work runs

memory_ceiling_percentage: int = 50#

The share of the memory this process may use that the in-memory caches may occupy (default 50), above which they evict least recently used entries to admit new ones. The denominator is the process’s cgroup allowance where it has one (a scheduler-managed job, a container) and total physical memory otherwise.

memory_ceiling_bytes: int | None = None#

An absolute ceiling on the process’s resident memory, above which the in-memory caches hold their occupancy steady by evicting least recently used entries (default None). Replaces memory_ceiling_percentage when set, for an allowance no cgroup reports. It is compared against the whole process’s resident memory, of which the caches are usually a small part, so size it from what the process may use: the caches get the ceiling less the interpreter, the substrate, and working space.

cache_repertoires: bool = True#

Cache the repertoires computed within a system (default True). False recomputes them on every use, which is slower but bounds memory.

cache_potential_purviews: bool = True#

Cache each mechanism’s connectivity-pruned candidate purviews on the substrate (default True).

cache_macro_construction: bool = True#

Cache the mapping-independent intermediates of macro-unit construction (the discounted transition matrix and the per-grain sequence-class distributions) per substrate, so candidate units that share a footprint, update grain, and apportionment reuse them (default True). Results are identical either way.

clear_system_caches_after_computing_sia: bool = False#

Clear a system’s caches after each system irreducibility analysis (default False). Frees memory in sweeps over many systems at the cost of recomputing what a later analysis of the same system would have reused.

disk_cache_results: bool = False#

Persist top-level results (system irreducibility analyses and cause-effect structures) to a content-addressed cache on disk, in __pyphi_cache__ under the working directory, and reuse them across runs (default False). The key includes the configuration and the code version, so a changed setting or release never returns a stale result. See Cache results.

progress_bars: bool = True#

Show progress bars during long computations (default True).

repr_verbosity: int = 2#

0 the one-line compact form; 1 the card without expensive embedded grids such as a substrate’s TPM; 2 (default) the standard card; 3 the card plus all mathematical content, such as partition cut grids and selection margins; 4 that plus a provenance section recording how, when, and by what code the result was computed.

Type:

How much a result’s repr shows, 0 to 4

repr_max_table_rows: int = 50#

Maximum rows shown in a collection table (distinctions, relations, account links) in a result’s text or HTML rendering (default 50). Larger collections are truncated with a “… N more” line; the full data is always available from the object itself and to_pandas().

print_fractions: bool = True#

When True (default), a probability in text output that is close to a simple fraction (denominator at most 128) is printed as that fraction; otherwise probabilities print as decimals at the configured precision.

label_separator: str = ''#

The string placed between unit labels when a set of units is written as one label (default "", so units A and B print as AB; "," gives A,B).

welcome_off: bool = False#

Suppress the welcome message printed when PyPhi is imported (default False). The environment variable PYPHI_WELCOME_OFF has the same effect. Controls only the welcome; the agent note has its own switch.

agent_note_off: bool = False#

Suppress the note printed to standard error when PyPhi is imported under an AI coding agent, detected through the CLAUDECODE or PYPHI_AGENT environment variables (default False). The environment variable PYPHI_AGENT_NOTE_OFF has the same effect. Independent of welcome_off: the two messages have different audiences and channels.

validate_system_states: bool = True#

When True (default), constructing a system checks that its state can be reached under the substrate’s dynamics and raises StateUnreachableForwardsError otherwise, since a state with no possible predecessor has no defined analysis.

validate_conditional_independence: bool = True#

When True (default), constructing a substrate checks that its units are conditionally independent given the previous state and raises ConditionallyDependentError otherwise. See Conditional independence.

validate_connectivity: bool = True#

When True (default), a substrate’s connectivity matrix is checked against the connections its TPM implies, and a matrix that omits a real connection (which would silently marginalize a true dependency and under-count φ) is rejected with a ValueError naming the missing connections. Declaring an unused connection stays legal. Set False for a deliberately permissive matrix.

validate_phi_bounds: bool = False#

When True, every result checks its φ against the certified upper bound of Zaeemzadeh et al. (2024) and raises BoundViolationError on an overshoot within the bound’s domain, which would prove a formalism bug. Off by default, since it adds bound arithmetic to the hot path; intended for continuous integration and debugging. Outside the certified domain (non-binary units, other measures) the check is skipped.

validate_config: bool = True#

When True (default), combinations of options are checked eagerly on override and when a configuration file is loaded, so that an IIT version paired with a measure or scheme it does not define is rejected with a ConfigurationError naming the two fields and a fix (see pyphi.conf.constraints). Set False to experiment with unsupported combinations.