Skip to content

Erroneous examples for rotateby #2901

@RMeli

Description

@RMeli

The examples in the documentation of transforms.rotate.rotateby are not up-to-date since they call transformations.rotate instead of transforms.rotate.rotateby.

def rotateby(angle, direction, point=None, ag=None, weights=None, wrap=False):
'''
Rotates the trajectory by a given angle on a given axis. The axis is defined by
the user, combining the direction vector and a point. This point can be the center
of geometry or the center of mass of a user defined AtomGroup, or an array defining
custom coordinates.
Examples
--------
e.g. rotate the coordinates by 90 degrees on a axis formed by the [0,0,1] vector and
the center of geometry of a given AtomGroup:
.. code-block:: python
ts = u.trajectory.ts
angle = 90
ag = u.atoms()
d = [0,0,1]
rotated = MDAnalysis.transformations.rotate(angle, direction=d, ag=ag)(ts)
e.g. rotate the coordinates by a custom axis:
.. code-block:: python
ts = u.trajectory.ts
angle = 90
p = [1,2,3]
d = [0,0,1]
rotated = MDAnalysis.transformations.rotate(angle, direction=d, point=point)(ts)

I'll provide a quick fix.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions