Reworked how financial model units and commodity streams are defined#786
Open
elenya-grant wants to merge 17 commits into
Open
Reworked how financial model units and commodity streams are defined#786elenya-grant wants to merge 17 commits into
elenya-grant wants to merge 17 commits into
Conversation
…inance_commodity_units
26 tasks
johnjasa
reviewed
Jun 23, 2026
Comment on lines
+1344
to
+1353
| # Default logic for tech-names and the primary commodity streams | ||
| default_techs_to_commodities = { | ||
| "electrolyzer": "hydrogen", | ||
| "geoh2": "hydrogen", | ||
| "ammonia": "ammonia", | ||
| "doc": "co2", | ||
| "oae": "co2", | ||
| "methanol": "methanol", | ||
| "air_separator": "nitrogen", | ||
| } |
Collaborator
There was a problem hiding this comment.
Do we still need this? I think it might not be strictly necessary. I might've made this change.
Collaborator
There was a problem hiding this comment.
Okay, by saying that commodity_stream is req'd now, we can get rid of this -- so I did!
jaredthomas68
left a comment
Collaborator
There was a problem hiding this comment.
I didn't have time to give a detailed review, but I skimmed through the changes and I like this. Nice code simplification and at the same time reducing some obfuscation on commodity streams/sources.
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.
Reworked how financial model units and commodity streams are defined
Updated finance models to not have hard-coded logic related to defining units by taking advantage of the
compute_unitsandcopy_unitsoptions when defining inputs and outputs in OpenMDAO.The main contribution of this PR is the addition of the
_compute_price_units()function.This PR is ready for a high-level review. The file changes are pretty minor so I'm hoping the changes are pretty easy to follow.
We also removed
is_electricity_produceras part of this!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
path/to/file.extensionmethod1: What and why something was changed in one sentence or less.Section 6: Additional Supporting Information
Section 7: Test Results, if applicable
Section 8 (Optional): New Model Checklist
docs/developer_guide/coding_guidelines.mdattrsclass to define theConfigto load in attributes for the modelBaseConfigorCostModelBaseConfiginitialize()method,setup()method,compute()methodCostModelBaseClasssupported_models.pycreate_financial_modelinh2integrate_model.pytest_all_examples.pydocs/user_guide/model_overview.mddocs/section<model_name>.mdis added to the_toc.ymlgenerate_class_hierarchy.pyto update the class hierarchy diagram indocs/developer_guide/class_structure.md