pyphi.mcp.server.estimate_cost#
- pyphi.mcp.server.estimate_cost(handle, subset=None, compute='full', formalism=None, scope=None)[source]#
Count the workload of an analysis before running it.
Reports what
analyzewould evaluate — system partitions, candidate mechanisms, connectivity-pruned purview evaluations, and mechanism-partition sweeps — without computing any φ. The counts reflect the partition schemes, connectivity, and alphabet under the requested formalism.estimated_cpu_secondsconverts the distinction axis to time atpyphi.cost.SECONDS_PER_UNIT, which is calibrated on reference hardware and holds to roughly 20% there. It excludes the system-partition axis, whose cost per partition is not calibrated against the same unit, and it isNonewhen the distinction axis was not counted.- Parameters:
handle (str) – A substrate handle from
load_exampleorbuild_substrate.subset (list of int or str, optional) – The candidate system, as in
analyze. Default prices the whole substrate.compute (str) –
"full"(default),"sia","ces", or"distinctions"— the analysis whose workload to estimate, as inanalyze. Under IIT 4.0,"ces"is charged on the system-partition axis too, since unfolding a cause-effect structure computes a system irreducibility analysis first.formalism (str, optional) – As in
analyze.scope (dict, optional) – Restricts the counted mechanisms and purviews, as a scoped campaign does; it affects only the distinction axis. Keys:
"mechanisms","cause_purviews"and"effect_purviews", each a mapping with any of"explicit"(a list of unit lists, which cannot combine with the other keys),"min_order","max_order","containing"(units every admitted set contains) and"within"(units every admitted set lies within); and"max_purview_order_by_mechanism_order", a list of[mechanism order, max purview order]pairs applied to both purview directions. Units may be labels or indices. An unknown key raises an error. Example:{"mechanisms": {"max_order": 2, "containing": ["A"]}, "cause_purviews": {"within": ["A", "B"]}}.
- Returns:
dict – A
card(human-readable text), anestimatemapping with the counts, andestimated_cpu_secondswith a note on what it covers: the distinction axis only, so a"sia"estimate has no seconds and a"full"estimate is a lower bound.capped=truemarks counts that are lower bounds: the count stops at a fixed work budget, which it reaches within seconds.- Return type: