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

made universe for A and B to fix doctest fails #4023

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ Chronological list of authors
- Mikhail Glagolev
2023
- Christian Pfaendner
- Aryan Shukla


External code
Expand Down
12 changes: 12 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------
24/02/23 Telomelonia

* 2.5.0

Fixes
* Fix the code for docstring in rotation_matrix method in align.py
which was giving NameError (Issue #3365)

Changes
* Defined the universe for which NameError was raised. (PR #4023)


Telomelonia marked this conversation as resolved.
Show resolved Hide resolved
??/??/?? IAlibay, pgbarletta, mglagolev, hmacdope, manuel.nuno.melo, chrispfae

* 2.5.0
Expand Down
6 changes: 4 additions & 2 deletions package/MDAnalysis/analysis/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ def rotation_matrix(a, b, weights=None):
`R` can be used as an argument for
:meth:`MDAnalysis.core.groups.AtomGroup.rotate` to generate a rotated
selection, e.g. ::

>>> from MDAnalysisTests.datafiles import TPR, TRR
>>> A = mda.Universe('topol.tpr','traj.trr')
Telomelonia marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

fix

Copy link
Author

Choose a reason for hiding this comment

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

Yeah. I am fixing this, but I am getting errors, and I don't know why, but I need time to understand before debugging

Copy link
Member

Choose a reason for hiding this comment

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

Show your code, then I can help.

Copy link
Author

Choose a reason for hiding this comment

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

@orbeckst, thanks, but I am currently having my semester exams 😄. So, I will try to continue after that ✌️

>>> B = A.copy()
>>> R = rotation_matrix(A.select_atoms('backbone').positions,
>>> B.select_atoms('backbone').positions)[0]
... B.select_atoms('backbone').positions)[0]
>>> A.atoms.rotate(R)
>>> A.atoms.write("rotated.pdb")

Expand Down