-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Suggested logic changes around Inclusion and AnalysisType #155
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -329,6 +329,53 @@ def _initialize_billing_periods(self, billing_periods: List[BillingPeriod]) -> N | |
self.bills_summer = [] | ||
self.bills_shoulder = [] | ||
|
||
|
||
# ##### | ||
# Logic Change: | ||
# 'Inclusion' in calculations is now determined by two variables: | ||
# billing_period.inclusion_calculated: bool | ||
# billing_period.inclusion_override: bool (False by default) | ||
# | ||
# Our logic around the AnalysisType can now disallow | ||
# a billing_period from being included or overridden | ||
# by marking it as NOT_ALLOWED_IN_CALCULATIONS | ||
# | ||
# Options for billing_period.analysis_type: | ||
# ALLOWED_HEATING_USAGE = 1 # winter months - allowed in heating usage calculations | ||
# ALLOWED_NON_HEATING_USAGE = -1 # summer months - allowed in non-heating usage calculations | ||
# NOT_ALLOWED_IN_CALCULATIONS = 0 # shoulder months that fall outside reasonable bounds | ||
# | ||
# Use HDDs to determine if shoulder months | ||
# are heating or non-heating or not allowed, | ||
# or included or excluded | ||
# | ||
# Rough calculations from Steve, this will be ammended: | ||
# IF hdds is within 70% or higher of max, allowed | ||
# less than 25% of max, not allowed | ||
# | ||
# | ||
# IF winter months | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please see the table in this Google sheet. The column headings map to variable names in the pseudo code as follows: Column B maps to analysis_type and column C maps to inclusion_calculated. As mentioned in my previous comment, the table lookup approach should be used for all months, i.e. don't use the hdd-based algorithm for shoulder months. |
||
# analysis_type = ALLOWED_HEATING_USAGE | ||
# inclusion_calculated = True | ||
# ELSE IF summer months | ||
# analysis_type = ALLOWED_NON_HEATING_USAGE | ||
# inclusion_calculated = True | ||
# ELSE IF shoulder months | ||
# IF hdds < 25% || hdds > 70% | ||
# analysis_type = NOT_ALLOWED_IN_CALCULATIONS | ||
# inclusion_calculated = False | ||
# IF 25% < hdds < 50% | ||
# analysis_type = ALLOWED_NON_HEATING_USAGE | ||
# inclusion_calculated = False | ||
# IF 50% < hdds < 70% | ||
# analysis_type = ALLOWED_HEATING_USAGE | ||
# inclusion_calculated = False | ||
# | ||
# | ||
# ##### | ||
|
||
|
||
|
||
# winter months 1; summer months -1; shoulder months 0 | ||
for billing_period in billing_periods: | ||
billing_period.set_initial_balance_point(self.balance_point) | ||
|
@@ -545,10 +592,14 @@ def __init__( | |
avg_temps: List[float], | ||
usage: float, | ||
analysis_type: AnalysisType, | ||
# inclusion_calculated: bool | ||
# inclusion_override: bool | ||
) -> None: | ||
self.avg_temps = avg_temps | ||
self.usage = usage | ||
self.analysis_type = analysis_type | ||
# self.inclusion_calculated: inclusion_calculated | ||
# self.inclusion_override: inclusion_override | ||
self.days = len(self.avg_temps) | ||
|
||
def set_initial_balance_point(self, balance_point: float) -> None: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proposed the approach of using HDDs during a March hackathon discussion, but let's defer implementing it until after the MVP release. A change like this could make it difficult to verify the Rules Engine vs. the original spreadsheet.