-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Finish restructuring the tests to follow the structure of the code #6125
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6125 +/- ##
==========================================
+ Coverage 93.04% 93.37% +0.33%
==========================================
Files 91 100 +9
Lines 20813 21896 +1083
==========================================
+ Hits 19365 20445 +1080
- Misses 1448 1451 +3
|
dd9a250
to
ca8ef50
Compare
These metropolis tests are flaky even though they are supposed to be Lines 287 to 290 in 4ea8dde
My suggestion is to use a seed from the global numpy random generator in case number 4 described in this function's docstring: this makes these tests deterministic. Concretely I would add this couple of lines before L287 above: if random_state is None:
random_state = np.random.randint(2**30) Would that be okay? |
No, we officially don't allow users to control seeding via global seeding anymore (even if we still use global seeding internally), because those have less quality. The solution is to explicitly pass But how often does it fail? I haven't seen it fail before for a long time now. |
I see, that makes sense. I will change the name of the class and we will see if that repeats. But doesn't this mean that |
ca8ef50
to
c5805cd
Compare
Yes it's not doing much anymore, other than providing a seed when requested |
@@ -149,7 +149,7 @@ jobs: | |||
- pymc/tests/test_variational_inference.py pymc/tests/test_initial_point.py | |||
- pymc/tests/test_model.py pymc/tests/test_step.py | |||
- pymc/tests/gp/test_cov.py pymc/tests/gp/test_gp.py pymc/tests/gp/test_mean.py pymc/tests/gp/test_util.py pymc/tests/ode/test_ode.py pymc/tests/ode/test_utils.py pymc/tests/test_smc.py pymc/tests/test_parallel_sampling.py | |||
- pymc/tests/test_sampling.py pymc/tests/test_posteriors.py | |||
- pymc/tests/test_sampling.py pymc/tests/step_methods/test_metropolis.py pymc/tests/step_methods/test_slicer.py pymc/tests/step_methods/hmc/test_nuts.py |
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.
Isn't it enough to do -pymc/tests/step_methods/
?
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.
Yes it is, but here I selected only the few files where tests from test_posteriors
ended up, to not increase too much the runtime of the tests. The rest is already tested in other platforms. I am not sure how much of a difference that makes, though. If we test the whole of step_methods
I will also check that the check_all_tests_are_covered.py
script understands what happens.
These two tests ( |
@Armavica Do you want to try to rebase this from main and see if we can get it merged quickly? One of the flaky tests you mention was fixed recently |
Otherwise it might be easier to do it one module at a time |
* three_var_aevb_groups * three_var_aevb_approx
* fit_method_with_object * aevb_model
c5805cd
to
d3e41de
Compare
The |
Yes |
Awesome work @Armavica, are we done? |
Yes, that was the last batch! |
What is this PR about?
This PR restructures the last test files to follow the structure of the code, as discussed in #5777.
I think that this closes #5777. One last unresolved question is whether we want to move
tests
out ofpymc
, like it is done in aesara for example.Checklist
Major / Breaking Changes
Bugfixes / New features
Docs / Maintenance