NREL / ComStock

National scale modeling of the U.S. commercial building stock supported by U.S. DOE, LADWP, and others and maintained by NREL
Other
29 stars 7 forks source link

Fixed the issues during name generating for saving column. #196

Closed wenyikuang closed 1 month ago

wenyikuang commented 1 month ago

Pull request overview

Purpose of the PR:

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):

Author pull request checklist:

Review Checklist

This will not be exhaustively relevant to every PR.

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.