-
Notifications
You must be signed in to change notification settings - Fork 8
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
test: post regression tests #70
base: master
Are you sure you want to change the base?
Conversation
it looks great! I will hurry up with #69 |
#69 was merged :) Please rebase against master. Tip: Since only the last commit is needed here, I sugges to rebase using interactive mode (git rebase -i BASE) and drop all commits except the last EDIT: If master is already up to date, |
4de3cf5
to
b71e682
Compare
Is there a new dependency here with #77 or this one should be merged first? |
Creates a number of tests for input and model initialization validation to use confidence_intervals. As this is a function that requires a sequence of steps to be performed before, it is highly error prone and I think it is good to spend time developing tests for it as it bad use can produce misleading conclusions
b71e682
to
dc9d5be
Compare
dc9d5be
to
3a721f9
Compare
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.
But left some minor comments
@@ -144,6 +144,21 @@ def rolling_avg(x_list): | |||
class ConfidenceIntervalsMixin: | |||
""" Mixin with confidence interval definitions """ | |||
|
|||
def is_initialized(self): | |||
""" Checks that the model is initialized and fitted before calling | |||
any postprocessing rotuine""" |
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.
Routine?
instance before calculating confidence intervals" | ||
) | ||
|
||
if (self.p is None) | (self.w0 is 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.
Should this be an ||
instead?
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.
Maybe an or would be even better
# ci_bootstrap | ||
def test_ci_without_model_init(self, model): | ||
""" Tests that an error is raised if the ci routines | ||
are from an model instance that doesn't have initialized |
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.
are from an model instance that doesn't have initialized | |
are from a model instance that has not initialized |
are from an model instance that doesn't have initialized | ||
it parameters or initial conditions""" | ||
|
||
# model.is_fitted = True |
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.
Should we remove this comment?
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.
Thanks! will implement the updates today
I began the creation of tests for the confidence interval routines.
Note that this branch is branched from the PR #69, so it depends on merging that one.
We could potentially spend our whole life thinking on tests for confidence intervals so I am trying to write the most typical ones, such as providing incorrect inputs, not initializing the model or not fitting the model prior calling confidence intervals.
Still work in progress but some significant progress has been made. I am aware that this will require some rebase and so on.
Update 13/07/2020
The tests are now adequate to the latest version of
open-sir
!