Provide escalation option for generation price objects - #32
Conversation
j-bryan
left a comment
There was a problem hiding this comment.
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:
build_construction_outage'sGenerationPricefallback branch (market price used to value a construction outage without an explicitsell_price_per_unit).EnergyContract/GenerationRevenueRemainderConfigprices used viageneration_revenue_contractandgeneration_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.
…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.
dylanjm
left a comment
There was a problem hiding this comment.
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.
This adds an
apply_escalation: bool = Falseargument to theGenerationPrice.fixed,.schedule, and.callablemethods. When this argument is set toTrue, the_compilerapplies 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.