Added more expansive feedstock tests for SLC#793
Draft
johnjasa wants to merge 1 commit into
Draft
Conversation
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.
Add tests for multi-feedstock handling in the system-level controller
cost_per_tech: feedstocklogic inSystemLevelControlBasealready discovers all upstream feedstocks vianx.ancestors(any graph depth) and sums their first-yearVarOpExvalues when computing the dispatchable technology's marginal cost. No code changes were required.test_slc_controllers.pyto lock in this behavior against the fuel-cell scenario in the issue (a dispatchable consuming both hydrogen and oxygen as feedstocks):test_feedstock_fuel_cell_h2_o2exercises a fuel cell with H2 and O2 feedstocks underCostMinimizationControland checks that the combined feedstock cost yields full dispatch.test_feedstock_multiple_sum_not_averagepins the marginal-cost combination to a sum (not a mean) by selectingVarOpExvalues where the summed cost is just above the sell price; averaging would incorrectly dispatch the tech.test_feedstock_indirect_upstreamconnects one feedstock directly and another through an intermediate combiner, verifying that the ancestor-based discovery sees both.Section 1: Type of Contribution
Section 2: Draft PR Checklist
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", where
XYZshould be replaced with the actual number.Section 4: Related Issues
Fully resolves #789
Section 5: Impacted Areas of the Software
Section 5.1: New Files
Section 5.2: Modified Files
h2integrate/control/control_strategies/system_level/test/test_slc_controllers.py- adds three multi-feedstock tests covering the fuel cell H2+O2 case, sum-vs-average correctness, and indirect graph ancestry.Section 6: Additional Supporting Information
The existing
test_feedstock_multiplealready covered a 2-feedstock summation case with generic names, but we now cover the fuel-cell H2+O2 scenario plus assurance that the summation is correct under conditions where averaging would change the outcome. The new tests address both.Section 7: Test Results, if applicable
Section 8 (Optional): New Model Checklist
N/A