-
Notifications
You must be signed in to change notification settings - Fork 661
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
new DensityAnalysis #2537
new DensityAnalysis #2537
Conversation
So not directly related to issue #2502, but whilst things are being deprecated. As far as I am aware, |
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.
Just a couple of suggested changes, otherwise looks good.
Codecov Report
@@ Coverage Diff @@
## develop #2537 +/- ##
===========================================
+ Coverage 90.71% 90.79% +0.07%
===========================================
Files 174 174
Lines 23552 23597 +45
Branches 3073 3075 +2
===========================================
+ Hits 21366 21425 +59
+ Misses 1565 1548 -17
- Partials 621 624 +3
Continue to review full report at Codecov.
|
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.
This is nice. Mostly comments on docs
@IAlibay and @lilyminium many thanks for the excellent review, I'll work on it. I'll throw out |
cd5a1d1
to
f5b337b
Compare
Cleaned up history. Please review. Thanks. |
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.
Just a couple of extra tests if possible.
f5b337b
to
d376f70
Compare
(need two lines before ..versionchanged)
- deprecate in 1.0.0 - remove in 2.0.0 - adjusted tests that test for warnings: only test for UserWarning and match the message with regex in pytest.warns() instead manually looking through the WarningReport object: the problem is that the deprecation warning changes the number of entries
These tests are not necessary because gridDataFormats is a dependency.
- close #2502 - DensityAnalysis is based on @nawtrey's pmda.density.DensityAnalysis but replace _reduce with accumulation in _single_frame - added tests (based on the Test_density_from_universe): both give the same answer as they pass the same tests; test specific exceptions in DensityAnalysis - update docs (also write ångström consistently throughout) - update CHANGELOG
When density_from_universe() is gone we will not need the function factory either.
- density_from_PDB is terrible code (I wrote it) and not used: deprecated and to be removed for 2.0.0 - added test so that it is covered - fixed bug that was uncovered by test (us ag.tempfactors) - added test for Bfactors2RMSF - test for deprecation warnings - organized in classes - shortened test names for density_from_universe()
d376f70
to
1154532
Compare
Docs should pass, too – took me a while to figure out that I cannot just |
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.
A possible test failure and two questions.
I am not ignoring all your excellent reviews, I just don't have time to work on it at the moment! If anyone else wants to finish the PR, please do! Otherwise I'll get to it... when I get to it. |
@IAlibay I am assigning you as the official chaperone for this PR. Perhaps @wvandertoorn wants to finish this PR? That would be awesome. |
- [DOC] add sphinx deprecated paragraph to density/BFactor2RMSF docstring - [TEST] decrease precision in assert_almost_equal test_density/test_density_from_PDB - [TEST] Bring back TestGridImport class in test_density
- [DOC] add sphinx deprecated paragraph to density/BFactor2RMSF docstring - [TEST] decrease precision in assert_almost_equal test_density/test_density_from_PDB - [TEST] Bring back TestGridImport class in test_density - [DOC] Update CHANGELOG
- [DOC] add sphinx deprecated paragraph to density/BFactor2RMSF docstring - [TEST] decrease precision in assert_almost_equal test_density/test_density_from_PDB - [TEST] Bring back TestGridImport class in test_density - [DOC] Update CHANGELOG
Partially fixes #2502 (completes PR #2537) ## PR contents: This PR by @wvandertoorn finalises the work done as part of #2537 Key commits: - Fixes docstring (adds .. deprecated information). - Adds back :class:`TestGridImport`. - Reduces precision matching of `test_density_from_PDB`. - CHANGELOG and AUTHORS updated accordingly.
@orbeckst just cleaned up the merge conflict to get travis et al. to run (I assume that's why appveyor/pr failed straight away...). |
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.
Some changes I didn't catch in @wvandertoorn's PR. I'd blame it on the lack of Travis checks on #2616, but I probably should have picked these up 😱
@IAlibay I'm sorry to have missed it myself, wasn't familiar with sphynx before. I'll take care of the indentation issues right away, but the import failure isn't trivial too me, that might take a bit longer. Would you prefer the indentation and import fixes in separate PR's or in one? |
@wvandertoorn if you look at the file difference, it looks like all you have to do is replace the unittest.mock import with: |
Take it back, trivial indeed. Wasn't aware of testing-cabal's mock package, neat. |
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, now that Travis is green, I've run out of things to review.
@lilyminium any more comments?
@orbeckst are you ok with the PR as it is now?
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.
This looks great, I really like all the examples! Super tiny nitpicks.
I did think that ..versionchanged::
etc entries came in reverse-chronological order though, i.e. from most recent to least?
|
||
After the analysis (see the :meth:`~DensityAnalysis.run` method), the resulting density is | ||
stored in the :attr:`density` attribut as a :class:`Density` instance. |
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.
attribut[e]
""" | ||
""" |
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.
Extra empty string
@lilyminium I'm not sure we've been super consistent in this unfortunately. I've had a look through and for the most part there seems to be quite a few cases of Example cases: @wvandertoorn would you like to raise a separate PR to address @lilyminium's comments? |
@IAlibay Yes, will do |
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, just waiting on final comments by @orbeckst
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.
Thank you @wvandertoorn (and @IAlibay and @lilyminium ), all lgtm!
@IAlibay , if you could do the honors? |
p.s.: Merge so that @wvandertoorn 's commits survive. |
@orbeckst Being wary of these new merge powers, it's probably best I ask for clarification here. What's the preferred option for MDAnalysis when trying to conserve commits on merge, merge rebase or a merge commit? |
If it's a simple fix from a single contributor then we typically squash&merge. We especially want to remove little micro-updates and reversals that make no sense when you read the commit history. If it's a bigger thing with
then we typically just merge. If committers are experienced with git we sometimes ask them to rewrite their history, especially if they care about individual commits. If someone who isn't the original author of the commits rebased then we typically also merge because in the past we found that on a double-rebase, the original committer is lost. This might also be a case when history rewriting and commit-condensing is necessary. update: ASV (the automatic benchmarks) is configured so that they only run on merge commits, therefore if anything is affecting actual code then you should not rebase & merge because this will not trigger ASV. |
Thanks for the explanation @orbeckst that helped clear things up 😄 Congrats on your first commits @wvandertoorn 🎉 |
Thanks @wvandertoorn for finalizing this features – makes me very happy that this managed to get into 1.0, thanks to your push. |
Fixes #2502
Changes made in this Pull Request:
PR Checklist