Skip to content

Commit 62c0dc5

Browse files
chore: update pre-commit hooks (#599)
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.9](astral-sh/ruff-pre-commit@v0.8.6...v0.9.9) - [github.com/pre-commit/mirrors-mypy: v1.14.1 → v1.15.0](pre-commit/mirrors-mypy@v1.14.1...v1.15.0) - [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](codespell-project/codespell@v2.3.0...v2.4.1) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <[email protected]>
1 parent 19eeb15 commit 62c0dc5

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- id: trailing-whitespace
2626

2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.8.6
28+
rev: v0.9.9
2929
hooks:
3030
- id: ruff
3131
args: ["--fix", "--show-fixes"]
@@ -34,18 +34,18 @@ repos:
3434
types_or: [python, pyi, jupyter]
3535

3636
- repo: https://github.com/pre-commit/mirrors-mypy
37-
rev: v1.14.1
37+
rev: v1.15.0
3838
hooks:
3939
- id: mypy
4040
files: ^src
4141
args: []
4242
additional_dependencies: ["numpy~=2.2.0", "matplotlib>=3.4", "boost-histogram~=1.5.0", "uhi~=0.3.1", "pandas-stubs>=2.0.1.230501"]
4343

4444
- repo: https://github.com/codespell-project/codespell
45-
rev: v2.3.0
45+
rev: v2.4.1
4646
hooks:
4747
- id: codespell
48-
args: ["-Lhist,gaus,nd"]
48+
args: ["-Lhist,gaus,nd,ine", "-w"]
4949
exclude: ^notebooks/HistLogo.ipynb$
5050

5151
- repo: https://github.com/pre-commit/pygrep-hooks

docs/user-guide/notebooks/SVGHistogram.ipynb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -448,22 +448,22 @@
448448
"\n",
449449
" polylines = [\n",
450450
" polyline(\n",
451-
" points=f\"{3*20}, {3*20+105} \"\n",
452-
" f\"{3*20+30}, {3*20+105} \"\n",
453-
" f\"{3*20+30}, {3*20+95} \"\n",
454-
" f\"{3*20+40}, {3*20+95} \"\n",
455-
" f\"{3*20+40}, {3*20+70} \"\n",
456-
" f\"{3*20+50}, {3*20+70} \"\n",
457-
" f\"{3*20+50}, {3*20+52} \"\n",
458-
" f\"{3*20+60}, {3*20+52} \"\n",
459-
" f\"{3*20+60}, {3*20+45} \"\n",
460-
" f\"{3*20+70}, {3*20+45} \"\n",
461-
" f\"{3*20+70}, {3*20+65} \"\n",
462-
" f\"{3*20+80}, {3*20+65} \"\n",
463-
" f\"{3*20+80}, {3*20+95} \"\n",
464-
" f\"{3*20+90}, {3*20+95} \"\n",
465-
" f\"{3*20+90}, {3*20+105} \"\n",
466-
" f\"{3*20+120}, {3*20+105} \",\n",
451+
" points=f\"{3 * 20}, {3 * 20 + 105} \"\n",
452+
" f\"{3 * 20 + 30}, {3 * 20 + 105} \"\n",
453+
" f\"{3 * 20 + 30}, {3 * 20 + 95} \"\n",
454+
" f\"{3 * 20 + 40}, {3 * 20 + 95} \"\n",
455+
" f\"{3 * 20 + 40}, {3 * 20 + 70} \"\n",
456+
" f\"{3 * 20 + 50}, {3 * 20 + 70} \"\n",
457+
" f\"{3 * 20 + 50}, {3 * 20 + 52} \"\n",
458+
" f\"{3 * 20 + 60}, {3 * 20 + 52} \"\n",
459+
" f\"{3 * 20 + 60}, {3 * 20 + 45} \"\n",
460+
" f\"{3 * 20 + 70}, {3 * 20 + 45} \"\n",
461+
" f\"{3 * 20 + 70}, {3 * 20 + 65} \"\n",
462+
" f\"{3 * 20 + 80}, {3 * 20 + 65} \"\n",
463+
" f\"{3 * 20 + 80}, {3 * 20 + 95} \"\n",
464+
" f\"{3 * 20 + 90}, {3 * 20 + 95} \"\n",
465+
" f\"{3 * 20 + 90}, {3 * 20 + 105} \"\n",
466+
" f\"{3 * 20 + 120}, {3 * 20 + 105} \",\n",
467467
" style=\"fill:none;stroke:black;stroke-width:2\",\n",
468468
" ),\n",
469469
" ]\n",
@@ -538,8 +538,8 @@
538538
" polygons.append(\n",
539539
" polygon(\n",
540540
" points=\"150, 125 \"\n",
541-
" f\"{150+100*norm_vals[i] * math.cos(i * ang)}, {125+100*norm_vals[i] * math.sin(i * ang)} \"\n",
542-
" f\"{150+100*norm_vals[i] * math.cos((i+1) * ang)}, {125+100*norm_vals[i] * math.sin((i+1) * ang)} \",\n",
541+
" f\"{150 + 100 * norm_vals[i] * math.cos(i * ang)}, {125 + 100 * norm_vals[i] * math.sin(i * ang)} \"\n",
542+
" f\"{150 + 100 * norm_vals[i] * math.cos((i + 1) * ang)}, {125 + 100 * norm_vals[i] * math.sin((i + 1) * ang)} \",\n",
543543
" style=\"fill:none;stroke:black;stroke-width:2\",\n",
544544
" )\n",
545545
" )\n",
@@ -548,7 +548,7 @@
548548
" circle(\n",
549549
" cx=\"150\",\n",
550550
" cy=\"125\",\n",
551-
" r=f\"{30*min(norm_vals)}\",\n",
551+
" r=f\"{30 * min(norm_vals)}\",\n",
552552
" stroke=\"black\",\n",
553553
" fill=\"white\",\n",
554554
" stroke_width=\"3\",\n",

src/hist/svgplots.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def svg_hist_1d(h: hist.BaseHist) -> svg:
105105
upper,
106106
label,
107107
bins,
108-
viewBox=f"-10 {-height-5} {width+20} {height+20}",
108+
viewBox=f"-10 {-height - 5} {width + 20} {height + 20}",
109109
)
110110

111111

@@ -142,7 +142,7 @@ def svg_hist_1d_c(h: hist.BaseHist) -> svg:
142142
style="fill:none;stroke-width:2;stroke:currentColor",
143143
)
144144

145-
return svg(bins, center, viewBox=f"{-width/2} {-height/2} {width} {height}")
145+
return svg(bins, center, viewBox=f"{-width / 2} {-height / 2} {width} {height}")
146146

147147

148148
def svg_hist_2d(h: hist.BaseHist) -> svg:
@@ -190,8 +190,10 @@ def svg_hist_2d(h: hist.BaseHist) -> svg:
190190
h.axes[1],
191191
x=-10,
192192
y=-height / 2,
193-
transform=f"rotate(-90,{-10},{-height/2})",
193+
transform=f"rotate(-90,{-10},{-height / 2})",
194194
),
195195
]
196196

197-
return svg(*texts, *boxes, viewBox=f"{-20} {-height - 20} {width+40} {height+40}")
197+
return svg(
198+
*texts, *boxes, viewBox=f"{-20} {-height - 20} {width + 40} {height + 40}"
199+
)

0 commit comments

Comments
 (0)