Skip to content

feat: add build_period axis to investment effect matrices #96

@FBumann

Description

@FBumann

Summary

Investment effect fields (effects_per_size, effects_fixed, effects_per_size_periodic, effects_fixed_periodic) currently support an optional period dimension (added in #94). Per the design decision in #88 and the target in #92, they should also support a build_period axis to enable period-dependent construction costs.

Target dimensions

Field Current Target
Investment.effects_per_size (invest_flow, effect, period?) (invest_flow, effect, period?, build_period?)
Investment.effects_fixed (invest_flow, effect, period?) (invest_flow, effect, period?, build_period?)
Investment.effects_per_size_periodic (invest_flow, effect, period?) (invest_flow, effect, period?, build_period?)
Investment.effects_fixed_periodic (invest_flow, effect, period?) (invest_flow, effect, period?, build_period?)

Construction rule (from design decision)

  • Scalar → constant across all periods → diagonal
  • 1D (build_period,) → diagonal (cost charged in the period when built)
  • 2D (period, build_period) → as-is (construction spread, learning curves, decommissioning costs)

Diagonal means: effects[p, bp] = value[bp] only where p == bp.

Scope

  • model_data.py: _InvestmentArrays.build must accept and expand build_period-indexed inputs via the diagonal rule
  • model.py: consumption multiplies invest_size_at_build[flow, build_period] by the 2D effect matrix and sums over build_period
  • elements.py: type hints already accept TimeSeries (which includes xr.DataArray), so no change needed
  • Tests: add cases for scalar, 1D (build_period,), and 2D (period, build_period) inputs

Context

Separated from #92 (period-aware effects) and #94 (implementation). The _EffectTemplate helper introduced in #95 can be extended to support this.

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