Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation and documentation fixes and enhancements #420

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

trynthink
Copy link
Owner

@trynthink trynthink commented Sep 21, 2024

Incorporate changes from

and address issue #383.

@trynthink trynthink added this to the v1.0.0 milestone Sep 21, 2024
@trynthink trynthink self-assigned this Sep 21, 2024
@trynthink trynthink force-pushed the calc-tw2 branch 3 times, most recently from 574e27d to ebfbb03 Compare September 25, 2024 22:55
Base automatically changed from calc-tw2 to master September 26, 2024 05:26
@trynthink trynthink marked this pull request as ready for review September 26, 2024 05:40
scout/ecm_prep.py Outdated Show resolved Hide resolved
scout/ecm_prep.py Outdated Show resolved Hide resolved
@@ -17019,18 +17019,18 @@ def test_mseg_fail_inputs(self):
with self.assertRaises(Exception):
measure.check_meas_inputs()

def test_mseg_fail_missing(self):
"""Test 'fill_mkts' function given measure with missing baseline data.
# def test_mseg_fail_missing(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete or uncomment?

Copy link
Owner Author

@trynthink trynthink Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtlangevin I see that this test doesn't pass as of the commit where it gets commented out (f9a68e3, originally from 9dea911). Can we drop (delete) the test or do we need to fix it?

jtlangevin and others added 4 commits September 26, 2024 22:53
Remove secondary heating and wood stoves from being subject to exogenous switching rates, as they were not intended to be covered by these rates.

Allow users to set ‘tech_switch_to’ to the value ‘same’ and have the code calculate a switchover to the same technology under exogenous switching rates. This is sometimes necessary for accounting purposes – for example, if exogenous rates are represented and a baseline segment is included that is subject to those rates, but without a complementary measure in the analysis to switch that baseline segment to, the results will show a decline in that baseline segment without a complementary increase in a switched to segment, thus under-representing that baseline segment’s influence on the total results.

Add ASHP to technology list where zero costs are expected (in EIA new construction data ASHP costs are zero for cooling, all costs are in the heating end use).

Remove water services as a distinct technology type as it appears to be counted already under “unspecified” (see issue #394).

Refactor calculation of hourly TSV load adjustment factors to ensure that each end use in the tsv_load.gz data will be leveraged (previous approach had resulted in skipping some edge case end uses in those data like clothes washing, pool pumps and pool heaters that are under ‘other’ in the Scout data).

Ensure that once cumulative measure-captured or cumulative competed stock fractions reach 1 in a given modeling year, these fractions are not updated in any subsequent years of the modeling time horizon.

Improve warning message for units conversion issues.

Add measure JSON check to ensure that measures that are set to fuel switch to electricity apply to non-electric fuels in the baseline.

Suppress check for 'other' and 'unspecified' building type input breakouts when these categories are also present in measure end uses (prioritize correct end use input breakouts, which are more commonly used).
Measures that apply to both heating and cooling equipment microsegments will now see stock turnover and (where applicable) exogenous HP switching rates linked across those microsegments. The linked calculations are anchored on a single end use and technology from the measure’s applicable market. The default end use anchor is set to heating (in UsefulVars), while the anchor technology is determined uniquely for each measure by comparing the technologies in the measure’s 'technology' attribute to a candidate list of anchor technologies for each building type (residential or commercial) and end use; the list order sets the priority for which anchor technology is used when the measure applies to multiple candidate technologies in the list.

To ensure the anchor end use and technology are always updated first in the preparation routine, given the dependence of linked microsegments on these updates, the iterable list of microsegments to update for each measure is reordered in fill_mkts so that microsegments that include the anchor end use and technology come first.

Add reporting of efficient stock that remains with baseline technology when applicable (previously only reported measure stock under the efficient key).

Ensure that a measure's baseline and efficient market microsegment breakouts are always adjusted to reflect measure competition when breakout values are not None or zero across all years.
Generalize approach to linking stock turnover across paired heating/cooling microsegments to any other microsegments that are included in the same measure (e.g., for commercial measures, sometimes ventilation will be paired). Do the same for cases where measure heating/cooling is constrained to certain market sub-segments (e.g., assume that when heating/cooling is scaled via mkt_scaling_fractions to match a certain equipment subset of the AEO classes, associated ventilation or other microsegments included in the measure will be scaled to represent the same subset and should only be competed with other measures that have the same scaling constraint).
Remove outdated references to R and plots.R for results figure generation and, where appropriate, add mentions of plots.py and matplotlib.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants