Skip to content

Commit

Permalink
Fix typos found by codespell (#9721)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos authored Nov 6, 2024
1 parent a26c816 commit 55ec436
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DATATREE_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion doc/getting-started-guide/quick-overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/user-guide/data-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/user-guide/hierarchical-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <https://github.com/xarray-contrib/datatree>`_ package, this is different from what you're used to!
Expand Down
2 changes: 1 addition & 1 deletion xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion xarray/plot/dataset_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 55ec436

Please sign in to comment.