From 55ec43609b79448ef0e6f9bb83fa929fde6bc399 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 7 Nov 2024 00:56:26 +0100 Subject: [PATCH] Fix typos found by codespell (#9721) --- DATATREE_MIGRATION_GUIDE.md | 2 +- doc/getting-started-guide/quick-overview.rst | 2 +- doc/user-guide/data-structures.rst | 6 +++--- doc/user-guide/hierarchical-data.rst | 6 +++--- xarray/backends/zarr.py | 2 +- xarray/core/groupby.py | 2 +- xarray/plot/dataset_plot.py | 2 +- xarray/tests/test_interp.py | 2 +- xarray/tests/test_plot.py | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DATATREE_MIGRATION_GUIDE.md b/DATATREE_MIGRATION_GUIDE.md index 644fe7c17c4..8c573999c53 100644 --- a/DATATREE_MIGRATION_GUIDE.md +++ b/DATATREE_MIGRATION_GUIDE.md @@ -41,7 +41,7 @@ A number of other API changes have been made, which should only require minor mo - 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`. - `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). - 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. -- Similarly the `parent` kwarg has been removed from the `DataTree.__init__` constuctor. +- Similarly the `parent` kwarg has been removed from the `DataTree.__init__` constructor. - DataTree objects passed to the `children` kwarg in `DataTree.__init__` are now shallow-copied. - `DataTree.as_array` has been replaced by `DataTree.to_dataarray`. - 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. diff --git a/doc/getting-started-guide/quick-overview.rst b/doc/getting-started-guide/quick-overview.rst index a0c6efbf751..b88ba971e7f 100644 --- a/doc/getting-started-guide/quick-overview.rst +++ b/doc/getting-started-guide/quick-overview.rst @@ -274,7 +274,7 @@ contain another two subgroups, named ``fine`` and ``coarse``. The (sub)subgroups ``fine`` and ``coarse`` contain two very similar datasets. They both have an ``"x"`` dimension, but the dimension is of different lengths in each group, which makes the data in each group unalignable. In the root group we placed some completely unrelated information, in order to show how a tree can -store heterogenous data. +store heterogeneous data. Remember to keep unalignable dimensions in sibling groups because a DataTree inherits coordinates down through its child nodes. You can see this inheritance in the above representation of the DataTree. The coordinates diff --git a/doc/user-guide/data-structures.rst b/doc/user-guide/data-structures.rst index 9a2f26ec7b5..2e5c527a703 100644 --- a/doc/user-guide/data-structures.rst +++ b/doc/user-guide/data-structures.rst @@ -609,7 +609,7 @@ We have created a tree with three nodes in it: Consistency checks are enforced. For instance, if we try to create a `cycle`, -where the root node is also a child of a decendent, the constructor will raise +where the root node is also a child of a descendant, the constructor will raise an (:py:class:`~xarray.InvalidTreeError`): .. ipython:: python @@ -711,8 +711,8 @@ inherited dimensions, but DataTree's inheritance is slightly stricter yet easier to reason about. The constraint that this puts on a DataTree is that dimensions and indices that -are inherited must be aligned with any direct decendent node's existing -dimension or index. This allows decendents to use dimensions defined in +are inherited must be aligned with any direct descendant node's existing +dimension or index. This allows descendants to use dimensions defined in ancestor nodes, without duplicating that information. But as a consequence, if a dimension-name is defined in on a node and that same dimension-name exists in one of its ancestors, they must align (have the same index and diff --git a/doc/user-guide/hierarchical-data.rst b/doc/user-guide/hierarchical-data.rst index 22121228234..2d22110afa4 100644 --- a/doc/user-guide/hierarchical-data.rst +++ b/doc/user-guide/hierarchical-data.rst @@ -28,7 +28,7 @@ Examples of data which one might want organise in a grouped or hierarchical mann - Observational data about the same system but from multiple different types of sensors, - Mixed experimental and theoretical data, - A systematic study recording the same experiment but with different parameters, -- Heterogenous data, such as demographic and metereological data, +- Heterogeneous data, such as demographic and metereological data, or even any combination of the above. @@ -177,7 +177,7 @@ Let's use a different example of a tree to discuss more complex relationships be "/Bony Skeleton/Four Limbs/Amniotic Egg/Two Fenestrae/Dinosaurs" ] -We have used the :py:meth:`~xarray.DataTree.from_dict` constructor method as a prefered way to quickly create a whole tree, +We have used the :py:meth:`~xarray.DataTree.from_dict` constructor method as a preferred way to quickly create a whole tree, and :ref:`filesystem paths` (to be explained shortly) to select two nodes of interest. .. ipython:: python @@ -703,7 +703,7 @@ Data Alignment ~~~~~~~~~~~~~~ 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. -Exact aligment means that shared dimensions must be the same length, and indexes along those dimensions must be equal. +Exact alignment means that shared dimensions must be the same length, and indexes along those dimensions must be equal. .. note:: If you were a previous user of the prototype `xarray-contrib/datatree `_ package, this is different from what you're used to! diff --git a/xarray/backends/zarr.py b/xarray/backends/zarr.py index bed7d84d60d..77d90321717 100644 --- a/xarray/backends/zarr.py +++ b/xarray/backends/zarr.py @@ -1718,7 +1718,7 @@ def _get_open_params( # for new data, we use a better default use_zarr_fill_value_as_mask = False else: - # this was the default for v2 and shold apply to most existing Zarr data + # this was the default for v2 and should apply to most existing Zarr data use_zarr_fill_value_as_mask = True return ( zarr_group, diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index 5c4633c1612..24e85f038b0 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -1003,7 +1003,7 @@ def _flox_reduce( # Note that `has_missing_groups=False` when `self._by_chunked is True`. # We *choose* to always do the masking, so that behaviour is predictable # in some way. The real solution is to expose fill_value as a kwarg, - # and set appopriate defaults :/. + # and set appropriate defaults :/. kwargs.setdefault("fill_value", np.nan) kwargs.setdefault("min_count", 1) diff --git a/xarray/plot/dataset_plot.py b/xarray/plot/dataset_plot.py index 04d298efcce..44d4ffa676a 100644 --- a/xarray/plot/dataset_plot.py +++ b/xarray/plot/dataset_plot.py @@ -652,7 +652,7 @@ def streamplot( def _update_doc_to_dataset(dataarray_plotfunc: Callable) -> Callable[[F], F]: """ - Add a common docstring by re-using the DataArray one. + Add a common docstring by reusing the DataArray one. TODO: Reduce code duplication. diff --git a/xarray/tests/test_interp.py b/xarray/tests/test_interp.py index 0e797b73d52..b661cfb0b3a 100644 --- a/xarray/tests/test_interp.py +++ b/xarray/tests/test_interp.py @@ -305,7 +305,7 @@ def test_interpolate_nd(case: int, method: InterpnOptions, nd_interp_coords) -> ydestnp = nd_interp_coords["ydestnp"] zdestnp = nd_interp_coords["zdestnp"] grid_grid_points = nd_interp_coords["grid_grid_points"] - # the presence/absence of z cordinate may affect nd interpolants, even when the + # the presence/absence of z coordinate may affect nd interpolants, even when the # coordinate is unchanged actual = da.interp(x=xdestnp, y=ydestnp, z=zdestnp, method=method) expected_data = scipy.interpolate.interpn( diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index 7b956177a9c..7b6741df72f 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -3279,7 +3279,7 @@ def test_maybe_gca() -> None: existing_axes = plt.axes() ax = _maybe_gca(aspect=1) - # re-uses the existing axes + # reuses the existing axes assert existing_axes == ax # kwargs are ignored when reusing axes assert ax.get_aspect() == "auto"