Skip to content

Commit a2567d0

Browse files
authored
DOC: Correct some wording mistakes in xarray documentation (#11120)
* an Pandas -> a Pandas Fix comment formatting in get_duck_array method. * an 1d -> a 1d * A a mapping -> A mapping * Cast a arrays -> Cast arrays * a added dimension -> an added dimension * a all dimensions -> all dimensions * a attribute -> an attribute
1 parent 8704ca5 commit a2567d0

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

xarray/backends/zarr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def decode(cls, value: int | float | str | bytes, dtype: str | np.dtype[Any]):
163163

164164
def encode_zarr_attr_value(value):
165165
"""
166-
Encode a attribute value as something that can be serialized as json
166+
Encode an attribute value as something that can be serialized as json
167167
168168
Many xarray datasets / variables have numpy arrays and values. This
169169
function handles encoding / decoding of such items.

xarray/core/accessor_str.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ def translate(self, table: Mapping[Any, str | bytes | int | None]) -> T_DataArra
16771677
Parameters
16781678
----------
16791679
table : dict-like from and to str or bytes or int
1680-
A a mapping of Unicode ordinals to Unicode ordinals, strings, int
1680+
A mapping of Unicode ordinals to Unicode ordinals, strings, int
16811681
or None. Unmapped characters are left untouched. Characters mapped
16821682
to None are deleted. :meth:`str.maketrans` is a helper function for
16831683
making translation tables.

xarray/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
except ImportError:
3030
cftime = None
3131

32-
# Used as a sentinel value to indicate a all dimensions
32+
# Used as a sentinel value to indicate all dimensions
3333
ALL_DIMS = ...
3434

3535

xarray/core/dataarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,7 @@ def interp_like(
24342434
----------
24352435
other : Dataset or DataArray
24362436
Object with an 'indexes' attribute giving a mapping from dimension
2437-
names to an 1d array-like, which provides coordinates upon
2437+
names to a 1d array-like, which provides coordinates upon
24382438
which to index the variables in this dataset. Missing values are skipped.
24392439
method : { "linear", "nearest", "zero", "slinear", "quadratic", "cubic", \
24402440
"quintic", "polynomial", "pchip", "barycentric", "krogh", "akima", "makima" }

xarray/core/duck_array_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def asarray(data, xp=np, dtype=None):
285285

286286

287287
def as_shared_dtype(scalars_or_arrays, xp=None):
288-
"""Cast a arrays to a shared dtype using xarray's type promotion rules."""
288+
"""Cast arrays to a shared dtype using xarray's type promotion rules."""
289289
# Avoid calling array_type("cupy") repeatidely in the any check
290290
array_type_cupy = array_type("cupy")
291291
if any(isinstance(x, array_type_cupy) for x in scalars_or_arrays):

xarray/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ def __array__(
19621962
return np.asarray(array.values, dtype=dtype)
19631963

19641964
def get_duck_array(self) -> np.ndarray | PandasExtensionArray:
1965-
# We return an PandasExtensionArray wrapper type that satisfies
1965+
# We return a PandasExtensionArray wrapper type that satisfies
19661966
# duck array protocols.
19671967
# `NumpyExtensionArray` is excluded
19681968
if is_allowed_extension_array(self.array):

xarray/core/variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ def rolling_window(
21382138
21392139
Returns
21402140
-------
2141-
Variable that is a view of the original array with a added dimension of
2141+
Variable that is a view of the original array with an added dimension of
21422142
size w.
21432143
The return dim: self.dims + (window_dim, )
21442144
The return shape: self.shape + (window, )

0 commit comments

Comments
 (0)