pyphi.cost.mechanism_workloads#

pyphi.cost.mechanism_workloads(substrate, subset=None, scope=None, limit=10000000)[source]#

Per-mechanism workload under a scope, keyed by mechanism.

Each mechanism’s MechanismWorkload weighs its scoped purview evaluations against its mechanism-partition sweeps by their measured relative cost, and records the state-space size of its largest scoped purview. Summed over all mechanisms, the units equal PURVIEW_EVALUATION_UNITS × the scoped AnalysisEstimate.purview_evaluations plus the scoped AnalysisEstimate.mechanism_partition_sweeps.

Parameters:
  • substrate (Substrate) – The substrate to analyze.

  • subset (optional) – Node indices (or labels) of the candidate system; None uses the whole substrate.

  • scope (CESScope, optional) – Restrict the counted mechanisms and purviews.

  • limit (int, optional) – Work budget for the counting walk.

Raises:

ValueError – If the counting walk exceeds limit — the workload is then too large to plan; narrow the scope or raise the limit.

Return type:

dict[tuple[int, …], MechanismWorkload]