Skip to content

Prorate PTC for partial eligibility years - #22

Merged
j-bryan merged 1 commit into
mainfrom
ptc-cutoff-fix
Jul 31, 2026
Merged

Prorate PTC for partial eligibility years#22
j-bryan merged 1 commit into
mainfrom
ptc-cutoff-fix

Conversation

@caleb-sitton-inl

Copy link
Copy Markdown
Collaborator

This change fixes incorrect PTC behavior where a partial final eligibility year would be omitted when building the PTC cashflows.

The main complication in fixing this bug was that some generation objects were created at a particular date but actually referred to generation over the entire year. Since the Generation class only accepted a date argument, there was no way to determine what portion of the generation should be included in the PTC payment. Thus, period_start and period_end attributes were added to Generation. The date attribute was preserved in order to maintain backwards compatibility and to allow specification of a particular date to use as a basis for other calculations instead of automatically selecting such a date from the applicable period.

The period on each Generation object is now used to determine overlap between the generation and the PTC eligibility window. This overlap (and the day count convention used for the PTC) determines how the PTC amount is prorated.

Tests have been updated and added for these changes, including regression checks to ensure that the full PTC eligibility window is respected.

Closes #18.

@caleb-sitton-inl
caleb-sitton-inl requested a review from j-bryan July 31, 2026 21:09
@j-bryan
j-bryan merged commit 801234a into main Jul 31, 2026
1 check passed
@caleb-sitton-inl
caleb-sitton-inl deleted the ptc-cutoff-fix branch July 31, 2026 21:30
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.

Mid-year first generation date results in partial last year of PTC being omitted

2 participants