Skip to content

Commit e092650

Browse files
authored
Merge pull request #352 from pymc-labs/ruff
Fix up ruff pre-commit checks to operate on notebooks
2 parents 1648681 + c9b2a34 commit e092650

8 files changed

+555
-554
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ repos:
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
2727
rev: v0.4.8
2828
hooks:
29+
# Run the linter
2930
- id: ruff
30-
args: ["--fix", "--output-format=full"]
31+
types_or: [ python, pyi, jupyter ]
32+
args: [ --fix ]
33+
# Run the formatter
3134
- id: ruff-format
32-
- repo: https://github.com/nbQA-dev/nbQA
33-
rev: 1.8.5
34-
hooks:
35-
- id: nbqa-ruff
35+
types_or: [ python, pyi, jupyter ]
3636
- repo: https://github.com/econchick/interrogate
3737
rev: 1.7.0
3838
hooks:

docs/source/notebooks/did_pymc_banks.ipynb

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
" # rename to meaningful variables\n",
5858
" .rename(columns={\"bib6\": \"Sixth District\", \"bib8\": \"Eighth District\"})\n",
5959
" # reduce from daily resolution to examine median banks open by year\n",
60-
" .groupby(\"year\").median()\n",
60+
" .groupby(\"year\")\n",
61+
" .median()\n",
6162
")\n",
6263
"\n",
6364
"treatment_time = 1930.5\n",

docs/source/notebooks/did_skl.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
}
6262
],
6363
"source": [
64-
"fig, ax = result.plot();"
64+
"fig, ax = result.plot()"
6565
]
6666
},
6767
{

docs/source/notebooks/generate_plots.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@
491491
}
492492
],
493493
"source": [
494-
"fig, ax = result.plot();"
494+
"fig, ax = result.plot()"
495495
]
496496
},
497497
{
@@ -1000,7 +1000,7 @@
10001000
}
10011001
],
10021002
"source": [
1003-
"fig, ax = result.plot();"
1003+
"fig, ax = result.plot()"
10041004
]
10051005
},
10061006
{

docs/source/notebooks/its_skl.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
}
205205
],
206206
"source": [
207-
"fig, ax = result.plot();"
207+
"fig, ax = result.plot()"
208208
]
209209
},
210210
{

docs/source/notebooks/rd_pymc_drinking.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
}
200200
],
201201
"source": [
202-
"fig, ax = result.plot();"
202+
"fig, ax = result.plot()"
203203
]
204204
},
205205
{
@@ -413,7 +413,7 @@
413413
" treatment_threshold=21,\n",
414414
")\n",
415415
"\n",
416-
"fig, ax = result2.plot();"
416+
"fig, ax = result2.plot()"
417417
]
418418
},
419419
{

docs/source/notebooks/rd_skl.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
}
173173
],
174174
"source": [
175-
"fig, ax = result.plot();"
175+
"fig, ax = result.plot()"
176176
]
177177
},
178178
{
@@ -354,7 +354,7 @@
354354
}
355355
],
356356
"source": [
357-
"fig, ax = result.plot();"
357+
"fig, ax = result.plot()"
358358
]
359359
},
360360
{

docs/source/quasi_dags.ipynb

+540-540
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)