Skip to content

Commit

Permalink
Fix typos found by codespell (pydata#8375)
Browse files Browse the repository at this point in the history
Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com>
  • Loading branch information
DimitriPapadopoulos and max-sixty authored Oct 26, 2023
1 parent 78f7491 commit bb489fa
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion doc/examples/apply_ufunc_vectorize_1d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This example will illustrate how to conveniently apply an unvectorized function `func` to xarray objects using `apply_ufunc`. `func` expects 1D numpy arrays and returns a 1D numpy array. Our goal is to coveniently apply this function along a dimension of xarray objects that may or may not wrap dask arrays with a signature.\n",
"This example will illustrate how to conveniently apply an unvectorized function `func` to xarray objects using `apply_ufunc`. `func` expects 1D numpy arrays and returns a 1D numpy array. Our goal is to conveniently apply this function along a dimension of xarray objects that may or may not wrap dask arrays with a signature.\n",
"\n",
"We will illustrate this using `np.interp`: \n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion doc/user-guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ with ``mode='a'`` on a Dataset containing the new variables, passing in an
existing Zarr store or path to a Zarr store.

To resize and then append values along an existing dimension in a store, set
``append_dim``. This is a good option if data always arives in a particular
``append_dim``. This is a good option if data always arrives in a particular
order, e.g., for time-stepping a simulation:

.. ipython:: python
Expand Down
2 changes: 1 addition & 1 deletion xarray/backends/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def sync(self, compute=True, chunkmanager_store_kwargs=None):
chunkmanager = get_chunked_array_type(*self.sources)

# TODO: consider wrapping targets with dask.delayed, if this makes
# for any discernible difference in perforance, e.g.,
# for any discernible difference in performance, e.g.,
# targets = [dask.delayed(t) for t in self.targets]

if chunkmanager_store_kwargs is None:
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/accessor_dt.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ class CombinedDatetimelikeAccessor(
DatetimeAccessor[T_DataArray], TimedeltaAccessor[T_DataArray]
):
def __new__(cls, obj: T_DataArray) -> CombinedDatetimelikeAccessor:
# CombinedDatetimelikeAccessor isn't really instatiated. Instead
# CombinedDatetimelikeAccessor isn't really instantiated. Instead
# we need to choose which parent (datetime or timedelta) is
# appropriate. Since we're checking the dtypes anyway, we'll just
# do all the validation here.
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def _unpack_dict_tuples(

def _check_core_dims(signature, variable_args, name):
"""
Chcek if an arg has all the core dims required by the signature.
Check if an arg has all the core dims required by the signature.
Slightly awkward design, of returning the error message. But we want to
give a detailed error message, which requires inspecting the variable in
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def _flox_reduce(
if kwargs["func"] not in ["sum", "prod"]:
raise TypeError("Received an unexpected keyword argument 'min_count'")
elif kwargs["min_count"] is None:
# set explicitly to avoid unncessarily accumulating count
# set explicitly to avoid unnecessarily accumulating count
kwargs["min_count"] = 0

# weird backcompat
Expand Down
4 changes: 2 additions & 2 deletions xarray/core/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def interp_func(var, x, new_x, method: InterpOptions, kwargs):
Notes
-----
This requiers scipy installed.
This requires scipy installed.
See Also
--------
Expand Down Expand Up @@ -724,7 +724,7 @@ def interp_func(var, x, new_x, method: InterpOptions, kwargs):
for i in range(new_x[0].ndim)
}

# if useful, re-use localize for each chunk of new_x
# if useful, reuse localize for each chunk of new_x
localize = (method in ["linear", "nearest"]) and new_x0_chunks_is_not_none

# scipy.interpolate.interp1d always forces to float.
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
_DTypeLikeNested = Any # TODO: wait for support for recursive types

# Xarray requires a Mapping[Hashable, dtype] in many places which
# conflics with numpys own DTypeLike (with dtypes for fields).
# conflicts with numpys own DTypeLike (with dtypes for fields).
# https://numpy.org/devdocs/reference/typing.html#numpy.typing.DTypeLike
# This is a copy of this DTypeLike that allows only non-Mapping dtypes.
DTypeLikeSave = Union[
Expand Down
2 changes: 1 addition & 1 deletion xarray/namedarray/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def __init__(
def __init_subclass__(cls, **kwargs: Any) -> None:
if NamedArray in cls.__bases__ and (cls._new == NamedArray._new):
# Type hinting does not work for subclasses unless _new is
# overriden with the correct class.
# overridden with the correct class.
raise TypeError(
"Subclasses of `NamedArray` must override the `_new` method."
)
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def test_concat_errors(self):
concat([data, data], "new_dim", data_vars=["not_found"])

with pytest.raises(ValueError, match=r"global attributes not"):
# call deepcopy seperately to get unique attrs
# call deepcopy separately to get unique attrs
data0 = deepcopy(split_data[0])
data1 = deepcopy(split_data[1])
data1.attrs["foo"] = "bar"
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def test_array_repr_variable(self) -> None:
def test_array_repr_recursive(self) -> None:
# GH:issue:7111

# direct recurion
# direct recursion
var = xr.Variable("x", [0, 1])
var.attrs["x"] = var
formatting.array_repr(var)
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 @@ -2768,7 +2768,7 @@ def test_datetime_hue(self) -> None:
def test_facetgrid_hue_style(self) -> None:
ds2 = self.ds.copy()

# Numbers plots as continous:
# Numbers plots as continuous:
g = ds2.plot.scatter(x="A", y="B", row="row", col="col", hue="hue")
assert isinstance(g._mappables[-1], mpl.collections.PathCollection)

Expand Down
2 changes: 1 addition & 1 deletion xarray/util/generate_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def {method}(self, *args: Any, **kwargs: Any) -> Self:
# We need to add "# type: ignore[override]"
# Keep an eye out for:
# https://discuss.python.org/t/make-type-hints-for-eq-of-primitives-less-strict/34240
# The type ignores might not be neccesary anymore at some point.
# The type ignores might not be necessary anymore at some point.
#
# We require a "hack" to tell type checkers that e.g. Variable + DataArray = DataArray
# In reality this returns NotImplementes, but this is not a valid type in python 3.9.
Expand Down

0 comments on commit bb489fa

Please sign in to comment.