Skip to content

Commit cf8af5f

Browse files
committed
add descriptions to functions
1 parent e7ed771 commit cf8af5f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/sdf_xarray/dataarray_accessor.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ def _resize_ndarray(
1717
arr: np.ndarray,
1818
new_shape: tuple | list | np.ndarray,
1919
) -> np.ndarray:
20+
"""
21+
Resizes a `numpy.ndarray` to another shape. The returned array must have the
22+
same dimensionality as the input array.
23+
24+
Parameters
25+
----------
26+
arr
27+
The input array.
28+
new_shape
29+
The shape of the new `xarray.DataArray`, must be the same length as arr.shape.
30+
"""
2031

2132
from scipy.interpolate import RegularGridInterpolator # noqa: PLC0415
2233

@@ -100,6 +111,15 @@ def resize(
100111
self,
101112
new_shape: tuple | list | np.ndarray,
102113
) -> xr.DataArray:
114+
"""
115+
Resizes a `xarray.DataArray` to another shape. The returned array must have the
116+
same dimensionality as the input array.
117+
118+
Parameters
119+
----------
120+
new_shape
121+
The shape of the new `xarray.DataArray`, must be the same length as self.shape.
122+
"""
103123

104124
da = self._obj
105125
# Create a copy of the existing dataarray so that we can copy over the

0 commit comments

Comments
 (0)