Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _infer_coords_and_dims(
raise ValueError(
"coords is not dict-like, but it has %s items, "
"which does not match the %s dimensions of the "
"data" % (len(coords), len(shape))
"data." % (len(coords), len(shape))
)

if isinstance(dims, str):
Expand Down Expand Up @@ -3481,17 +3481,17 @@ def differentiate(
return self._from_temp_dataset(ds)

def integrate(
self, dim: Union[Hashable, Sequence[Hashable]], datetime_unit: str = None
self, coord: Union[Hashable, Sequence[Hashable]], datetime_unit: str = None
) -> "DataArray":
""" integrate the array with the trapezoidal rule.

.. note::
This feature is limited to simple cartesian geometry, i.e. dim
This feature is limited to simple cartesian geometry, i.e. coord
must be one dimensional.

Parameters
----------
dim : hashable, or sequence of hashable
coord : hashable, or sequence of hashable
Coordinate(s) used for the integration.
datetime_unit : {"Y", "M", "W", "D", "h", "m", "s", "ms", "us", "ns", \
"ps", "fs", "as"}, optional
Expand Down Expand Up @@ -3528,7 +3528,7 @@ def integrate(
array([5.4, 6.6, 7.8])
Dimensions without coordinates: y
"""
ds = self._to_temp_dataset().integrate(dim, datetime_unit)
ds = self._to_temp_dataset().integrate(coord, datetime_unit)
return self._from_temp_dataset(ds)

def unify_chunks(self) -> "DataArray":
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -3681,7 +3681,7 @@ def test_stacking_reordering(self, func, dtype):
(
method("diff", dim="x"),
method("differentiate", coord="x"),
method("integrate", dim="x"),
method("integrate", coord="x"),
method("quantile", q=[0.25, 0.75]),
method("reduce", func=np.sum, dim="x"),
pytest.param(lambda x: x.dot(x), id="method_dot"),
Expand Down
Loading