Skip to content

Commit 9e8e4ac

Browse files
committed
Improve _compute_slope docstring
Add more infomration on the purpose of the _compute_slope method.
1 parent a18bcc2 commit 9e8e4ac

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/imagej/dims.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,14 @@ def _get_linear_axis(axis_type: "jc.AxisType", scale_array: np.ndarray, values):
301301

302302

303303
def _compute_slope(axis):
304-
"""
305-
Compute slope (i.e. scale) of an axis with all points.
304+
"""Compute slope (i.e. scale) of an axis.
305+
306+
Each axis will have an associated coodinates array (1D) which
307+
can be linear or non-linear (xarray will use an index as the
308+
coordinate array if none is given). This method computes the
309+
slope of a given coordinates array using all points in the
310+
array. The calculated slope is then used as the 'scale'
311+
parameter for creating an ImageJ2 DefaultLinenarAxis.
306312
307313
:param axis: List like 1D array with indexing.
308314
:return: Slope of the axis.

0 commit comments

Comments
 (0)