Skip to content

Commit a939e29

Browse files
committed
Will still doesn't know rst
1 parent e3b85ae commit a939e29

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

movement/utils/broadcasting.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
r"""Broadcasting operations across ``xarray.xr.DataArray`` dimensions.
1+
r"""Broadcasting operations across ``xarray.DataArray`` dimensions.
22
33
This module essentially provides an equivalent functionality to
4-
`numpy.apply_along_axis``, but for ``xarray.DataArray``s.
4+
``numpy.apply_along_axis``, but for ``xarray.DataArray`` objects.
55
This functionality is provided as a decorator, so it can be applied to both
66
functions within the package and be available to users who would like to use it
77
in their analysis.
8-
9-
In essence; suppose that we have a function which takes a 1-slice of a
8+
In essence; suppose that we have a function which takes a 1D-slice of a
109
``xarray.DataArray`` and returns either a scalar value, or another 1D array.
1110
Typically, one would either have to call this function successively in a
1211
``for`` loop, looping over all the 1D slices in a ``xarray.DataArray`` that
@@ -15,7 +14,8 @@
1514
1615
The ``make_broadcastable`` decorator takes care of the latter piece of work,
1716
allowing us to write functions that operate on 1D slices, then apply this
18-
decorator to have them work across ``xarray.DataArray``s. The function
17+
decorator to have them work across ``xarray.DataArray`` dimensions. The
18+
function
1919
2020
>>> def my_function(input_1d, *args, **kwargs):
2121
... # do something
@@ -32,7 +32,7 @@
3232
3333
>>> def my_function(data_array, *args, dimension, **kwargs)
3434
35-
which will perform the action of `my_function` along the `dimension` given.
35+
which will perform the action of ``my_function`` along the ``dimension`` given.
3636
The ``\*args`` and ``\*\*kwargs`` retain their original interpretations from
3737
``my_function`` too.
3838
"""

tests/test_unit/test_make_broadcastable.py

-1
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,3 @@ def two_to_some(xy_pair) -> np.ndarray:
241241
else:
242242
assert d in mock_dataset.dims
243243
assert len(output[d]) == len(mock_dataset[d])
244-
pass

0 commit comments

Comments
 (0)