Remove start/stop/step from AnalysisBase kwargs#2505
Remove start/stop/step from AnalysisBase kwargs#2505richardjgowers merged 14 commits intoMDAnalysis:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2505 +/- ##
========================================
Coverage 90.47% 90.47%
========================================
Files 170 170
Lines 23091 23091
Branches 2980 2980
========================================
Hits 20891 20891
Misses 1596 1596
Partials 604 604Continue to review full report at Codecov.
|
note that start/stop/step in AnalysisBase were deprecated
orbeckst
left a comment
There was a problem hiding this comment.
Already looking good but I found a few more — can you please deal with them, too? Thanks!
- Contacts.q1q2: https://github.com/IAlibay/mdanalysis/blob/4f6e3ede7e859fa621b2d41d2cac87e35af01137/package/MDAnalysis/analysis/contacts.py#L472
- HOLEtraj is not AnalysisBase but it already looks like it and it would be easy to remove start/stop/step https://github.com/IAlibay/mdanalysis/blob/4f6e3ede7e859fa621b2d41d2cac87e35af01137/package/MDAnalysis/analysis/hole.py#L1208 as you can just set them to defaults in run() at https://github.com/IAlibay/mdanalysis/blob/4f6e3ede7e859fa621b2d41d2cac87e35af01137/package/MDAnalysis/analysis/hole.py#L1294-L1296 (namely
start, stop, step = None, None, None) - in waterdynamics, the old hbonds.HydrogenBondAnalysis is used with start/stop constructor (https://github.com/IAlibay/mdanalysis/blob/4f6e3ede7e859fa621b2d41d2cac87e35af01137/package/MDAnalysis/analysis/waterdynamics.py#L644-L650): can you change this to call it from
h.run()https://github.com/IAlibay/mdanalysis/blob/4f6e3ede7e859fa621b2d41d2cac87e35af01137/package/MDAnalysis/analysis/waterdynamics.py#L653 (for consistency, even if we don't touch hbonds) - waterdynamics.SurvivalProbability also deprecated start/stop/step https://github.com/IAlibay/mdanalysis/blob/4f6e3ede7e859fa621b2d41d2cac87e35af01137/package/MDAnalysis/analysis/waterdynamics.py#L1248-L1260 — can you remove this code, too, please? (I also noted that here
stopis inclusive, which is contrary to everwhere else (stopis exclusive) — this should changed before 1.0 but needs to be documented as an API-breaking change): either fix here in the start/stop/step PR or raise an issue if this looks more complicated an needs review from some waterdynamics authors.
|
@IAlibay only contacts.q1q2 is strictly part of this PR re: AnalysisBase. I would also be ok with only fixing q1q2 and then opening another issue/PR for harmonizing start/stop/step in non-standard methods with the AnalysisBase model. I leave it up to you and how much time you can spare. Thank you so much for moving the code towards 1.0 — really much appreciated!! |
|
@orbeckst thanks for the review 😄 So going by #1463 (comment) my plan was to do all the :class: Going by #1463 (comment) would you prefer it if I raised the non-AnalysisBase required changes as separate issues or is the dicussion here sufficient? |
|
Aside from A note (to self) here: |
Please raise a separate issue, then we can cleanly close this one, and have a new rallying point for new things that might rear their ugly heads. Thanks! |
|
Unfortunately encountered #2511 whilst fixing this, it'll need to be fixed before this PR can be tied off. |
|
With #2520 completed, this should be complete for :class: |
|
Many thanks @IAlibay ! This should be merged once CI is good. |
Addresses #1463
Changes made in this Pull Request:
start,stop, andstepkeywords on object creation for :class:AnalysisBaseand :class:AnalysisFromFunctionstart,stop, andstepkeywords could be passed to__init__aversionchangedtag was added.To do:
AnalysisFromFunctiondon't seem to test out thestart/stoparguments very well, it's probably worth adding an extra test there.PR Checklist