Skip to content

Commit 94b8749

Browse files
andersy005pre-commit-ci[bot]Kevin Paul
authored
unpin nbqa pre-commit hook's additional dependencies (#259)
* unpin nbqa additional dependencies * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix notebook * Ignore GitHub docs link checks Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kevin Paul <[email protected]>
1 parent e19da9f commit 94b8749

10 files changed

+22
-19
lines changed

Diff for: .pre-commit-config.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.1.0
3+
rev: v4.2.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -42,8 +42,9 @@ repos:
4242
rev: 1.3.1
4343
hooks:
4444
- id: nbqa-black
45-
additional_dependencies: [black==20.8b1]
45+
additional_dependencies: [black]
4646
- id: nbqa-pyupgrade
47-
additional_dependencies: [pyupgrade==2.7.3]
47+
additional_dependencies: [pyupgrade]
48+
exclude: foundations/quickstart.ipynb
4849
- id: nbqa-isort
49-
additional_dependencies: [isort==5.6.4]
50+
additional_dependencies: [isort]

Diff for: _config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ bibtex_bibfiles:
8989

9090
sphinx:
9191
config:
92+
linkcheck_ignore:
93+
- https://docs.github.com
9294
html_favicon: images/icons/favicon.ico
9395
html_last_updated_fmt: '%-d %B %Y'
9496
html_theme: sphinx_pythia_theme

Diff for: core/data-formats/netcdf-cf.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
"metadata": {},
440440
"outputs": [],
441441
"source": [
442-
"time_units = 'hours since {:%Y-%m-%d 00:00}'.format(times[0])\n",
442+
"time_units = f'hours since {times[0]:%Y-%m-%d 00:00}'\n",
443443
"time_vals = date2num(times, time_units)\n",
444444
"time_vals"
445445
]

Diff for: core/datetime/datetime.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
"print(f\"The next low tide is {next_low_tide}.\")\n",
369369
"print(f\"The next high tide {next_high_tide}.\")\n",
370370
"print(f\"The tide length is {tide_length}.\")\n",
371-
"print(\"The type of the 'tide_length' variable is {}.\".format(type(tide_length)))"
371+
"print(f\"The type of the 'tide_length' variable is {type(tide_length)}.\")"
372372
]
373373
},
374374
{

Diff for: core/matplotlib/matplotlib-basics.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@
736736
"source": [
737737
"x = y = np.arange(-3.0, 3.0, 0.025)\n",
738738
"X, Y = np.meshgrid(x, y)\n",
739-
"Z1 = np.exp(-(X ** 2) - Y ** 2)\n",
739+
"Z1 = np.exp(-(X**2) - Y**2)\n",
740740
"Z2 = np.exp(-((X - 1) ** 2) - (Y - 1) ** 2)\n",
741741
"Z = (Z1 - Z2) * 2"
742742
]

Diff for: core/numpy/numpy-basics.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@
365365
"metadata": {},
366366
"outputs": [],
367367
"source": [
368-
"a ** b"
368+
"a**b"
369369
]
370370
},
371371
{

Diff for: core/numpy/numpy-broadcasting.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
"metadata": {},
312312
"outputs": [],
313313
"source": [
314-
"d_2d = x[:, np.newaxis] ** 2 + y ** 2"
314+
"d_2d = x[:, np.newaxis] ** 2 + y**2"
315315
]
316316
},
317317
{
@@ -336,7 +336,7 @@
336336
"metadata": {},
337337
"outputs": [],
338338
"source": [
339-
"d_3d = d_2d[..., np.newaxis] + z ** 2"
339+
"d_3d = d_2d[..., np.newaxis] + z**2"
340340
]
341341
},
342342
{
@@ -361,7 +361,7 @@
361361
"metadata": {},
362362
"outputs": [],
363363
"source": [
364-
"h = x[:, np.newaxis, np.newaxis] ** 2 + y[np.newaxis, :, np.newaxis] ** 2 + z ** 2"
364+
"h = x[:, np.newaxis, np.newaxis] ** 2 + y[np.newaxis, :, np.newaxis] ** 2 + z**2"
365365
]
366366
},
367367
{

Diff for: core/xarray/computation-masking.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"metadata": {},
144144
"outputs": [],
145145
"source": [
146-
"ds.tos ** 2"
146+
"ds.tos**2"
147147
]
148148
},
149149
{

Diff for: foundations/quickstart.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
"metadata": {},
200200
"outputs": [],
201201
"source": [
202-
"type(m)"
202+
"print(type(m))"
203203
]
204204
},
205205
{
@@ -219,7 +219,7 @@
219219
"metadata": {},
220220
"outputs": [],
221221
"source": [
222-
"type(0.1)"
222+
"print(type(0.1))"
223223
]
224224
},
225225
{
@@ -237,7 +237,7 @@
237237
"metadata": {},
238238
"outputs": [],
239239
"source": [
240-
"type(4e7)"
240+
"print(type(4e7))"
241241
]
242242
},
243243
{
@@ -265,7 +265,7 @@
265265
"metadata": {},
266266
"outputs": [],
267267
"source": [
268-
"type(\"orange\")"
268+
"print(type(\"orange\"))"
269269
]
270270
},
271271
{
@@ -275,7 +275,7 @@
275275
"metadata": {},
276276
"outputs": [],
277277
"source": [
278-
"type('orange')"
278+
"print(type('orange'))"
279279
]
280280
},
281281
{
@@ -386,7 +386,7 @@
386386
"metadata": {},
387387
"outputs": [],
388388
"source": [
389-
"squares = [i ** 2 for i in range(11)]\n",
389+
"squares = [i**2 for i in range(11)]\n",
390390
"squares"
391391
]
392392
},

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ pyupgrade = 1
1313
isort = 1
1414

1515
[tool.nbqa.addopts]
16-
pyupgrade = ["--py36-plus"]
16+
pyupgrade = ["--py38-plus"]

0 commit comments

Comments
 (0)