Skip to content

Commit 4cd998d

Browse files
committed
Fix typos in docs and code
1 parent 22b9d81 commit 4cd998d

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

DATATREE_MIGRATION_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ A number of other API changes have been made, which should only require minor mo
4141
- The method `DataTree.to_dataset()` still exists but now has different options for controlling which variables are present on the resulting `Dataset`, e.g. `inherit=True/False`.
4242
- `DataTree.copy()` also has a new `inherit` keyword argument for controlling whether or not coordinates defined on parents are copied (only relevant when copying a non-root node).
4343
- The `DataTree.parent` property is now read-only. To assign a ancestral relationships directly you must instead use the `.children` property on the parent node, which remains settable.
44-
- Similarly the `parent` kwarg has been removed from the `DataTree.__init__` constuctor.
44+
- Similarly the `parent` kwarg has been removed from the `DataTree.__init__` constructor.
4545
- DataTree objects passed to the `children` kwarg in `DataTree.__init__` are now shallow-copied.
4646
- `DataTree.as_array` has been replaced by `DataTree.to_dataarray`.
4747
- A number of methods which were not well tested have been (temporarily) disabled. In general we have tried to only keep things that are known to work, with the plan to increase API surface incrementally after release.

doc/user-guide/data-structures.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ We have created a tree with three nodes in it:
608608
609609
610610
Consistency checks are enforced. For instance, if we try to create a ``cycle``,
611-
where the root node is also a child of a decendent, the constructor will raise
611+
where the root node is also a child of a descendent, the constructor will raise
612612
an (:py:class:`~xarray.InvalidTreeError`):
613613

614614
.. ipython:: python
@@ -710,8 +710,8 @@ inherited dimensions, but DataTree's inheritance is slightly stricter yet
710710
easier to reason about.
711711

712712
The constraint that this puts on a DataTree is that dimensions and indices that
713-
are inherited must be aligned with any direct decendent node's existing
714-
dimension or index. This allows decendents to use dimensions defined in
713+
are inherited must be aligned with any direct descendent node's existing
714+
dimension or index. This allows descendents to use dimensions defined in
715715
ancestor nodes, without duplicating that information. But as a consequence, if
716716
a dimension-name is defined in on a node and that same dimension-name
717717
exists in one of its ancestors, they must align (have the same index and

doc/user-guide/hierarchical-data.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Let's use a different example of a tree to discuss more complex relationships be
177177
"/Bony Skeleton/Four Limbs/Amniotic Egg/Two Fenestrae/Dinosaurs"
178178
]
179179
180-
We have used the :py:meth:`~xarray.DataTree.from_dict` constructor method as a prefered way to quickly create a whole tree,
180+
We have used the :py:meth:`~xarray.DataTree.from_dict` constructor method as a preferred way to quickly create a whole tree,
181181
and :ref:`filesystem paths` (to be explained shortly) to select two nodes of interest.
182182

183183
.. ipython:: python
@@ -658,7 +658,7 @@ Data Alignment
658658
~~~~~~~~~~~~~~
659659

660660
The data in different datatree nodes are not totally independent. In particular dimensions (and indexes) in child nodes must be exactly aligned with those in their parent nodes.
661-
Exact aligment means that shared dimensions must be the same length, and indexes along those dimensions must be equal.
661+
Exact alignment means that shared dimensions must be the same length, and indexes along those dimensions must be equal.
662662

663663
.. note::
664664
If you were a previous user of the prototype `xarray-contrib/datatree <https://github.com/xarray-contrib/datatree>`_ package, this is different from what you're used to!

xarray/core/dataarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def reset_coords(
11051105
return self._replace(coords=dataset._variables)
11061106
if self.name is None:
11071107
raise ValueError(
1108-
"cannot reset_coords with drop=False on an unnamed DataArrray"
1108+
"cannot reset_coords with drop=False on an unnamed DataArray"
11091109
)
11101110
dataset[self.name] = self.variable
11111111
return dataset

xarray/core/indexes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ def group_by_index(
16231623
return index_coords
16241624

16251625
def to_pandas_indexes(self) -> Indexes[pd.Index]:
1626-
"""Returns an immutable proxy for Dataset or DataArrary pandas indexes.
1626+
"""Returns an immutable proxy for Dataset or DataArray pandas indexes.
16271627
16281628
Raises an error if this proxy contains indexes that cannot be coerced to
16291629
pandas.Index objects.

xarray/tests/test_dataarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3797,7 +3797,7 @@ def test_to_dataset_retains_keys(self) -> None:
37973797

37983798
array = DataArray([1, 2, 3], coords=[("x", dates)], attrs={"a": 1})
37993799

3800-
# convert to dateset and back again
3800+
# convert to dataset and back again
38013801
result = array.to_dataset("x").to_dataarray(dim="x")
38023802

38033803
assert_equal(array, result)

xarray/tests/test_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,7 @@ def test_rename_multiindex(self) -> None:
32063206
with pytest.raises(ValueError, match=r"'b' conflicts"):
32073207
original.rename({"a": "b"})
32083208

3209-
def test_rename_perserve_attrs_encoding(self) -> None:
3209+
def test_rename_preserve_attrs_encoding(self) -> None:
32103210
# test propagate attrs/encoding to new variable(s) created from Index object
32113211
original = Dataset(coords={"x": ("x", [0, 1, 2])})
32123212
expected = Dataset(coords={"y": ("y", [0, 1, 2])})

0 commit comments

Comments
 (0)