Skip to content

Commit d2a7f73

Browse files
authored
pre-commit maintenance (#156)
* use the version of isort from the pycqa * use `flake8`'s github repository * upgrade `flake8` * use `black` on notebooks * black * configure pre-commit.ci * [skip-ci]
1 parent fbcdff3 commit d2a7f73

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ci:
2+
autoupdate_schedule: weekly
3+
14
# https://pre-commit.com/
25
repos:
36
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -8,7 +11,7 @@ repos:
811
- id: check-docstring-first
912
- id: check-yaml
1013
# isort should run before black as black sometimes tweaks the isort output
11-
- repo: https://github.com/timothycrosley/isort
14+
- repo: https://github.com/pycqa/isort
1215
rev: 5.10.1
1316
hooks:
1417
- id: isort
@@ -17,11 +20,12 @@ repos:
1720
rev: 22.1.0
1821
hooks:
1922
- id: black
23+
- id: black-jupyter
2024
- repo: https://github.com/keewis/blackdoc
2125
rev: v0.3.4
2226
hooks:
2327
- id: blackdoc
24-
- repo: https://gitlab.com/pycqa/flake8
25-
rev: 3.9.2
28+
- repo: https://github.com/pycqa/flake8
29+
rev: 4.0.1
2630
hooks:
2731
- id: flake8

docs/examples/plotting.ipynb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"outputs": [],
1717
"source": [
1818
"import xarray as xr\n",
19+
"\n",
1920
"# to be able to read unit attributes following the CF conventions\n",
2021
"import cf_xarray.units # must be imported before pint_xarray\n",
2122
"import pint_xarray\n",
@@ -88,12 +89,7 @@
8889
"metadata": {},
8990
"outputs": [],
9091
"source": [
91-
"monthly_means = (\n",
92-
" quantified\n",
93-
" .pint.to(\"degC\")\n",
94-
" .sel(time=\"2013\")\n",
95-
" .groupby(\"time.month\").mean()\n",
96-
")\n",
92+
"monthly_means = quantified.pint.to(\"degC\").sel(time=\"2013\").groupby(\"time.month\").mean()\n",
9793
"monthly_means"
9894
]
9995
},

0 commit comments

Comments
 (0)