sbi
sbi copied to clipboard
Reuse npse_trained_model fixure for test_npse_map
#1428
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 84.82%. Comparing base (4d1dc5f) to head (e1fe4bd).
:warning: Report is 8 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1461 +/- ##
==========================================
- Coverage 87.77% 84.82% -2.96%
==========================================
Files 134 137 +3
Lines 11126 11473 +347
==========================================
- Hits 9766 9732 -34
- Misses 1360 1741 +381
| Flag | Coverage Ξ | |
|---|---|---|
| unittests | 84.82% <ΓΈ> (-2.96%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more. see 48 files with indirect coverage changes
CI is failing due to testmon error. this will be fixed in a separate PR
What is the speed up you notice through this change?
Basically, we save the time of training a model specifically for `test_npse_map'. But now it would be much cheaper to add more tests that can reuse specific trained models.
One concern I have @vagechirkov is that now all the tests here are marked as slow, right?
Is there a way to have one of the c2st tests "not slow"? e.g., the one with the default settings we use in the class?
Hey @janfb, I think this is more or less how the final test structure should look like, so ready for review π
Hey @janfb, I think this is more or less how the final test structure should look like, so ready for review π
Cool, I will review it now.
An issue with snapshot tests: https://github.com/syrupy-project/syrupy/issues/438
@vagechirkov @janfb my suggestion for this PR would be:
- revert to the previous version of the test file
linearGaussian_npse_test.py - add
pytest.mark.slowto the tests - add the regression test (rename from test_snapshot -> linearGaussian_npse_test_regression.py)
- remove the ambr file (and also clean the history, as I forgot to put it into lfs, my bad:(...)
This would not show the refactoring of the test (which we aimed for at the beginning), but at least it shows the usage of pytest-regression. What do you think?
Alright, I think Iβve finally tracked down the issue ππ« (was seriously starting to question my sanity). Turns out itβs all about the combination of parameters β nothing to do with how we wrote the tests π€ͺ I used the pytest-timeout plugin with @pytest.mark.timeout(60) to catch it. These are the tests that take longer than 60 seconds to complete:
- uniform_prior-dim_3-ve-fnpe-sde-trials_8
- uniform_prior-dim_3-ve-auto_gauss-sde-trials_8
- uniform_prior-dim_3-ve-jac_gauss-sde-trials_8
- uniform_prior-dim_3-vp-fnpe-sde-trials_8
- uniform_prior-dim_3-subvp-fnpe-sde-trials_8
This means, in turn, that this seems to be a separate issue. What do you think, @janfb?
P.S.
The reason we didnβt hit this issue in test_spnapshot.py is because thereβs actually a bug there β weβre not really using the number of trials π @schroedk
Here is the longer list of slow regression tests:
Very nice refactoring, thanks @schroedk! Regression tests run locally for me in 4min without the problem reported here: #1473
@janfb, great! I am happy to help finish implementing this issue! I'm down to have a quick meeting about this π
@janfb, great! I am happy to help finish implementing this issue! I'm down to have a quick meeting about this π
Awesome, let's aim for a meeting this week. How about some time Thu after 10:30? or Friday before noon?
@schroedk @vagechirkov
@janfb, great! I am happy to help finish implementing this issue! I'm down to have a quick meeting about this π
Awesome, let's aim for a meeting this week. How about some time Thu after 10:30? or Friday before noon?
@schroedk @vagechirkov
Friday before noon works for me π
@janfb, great! I am happy to help finish implementing this issue! I'm down to have a quick meeting about this π
Awesome, let's aim for a meeting this week. How about some time Thu after 10:30? or Friday before noon? @schroedk @vagechirkov
Friday before noon works for me π
Cool! I reached out on Discord and suggested 9am.
@vagechirkov I now managed to push the merge of main and some small type fixes I did locally to get this running (pushing was blocked by git-lfs, turning it off temporarily fixed it).
Feel free to undo the changes in the recent commit, some of them are obsolete.
I copied the regression tests to linearGaussian_vector_field_test.py, and continuous integration seems happy with them so far π The old tests in linearGaussian_vector_field_test.py now need to be refactored. I will work on this in the next few days.
Sounds great π let me know if you need any input from my side.