Skip to content

fix: effect_contributions does not support investment costs or period decomposition #84

@FBumann

Description

@FBumann

Problem

compute_effect_contributions() in contributions.py does not correctly handle:

  1. Investment costs (effect_once domain): CAPEX from Investment.effects_per_size and Investment.effects_fixed are charged in the effect_once domain, but contributions only tracks temporal and periodic — it has no once domain.

  2. Period dimension: When multi-period optimization is used, contributions should decompose per-period. Currently periodic contributions have no period dimension, and total validation fails because solver effect--total has a period dim while computed total does not.

  3. Investment recurring costs: invest_effects_per_size_periodic and invest_effects_fixed_periodic are not accounted for in the periodic contribution computation.

Impact

Tests using optimize->save->reload->validate pipeline xfail when investment costs are present, because the contribution validation check computed == solver_total fails.

Expected behavior

compute_effect_contributions() should return contributions split by effect domain (temporal, periodic, once) with a period dimension when multi-period is active, and include investment cost contributions.

Related

Part of multi-period investment (#27).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions