Bugfix to technology_graph and other minor fixes - #823
Merged
Conversation
…dated what info is given to the SLC model wrt upstream techs
58 tasks
johnjasa
approved these changes
Aug 4, 2026
johnjasa
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this, Elenya! I pushed up some changes directly. Please update the changelog, otherwise this is good to come in. Let me know if you want a re-review after you make any more changes.
elenya-grant
marked this pull request as ready for review
August 4, 2026 23:23
elenya-grant
marked this pull request as draft
August 4, 2026 23:25
Collaborator
Author
|
@johnjasa I updated the changelog but I'm gonna play around with it a bit but will mark is ready for review once I'm done! |
elenya-grant
marked this pull request as ready for review
August 5, 2026 00:02
kbrunik
approved these changes
Aug 5, 2026
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.
Bugfix to
technology_graphand other minor fixesThis PR has two bug-fixes that were not caught earlier because those use-cases are not yet possible with the technologies in H2I or they were not tested. The main bug-fix has to do with adding the
commodityattribute to edges when creating thetechnology_graph. The commodity attribute was added as a string. In cases where multiple commodities are passed from one technology to another, this string is over-written. The technology graph should have not worked properly if there was a connection like below:Now - the edge attribute of the technology graph may be a string or a list, to prevent it getting overwritten.
Another minor fix/update was make to
H2IntegrateModel.create_slc_topologyto ensure that theslc_topologyonly contains information about technologies that are upstream and have a path to the demand component. This was a minor change in thetech_control_classifiersandtech_to_commodityinputs to theslc_topologydictionary.These changes were motivated by some of the work and testing done in PR #816
Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
Type of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
Implementation feedback:
Other feedback:
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.Section 4: Related Issues
Section 5: Impacted Areas of the Software
Section 5.1: New Files
path/to/file.extensionmethod1: What and why something was changed in one sentence or less.Section 5.2: Modified Files
H2IntegrateModelinh2integrate/core/h2integrate_model.pycreate_technology_graph(): updated to account for multiple commodities being connected between two technologies_classify_slc_technologies(): updated to account for change increate_technology_graphand also bugfix to only include tech info for techs upstream and with a path to the demand component for all information contained in theslc_topologyh2integrate/core/test/test_slc_framework.py::test_slc_topology_fake_complex_system: new test that uses a fake system where multiple commodities are connected between the electrolyzer and haber Bosch systemh2integrate/core/test/inputs/tech_connection_cases.yamlSystemLevelControlBaseinh2integrate/control/control_strategies/system_level/system_level_control_base.pyget_upstream_techs_for_commodity: updated to work for update to tech graphSection 6: Additional Supporting Information
Section 7: Test Results, if applicable