Skip to content

Commit

Permalink
docs(python): Document attributes on some coordinate space classes (#540
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dstansby authored Mar 18, 2024
1 parent d8b9095 commit fe99ae0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions python/neuroglancer/coordinate_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ def to_json(self):
class DimensionScale(
collections.namedtuple("DimensionScale", ["scale", "unit", "coordinate_array"])
):
"""
Attributes
----------
scale : float
Voxel spacing along the dimension.
unit : str
Units of `scale`.
coordinate_array : neuroglancer.CoordinateArray
"""
__slots__ = ()

def __new__(cls, scale=1, unit="", coordinate_array=None):
Expand Down Expand Up @@ -186,6 +195,17 @@ class CoordinateSpace:
def __init__(
self, json=None, names=None, scales=None, units=None, coordinate_arrays=None
):
"""
Parameters
----------
names : Iterable[str]
Dimension names (e.g., ['x', 'y', 'z']).
scales : float, Iterable[float]
Voxel spacing along each dimension.
units : str, Iterable[str]
Units of the values in `scales`.
coordinate_arrays : Iterable[neuroglancer.CoordinateArray]
"""
if json is None:
if names is not None:
self.names = tuple(names)
Expand Down

0 comments on commit fe99ae0

Please sign in to comment.