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:
objectInfrastructure-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_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).Falseruns every level sequentially;Truepermits the levels whose ownparallel_*_evaluationmapping hasparallelset. See Run computations in parallel.
- parallel_complex_evaluation: Mapping[str, Any]#
a mapping with the keys
parallel(whether this level may run in parallel;Falseby default),sequential_threshold(workloads with fewer items than this run sequentially regardless),chunksize(items per task), andprogress(show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switchparallelmust 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;Falseby default),sequential_threshold(workloads with fewer items than this run sequentially regardless),chunksize(items per task), andprogress(show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switchparallelmust 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;Falseby default),sequential_threshold(workloads with fewer items than this run sequentially regardless),chunksize(items per task), andprogress(show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switchparallelmust 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;Falseby default),sequential_threshold(workloads with fewer items than this run sequentially regardless),chunksize(items per task), andprogress(show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switchparallelmust 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;Falseby default),sequential_threshold(workloads with fewer items than this run sequentially regardless),chunksize(items per task), andprogress(show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switchparallelmust 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;Falseby default),sequential_threshold(workloads with fewer items than this run sequentially regardless),chunksize(items per task), andprogress(show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switchparallelmust 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;Falseby default),sequential_threshold(workloads with fewer items than this run sequentially regardless),chunksize(items per task), andprogress(show a progress bar). A partial mapping merges over the level’s defaults; unknown keys are rejected. The master switchparallelmust also be on. See Run computations in parallel.- Type:
Parallelism for the candidate macro systems of a grain search
- 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 throughpyphi.paralleland theclusterextra.- 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). Replacesmemory_ceiling_percentagewhen 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).Falserecomputes 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 (defaultFalse). The key includes the configuration and the code version, so a changed setting or release never returns a stale result. See Cache results.
- repr_verbosity: int = 2#
0the one-line compact form;1the card without expensive embedded grids such as a substrate’s TPM;2(default) the standard card;3the card plus all mathematical content, such as partition cut grids and selection margins;4that plus a provenance section recording how, when, and by what code the result was computed.- Type:
How much a result’s
reprshows,0to4
- 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 andto_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 asAB;","givesA,B).
- welcome_off: bool = False#
Suppress the welcome message printed when PyPhi is imported (default
False). The environment variablePYPHI_WELCOME_OFFhas 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
CLAUDECODEorPYPHI_AGENTenvironment variables (defaultFalse). The environment variablePYPHI_AGENT_NOTE_OFFhas the same effect. Independent ofwelcome_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 raisesStateUnreachableForwardsErrorotherwise, 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 raisesConditionallyDependentErrorotherwise. 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 aValueErrornaming the missing connections. Declaring an unused connection stays legal. SetFalsefor 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 raisesBoundViolationErroron 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 onoverrideand when a configuration file is loaded, so that an IIT version paired with a measure or scheme it does not define is rejected with aConfigurationErrornaming the two fields and a fix (seepyphi.conf.constraints). SetFalseto experiment with unsupported combinations.