Repository navigation
Add core framework support for non-annual simulation durations - #7
Open
jaredthomas68 wants to merge 6 commits into
Open
jaredthomas68 wants to merge 6 commits into
jaredthomas68 wants to merge 6 commits into
Conversation
jaredthomas68
added this pull request to stack #8
October 8, 2026 22:31
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.
Core framework support for non-annual simulation durations
This PR is the second of a stack of PRs enabling non-annual simulation durations in H2Integrate (built on top of the resource resampling work in H2Integrate PR NatLabRockies#893 and preceding the technology-model adoption PR).
Key changes:
load_plant_yamlnow permits positive durations up toplant_life(sub-annual, single-year, or multi-year).check_model_simulation_durationand_simulation_duration_bounds((min, max)in years, defaulting to(1.0, 1.0)) on base classes so existing models safely remain protected at annual-only until explicitly validated.PerformanceModelBaseClass.calculate_annual_cf_and_replacement_schedule()andCostModelBaseClass.calculate_annual_varopex()to project capacity factors, component replacements, and variable OpEx across plant life.Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
Type of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
_simulation_duration_boundschecking parallel to_time_step_boundscalculate_annual_cf_and_replacement_scheduleandcalculate_annual_varopexSection 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.mdSection 4: Related Issues
Partially resolves NatLabRockies#204
Section 5: Impacted Areas of the Software
Section 5.1: New Files
Section 5.2: Modified Files
h2integrate/core/inputs/validation.pyplant_life.h2integrate/core/model_checks.pycheck_model_simulation_durationto validate simulation length against_simulation_duration_bounds.h2integrate/core/model_baseclass.py_simulation_duration_boundsdefaults and helperscalculate_annual_cf_and_replacement_scheduleandcalculate_annual_varopex.h2integrate/core/h2integrate_model.pycheck_model_simulation_durationalongside time-step checks for all technology, feedstock, and transport components.h2integrate/control/control_strategies/openloop_control_baseclass.py_simulation_duration_bounds = (1.0, 1.0).h2integrate/control/control_strategies/pyomo_storage_controller_baseclass.py_simulation_duration_bounds = (1.0, 1.0).h2integrate/control/control_rules/pyomo_rule_baseclass.py_simulation_duration_bounds = (1.0, 1.0).h2integrate/finances/profast_baseclass.py&profast_npv.pyh2integrate/core/test/test_framework.pyh2integrate/core/test/test_model_baseclasses.pyh2integrate/finances/test/(test_finances.py,test_profast_lco.py,test_profast_npv.py)docs/intro.md,docs/developer_guide/class_structure.md,docs/developer_guide/adding_a_new_technology.md,docs/developer_guide/features_not_currently_implemented.mdSection 6: Additional Supporting Information
Subsequent PR will widen
_simulation_duration_boundson specific concrete models (solar, battery, grid, demand, combiners) and demonstrate non-annual runs in Example 24.Section 7: Test Results, if applicable
Targeted core framework, model baseclass, and finance tests all pass.