-
Notifications
You must be signed in to change notification settings - Fork 1
Fixing flaky tests #70
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
base: main
Are you sure you want to change the base?
Conversation
…e runners for the matrix
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #70 +/- ##
==========================================
- Coverage 88.16% 87.05% -1.11%
==========================================
Files 7 7
Lines 338 340 +2
==========================================
- Hits 298 296 -2
- Misses 40 44 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| assert ts.time == times[inx] | ||
| assert np.all(u.atoms.positions > 0) | ||
| # Positions are not all zero since PBC is not removed | ||
| assert np.any(u.atoms.positions != 0) |
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.
@IAlibay : This is what I mentioned yesterday. The positions in this nc file are not always >0.
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.
Ok thanks, that's interesting..
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.
When I add this u.trajectory.add_transformations(wrap(u.atoms)) it passes the >0 check.
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.
Ok, I think if wrap behaves well then it's fine. We might need to check this later when we do viz thing, but either way it's not like a regression is being added in this code, so we should be good.
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
| base_url=ZENODO_DOI, | ||
| registry=ZENODO_FILES, |
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.
glad you're doing this! it's what I'm moving us toward on the openfe side.
|
@hannahbaumann you'll want to build pooch from |
| yield u | ||
| u.trajectory.close() |
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 be doing the same here in openfe?
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.
No, xtc files, and trajectories in MDAnalysis overall, do not need this - close should get called on garbage collection and xtc files don't have concurrency issues.
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.
See above - close gets called by __del__ for trajectories, it shouldn't be needed unless there's weird things happening.
IAlibay
left a 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.
Couple of things, still looking into that positions thing.
| POOCH_CACHE = pooch.os_cache("openfe_analysis") | ||
| ZENODO_DOI = "doi:10.5281/zenodo.18378051" | ||
|
|
||
| ZENODO_FILES = { |
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.
We should probably have an "HAS_INTERNET" check on most of our tests.
Maybe todo in a separate issue?
|
|
||
|
|
||
| def test_universe_creation(simulation_nc, hybrid_system_pdb): | ||
| with pytest.warns(UserWarning, match="This is an older NetCDF file that"): |
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 still have a test somewhere to warn for the old netcdf file types?
If not, can we mock one?
| assert_allclose(u.dimensions, [82.191055, 82.191055, 82.191055, 90.0, 90.0, 90.0]) | ||
| assert_allclose(u.dimensions, [78.141495, 78.141495, 78.141495, 60.0, 60.0, 90.0]) | ||
|
|
||
| u.trajectory.close() |
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 these actually necessary now? __del__ should call self.close (it's a reader thing), so they should get garbage collected when they go out of scope, if they don't then we might still be encountering an issue with closing the files.
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.
I'm not seeing failures without this, I had put it since I wasn't sure if things could be unstable when lots of test run in parallel, but we could remove it for now and if we see problems later again, investigate further?
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.
Since it's only in tests, I would vote for removing and seeing how we fare - it's a good canary.
| yield u | ||
| u.trajectory.close() |
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.
See above - close gets called by __del__ for trajectories, it shouldn't be needed unless there's weird things happening.
Co-authored-by: Irfan Alibay <[email protected]>
| key: pooch-${{ matrix.os }}-v2 | ||
|
|
||
| - name: "Download Zenodo data" | ||
| shell: python |
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.
Ah sorry @hannahbaumann - I was wrong, it looks like this might use some other python (not the one from micromamba)!
Fixes #43 and #67
This PR: