From cdab326bab0cf86f96bcce4292f4fae24bddc7b6 Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Wed, 2 Mar 2022 14:57:29 +0100 Subject: [PATCH] fix typos (using codespell) (#6316) * fix typos (using codespell) * revert 'split' --- doc/examples/ROMS_ocean_model.ipynb | 2 +- doc/gallery/plot_colorbar_center.py | 2 +- doc/internals/how-to-add-new-backend.rst | 4 ++-- doc/internals/zarr-encoding-spec.rst | 2 +- doc/roadmap.rst | 2 +- doc/user-guide/time-series.rst | 2 +- doc/whats-new.rst | 12 ++++++------ xarray/backends/common.py | 2 +- xarray/backends/file_manager.py | 2 +- xarray/backends/pseudonetcdf_.py | 2 +- xarray/backends/zarr.py | 2 +- xarray/convert.py | 2 +- xarray/core/accessor_str.py | 4 ++-- xarray/core/combine.py | 2 +- xarray/core/computation.py | 2 +- xarray/core/concat.py | 2 +- xarray/core/dataarray.py | 4 ++-- xarray/core/dataset.py | 12 ++++++------ xarray/core/merge.py | 2 +- xarray/core/missing.py | 8 ++++---- xarray/core/rolling.py | 4 ++-- xarray/core/variable.py | 2 +- xarray/tests/test_backends.py | 6 +++--- xarray/tests/test_calendar_ops.py | 2 +- xarray/tests/test_coarsen.py | 4 ++-- xarray/tests/test_computation.py | 2 +- xarray/tests/test_dask.py | 2 +- xarray/tests/test_dataarray.py | 6 +++--- xarray/tests/test_dataset.py | 2 +- xarray/tests/test_interp.py | 2 +- xarray/tests/test_missing.py | 2 +- xarray/tests/test_plot.py | 6 +++--- 32 files changed, 56 insertions(+), 56 deletions(-) diff --git a/doc/examples/ROMS_ocean_model.ipynb b/doc/examples/ROMS_ocean_model.ipynb index 82d7a8d58af..d5c76380525 100644 --- a/doc/examples/ROMS_ocean_model.ipynb +++ b/doc/examples/ROMS_ocean_model.ipynb @@ -77,7 +77,7 @@ "ds = xr.tutorial.open_dataset(\"ROMS_example.nc\", chunks={\"ocean_time\": 1})\n", "\n", "# This is a way to turn on chunking and lazy evaluation. Opening with mfdataset, or\n", - "# setting the chunking in the open_dataset would also achive this.\n", + "# setting the chunking in the open_dataset would also achieve this.\n", "ds" ] }, diff --git a/doc/gallery/plot_colorbar_center.py b/doc/gallery/plot_colorbar_center.py index 42d6448adf6..da3447a1f25 100644 --- a/doc/gallery/plot_colorbar_center.py +++ b/doc/gallery/plot_colorbar_center.py @@ -38,6 +38,6 @@ ax4.set_title("Celsius: center=False") ax4.set_ylabel("") -# Mke it nice +# Make it nice plt.tight_layout() plt.show() diff --git a/doc/internals/how-to-add-new-backend.rst b/doc/internals/how-to-add-new-backend.rst index 940fa7a4d1e..17f94189504 100644 --- a/doc/internals/how-to-add-new-backend.rst +++ b/doc/internals/how-to-add-new-backend.rst @@ -317,7 +317,7 @@ grouped in three types of indexes :py:class:`~xarray.core.indexing.OuterIndexer` and :py:class:`~xarray.core.indexing.VectorizedIndexer`. This implies that the implementation of the method ``__getitem__`` can be tricky. -In oder to simplify this task, Xarray provides a helper function, +In order to simplify this task, Xarray provides a helper function, :py:func:`~xarray.core.indexing.explicit_indexing_adapter`, that transforms all the input ``indexer`` types (`basic`, `outer`, `vectorized`) in a tuple which is interpreted correctly by your backend. @@ -426,7 +426,7 @@ The ``OUTER_1VECTOR`` indexing shall supports number, slices and at most one list. The behaviour with the list shall be the same of ``OUTER`` indexing. If you support more complex indexing as `explicit indexing` or -`numpy indexing`, you can have a look to the implemetation of Zarr backend and Scipy backend, +`numpy indexing`, you can have a look to the implementation of Zarr backend and Scipy backend, currently available in :py:mod:`~xarray.backends` module. .. _RST preferred_chunks: diff --git a/doc/internals/zarr-encoding-spec.rst b/doc/internals/zarr-encoding-spec.rst index 7fb2383935f..f8bffa6e82f 100644 --- a/doc/internals/zarr-encoding-spec.rst +++ b/doc/internals/zarr-encoding-spec.rst @@ -14,7 +14,7 @@ for the storage of the NetCDF data model in Zarr; see discussion. First, Xarray can only read and write Zarr groups. There is currently no support -for reading / writting individual Zarr arrays. Zarr groups are mapped to +for reading / writing individual Zarr arrays. Zarr groups are mapped to Xarray ``Dataset`` objects. Second, from Xarray's point of view, the key difference between diff --git a/doc/roadmap.rst b/doc/roadmap.rst index c59d56fdd6d..d4098cfd35a 100644 --- a/doc/roadmap.rst +++ b/doc/roadmap.rst @@ -112,7 +112,7 @@ A cleaner model would be to elevate ``indexes`` to an explicit part of xarray's data model, e.g., as attributes on the ``Dataset`` and ``DataArray`` classes. Indexes would need to be propagated along with coordinates in xarray operations, but will no longer would need to have -a one-to-one correspondance with coordinate variables. Instead, an index +a one-to-one correspondence with coordinate variables. Instead, an index should be able to refer to multiple (possibly multidimensional) coordinates that define it. See `GH 1603 `__ for full details diff --git a/doc/user-guide/time-series.rst b/doc/user-guide/time-series.rst index 36a57e37475..f6b9d0bc35b 100644 --- a/doc/user-guide/time-series.rst +++ b/doc/user-guide/time-series.rst @@ -101,7 +101,7 @@ You can also select a particular time by indexing with a ds.sel(time=datetime.time(12)) -For more details, read the pandas documentation and the section on `Indexing Using Datetime Components `_ (i.e. using the ``.dt`` acessor). +For more details, read the pandas documentation and the section on `Indexing Using Datetime Components `_ (i.e. using the ``.dt`` accessor). .. _dt_accessor: diff --git a/doc/whats-new.rst b/doc/whats-new.rst index ae51b9f6ce1..6f939a36f25 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -138,7 +138,7 @@ Bug fixes By `Michael Delgado `_. - `dt.season `_ can now handle NaN and NaT. (:pull:`5876`). By `Pierre Loicq `_. -- Determination of zarr chunks handles empty lists for encoding chunks or variable chunks that occurs in certain cirumstances (:pull:`5526`). By `Chris Roat `_. +- Determination of zarr chunks handles empty lists for encoding chunks or variable chunks that occurs in certain circumstances (:pull:`5526`). By `Chris Roat `_. Internal Changes ~~~~~~~~~~~~~~~~ @@ -706,7 +706,7 @@ Breaking changes By `Alessandro Amici `_. - Functions that are identities for 0d data return the unchanged data if axis is empty. This ensures that Datasets where some variables do - not have the averaged dimensions are not accidentially changed + not have the averaged dimensions are not accidentally changed (:issue:`4885`, :pull:`5207`). By `David Schwörer `_. - :py:attr:`DataArray.coarsen` and :py:attr:`Dataset.coarsen` no longer support passing ``keep_attrs`` @@ -1419,7 +1419,7 @@ New Features Enhancements ~~~~~~~~~~~~ - Performance improvement of :py:meth:`DataArray.interp` and :py:func:`Dataset.interp` - We performs independant interpolation sequentially rather than interpolating in + We performs independent interpolation sequentially rather than interpolating in one large multidimensional space. (:issue:`2223`) By `Keisuke Fujii `_. - :py:meth:`DataArray.interp` now support interpolations over chunked dimensions (:pull:`4155`). By `Alexandre Poux `_. @@ -2770,7 +2770,7 @@ Breaking changes - ``Dataset.T`` has been removed as a shortcut for :py:meth:`Dataset.transpose`. Call :py:meth:`Dataset.transpose` directly instead. - Iterating over a ``Dataset`` now includes only data variables, not coordinates. - Similarily, calling ``len`` and ``bool`` on a ``Dataset`` now + Similarly, calling ``len`` and ``bool`` on a ``Dataset`` now includes only data variables. - ``DataArray.__contains__`` (used by Python's ``in`` operator) now checks array data, not coordinates. @@ -3908,7 +3908,7 @@ Bug fixes (:issue:`1606`). By `Joe Hamman `_. -- Fix bug when using ``pytest`` class decorators to skiping certain unittests. +- Fix bug when using ``pytest`` class decorators to skipping certain unittests. The previous behavior unintentionally causing additional tests to be skipped (:issue:`1531`). By `Joe Hamman `_. @@ -5656,7 +5656,7 @@ Bug fixes - Several bug fixes related to decoding time units from netCDF files (:issue:`316`, :issue:`330`). Thanks Stefan Pfenninger! - xray no longer requires ``decode_coords=False`` when reading datasets with - unparseable coordinate attributes (:issue:`308`). + unparsable coordinate attributes (:issue:`308`). - Fixed ``DataArray.loc`` indexing with ``...`` (:issue:`318`). - Fixed an edge case that resulting in an error when reindexing multi-dimensional variables (:issue:`315`). diff --git a/xarray/backends/common.py b/xarray/backends/common.py index f659d71760b..ad92a6c5869 100644 --- a/xarray/backends/common.py +++ b/xarray/backends/common.py @@ -160,7 +160,7 @@ def sync(self, compute=True): import dask.array as da # TODO: consider wrapping targets with dask.delayed, if this makes - # for any discernable difference in perforance, e.g., + # for any discernible difference in perforance, e.g., # targets = [dask.delayed(t) for t in self.targets] delayed_store = da.store( diff --git a/xarray/backends/file_manager.py b/xarray/backends/file_manager.py index 47a4201539b..06be03e4e44 100644 --- a/xarray/backends/file_manager.py +++ b/xarray/backends/file_manager.py @@ -204,7 +204,7 @@ def _acquire_with_cache_info(self, needs_lock=True): kwargs["mode"] = self._mode file = self._opener(*self._args, **kwargs) if self._mode == "w": - # ensure file doesn't get overriden when opened again + # ensure file doesn't get overridden when opened again self._mode = "a" self._cache[self._key] = file return file, False diff --git a/xarray/backends/pseudonetcdf_.py b/xarray/backends/pseudonetcdf_.py index da178926dbe..a2ca7f0206c 100644 --- a/xarray/backends/pseudonetcdf_.py +++ b/xarray/backends/pseudonetcdf_.py @@ -105,7 +105,7 @@ class PseudoNetCDFBackendEntrypoint(BackendEntrypoint): available = has_pseudonetcdf # *args and **kwargs are not allowed in open_backend_dataset_ kwargs, - # unless the open_dataset_parameters are explicity defined like this: + # unless the open_dataset_parameters are explicitly defined like this: open_dataset_parameters = ( "filename_or_obj", "mask_and_scale", diff --git a/xarray/backends/zarr.py b/xarray/backends/zarr.py index b3f62bb798d..97517818d07 100644 --- a/xarray/backends/zarr.py +++ b/xarray/backends/zarr.py @@ -179,7 +179,7 @@ def _determine_zarr_chunks(enc_chunks, var_chunks, ndim, name, safe_chunks): def _get_zarr_dims_and_attrs(zarr_obj, dimension_key): - # Zarr arrays do not have dimenions. To get around this problem, we add + # Zarr arrays do not have dimensions. To get around this problem, we add # an attribute that specifies the dimension. We have to hide this attribute # when we send the attributes to the user. # zarr_obj can be either a zarr group or zarr array diff --git a/xarray/convert.py b/xarray/convert.py index 0fbd1e13163..93b0a30e57b 100644 --- a/xarray/convert.py +++ b/xarray/convert.py @@ -235,7 +235,7 @@ def _iris_cell_methods_to_str(cell_methods_obj): def _name(iris_obj, default="unknown"): - """Mimicks `iris_obj.name()` but with different name resolution order. + """Mimics `iris_obj.name()` but with different name resolution order. Similar to iris_obj.name() method, but using iris_obj.var_name first to enable roundtripping. diff --git a/xarray/core/accessor_str.py b/xarray/core/accessor_str.py index 9c9de76c0ed..54c9b857a7a 100644 --- a/xarray/core/accessor_str.py +++ b/xarray/core/accessor_str.py @@ -456,7 +456,7 @@ def cat( Strings or array-like of strings to concatenate elementwise with the current DataArray. sep : str or array-like of str, default: "". - Seperator to use between strings. + Separator to use between strings. It is broadcast in the same way as the other input strings. If array-like, its dimensions will be placed at the end of the output array dimensions. @@ -539,7 +539,7 @@ def join( Only one dimension is allowed at a time. Optional for 0D or 1D DataArrays, required for multidimensional DataArrays. sep : str or array-like, default: "". - Seperator to use between strings. + Separator to use between strings. It is broadcast in the same way as the other input strings. If array-like, its dimensions will be placed at the end of the output array dimensions. diff --git a/xarray/core/combine.py b/xarray/core/combine.py index 081b53391ba..d23a58522e6 100644 --- a/xarray/core/combine.py +++ b/xarray/core/combine.py @@ -135,7 +135,7 @@ def _infer_concat_order_from_coords(datasets): order = rank.astype(int).values - 1 # Append positions along extra dimension to structure which - # encodes the multi-dimensional concatentation order + # encodes the multi-dimensional concatenation order tile_ids = [ tile_id + (position,) for tile_id, position in zip(tile_ids, order) ] diff --git a/xarray/core/computation.py b/xarray/core/computation.py index c11bd1a78a4..ce37251576a 100644 --- a/xarray/core/computation.py +++ b/xarray/core/computation.py @@ -1941,7 +1941,7 @@ def unify_chunks(*objects: T_Xarray) -> tuple[T_Xarray, ...]: for obj in objects ] - # Get argumets to pass into dask.array.core.unify_chunks + # Get arguments to pass into dask.array.core.unify_chunks unify_chunks_args = [] sizes: dict[Hashable, int] = {} for ds in datasets: diff --git a/xarray/core/concat.py b/xarray/core/concat.py index 4621e622d42..1e6e246322e 100644 --- a/xarray/core/concat.py +++ b/xarray/core/concat.py @@ -455,7 +455,7 @@ def _dataset_concat( if (dim in coord_names or dim in data_names) and dim not in dim_names: datasets = [ds.expand_dims(dim) for ds in datasets] - # determine which variables to concatentate + # determine which variables to concatenate concat_over, equals, concat_dim_lengths = _calc_concat_over( datasets, dim, dim_names, data_vars, coords, compat ) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 3d720f7fc8b..3df9f7ca8a4 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -2584,7 +2584,7 @@ def interpolate_na( ) def ffill(self, dim: Hashable, limit: int = None) -> DataArray: - """Fill NaN values by propogating values forward + """Fill NaN values by propagating values forward *Requires bottleneck.* @@ -2609,7 +2609,7 @@ def ffill(self, dim: Hashable, limit: int = None) -> DataArray: return ffill(self, dim, limit=limit) def bfill(self, dim: Hashable, limit: int = None) -> DataArray: - """Fill NaN values by propogating values backward + """Fill NaN values by propagating values backward *Requires bottleneck.* diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 90684c4db87..a1d7209bc75 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -379,7 +379,7 @@ def _check_chunks_compatibility(var, chunks, preferred_chunks): def _get_chunk(var, chunks): - # chunks need to be explicity computed to take correctly into accout + # chunks need to be explicitly computed to take correctly into account # backend preferred chunking import dask.array as da @@ -1529,7 +1529,7 @@ def __setitem__(self, key: Hashable | list[Hashable] | Mapping, value) -> None: except Exception as e: if processed: raise RuntimeError( - "An error occured while setting values of the" + "An error occurred while setting values of the" f" variable '{name}'. The following variables have" f" been successfully updated:\n{processed}" ) from e @@ -1976,7 +1976,7 @@ def to_zarr( metadata for existing stores (falling back to non-consolidated). append_dim : hashable, optional If set, the dimension along which the data will be appended. All - other dimensions on overriden variables must remain the same size. + other dimensions on overridden variables must remain the same size. region : dict, optional Optional mapping from dimension names to integer slices along dataset dimensions to indicate the region of existing zarr array(s) @@ -2001,7 +2001,7 @@ def to_zarr( Set False to override this restriction; however, data may become corrupted if Zarr arrays are written in parallel. This option may be useful in combination with ``compute=False`` to initialize a Zarr from an existing - Dataset with aribtrary chunk structure. + Dataset with arbitrary chunk structure. storage_options : dict, optional Any additional parameters for the storage backend (ignored for local paths). @@ -4930,7 +4930,7 @@ def interpolate_na( return new def ffill(self, dim: Hashable, limit: int = None) -> Dataset: - """Fill NaN values by propogating values forward + """Fill NaN values by propagating values forward *Requires bottleneck.* @@ -4956,7 +4956,7 @@ def ffill(self, dim: Hashable, limit: int = None) -> Dataset: return new def bfill(self, dim: Hashable, limit: int = None) -> Dataset: - """Fill NaN values by propogating values backward + """Fill NaN values by propagating values backward *Requires bottleneck.* diff --git a/xarray/core/merge.py b/xarray/core/merge.py index d5307678f89..e5407ae79c3 100644 --- a/xarray/core/merge.py +++ b/xarray/core/merge.py @@ -587,7 +587,7 @@ def merge_core( Parameters ---------- objects : list of mapping - All values must be convertable to labeled arrays. + All values must be convertible to labeled arrays. compat : {"identical", "equals", "broadcast_equals", "no_conflicts", "override"}, optional Compatibility checks to use when merging variables. join : {"outer", "inner", "left", "right"}, optional diff --git a/xarray/core/missing.py b/xarray/core/missing.py index 39e7730dd58..c1776145e21 100644 --- a/xarray/core/missing.py +++ b/xarray/core/missing.py @@ -573,7 +573,7 @@ def _localize(var, indexes_coords): def _floatize_x(x, new_x): """Make x and new_x float. - This is particulary useful for datetime dtype. + This is particularly useful for datetime dtype. x, new_x: tuple of np.ndarray """ x = list(x) @@ -624,7 +624,7 @@ def interp(var, indexes_coords, method, **kwargs): kwargs["bounds_error"] = kwargs.get("bounds_error", False) result = var - # decompose the interpolation into a succession of independant interpolation + # decompose the interpolation into a succession of independent interpolation for indexes_coords in decompose_interp(indexes_coords): var = result @@ -731,7 +731,7 @@ def interp_func(var, x, new_x, method, kwargs): for i in range(new_x[0].ndim) } - # if usefull, re-use localize for each chunk of new_x + # if useful, re-use localize for each chunk of new_x localize = (method in ["linear", "nearest"]) and (new_x[0].chunks is not None) # scipy.interpolate.interp1d always forces to float. @@ -825,7 +825,7 @@ def _dask_aware_interpnd(var, *coords, interp_func, interp_kwargs, localize=True def decompose_interp(indexes_coords): - """Decompose the interpolation into a succession of independant interpolation keeping the order""" + """Decompose the interpolation into a succession of independent interpolation keeping the order""" dest_dims = [ dest[1].dims if dest[1].ndim > 0 else [dim] diff --git a/xarray/core/rolling.py b/xarray/core/rolling.py index 0bc07c1aaeb..f2ac9d979ae 100644 --- a/xarray/core/rolling.py +++ b/xarray/core/rolling.py @@ -33,7 +33,7 @@ Returns ------- reduced : same type as caller - New object with `{name}` applied along its rolling dimnension. + New object with `{name}` applied along its rolling dimension. """ @@ -767,7 +767,7 @@ def __init__(self, obj, windows, boundary, side, coord_func): exponential window along (e.g. `time`) to the size of the moving window. boundary : 'exact' | 'trim' | 'pad' If 'exact', a ValueError will be raised if dimension size is not a - multiple of window size. If 'trim', the excess indexes are trimed. + multiple of window size. If 'trim', the excess indexes are trimmed. If 'pad', NA will be padded. side : 'left' or 'right' or mapping from dimension to 'left' or 'right' coord_func : mapping from coordinate name to func. diff --git a/xarray/core/variable.py b/xarray/core/variable.py index 6db795ce26f..74f394b68ca 100644 --- a/xarray/core/variable.py +++ b/xarray/core/variable.py @@ -700,7 +700,7 @@ def _broadcast_indexes_outer(self, key): return dims, OuterIndexer(tuple(new_key)), None def _nonzero(self): - """Equivalent numpy's nonzero but returns a tuple of Varibles.""" + """Equivalent numpy's nonzero but returns a tuple of Variables.""" # TODO we should replace dask's native nonzero # after https://github.com/dask/dask/issues/1076 is implemented. nonzeros = np.nonzero(self.data) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 1d0342dd344..e0bc0b10437 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -1937,7 +1937,7 @@ def test_chunk_encoding_with_dask(self): with self.roundtrip(ds_chunk4) as actual: assert (4,) == actual["var1"].encoding["chunks"] - # TODO: remove this failure once syncronized overlapping writes are + # TODO: remove this failure once synchronized overlapping writes are # supported by xarray ds_chunk4["var1"].encoding.update({"chunks": 5}) with pytest.raises(NotImplementedError, match=r"named 'var1' would overlap"): @@ -2255,7 +2255,7 @@ def test_write_region_mode(self, mode): @requires_dask def test_write_preexisting_override_metadata(self): - """Metadata should be overriden if mode="a" but not in mode="r+".""" + """Metadata should be overridden if mode="a" but not in mode="r+".""" original = Dataset( {"u": (("x",), np.zeros(10), {"variable": "original"})}, attrs={"global": "original"}, @@ -2967,7 +2967,7 @@ def test_open_fileobj(self): with pytest.raises(TypeError, match="not a valid NetCDF 3"): open_dataset(f, engine="scipy") - # TOOD: this additional open is required since scipy seems to close the file + # TODO: this additional open is required since scipy seems to close the file # when it fails on the TypeError (though didn't when we used # `raises_regex`?). Ref https://github.com/pydata/xarray/pull/5191 with open(tmp_file, "rb") as f: diff --git a/xarray/tests/test_calendar_ops.py b/xarray/tests/test_calendar_ops.py index 8d1ddcf4689..0f0948aafc5 100644 --- a/xarray/tests/test_calendar_ops.py +++ b/xarray/tests/test_calendar_ops.py @@ -161,7 +161,7 @@ def test_convert_calendar_errors(): with pytest.raises(ValueError, match="Argument `align_on` must be specified"): convert_calendar(src_nl, "360_day") - # Standard doesn't suuport year 0 + # Standard doesn't support year 0 with pytest.raises( ValueError, match="Source time coordinate contains dates with year 0" ): diff --git a/xarray/tests/test_coarsen.py b/xarray/tests/test_coarsen.py index 9b1919b136c..7d6613421d5 100644 --- a/xarray/tests/test_coarsen.py +++ b/xarray/tests/test_coarsen.py @@ -158,7 +158,7 @@ def test_coarsen_keep_attrs(funcname, argument) -> None: @pytest.mark.parametrize("window", (1, 2, 3, 4)) @pytest.mark.parametrize("name", ("sum", "mean", "std", "var", "min", "max", "median")) def test_coarsen_reduce(ds, window, name) -> None: - # Use boundary="trim" to accomodate all window sizes used in tests + # Use boundary="trim" to accommodate all window sizes used in tests coarsen_obj = ds.coarsen(time=window, boundary="trim") # add nan prefix to numpy methods to get similar behavior as bottleneck @@ -241,7 +241,7 @@ def test_coarsen_da_reduce(da, window, name) -> None: if da.isnull().sum() > 1 and window == 1: pytest.skip("These parameters lead to all-NaN slices") - # Use boundary="trim" to accomodate all window sizes used in tests + # Use boundary="trim" to accommodate all window sizes used in tests coarsen_obj = da.coarsen(time=window, boundary="trim") # add nan prefix to numpy methods to get similar # behavior as bottleneck diff --git a/xarray/tests/test_computation.py b/xarray/tests/test_computation.py index 7f601c6195a..dac3c17b1f1 100644 --- a/xarray/tests/test_computation.py +++ b/xarray/tests/test_computation.py @@ -2038,7 +2038,7 @@ def test_polyval(use_dask, use_datetime) -> None: "cartesian", -1, ], - [ # Test filling inbetween with coords: + [ # Test filling in between with coords: xr.DataArray( [1, 2], dims=["cartesian"], diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index 48432f319b2..42d8df57cb7 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -460,7 +460,7 @@ def test_concat_loads_variables(self): assert isinstance(out["c"].data, dask.array.Array) out = xr.concat([ds1, ds2, ds3], dim="n", data_vars=[], coords=[]) - # variables are loaded once as we are validing that they're identical + # variables are loaded once as we are validating that they're identical assert kernel_call_count == 12 assert isinstance(out["d"].data, np.ndarray) assert isinstance(out["c"].data, np.ndarray) diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index fc82c03c5d9..3939da08a67 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -174,7 +174,7 @@ def test_get_index_size_zero(self): def test_struct_array_dims(self): """ - This test checks subraction of two DataArrays for the case + This test checks subtraction of two DataArrays for the case when dimension is a structured array. """ # GH837, GH861 @@ -197,7 +197,7 @@ def test_struct_array_dims(self): assert_identical(actual, expected) - # checking array subraction when dims are not the same + # checking array subtraction when dims are not the same p_data_alt = np.array( [("Abe", 180), ("Stacy", 151), ("Dick", 200)], dtype=[("name", "|S256"), ("height", object)], @@ -213,7 +213,7 @@ def test_struct_array_dims(self): assert_identical(actual, expected) - # checking array subraction when dims are not the same and one + # checking array subtraction when dims are not the same and one # is np.nan p_data_nan = np.array( [("Abe", 180), ("Stacy", np.nan), ("Dick", 200)], diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 7ff75fb791b..d726920acce 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -587,7 +587,7 @@ def test_get_index(self): def test_attr_access(self): ds = Dataset( - {"tmin": ("x", [42], {"units": "Celcius"})}, attrs={"title": "My test data"} + {"tmin": ("x", [42], {"units": "Celsius"})}, attrs={"title": "My test data"} ) assert_identical(ds.tmin, ds["tmin"]) assert_identical(ds.tmin.x, ds.x) diff --git a/xarray/tests/test_interp.py b/xarray/tests/test_interp.py index f6d8a7cfcb0..2a6de0be550 100644 --- a/xarray/tests/test_interp.py +++ b/xarray/tests/test_interp.py @@ -770,7 +770,7 @@ def test_decompose(method): ], ) def test_interpolate_chunk_1d(method, data_ndim, interp_ndim, nscalar, chunked): - """Interpolate nd array with multiple independant indexers + """Interpolate nd array with multiple independent indexers It should do a series of 1d interpolation """ diff --git a/xarray/tests/test_missing.py b/xarray/tests/test_missing.py index 2bf5af31fa5..3721c92317d 100644 --- a/xarray/tests/test_missing.py +++ b/xarray/tests/test_missing.py @@ -116,7 +116,7 @@ def test_interpolate_pd_compat(): @pytest.mark.parametrize("method", ["barycentric", "krog", "pchip", "spline", "akima"]) def test_scipy_methods_function(method): # Note: Pandas does some wacky things with these methods and the full - # integration tests wont work. + # integration tests won't work. da, _ = make_interpolate_example_data((25, 25), 0.4, non_uniform=True) actual = da.interpolate_na(method=method, dim="time") assert (da.count("time") <= actual.count("time")).all() diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index c0b6d355441..8ded4c6515f 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -526,7 +526,7 @@ def test__infer_interval_breaks_logscale_invalid_coords(self): x = np.linspace(0, 5, 6) with pytest.raises(ValueError): _infer_interval_breaks(x, scale="log") - # Check if error is raised after nagative values in the array + # Check if error is raised after negative values in the array x = np.linspace(-5, 5, 11) with pytest.raises(ValueError): _infer_interval_breaks(x, scale="log") @@ -1506,7 +1506,7 @@ def test_convenient_facetgrid(self): else: assert "" == ax.get_xlabel() - # Infering labels + # Inferring labels g = self.plotfunc(d, col="z", col_wrap=2) assert_array_equal(g.axes.shape, [2, 2]) for (y, x), ax in np.ndenumerate(g.axes): @@ -1986,7 +1986,7 @@ def test_convenient_facetgrid(self): assert "y" == ax.get_ylabel() assert "x" == ax.get_xlabel() - # Infering labels + # Inferring labels g = self.plotfunc(d, col="z", col_wrap=2) assert_array_equal(g.axes.shape, [2, 2]) for (y, x), ax in np.ndenumerate(g.axes):