Skip to content

Provide escalation option for generation price objects - #32

Merged
dylanjm merged 2 commits into
mainfrom
generation-price-escalation
Aug 17, 2026
Merged

dylanjm merged 2 commits into
mainfrom
generation-price-escalation

Conversation

@caleb-sitton-inl

Copy link
Copy Markdown
Collaborator

This adds an apply_escalation: bool = False argument to the GenerationPrice.fixed, .schedule, and .callable methods. When this argument is set to True, the _compiler applies the project default escalation to the cashflows generated from the associated generation. This means that, if they desire, users no longer have to manually apply an escalation adjustment when using these flexible price configurations.

Closes #26.

@j-bryan j-bryan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds apply_escalation cleanly and the implementation is correct — I traced and manually verified all four call sites (build_revenue, build_construction_outage, contract revenue, and remainder revenue) and confirmed escalation is applied/omitted as expected in each. Full test suite (908 tests), ruff, and mypy all pass.

Requesting changes only for test coverage: the new tests only exercise apply_escalation=True through generation_revenue/build_revenue. Two other paths that consume the same flag have no equivalent test:

  1. build_construction_outage's GenerationPrice fallback branch (market price used to value a construction outage without an explicit sell_price_per_unit).
  2. EnergyContract/GenerationRevenueRemainderConfig prices used via generation_revenue_contract and generation_revenue_remainder.

Both behave correctly today (verified manually), but neither is protected by a regression test, so a future refactor of _resolve_price_escalation could silently break either path. Please add coverage for apply_escalation=True in these two cases before merging.

Comment thread dcaf/project/_compiler.py
Comment thread dcaf/project/_compiler.py
…er prices

Adds regression tests for the two GenerationPrice.apply_escalation code
paths that PR review flagged as untested: the construction_outage market
price fallback, and generation_revenue_contract/generation_revenue_remainder.
@j-bryan
j-bryan requested a review from dylanjm August 17, 2026 18:11

@dylanjm dylanjm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is good. It adds some type checking to ensure consistent behavior for price escalation. Mainly adding escalation for generation price objects. Tests are well crafted as well.

@dylanjm
dylanjm merged commit 0d79914 into main Aug 17, 2026
1 check passed
@dylanjm
dylanjm deleted the generation-price-escalation branch August 17, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escalation handling for GenerationPrice pricing

3 participants