Skip to content

Commit

Permalink
unpin nbqa pre-commit hook's additional dependencies (ProjectPythia#259)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Apr 12, 2022
1 parent e19da9f commit 94b8749
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down Expand Up @@ -42,8 +42,9 @@ repos:
rev: 1.3.1
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
additional_dependencies: [black]
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade==2.7.3]
additional_dependencies: [pyupgrade]
exclude: foundations/quickstart.ipynb
- id: nbqa-isort
additional_dependencies: [isort==5.6.4]
additional_dependencies: [isort]
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ bibtex_bibfiles:

sphinx:
config:
linkcheck_ignore:
- https://docs.github.com
html_favicon: images/icons/favicon.ico
html_last_updated_fmt: '%-d %B %Y'
html_theme: sphinx_pythia_theme
Expand Down
2 changes: 1 addition & 1 deletion core/data-formats/netcdf-cf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
"metadata": {},
"outputs": [],
"source": [
"time_units = 'hours since {:%Y-%m-%d 00:00}'.format(times[0])\n",
"time_units = f'hours since {times[0]:%Y-%m-%d 00:00}'\n",
"time_vals = date2num(times, time_units)\n",
"time_vals"
]
Expand Down
2 changes: 1 addition & 1 deletion core/datetime/datetime.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
"print(f\"The next low tide is {next_low_tide}.\")\n",
"print(f\"The next high tide {next_high_tide}.\")\n",
"print(f\"The tide length is {tide_length}.\")\n",
"print(\"The type of the 'tide_length' variable is {}.\".format(type(tide_length)))"
"print(f\"The type of the 'tide_length' variable is {type(tide_length)}.\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion core/matplotlib/matplotlib-basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@
"source": [
"x = y = np.arange(-3.0, 3.0, 0.025)\n",
"X, Y = np.meshgrid(x, y)\n",
"Z1 = np.exp(-(X ** 2) - Y ** 2)\n",
"Z1 = np.exp(-(X**2) - Y**2)\n",
"Z2 = np.exp(-((X - 1) ** 2) - (Y - 1) ** 2)\n",
"Z = (Z1 - Z2) * 2"
]
Expand Down
2 changes: 1 addition & 1 deletion core/numpy/numpy-basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
"metadata": {},
"outputs": [],
"source": [
"a ** b"
"a**b"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions core/numpy/numpy-broadcasting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
"metadata": {},
"outputs": [],
"source": [
"d_2d = x[:, np.newaxis] ** 2 + y ** 2"
"d_2d = x[:, np.newaxis] ** 2 + y**2"
]
},
{
Expand All @@ -336,7 +336,7 @@
"metadata": {},
"outputs": [],
"source": [
"d_3d = d_2d[..., np.newaxis] + z ** 2"
"d_3d = d_2d[..., np.newaxis] + z**2"
]
},
{
Expand All @@ -361,7 +361,7 @@
"metadata": {},
"outputs": [],
"source": [
"h = x[:, np.newaxis, np.newaxis] ** 2 + y[np.newaxis, :, np.newaxis] ** 2 + z ** 2"
"h = x[:, np.newaxis, np.newaxis] ** 2 + y[np.newaxis, :, np.newaxis] ** 2 + z**2"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion core/xarray/computation-masking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"metadata": {},
"outputs": [],
"source": [
"ds.tos ** 2"
"ds.tos**2"
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions foundations/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"metadata": {},
"outputs": [],
"source": [
"type(m)"
"print(type(m))"
]
},
{
Expand All @@ -219,7 +219,7 @@
"metadata": {},
"outputs": [],
"source": [
"type(0.1)"
"print(type(0.1))"
]
},
{
Expand All @@ -237,7 +237,7 @@
"metadata": {},
"outputs": [],
"source": [
"type(4e7)"
"print(type(4e7))"
]
},
{
Expand Down Expand Up @@ -265,7 +265,7 @@
"metadata": {},
"outputs": [],
"source": [
"type(\"orange\")"
"print(type(\"orange\"))"
]
},
{
Expand All @@ -275,7 +275,7 @@
"metadata": {},
"outputs": [],
"source": [
"type('orange')"
"print(type('orange'))"
]
},
{
Expand Down Expand Up @@ -386,7 +386,7 @@
"metadata": {},
"outputs": [],
"source": [
"squares = [i ** 2 for i in range(11)]\n",
"squares = [i**2 for i in range(11)]\n",
"squares"
]
},
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ pyupgrade = 1
isort = 1

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

0 comments on commit 94b8749

Please sign in to comment.