Skip to content

Move xdsm call in H2IntegrateModel to its own method#629

Merged
johnjasa merged 12 commits intoNatLabRockies:developfrom
jaredthomas68:optxdsm
Mar 27, 2026
Merged

Move xdsm call in H2IntegrateModel to its own method#629
johnjasa merged 12 commits intoNatLabRockies:developfrom
jaredthomas68:optxdsm

Conversation

@jaredthomas68
Copy link
Copy Markdown
Collaborator

@jaredthomas68 jaredthomas68 commented Mar 26, 2026

Move xdsm call in H2IntegrateModel to its own method

Having the xdsm call happen in tech interconnect leads to a lot of extra processing and print statements that are not necessary when calling H2I multiple times for similar cases. I moved the xdsm call to a method so it can still be called on the h2i model instance, but only when desired.

I also added some documentation on visualizing an H2I model with XDSM and N2 diagrams.

Section 1: Type of Contribution

  • Feature Enhancement
    • Framework
    • New Model
    • Updated Model
    • Tools/Utilities
    • Other (please describe):
  • 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
    • At least one complete sentence has been provided to describe the changes made in this PR
    • After the above, a hyperlink has been provided to the PR using the following format:
      "A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
      XYZ should be replaced with the actual number.

Section 3: Related Issues

Section 4: Impacted Areas of the Software

Section 4.1: New Files

  • path/to/file.extension
    • method1: What and why something was changed in one sentence or less.

Section 4.2: Modified Files

  • path/to/file.extension
    • method1: What and why something was changed in one sentence or less.

Section 5: Additional Supporting Information

Section 6: Test Results, if applicable

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

@jaredthomas68 jaredthomas68 requested a review from johnjasa March 26, 2026 16:32
@jaredthomas68 jaredthomas68 changed the base branch from main to develop March 26, 2026 16:33
Copy link
Copy Markdown
Collaborator

@johnjasa johnjasa left a comment

Choose a reason for hiding this comment

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

Thanks for this, Jared! I think it's good to have it be optional.

Could you please:

  • add to the changelog
  • add to the docs where appropriate about this create_xdsm functionality, maybe in how_to_set_up_an_analysis.md?

@jaredthomas68 jaredthomas68 requested a review from johnjasa March 27, 2026 17:53
@jaredthomas68 jaredthomas68 added the ready for review This PR is ready for input from folks label Mar 27, 2026
Copy link
Copy Markdown
Collaborator

@johnjasa johnjasa left a comment

Choose a reason for hiding this comment

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

Thanks for these updates, Jared! I really like the amount of detail you added in the docs, as well as the useful figures and links.

@johnjasa johnjasa enabled auto-merge (squash) March 27, 2026 18:07
@johnjasa johnjasa merged commit 46692f3 into NatLabRockies:develop Mar 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review This PR is ready for input from folks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants