Skip to content

Commit 8f67dca

Browse files
authored
Update pre-commit hooks (#4651)
* autoupdate pre-commit hooks * run pre-commit on all files * stop using doctest for the code snippet
1 parent 8bef069 commit 8f67dca

File tree

7 files changed

+8
-7
lines changed

7 files changed

+8
-7
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
hooks:
1212
- id: black
1313
- repo: https://github.com/keewis/blackdoc
14-
rev: v0.3
14+
rev: v0.3.1
1515
hooks:
1616
- id: blackdoc
1717
- repo: https://gitlab.com/pycqa/flake8

doc/contributing.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ Bug reports must:
5151
<http://github.github.com/github-flavored-markdown/>`_::
5252

5353
```python
54-
>>> import xarray as xr
55-
>>> df = xr.Dataset(...)
54+
import xarray as xr
55+
df = xr.Dataset(...)
56+
5657
...
5758
```
5859

doc/io.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ and then calling ``to_zarr`` with ``compute=False`` to write only metadata
10331033
.. ipython:: python
10341034
10351035
import dask.array
1036+
10361037
# The values of this dask array are entirely irrelevant; only the dtype,
10371038
# shape and chunks are used
10381039
dummies = dask.array.zeros(30, chunks=10)

xarray/core/computation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ def apply_ufunc(
931931
>>> def magnitude(a, b):
932932
... func = lambda x, y: np.sqrt(x ** 2 + y ** 2)
933933
... return xr.apply_ufunc(func, a, b)
934+
...
934935
935936
You can now apply ``magnitude()`` to ``xr.DataArray`` and ``xr.Dataset``
936937
objects, with automatically preserved dimensions and coordinates, e.g.,

xarray/core/dataset.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5940,10 +5940,6 @@ def filter_by_attrs(self, **kwargs):
59405940
Examples
59415941
--------
59425942
>>> # Create an example dataset:
5943-
...
5944-
>>> import numpy as np
5945-
>>> import pandas as pd
5946-
>>> import xarray as xr
59475943
>>> temp = 15 + 8 * np.random.randn(2, 2, 3)
59485944
>>> precip = 10 * np.random.rand(2, 2, 3)
59495945
>>> lon = [[-99.83, -99.32], [-99.79, -99.23]]

xarray/core/options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class set_options:
111111
>>> ds = xr.Dataset({"x": np.arange(1000)})
112112
>>> with xr.set_options(display_width=40):
113113
... print(ds)
114+
...
114115
<xarray.Dataset>
115116
Dimensions: (x: 1000)
116117
Coordinates:

xarray/core/parallel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def map_blocks(
232232
... gb = da.groupby(groupby_type)
233233
... clim = gb.mean(dim="time")
234234
... return gb - clim
235+
...
235236
>>> time = xr.cftime_range("1990-01", "1992-01", freq="M")
236237
>>> month = xr.DataArray(time.month, coords={"time": time}, dims=["time"])
237238
>>> np.random.seed(123)

0 commit comments

Comments
 (0)