mdanalysis
mdanalysis copied to clipboard
Failed doc examples in align.py
Expected behavior
Sub-issue of #760
Doc examples work.
Actual behavior
This is after changing a >>>
in the rotation matrix example to ...
================================================== FAILURES ===================================================
_____________________________________ [doctest] MDAnalysis.analysis.align _____________________________________
069 >>> from MDAnalysis.analysis.rms import rmsd
070 >>> from MDAnalysis.tests.datafiles import PSF, DCD, PDB_small
071
072
073 In the simplest case, we can simply calculate the C-alpha RMSD between
074 two structures, using :func:`rmsd`::
075
076 >>> ref = mda.Universe(PDB_small)
077 >>> mobile = mda.Universe(PSF,DCD)
078 >>> rmsd(mobile.select_atoms('name CA').positions, ref.select_atoms('name CA').positions)
Expected:
16.282308620224068
Got:
28.20178579474479
/Users/lily/pydev/mdanalysis/package/MDAnalysis/analysis/align.py:78: DocTestFailure
_____________________________ [doctest] MDAnalysis.analysis.align.rotation_matrix _____________________________
238 RMSD between `a` and `b` before rotation
239 ``(R, rmsd)`` rmsd and rotation matrix *R*
240
241 Example
242 -------
243 `R` can be used as an argument for
244 :meth:`MDAnalysis.core.groups.AtomGroup.rotate` to generate a rotated
245 selection, e.g. ::
246
247 >>> R = rotation_matrix(A.select_atoms('backbone').positions,
UNEXPECTED EXCEPTION: NameError("name 'A' is not defined")
Traceback (most recent call last):
File "/Users/lily/anaconda3/envs/mda-dev/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest MDAnalysis.analysis.align.rotation_matrix[0]>", line 1, in <module>
NameError: name 'A' is not defined
/Users/lily/pydev/mdanalysis/package/MDAnalysis/analysis/align.py:247: UnexpectedException
=========================================== short test summary info ===========================================
FAILED analysis/align.py::MDAnalysis.analysis.align
FAILED analysis/align.py::MDAnalysis.analysis.align.rotation_matrix
Code to reproduce the behavior
import MDAnalysis as mda
from MDAnalysis.tests.datafiles import PSF, DCD, GRO, PDB, TPR, XTC, TRR, PRMncdf, NCDF
u = mda.Universe(PSF, DCD)
....
Current version of MDAnalysis
- Which version are you using? (run
python -c "import MDAnalysis as mda; print(mda.__version__)"
) https://github.com/MDAnalysis/mdanalysis/commit/8f9f402fe65d6a90e88b60b6da735c130425f00e - Which version of Python (
python -V
)? 3.7.3 - Which operating system? Mac Catalina
Should we tag this with good first issue
, @lilyminium ?
Sure :)
There are actually two issues here, and people should feel welcome to only fix one in a PR if they want.
The important errors are:
>>> ref = mda.Universe(PDB_small)
077 >>> mobile = mda.Universe(PSF,DCD)
078 >>> rmsd(mobile.select_atoms('name CA').positions, ref.select_atoms('name CA').positions)
Expected:
16.282308620224068
Got:
28.20178579474479
Here, the fix is fairly simple -- change the expected number.
UNEXPECTED EXCEPTION: NameError("name 'A' is not defined")
Traceback (most recent call last):
File "/Users/lily/anaconda3/envs/mda-dev/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest MDAnalysis.analysis.align.rotation_matrix[0]>", line 1, in <module>
NameError: name 'A' is not defined
/Users/lily/pydev/mdanalysis/package/MDAnalysis/analysis/align.py:247: UnexpectedException
Here, the problem is less simple -- a whole universe needs to be defined to substitute A
, as was done with the example higher in this comment.
The automated CI won't catch the problem, so it would be great if anyone who opened a PR pasted the code into a notebook or iPython to demonstrate it works.
Hello @lilyminium, I was going through the code of align.py, and it reflects the expected calculation to be 28.20178579474479 instead of 16.282308620224068. However, it has not been released yet on the official documentation. It is still 16.282308620224068 in the 2.0.0 beta version.
I would like to solve this issue. can you please provide some more details and how to approach this.
Hi, I would like to work on this Issue. it would be great could you please assign this issue to me
I want to solve this issue please assign me this issue
Hi @jhunjhunwala1234, usually issues are not assigned to people in MDAnalysis. If you want to work on an issue, just work on it and open a pull request with your fix when you think it's ready. Other developers will then review your PR, on a first come first served basis.
Please note that there is already an open PR addressing this issue (see PR #4023).
hi i want work on this issue please assing me this issue
I want to solve this issue please assign me this issue because of my study area B.Tech CSE (Data Science)
@pradeeprao31, as explained above we don’t assign issues. If you want to work on an issue, just work on it and open a pull request with your fix when you think it's ready. Just make sure there is not an active PR against the issue you want to work on, since earlier PRs will be reviewed first.
Dear mentors, I just opened a PR #4182. Please review it.
Dear mentors,
Thank you for notifying us about PR #4182. We will review it promptly and provide our feedback.
Best regards, [pradeep kumar] https://gpt.space/gmail?source=watermarkr On Fri, Jun 30, 2023 12:16 PM, @.*** wrote:
Dear mentors, I just opened a PR #4182 https://github.com/MDAnalysis/mdanalysis/pull/4182. Please review it.
— Reply to this email directly, view it on GitHub https://github.com/MDAnalysis/mdanalysis/issues/3365#issuecomment-1614069758, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2GE4D3IJNXOMA6A6AR5GP3XNZC33ANCNFSM5AT2RYLQ . You are receiving this because you were mentioned.Message ID: @.***>