Auto-generate ng_crf_penalty_st.csv and update financials.py#113
Open
merveturan wants to merge 7 commits into
Open
Auto-generate ng_crf_penalty_st.csv and update financials.py#113merveturan wants to merge 7 commits into
merveturan wants to merge 7 commits into
Conversation
added 6 commits
May 12, 2026 18:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PR resolves issue #25. The values stored in
inputs/state_policies/ng_crf_penalty_st.csvrepresent a ratio of capital recovery factors — specificallyCRF_X / CRF_30, whereXis the number of years remaining before a natural gas power plant must retire. Because these values were hard-coded in a CSV, they stayed fixed even when financial inputs likesys_eval_yearwere changed. This PR wires the calculation intocalc_financial_inputsso that the penalty values are derived at runtime from the model's existing financial parameters, keeping them in sync with any upstream changes. The second part of issue #25 — removing the CRF penalty when DAC/BECCS are available — is out of scope for this PR.Technical details
The
CRF_X / CRF_30ratio computation has been moved from the pre-generated CSV intocalc_financial_inputs. BothCRF_X(CRF at the state-specific retirement horizon) andCRF_30(CRF at 30 years) are now pulled from the model's financial parameter infrastructure, so the penalty automatically updates whensys_eval_yearor related inputs change. Theng_crf_penalty_st.csvfile has also been updated to reflect the dynamically computed values; the proposed version extends coverage back to 2010 (from 2019 inmain) and shows small decimal-level differences in the overlapping years due to the recalculation.Implementation notes
Additional changes
Switches added/removed/changed
Issues resolved
Closes #25
Known incompatibilities
Relevant sources or documentation
Validation, testing, and comparison report(s)
A comparison run was conducted between
v20260524_main_USA_defaults(baseline) andv20260525_USA_defaults(proposed branch). The differences are small and directly attributable to the decimal-level shifts in the dynamically computedng_crf_penalty_stvalues. The dispatch differences in the comparison report (primarily Gas-CC, Gas-CC-CCS, Gas-CC-CCS_Upgrade, Gas-CT, and Coal-CCS by timeslice in 2050) are consistent with the modified financial penalty affecting fossil plant retirement economics, and no unexpected changes were observed in non-fossil technologies. The full comparisons report is here.ng_crf_penalty_st.csvvalue differences (proposed vs. main)Checklist for author
Details to double-check
hourlize/resource.pywas rerun to regenerate the existing/prescribed VRE capacity dataGeneral information to guide review
Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how
Yes, It used in preparing text and coding.
Tag points of contact here if you would like additional review of the relevant parts of the model