Fixs issues that columns like calc.weighted.savings.utility_bills.fuel_oil_bill..billion_usdout.utility_bills.fuel_oil_bill..usd, calc.utility_bills.total_mean_bill..usd cannot generate the saving columns in proper way.
Description:
col_name_to_savings is used to conveted the source columns to saving-columns in postprocessing/comstock.py link.
Workflow and why it's a bug:
column site_energy.total.energy_consumption -> initialization of saving-columns site_energy.total.energy_savings-> differ of columns site_energy.total.energy_consumption -> store the value back in site_energy.total.energy_savings column.
The original col_name_to_savings implementation didn't consider the situtation when bill is in the end of column name.
Then if a column's name is out.utility_bills.fuel_oil_bill..usd the workflow will be:
column out.utility_bills.fuel_oil_bill..usd -> initialization of saving-columns out.utility_bills.fuel_oil_bill..usd-> differ of columns out.utility_bills.fuel_oil_bill..usd -> store the value back in out.utility_bills.fuel_oil_bill..usd column.
Which is not what we want it to do.
Pull Request Author
Wenyi Kuang
This pull request makes changes to (select all the apply):
[ ] Tagged the pull request with the appropriate label (documentation, infrastructure, sampling, workflow measure, upgrade measure, reporting measure, postprocessing) to help categorize changes in the release notes.
[ ] Added tests for new measures
[ ] Updated measure .xml(s)
[ ] Register values added to comstock_column_definitions.csv
[ ] Both options_lookup.tsv files updated
[ ] 10k+ test run
[ ] Change documentation written
[ ] Measure documentation written
[ ] ComStock documentation updated
[ ] Changes reflected in example .yml files
[ ] Changes reflected in README.md files
[ ] Added 'See ComStock License' language to first two lines of each code file
[ ] Implements corresponding measure tests and indexing path in test/measure_tests.txt or/and test/resource_measure_tests.txt
[ ] All new and existing tests pass the CI
Review Checklist
This will not be exhaustively relevant to every PR.
[ ] Perform a code review on GitHub
[ ] All related changes have been implemented: data and method additions, changes, tests
[ ] If fixing a defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
[ ] Reviewed change documentation
[ ] Ensured code files contain License reference
[ ] Results differences are reasonable
[ ] Make sure the newly added measures has been added with tests and indexed properly
[ ] CI status: all tests pass
ComStock Licensing Language - Add to Beginning of Each Code File
# ComStock™, Copyright (c) 2023 Alliance for Sustainable Energy, LLC. All rights reserved.
# See top level LICENSE.txt file for license terms.
Pull request overview
Purpose of the PR:
calc.weighted.savings.utility_bills.fuel_oil_bill..billion_usd
out.utility_bills.fuel_oil_bill..usd
,calc.utility_bills.total_mean_bill..usd
cannot generate the saving columns in proper way.Description:
col_name_to_savings
is used to conveted the source columns to saving-columns in postprocessing/comstock.py link.Workflow and why it's a bug: column
site_energy.total.energy_consumption
-> initialization of saving-columnssite_energy.total.energy_savings
-> differ of columnssite_energy.total.energy_consumption
-> store the value back insite_energy.total.energy_savings
column.The original
col_name_to_savings
implementation didn't consider the situtation whenbill
is in the end of column name. Then if a column's name isout.utility_bills.fuel_oil_bill..usd
the workflow will be: columnout.utility_bills.fuel_oil_bill..usd
-> initialization of saving-columnsout.utility_bills.fuel_oil_bill..usd
-> differ of columnsout.utility_bills.fuel_oil_bill..usd
-> store the value back inout.utility_bills.fuel_oil_bill..usd
column.Which is not what we want it to do.
Pull Request Author
Wenyi Kuang
This pull request makes changes to (select all the apply):
Author pull request checklist:
comstock_column_definitions.csv
options_lookup.tsv
files updated.yml
filesREADME.md
filestest/measure_tests.txt
or/andtest/resource_measure_tests.txt
Review Checklist
This will not be exhaustively relevant to every PR.
ComStock Licensing Language - Add to Beginning of Each Code File