Skip to content

Commit

Permalink
Update map_blocks and map_overlap docstrings (#4303)
Browse files Browse the repository at this point in the history
This reference an `obj` argument that only exists in parallel. The
object being referenced is actually `self`.
  • Loading branch information
TomAugspurger authored Aug 3, 2020
1 parent f99c6cc commit 5200a18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 3 additions & 6 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3312,24 +3312,21 @@ def map_blocks(
This function cannot add a new chunked dimension.
obj: DataArray, Dataset
Passed to the function as its first argument, one block at a time.
args: Sequence
Passed to func after unpacking and subsetting any xarray objects by blocks.
xarray objects in args must be aligned with obj, otherwise an error is raised.
xarray objects in args must be aligned with this object, otherwise an error is raised.
kwargs: Mapping
Passed verbatim to func after unpacking. xarray objects, if any, will not be
subset to blocks. Passing dask collections in kwargs is not allowed.
template: (optional) DataArray, Dataset
xarray object representing the final result after compute is called. If not provided,
the function will be first run on mocked-up data, that looks like ``obj`` but
the function will be first run on mocked-up data, that looks like this object but
has sizes 0, to determine properties of the returned object such as dtype,
variable names, attributes, new dimensions and new indexes (if any).
``template`` must be provided if the function changes the size of existing dimensions.
When provided, ``attrs`` on variables in `template` are copied over to the result. Any
``attrs`` set by ``func`` will be ignored.
Returns
-------
A single DataArray or Dataset with dask backend, reassembled from the outputs of the
Expand All @@ -3341,7 +3338,7 @@ def map_blocks(
subset to each block. In the more common case where ``func`` can work on numpy arrays, it is
recommended to use ``apply_ufunc``.
If none of the variables in ``obj`` is backed by dask arrays, calling this function is
If none of the variables in this object is backed by dask arrays, calling this function is
equivalent to calling ``func(obj, *args, **kwargs)``.
See Also
Expand Down
6 changes: 2 additions & 4 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5770,8 +5770,6 @@ def map_blocks(
This function cannot add a new chunked dimension.
obj: DataArray, Dataset
Passed to the function as its first argument, one block at a time.
args: Sequence
Passed to func after unpacking and subsetting any xarray objects by blocks.
xarray objects in args must be aligned with obj, otherwise an error is raised.
Expand All @@ -5780,7 +5778,7 @@ def map_blocks(
subset to blocks. Passing dask collections in kwargs is not allowed.
template: (optional) DataArray, Dataset
xarray object representing the final result after compute is called. If not provided,
the function will be first run on mocked-up data, that looks like ``obj`` but
the function will be first run on mocked-up data, that looks like this object but
has sizes 0, to determine properties of the returned object such as dtype,
variable names, attributes, new dimensions and new indexes (if any).
``template`` must be provided if the function changes the size of existing dimensions.
Expand All @@ -5799,7 +5797,7 @@ def map_blocks(
subset to each block. In the more common case where ``func`` can work on numpy arrays, it is
recommended to use ``apply_ufunc``.
If none of the variables in ``obj`` is backed by dask arrays, calling this function is
If none of the variables in this object is backed by dask arrays, calling this function is
equivalent to calling ``func(obj, *args, **kwargs)``.
See Also
Expand Down

0 comments on commit 5200a18

Please sign in to comment.