8000 consistent documentation notation · suddrey-qut/spatialmath-python@0b6c4f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b6c4f2

Browse files
committed
consistent documentation notation
SE then SO add dimensions to array_like used ndarray(n) ndarray(n,m)
1 parent 14141cb commit 0b6c4f2

File tree

6 files changed

+333
-314
lines changed

6 files changed

+333
-314
lines changed

spatialmath/base/animate.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, axes=None, dims=None, projection='ortho', labels=('X', 'Y', '
4848
:param dims: dimension of plot volume as [xmin, xmax, ymin, ymax,
4949
zmin, zmax]. If dims is [min, max] those limits are applied
5050
to the x-, y- and z-axes.
51-
:type dims: array_like
51+
:type dims: array_like(6) or array_like(2)
5252
:param projection: 3D projection: ortho [default] or persp
5353
:type projection: str
5454
:param labels: labels for the axes, defaults to X, Y and Z
@@ -92,10 +92,10 @@ def trplot(self, end, start=None, **kwargs):
9292
"""
9393
Define the transform to animate
9494
95-
:param end: the final pose SO(3) or SE(3) to display as a coordinate frame
96-
:type end: numpy.ndarray, shape=(3,3) or (4,4)
97-
:param start: the initial pose SO(3) or SE(3) to display as a coordinate frame, defaults to null
98-
:type start: numpy.ndarray, shape=(3,3) or (4,4)
95+
:param end: the final pose SE(3) or SO(3) to display as a coordinate frame
96+
:type end: ndarray(4,4) or ndarray(3,3)
97+
:param start: the initial pose SE(3) or SO(3) to display as a coordinate frame, defaults to null
98+
:type start: ndarray(4,4) or ndarray(3,3)
9999
:param start: an
100100
101101
Is polymorphic with ``base.trplot`` and accepts the same parameters.
@@ -318,13 +318,15 @@ def text(self, x, y, z, *args, **kwargs):
318318
:param x: x-coordinate
319319
:type x: float
320320
:param y: float
321-
:type y: array_like
321+
:type y: float
322322
:param z: z-coordinate
323323
:type z: float
324+
:param kwargs: Other arguments as accepted by the matplotlib method.
324325
325-
Other arguments as accepted by the matplotlib method.
326+
``.text(x, y, z, s)`` display the string ``s`` at coordinate
327+
(``x``, ``y``, ``z``).
326328
327-
:seealso: :func:`matplotlib.pyplot.text`
329+
:seealso: :func:`~matplotlib.pyplot.text`
328330
"""
329331
h = self.ax.text3D(x, y, z, *args, **kwargs)
330332
self.displaylist.append(Animate._Text(self, h, x, y, z))
@@ -385,10 +387,9 @@ def __init__(self, axes=None, dims=None, labels=('X', 'Y'), **kwargs):
385387
386388
:param axes: the axes to plot into, defaults to current axes
387389
:type axes: Axes3D reference
388-
:param dims: dimension of plot volume as [xmin, xmax, ymin, ymax,
389-
zmin, zmax]. If dims is [min, max] those limits are applied
390-
to the x-, y- and z-axes.
391-
:type dims: array_like
390+
:param dims: dimension of plot volume as [xmin, xmax, ymin, ymax]. If
391+
dims is [min, max] those limits are applied to the x- and y-axes.
392+
:type dims: array_like(4) or array_like(2)
392393
:param projection: 3D projection: ortho [default] or persp
393394
:type projection: str
394395
:param labels: labels for the axes, defaults to X, Y and Z
@@ -427,10 +428,10 @@ def trplot2(self, end, start=None, **kwargs):
427428
"""
428429
Define the transform to animate
429430
430-
:param end: the final pose SO(2) or SE(2) to display as a coordinate frame
431-
:type end: numpy.ndarray, shape=(2,2) or (3,3)
432-
:param start: the initial pose SO(2) or SE(2) to display as a coordinate frame, defaults to null
433-
:type start: numpy.ndarray, shape=(2,2) or (3,3)
431+
:param end: the final pose SE(2) or SO(2) to display as a coordinate frame
432+
:type end: ndarray(3,3) or ndarray(2,2)
433+
:param start: the initial pose SE(2) or SO(2) to display as a coordinate frame, defaults to null
434+
:type start: ndarray(3,3) or ndarray(2,2)
434435
435436
Is polymorphic with ``base.trplot`` and accepts the same parameters.
436437
This sets up the animation but doesn't execute it.
@@ -633,11 +634,13 @@ def text(self, x, y, *args, **kwargs):
633634
:param x: x-coordinate
634635
:type x: float
635636
:param y: float
636-
:type y: array_like
637+
:type y: float
637638
:param z: z-coordinate
638639
:type z: float
640+
:param kwargs: Other arguments as accepted by the matplotlib method.
639641
640-
Other arguments as accepted by the matplotlib method.
642+
``.text(x, y, s)`` display the string ``s`` at coordinate
643+
(``x``, ``y``).
641644
642645
:seealso: :func:`matplotlib.pyplot.text`
643646
"""

spatialmath/base/argcheck.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,11 @@ def getunit(v, unit):
402402
Convert value according to angular units
403403
404404
:param v: the value in radians or degrees
405-
:type v: array_like
405+
:type v: array_like(m) or ndarray(m)
406406
:param unit: the angular unit, "rad" or "deg"
407407
:type unit: str
408408
:return: the converted value in radians
409-
:rtype: array_like
409+
:rtype: list(m) or ndarray(m)
410410
:raises ValueError: argument is not a valid angular unit
411411
412412
.. runblock:: pycon
@@ -419,7 +419,6 @@ def getunit(v, unit):
419419
>>> getunit(np.r_[0.5, 1], 'rad')
420420
>>> getunit(np.r_[90, 180], 'deg')
421421
"""
422-
423422
if unit == "rad":
424423
return v
425424
elif unit == "deg":

0 commit comments

Comments
 (0)
0