|
1 |
| -r"""Broadcasting operations across ``xarray.xr.DataArray`` dimensions. |
| 1 | +r"""Broadcasting operations across ``xarray.DataArray`` dimensions. |
2 | 2 |
|
3 | 3 | 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. |
5 | 5 | This functionality is provided as a decorator, so it can be applied to both
|
6 | 6 | functions within the package and be available to users who would like to use it
|
7 | 7 | 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 |
10 | 9 | ``xarray.DataArray`` and returns either a scalar value, or another 1D array.
|
11 | 10 | Typically, one would either have to call this function successively in a
|
12 | 11 | ``for`` loop, looping over all the 1D slices in a ``xarray.DataArray`` that
|
|
15 | 14 |
|
16 | 15 | The ``make_broadcastable`` decorator takes care of the latter piece of work,
|
17 | 16 | 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 |
19 | 19 |
|
20 | 20 | >>> def my_function(input_1d, *args, **kwargs):
|
21 | 21 | ... # do something
|
|
32 | 32 |
|
33 | 33 | >>> def my_function(data_array, *args, dimension, **kwargs)
|
34 | 34 |
|
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. |
36 | 36 | The ``\*args`` and ``\*\*kwargs`` retain their original interpretations from
|
37 | 37 | ``my_function`` too.
|
38 | 38 | """
|
|
0 commit comments