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

Merged
merged 5 commits into from
Oct 18, 2024
Merged

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
tests/ecm_prep_test.py Show resolved Hide resolved
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.

In ecm_prep.py, for measures with linked stock turnover dynamics for cooling with heating microsegments (e.g., HPs), competed cooling stock are ultimately set to zero to avoid double counting across the heating and cooling microsegments; therefore, use of those competed cooling stock data in run.py would make it appear as though there was no cooling stock turnover at all to drive the competition of cooling segments. Modifications to run.py ensure that, for those measures, competed heating (or other linked mseg) stock data that are not set to zero in ecm_prep.py are used.

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. The rank order of heating/cooling technologies to choose as anchors for such within-measure linkages when multiple such technologies are present in the measure definition is harmonized across ecm_prep and run.

A slight adjustment to run.py was needed to handle a new string that is now added to the measure competition information to signify the specific heating/cooling linkages that the measure represents, if any (see use of variable “tch_apnd”).

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.
@trynthink trynthink force-pushed the calc-tw3 branch 2 times, most recently from 65a4ef9 to 9340cca Compare October 17, 2024 06:34
jtlangevin and others added 2 commits October 17, 2024 12:24
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.
Copy link
Collaborator

@aspeake aspeake left a comment

Choose a reason for hiding this comment

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

Looks good, latest results appear to have been correctly brought in from the bug fix in #424 and the next set of results should not change from removal of the unit test.

@trynthink trynthink merged commit d7321a5 into master Oct 18, 2024
5 checks passed
@trynthink trynthink deleted the calc-tw3 branch October 18, 2024 04:29
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