Fix PV grid connection fee edge case#2206
Merged
Conversation
shorowit
commented
Apr 30, 2026
Comment on lines
+906
to
+913
| def test_pv_none_with_pv_grid_fee_dollars | ||
| # Check PV grid fee not applied if no PV | ||
| @hpxml.header.utility_bill_scenarios[-1].pv_monthly_grid_connection_fee_dollars = 7.50 | ||
| @hpxml_bldg.pv_systems.clear | ||
| actual_bills, actual_monthly_bills = _bill_calcs(@fuels_pv_none_simple, @hpxml) | ||
| _check_bills(@expected_bills, actual_bills) | ||
| _check_monthly_bills(actual_bills, actual_monthly_bills) | ||
| end |
Contributor
Author
There was a problem hiding this comment.
This test fails before the bugfix.
Comment on lines
-327
to
+330
| pv_monthly_fee = bill_scenario.pv_monthly_grid_connection_fee_dollars | ||
| has_pv = hpxml_buildings.map { |hpxml_bldg| hpxml_bldg.pv_systems.map { |pv_system| pv_system.max_power_output }.sum }.sum > 0 | ||
| if has_pv | ||
| pv_monthly_fee = bill_scenario.pv_monthly_grid_connection_fee_dollars | ||
| end |
Contributor
Author
There was a problem hiding this comment.
And this is the bugfix.
shorowit
commented
Apr 30, 2026
| @expected_bills['Test: Electricity: PV Credit (USD)'] = -177 | ||
| expected_bills = _get_expected_bills(@expected_bills) | ||
| _check_bills(expected_bills, actual_bills) | ||
| _check_bills(@expected_bills, actual_bills) |
Contributor
Author
There was a problem hiding this comment.
Unrelated cleanup throughout to reduce LOC and simplify _bill_calcs method signature.
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.
Pull Request Description
Closes #2205.
Checklist
Not all may apply:
EPvalidator.sch) has been updatedopenstudio tasks.rb update_hpxmls)HPXMLtoOpenStudio/tests/test*.rband/orworkflow/tests/test*.rb)openstudio tasks.rb update_measureshas been run