-
Notifications
You must be signed in to change notification settings - Fork 667
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
pin distopia<0.3.0 #4740
pin distopia<0.3.0 #4740
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4740 +/- ##
===========================================
- Coverage 93.60% 93.58% -0.02%
===========================================
Files 173 185 +12
Lines 21464 22536 +1072
Branches 2993 2994 +1
===========================================
+ Hits 20091 21090 +999
- Misses 929 1002 +73
Partials 444 444 ☔ View full report in Codecov by Sentry. |
@@ -78,6 +78,7 @@ Enhancements | |||
DOI 10.1021/acs.jpcb.7b11988. (Issue #2039, PR #4524) | |||
|
|||
Changes | |||
* only use distopia < 0.3.0 due to API changes (Issue #4739) |
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.
Not sure if we would normally make a CHANGELOG entry but in this case I would recommend to do so because there is not other part in the user-visible code base that knows about this requirement. If someone installs distopia by themselves, they will see failures.
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.
Now they will (hopefully) a warning
../package/MDAnalysis/lib/_distopia.py:45
~/MDAnalysis/mdanalysis/package/MDAnalysis/lib/_distopia.py:45: RuntimeWarning: Install 'distopia>=0.2.0,<0.3.0' to be used with this release of MDAnalysis. Your installed version of distopia >=0.3.0 will NOT be used.
warnings.warn("Install 'distopia>=0.2.0,<0.3.0' to be used with this release "
- fix #4739 - temporarily restrict distopia to >=0.2.0,<0.3.0 until MDAnalysis has caught up with distopia API changes - updated CHANGELOG
43f83b4
to
e60f3d5
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.
LGTM @orbeckst, thanks for fixing.
Merge when ready |
4416672
to
575726b
Compare
- only enable HAS_DISTOPIA if the appropriate version of distopia is installed - issue RuntimeWarning if incorrect version present - added test
575726b
to
6adbf74
Compare
I will make a patch release for |
I tested locally with distopia==0.2.0 and distopia=0.3.0 and the code behaves as it should: it fails for neither but warns for 0.3.0 and falls back to |
# check for compatibility: currently needs to be >=0.2.0,<0.3.0 (issue | ||
# #4740) No distopia.__version__ available so we have to do some probing. | ||
needed_funcs = ['calc_bonds_no_box_float', 'calc_bonds_ortho_float'] | ||
has_distopia_020 = all([hasattr(distopia, func) for func in needed_funcs]) |
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.
There's no distopia.__version__
attribute that I could check so I am explicitly probing for the functions we need.
@hmacdope is there a better way to get the version of the installed distopia package?
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 comment above, I will make a patch release, I accidentally removed __version__
@@ -788,9 +790,10 @@ def test_pbc_wrong_wassenaar_distance(self, backend): | |||
# expected. | |||
assert np.linalg.norm(point_a - point_b) != dist[0, 0] | |||
|
|||
@pytest.mark.parametrize("box", | |||
|
|||
@pytest.mark.parametrize("box", |
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.
pep8 fix
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 @orbeckst !
I'll merge with the clunky version probe to move things along and if needed we improve when there's a distopia 0.3.1. |
Fixes #4739
Changes made in this Pull Request:
PR Checklist
Developers certificate of origin
📚 Documentation preview 📚: https://mdanalysis--4740.org.readthedocs.build/en/4740/