Skip to content
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

Fix doctest for MDAnalysis.analysis.rms (#3925) #4009

Merged
merged 5 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ Chronological list of authors
- Utsav Khatu
- Patricio Barletta
- Mikhail Glagolev
2023
- Christian Pfaendner


External code
Expand Down
2 changes: 1 addition & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------
??/??/?? IAlibay, pgbarletta, mglagolev, hmacdope, manuel.nuno.melo
??/??/?? IAlibay, pgbarletta, mglagolev, hmacdope, manuel.nuno.melo, chrispfae

* 2.5.0

Expand Down
10 changes: 7 additions & 3 deletions package/MDAnalysis/analysis/rms.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,17 @@ def rmsd(a, b, weights=None, center=False, superposition=False):

Example
-------
>>> u = Universe(PSF,DCD)
>>> import MDAnalysis as mda
>>> from MDAnalysis.analysis.rms import rmsd
>>> from MDAnalysis.tests.datafiles import PSF, DCD
>>> u = mda.Universe(PSF, DCD)
>>> bb = u.select_atoms('backbone')
>>> A = bb.positions.copy() # coordinates of first frame
>>> u.trajectory[-1] # forward to last frame
hmacdope marked this conversation as resolved.
Show resolved Hide resolved
>>> _ = u.trajectory[-1] # forward to last frame
>>> B = bb.positions.copy() # coordinates of last frame
>>> rmsd(A, B, center=True)
3.9482355416565049
6.838544558398293


.. versionchanged: 0.8.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. versionchanged: 0.8.1
.. versionchanged: 0.8.1

This is a slightly separate issue, but it looks like the versionchanged entries are being ignored because doctest need a blank line and so do versionchanged entries. I'll self merge this fix and see if it fixes the problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That didn't fix it, I'm going to go ahead and shift the versionchanged problem to a separate issue, it's an issue that predates this fix anyways.

*center* keyword added
Expand Down