fluxopt.contributions
¶
Per-contributor effect breakdown.
Decomposes solver effect totals into per-contributor (flow/storage) parts, split into temporal (per-timestep) and lump (sizing + investment costs) domains — matching the model's own temporal/lump structure.
Two views are supported via the cross_effects parameter on
compute_effect_contributions:
- with cross-effects (default): propagates
contribution_fromchains via the Leontief inverse —total = (I - C)^-1 * direct— so each contributor is charged the full priced-in cost (e.g. CO₂ → cost). - direct: skips Leontief; each contributor shows only effects it directly emits.
Functions:
| Name | Description |
|---|---|
compute_effect_contributions |
Compute per-contributor effect breakdown from solved values. |
compute_effect_contributions
¶
compute_effect_contributions(
solution: Dataset, data: ModelData, *, cross_effects: bool = True
) -> Dataset
Compute per-contributor effect breakdown from solved values.
Decomposes effect totals into per-contributor parts on a unified
contributor dimension (flow IDs + storage IDs).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Dataset
|
Solved variable dataset from |
required |
|
ModelData
|
Model data used to build the optimization. |
required |
|
bool
|
When True (default), propagates effects along
|
True
|
Returns:
| Type | Description |
|---|---|
Dataset
|
Dataset with: |
Dataset
|
|
Dataset
|
|
Dataset
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
if |