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

Reconcile the purpose and usage of Analysis Type override and Inclusion override in rules engine #236

Closed
debajyotid2 opened this issue Aug 20, 2024 · 3 comments
Assignees
Labels
rules-engine Issues related to the Python rules engine

Comments

@debajyotid2
Copy link
Collaborator

No description provided.

@debajyotid2 debajyotid2 added the rules-engine Issues related to the Python rules engine label Aug 20, 2024
@eriksynn
Copy link
Collaborator

AnalysisType can be three things: ALLOWED_HEATING_USAGE, ALLOWED_NON_HEATING_USAGE, or NOT_ALLOWED_IN_CALCULATIONS. This value is set for each billing period by an algorithm, one for Natural Gas, and one for Oil/Propane. The result of these calculations then determines whether a particular bill is appended to bills_winter or bills_summer or bills_shoulder. The user is then allowed to override this algorithm for a particular bill in the UI by setting inclusion_override for that bill to True. The result in the rules engine should be then that that bill is either included or excluded from winter or summer calculations (whichever it is in). However, if a bill is added to bills_shoulder and the user sets inclusion_override to True on that bill, we don't necessarily know whether they intended for that bill to be added to winter or summer calculations, although we could make an educated guess. But in that situation, we would need to add that bill to the appropriate "bills" list. The question I had is, in reacting to inclusion_override settings by the user, should we be writing the code to add or remove bills from the winter or summer bills lists prior to various calculations, or should we be simply inserting "inclusion_override truth" tests in various calculation functions. Given that this inclusion_override feature was not designed into the rules_engine from the start, I think this question must be tackled before we attempt to write code.

@eriksynn eriksynn self-assigned this Aug 27, 2024
@eriksynn
Copy link
Collaborator

eriksynn commented Aug 27, 2024

This week I got curious about how to reconcile analysis_type_override and inclusion_override in the code. So, I made a number of changes and verified that the tests still run. These are staged in PR #241. Comments and questions are welcome.

@eriksynn
Copy link
Collaborator

eriksynn commented Sep 11, 2024

This issue is fixed by the changes committed in PR #241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rules-engine Issues related to the Python rules engine
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants