Moves hbond_autocorrel and removes old hbond code#3258
Moves hbond_autocorrel and removes old hbond code#3258IAlibay merged 9 commits intoMDAnalysis:developfrom
Conversation
|
Hello @IAlibay! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-05-06 06:54:17 UTC |
|
I realise we usually create stubs so that folks can change workflows ahead of time, however the removal of history for hbond_autocorrel bothered me. Since all it means to users is that they have to change their import, can we just do this as a warned move without moving things ahead of time? (worst case I create a stub in hydrogenbonds that imports hbond.hbond_autocorrel, but that makes warnings messy) Edit: please ignore me, this doesn't fix the history problem, we lose history as soon as we move the file... |
|
At the moment the test_api tests fail because there's nothing in hydrogenbonds. I'll push a change with the moved file and stubs in the old place. If you don't like it, revert it. |
|
@orbeckst please go ahead, I was going to try to complete this tomorrow, but any push along is appreciated :) |
- deprecated hbonds.hbond_autocorrel (2.0.0) and stub will be removed in 3.0.0 - hbonds.hbond_autocorrel module raises a deprecation warning, HydrogenBondAutoCorrel and find_hydrogen_donors raise deprecation warnings - tests (note: tests were copied and we run full tests on the deprecated and the moved code, mainly to make sure that they can be called as expected; deprecation warnings are also tested)
- make hydrogenbonds.hbond_autocorrel primary entry for docs - add entry for deprecated module at bottom of Hydrogen bonding docs - make clear in CHANGELOG that hbonds.hbond_autocorrel will be removed in 3.0.0
|
I am also fixing #3259 because I have to edit the docs in wbridge_analysis anyway. |
Codecov Report
@@ Coverage Diff @@
## develop #3258 +/- ##
===========================================
+ Coverage 92.91% 93.02% +0.10%
===========================================
Files 172 172
Lines 23033 22694 -339
Branches 3266 3193 -73
===========================================
- Hits 21402 21110 -292
+ Misses 1581 1534 -47
Partials 50 50
Continue to review full report at Codecov.
|
- fix MDAnalysis#3259 (title of Water Bridge Analysis docs is not correct) - include the Gregoret 1991 reference (that was removed with the deprecated hbonds.hbond_analysis module) - minor formatting fixes in the docs
| hbonds.find_hydrogen_donors(u.atoms) | ||
|
|
||
|
|
||
| def test_find_hydrogen_donors_deprecation_warning(u_water): |
There was a problem hiding this comment.
@orbeckst is there any point in having most of the hbond_autocorrel tests duplicated here? They are pretty expensive iirc, if you're happy with it, we can just move these two warning tests over to the other hbond_autocorrel tests?
|
Tests run in seconds and I wanted to make sure that the stubs properly process arguments (I wasn’t 100% sure if I could use the deprecate decorator on a class like that..).
For 2.0.0 I’d leave the full tests (no harm) and then we can slim it down later. I didn’t quite know which ones to remove but still test basic functionality.
… Am 5/6/21 um 07:59 schrieb Irfan Alibay ***@***.***>:
@IAlibay commented on this pull request.
In testsuite/MDAnalysisTests/analysis/test_hydrogenbondautocorrel_deprecated.py:
> + D = hbonds.find_hydrogen_donors(H)
+
+ assert len(H) == len(D)
+ # check each O is bonded to the corresponding H
+ for h_atom, o_atom in zip(H, D):
+ assert o_atom in h_atom.bonded_atoms
+
+
+def test_donors_nobonds():
+ u = mda.Universe(XYZ_mini)
+
+ with pytest.raises(mda.NoDataError):
+ hbonds.find_hydrogen_donors(u.atoms)
+
+
+def test_find_hydrogen_donors_deprecation_warning(u_water):
@orbeckst is there any point in having most of the hbond_autocorrel tests duplicated here? They are pretty expensive iirc, if you're happy with it, we can just move these two warning tests over to the other hbond_autocorrel tests?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
@orbeckst - ok that's fair. I'm happy with this (except from being sad that we will lose git history for |
Fixes #2739
Fixes #3259
Changes made in this Pull Request:
PR Checklist