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: Transformations.py doctest errors #4370

Merged
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
1 change: 1 addition & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The rules for this file:
* 2.7.0

Fixes
* Fix doctest errors of lib/transformations.py (Issue #3925, PR #4370)
* Fix documentation building errors due to `html_static_path` and unindented
block of code (Issue #4362, PR #4365)
* Updated cimport for numpy to maintain cimport consistency (Issue #3908)
Expand Down
6 changes: 3 additions & 3 deletions package/MDAnalysis/lib/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def clip_matrix(left, right, bottom, top, near, far, perspective=False):
>>> np.dot(M, [frustrum[0], frustrum[2], frustrum[4], 1.0])
array([-1., -1., -1., 1.])
>>> np.dot(M, [frustrum[1], frustrum[3], frustrum[5], 1.0])
array([ 1., 1., 1., 1.])
array([1., 1., 1., 1.])
>>> M = clip_matrix(perspective=True, *frustrum)
>>> v = np.dot(M, [frustrum[0], frustrum[2], frustrum[4], 1.0])
>>> v / v[3]
Expand Down Expand Up @@ -1031,7 +1031,7 @@ def euler_matrix(ai, aj, ak, axes='sxyz'):
ai, aj, ak : Euler's roll, pitch and yaw angles
axes : One of 24 axis sequences as string or encoded tuple

>>> from MDAnalysis.lib.transformations import (euler_matrix
>>> from MDAnalysis.lib.transformations import (euler_matrix,
... _AXES2TUPLE, _TUPLE2AXES)
>>> import math
>>> import numpy as np
Expand Down Expand Up @@ -1454,7 +1454,7 @@ def quaternion_slerp(quat0, quat1, fraction, spin=0, shortestpath=True):
>>> q = quaternion_slerp(q0, q1, 0.5)
>>> angle = math.acos(np.dot(q0, q))
>>> np.allclose(2.0, math.acos(np.dot(q0, q1)) / angle) or \
np.allclose(2.0, math.acos(-np.dot(q0, q1)) / angle)
... np.allclose(2.0, math.acos(-np.dot(q0, q1)) / angle)
True

"""
Expand Down
Loading