-
Notifications
You must be signed in to change notification settings - Fork 83
Create TopDownReconciliator
#1055
Conversation
🚀 Deployed on https://deploy-preview-1055--etna-docs.netlify.app |
Codecov Report
@@ Coverage Diff @@
## hierarchical_pipeline #1055 +/- ##
========================================================
Coverage ? 86.48%
========================================================
Files ? 167
Lines ? 8899
Branches ? 0
========================================================
Hits ? 7696
Misses ? 1203
Partials ? 0 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
||
proportions_method = ReconciliationProportionsMethod(method) | ||
if proportions_method == ReconciliationProportionsMethod.AHP: | ||
self._proportions_method_func = self._estimate_ahp_proportion |
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.
Initialize firstly to turn on type checking
self._proportions_method_func: Optional[<type>] = 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.
Do we really need this? This attribute can't be uninitialized. Init raises error if it fails to assign method reference to this variable.
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.
It might be uninitialized if we add new ReconciliationProportionsMethod but forget to add new case in "if-else", but I guess type checking won't catch it. So the better way would be to add "else" case throwing error there
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.
👍
elif proportions_method == ReconciliationProportionsMethod.PHA: | ||
self._proportions_method_func = self._estimate_pha_proportion | ||
|
||
def fit(self, ts: TSDataset) -> "TopDownReconciliator": |
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.
Also check that values in target
are non-negative, otherwise method might work incorrectly
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.
Added check and test
Before submitting (must do checklist)
Proposed Changes
Closing issues
closes #1038