Skip to content

Commit 085b0e7

Browse files
Update pre-commit hooks (pydata#10208)
* Update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.11.4](astral-sh/ruff-pre-commit@v0.9.9...v0.11.4) - [github.com/abravalheri/validate-pyproject: v0.23 → v0.24.1](abravalheri/validate-pyproject@v0.23...v0.24.1) - [github.com/crate-ci/typos: dictgen-v0.3.1 → v1](crate-ci/typos@dictgen-v0.3.1...v1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 08fa7b9 commit 085b0e7

26 files changed

+63
-63
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- id: text-unicode-replacement-char
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
2727
# Ruff version.
28-
rev: v0.9.9
28+
rev: v0.11.4
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff
@@ -69,12 +69,12 @@ repos:
6969
- id: taplo-format
7070
args: ["--option", "array_auto_collapse=false"]
7171
- repo: https://github.com/abravalheri/validate-pyproject
72-
rev: v0.23
72+
rev: v0.24.1
7373
hooks:
7474
- id: validate-pyproject
7575
additional_dependencies: ["validate-pyproject-schema-store[all]"]
7676
- repo: https://github.com/crate-ci/typos
77-
rev: dictgen-v0.3.1
77+
rev: v1
7878
hooks:
7979
- id: typos
8080
# https://github.com/crate-ci/typos/issues/347

design_notes/flexible_indexes_notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Besides `pandas.Index`, other indexes currently supported in Xarray like `CFTime
166166

167167
Like for the indexes, explicit coordinate creation should be preferred over implicit coordinate creation. However, there may be some situations where we would like to keep creating coordinates implicitly for backwards compatibility.
168168

169-
For example, it is currently possible to pass a `pandas.MulitIndex` object as a coordinate to the Dataset/DataArray constructor:
169+
For example, it is currently possible to pass a `pandas.MultiIndex` object as a coordinate to the Dataset/DataArray constructor:
170170

171171
```python
172172
>>> midx = pd.MultiIndex.from_arrays([['a', 'b'], [0, 1]], names=['lvl1', 'lvl2'])

doc/getting-started-guide/quick-overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Operations also align based on index labels:
128128
129129
data[:-1] - data[:1]
130130
131-
For more, see :ref:`comput`.
131+
For more, see :ref:`compute`.
132132

133133
GroupBy
134134
-------

doc/user-guide/computation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. currentmodule:: xarray
22

3-
.. _comput:
3+
.. _compute:
44

55
###########
66
Computation
@@ -236,7 +236,7 @@ These operations automatically skip missing values, like in pandas:
236236
If desired, you can disable this behavior by invoking the aggregation method
237237
with ``skipna=False``.
238238

239-
.. _comput.rolling:
239+
.. _compute.rolling:
240240

241241
Rolling window operations
242242
=========================
@@ -308,7 +308,7 @@ We can also manually iterate through ``Rolling`` objects:
308308
# arr_window is a view of x
309309
...
310310
311-
.. _comput.rolling_exp:
311+
.. _compute.rolling_exp:
312312

313313
While ``rolling`` provides a simple moving average, ``DataArray`` also supports
314314
an exponential moving average with :py:meth:`~xarray.DataArray.rolling_exp`.
@@ -354,7 +354,7 @@ You can also use ``construct`` to compute a weighted rolling sum:
354354
To avoid this, use ``skipna=False`` as the above example.
355355

356356

357-
.. _comput.weighted:
357+
.. _compute.weighted:
358358

359359
Weighted array reductions
360360
=========================
@@ -823,7 +823,7 @@ Arithmetic between two datasets matches data variables of the same name:
823823
Similarly to index based alignment, the result has the intersection of all
824824
matching data variables.
825825

826-
.. _comput.wrapping-custom:
826+
.. _compute.wrapping-custom:
827827

828828
Wrapping custom computation
829829
===========================

doc/user-guide/dask.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ we use to calculate `Spearman's rank-correlation coefficient <https://en.wikiped
282282
283283
The only aspect of this example that is different from standard usage of
284284
``apply_ufunc()`` is that we needed to supply the ``output_dtypes`` arguments.
285-
(Read up on :ref:`comput.wrapping-custom` for an explanation of the
285+
(Read up on :ref:`compute.wrapping-custom` for an explanation of the
286286
"core dimensions" listed in ``input_core_dims``.)
287287

288288
Our new ``spearman_correlation()`` function achieves near linear speedup

doc/user-guide/data-structures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ them into dataset objects:
880880
881881
The merge method is particularly interesting, because it implements the same
882882
logic used for merging coordinates in arithmetic operations
883-
(see :ref:`comput`):
883+
(see :ref:`compute`):
884884

885885
.. ipython:: python
886886

doc/user-guide/indexing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ This is particularly useful for ragged indexing of multi-dimensional data,
276276
e.g., to apply a 2D mask to an image. Note that ``where`` follows all the
277277
usual xarray broadcasting and alignment rules for binary operations (e.g.,
278278
``+``) between the object being indexed and the condition, as described in
279-
:ref:`comput`:
279+
:ref:`compute`:
280280

281281
.. ipython:: python
282282

doc/whats-new.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4281,7 +4281,7 @@ New Features
42814281
~~~~~~~~~~~~
42824282

42834283
- Weighted array reductions are now supported via the new :py:meth:`DataArray.weighted`
4284-
and :py:meth:`Dataset.weighted` methods. See :ref:`comput.weighted`. (:issue:`422`, :pull:`2922`).
4284+
and :py:meth:`Dataset.weighted` methods. See :ref:`compute.weighted`. (:issue:`422`, :pull:`2922`).
42854285
By `Mathias Hauser <https://github.com/mathause>`_.
42864286
- The new jupyter notebook repr (``Dataset._repr_html_`` and
42874287
``DataArray._repr_html_``) (introduced in 0.14.1) is now on by default. To
@@ -6412,7 +6412,7 @@ Enhancements
64126412
- New helper function :py:func:`~xarray.apply_ufunc` for wrapping functions
64136413
written to work on NumPy arrays to support labels on xarray objects
64146414
(:issue:`770`). ``apply_ufunc`` also support automatic parallelization for
6415-
many functions with dask. See :ref:`comput.wrapping-custom` and
6415+
many functions with dask. See :ref:`compute.wrapping-custom` and
64166416
:ref:`dask.automatic-parallelization` for details.
64176417
By `Stephan Hoyer <https://github.com/shoyer>`_.
64186418

@@ -7434,7 +7434,7 @@ Enhancements
74347434
* x (x) int64 0 1 2
74357435
* y (y) int64 0 1 2 3 4
74367436

7437-
See :ref:`comput.rolling` for more details. By
7437+
See :ref:`compute.rolling` for more details. By
74387438
`Joe Hamman <https://github.com/jhamman>`_.
74397439

74407440
Bug fixes

xarray/backends/zarr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ def _validate_and_autodetect_region(self, ds: Dataset) -> Dataset:
12901290
region = self._write_region
12911291

12921292
if region == "auto":
1293-
region = {dim: "auto" for dim in ds.dims}
1293+
region = dict.fromkeys(ds.dims, "auto")
12941294

12951295
if not isinstance(region, dict):
12961296
raise TypeError(f"``region`` must be a dict, got {type(region)}")

xarray/computation/fit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def _initialize_feasible(lb, ub):
8080
)
8181
return p0
8282

83-
param_defaults = {p: 1 for p in params}
84-
bounds_defaults = {p: (-np.inf, np.inf) for p in params}
83+
param_defaults = dict.fromkeys(params, 1)
84+
bounds_defaults = dict.fromkeys(params, (-np.inf, np.inf))
8585
for p in params:
8686
if p in func_args and func_args[p].default is not func_args[p].empty:
8787
param_defaults[p] = func_args[p].default

0 commit comments

Comments
 (0)