Skip to content

Enhancement: Automatically insert technology names in control strategy definitions#558

Merged
johnjasa merged 3 commits intoNatLabRockies:developfrom
RHammond2:enhancement/model-tech-name
Feb 28, 2026
Merged

Enhancement: Automatically insert technology names in control strategy definitions#558
johnjasa merged 3 commits intoNatLabRockies:developfrom
RHammond2:enhancement/model-tech-name

Conversation

@RHammond2
Copy link
Collaborator

Automatically provide the technology name to the model_inputs when control_parameters is present

This PR automatically replaces or provides the technology name to control_parameters when it is present in model_inputs or adds it if it isn't present instead of relying on users replicating the name of the technology in a subdictionary.

Section 1: Type of Contribution

  • Feature Enhancement
    • Framework
    • New Model
    • Updated Model
    • Tools/Utilities
    • Other (please describe): automated configuration modification
  • Bug Fix
  • Documentation Update
  • CI Changes
  • Other (please describe):

Section 2: Draft PR Checklist

  • Open draft PR
  • Describe the feature that will be added
  • Fill out TODO list steps
  • Describe requested feedback from reviewers on draft PR
  • Complete Section 7: New Model Checklist (if applicable)

TODO:

  • Step 1
  • Step 2

Type of Reviewer Feedback Requested (on Draft PR)

Structural feedback:

Implementation feedback:

Other feedback:

Section 3: General PR Checklist

  • PR description thoroughly describes the new feature, bug fix, etc.
  • Added tests for new functionality or bug fixes
  • Tests pass (If not, and this is expected, please elaborate in the Section 6: Test Results)
  • Documentation
    • Docstrings are up-to-date
    • Related docs/ files are up-to-date, or added when necessary
    • Documentation has been rebuilt successfully
    • Examples have been updated (if applicable)
  • CHANGELOG.md has been updated to describe the changes made in this PR

Section 3: Related Issues

Closes #305

Section 4: Impacted Areas of the Software

Section 4.1: New Files

N/A

Section 4.2: Modified Files

  • h2integrate/core/h2integrate_model.py
    • H2IntegrateModel.load_config: modifies the technology configuration file to add the tech_name parameter for each of the provided technologies with a control_parameters dictionary.
  • examples/test/test_all_examples.py::test_pyomo_heuristic_dispatch_example: Replace the incorrect name failure subtest and replace it with 2 new subtests to ensure incorrect names and no provided names both load successfully.
  • examples/18_pyomo_heuristic_dispatch/tech_config_error_for_testing.yaml: removed now that it's obselete
  • examples/18_pyomo_heuristic_dispatch/pyomo_heuristic_dispatch_error_for_testing.yaml: removed now that it's obselete

Section 5: Additional Supporting Information

N/A

Section 6: Test Results, if applicable

All tests pass with one modified test that has an obsolete subtest replaced.

Section 7 (Optional): New Model Checklist

  • Model Structure:
    • Follows established naming conventions outlined in docs/developer_guide/coding_guidelines.md
    • Used attrs class to define the Config to load in attributes for the model
      • If applicable: inherit from BaseConfig or CostModelBaseConfig
    • Added: initialize() method, setup() method, compute() method
      • If applicable: inherit from CostModelBaseClass
  • Integration: Model has been properly integrated into H2Integrate
    • Added to supported_models.py
    • If a new commodity_type is added, update create_financial_model in h2integrate_model.py
  • Tests: Unit tests have been added for the new model
    • Pytest-style unit tests
    • Unit tests are in a "test" folder within the folder a new model was added to
    • If applicable add integration tests
  • Example: If applicable, a working example demonstrating the new model has been created
    • Input file comments
    • Run file comments
    • Example has been tested and runs successfully in test_all_examples.py
  • Documentation:
    • Write docstrings using the Google style
    • Model added to the main models list in docs/user_guide/model_overview.md
      • Model documentation page added to the appropriate docs/ section
      • <model_name>.md is added to the _toc.yml

@RHammond2 RHammond2 added enhancement New feature or request ready for review This PR is ready for input from folks labels Feb 27, 2026
Copy link
Collaborator

@jaredthomas68 jaredthomas68 left a comment

Choose a reason for hiding this comment

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

This looks great, thanks!

@johnjasa johnjasa merged commit 9e99841 into NatLabRockies:develop Feb 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready for review This PR is ready for input from folks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants