NREL / buildstock-query

BuildStockQuery is a python library for querying datasets generated by ResStock™ and ComStock™.
https://nrel.github.io/buildstock-query/
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Bug fix for calculating savings #10

Closed rajeee closed 1 year ago

rajeee commented 1 year ago

Resolves #[issue number here].

Pull Request Description

The savings was not being calculated properly, especially for columns which may be missing because of two reasons:

  1. The building is missing in the upgrade - i.e. the upgrade doesn't apply to the building. In this case, all columns for this building will be missing.
  2. The end use no longer exists for the building. For example, end_useelectricityhot_water__kwh column will be missing for a building that has natural gas hot water.

Previously, when columns were missing, it was assumed to be only because of 1. This caused the savings calculation to be wrong. This PR fixes the issue.