Skip to content

Commit a8acd57

Browse files
pre-commit-ci[bot]HDembinski
authored andcommitted
[pre-commit.ci] pre-commit autoupdate (scikit-hep#1066)
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.3 → v0.9.4](astral-sh/ruff-pre-commit@v0.8.3...v0.9.4) - [github.com/pre-commit/mirrors-clang-format: v19.1.5 → v19.1.7](pre-commit/mirrors-clang-format@v19.1.5...v19.1.7) - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](pre-commit/mirrors-mypy@v1.13.0...v1.14.1) - [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.1](python-jsonschema/check-jsonschema@0.30.0...0.31.1) - [github.com/henryiii/validate-pyproject-schema-store: 2024.11.25 → 2025.02.03](henryiii/validate-pyproject-schema-store@2024.11.25...2025.02.03) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2222b65 commit a8acd57

7 files changed

+21
-22
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ repos:
3434

3535
# Ruff linter and formatter
3636
- repo: https://github.com/astral-sh/ruff-pre-commit
37-
rev: 'v0.8.3'
37+
rev: 'v0.9.4'
3838
hooks:
3939
- id: ruff
4040
args: [--fix, --show-fixes]
4141
- id: ruff-format
4242

4343
# C++ formatting
4444
- repo: https://github.com/pre-commit/mirrors-clang-format
45-
rev: v19.1.5
45+
rev: v19.1.7
4646
hooks:
4747
- id: clang-format
4848
files: "src"
@@ -58,7 +58,7 @@ repos:
5858

5959
# Python type checking
6060
- repo: https://github.com/pre-commit/mirrors-mypy
61-
rev: 'v1.13.0'
61+
rev: 'v1.14.1'
6262
hooks:
6363
- id: mypy
6464
additional_dependencies: [numpy]
@@ -73,11 +73,11 @@ repos:
7373
args: [--drop-empty-cells]
7474

7575
- repo: https://github.com/python-jsonschema/check-jsonschema
76-
rev: 0.30.0
76+
rev: 0.31.1
7777
hooks:
7878
- id: check-github-workflows
7979

8080
- repo: https://github.com/henryiii/validate-pyproject-schema-store
81-
rev: 2024.11.25
81+
rev: 2025.02.03
8282
hooks:
8383
- id: validate-pyproject

bench/plot.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5255,8 +5255,8 @@
52555255
"print(\n",
52565256
" f\"\"\"\\\n",
52575257
"benchmark results\n",
5258-
" {data['datetime']}\n",
5259-
" {data['machine_info']['cpu']['brand_raw']}\n",
5258+
" {data[\"datetime\"]}\n",
5259+
" {data[\"machine_info\"][\"cpu\"][\"brand_raw\"]}\n",
52605260
"\"\"\"\n",
52615261
")\n",
52625262
"\n",

doc/notebooks/automatic_differentiation.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@
16141614
"y = -np.arange(len(times))\n",
16151615
"plt.barh(y, x)\n",
16161616
"for yi, k, v in zip(y, times, x):\n",
1617-
" plt.text(v, yi, f\"{v/xmin:.1f}x\")\n",
1617+
" plt.text(v, yi, f\"{v / xmin:.1f}x\")\n",
16181618
"plt.yticks(y, times.keys())\n",
16191619
"for loc in (\"top\", \"right\"):\n",
16201620
" plt.gca().spines[loc].set_visible(False)\n",
@@ -3886,7 +3886,7 @@
38863886
"# check fit quality\n",
38873887
"chi2 = m.fval\n",
38883888
"ndof = len(data_y) - 3\n",
3889-
"plt.title(f\"$\\\\chi^2 / n_\\\\mathrm{{dof}} = {chi2:.2f} / {ndof} = {chi2/ndof:.2f}$\");"
3889+
"plt.title(f\"$\\\\chi^2 / n_\\\\mathrm{{dof}} = {chi2:.2f} / {ndof} = {chi2 / ndof:.2f}$\");"
38903890
]
38913891
},
38923892
{

doc/notebooks/binned_vs_unbinned.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10286,7 +10286,7 @@
1028610286
"y = [v[2] for v in results.values()]\n",
1028710287
"plt.plot(x, y, \"o\")\n",
1028810288
"for xi, yi in zip(x[1:], y[1:]):\n",
10289-
" plt.text(xi, yi * 1.2, f\"{y[0]/yi:.0f}x\", ha=\"center\")\n",
10289+
" plt.text(xi, yi * 1.2, f\"{y[0] / yi:.0f}x\", ha=\"center\")\n",
1029010290
"plt.xticks(x, [f\"{x}\" for x in results.keys()])\n",
1029110291
"plt.ylabel(\"time / sec\")\n",
1029210292
"plt.semilogy();"

doc/notebooks/numba.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@
22322232
"source": [
22332233
"for signature, code in norm_pdf.inspect_asm().items():\n",
22342234
" print(\n",
2235-
" f\"signature: {signature}\\n{'-'*(len(str(signature)) + 11)}\\n{code[:1000]}\\n[...]\"\n",
2235+
" f\"signature: {signature}\\n{'-' * (len(str(signature)) + 11)}\\n{code[:1000]}\\n[...]\"\n",
22362236
" )"
22372237
]
22382238
},
@@ -2283,7 +2283,7 @@
22832283
"from collections import Counter\n",
22842284
"\n",
22852285
"for signature, code in norm_pdf.inspect_asm().items():\n",
2286-
" print(f\"signature: {signature}\\n{'-'*(len(str(signature)) + 11)}\")\n",
2286+
" print(f\"signature: {signature}\\n{'-' * (len(str(signature)) + 11)}\")\n",
22872287
" instructions = []\n",
22882288
" for line in code.split(\"\\n\"):\n",
22892289
" instr = line.strip().split(\"\\t\")[0]\n",

doc/notebooks/weighted_histograms.ipynb

+8-8
Original file line numberDiff line numberDiff line change
@@ -6927,13 +6927,13 @@
69276927
" lambd1,\n",
69286928
" bins=20,\n",
69296929
" alpha=0.5,\n",
6930-
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1)*100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.2f}\",\n",
6930+
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1) * 100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.2f}\",\n",
69316931
")\n",
69326932
"plt.hist(\n",
69336933
" lambd2,\n",
69346934
" bins=20,\n",
69356935
" alpha=0.5,\n",
6936-
" label=f\"BinnedNLL\\nvalid={np.mean(valid2)*100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.2f}\",\n",
6936+
" label=f\"BinnedNLL\\nvalid={np.mean(valid2) * 100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.2f}\",\n",
69376937
")\n",
69386938
"plt.legend()\n",
69396939
"\n",
@@ -9187,15 +9187,15 @@
91879187
"x = np.linspace(0, 100)\n",
91889188
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
91899189
"plt.title(\n",
9190-
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
9190+
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
91919191
")\n",
91929192
"\n",
91939193
"plt.sca(ax[1])\n",
91949194
"plt.hist(minval2, bins=50, density=True)\n",
91959195
"x = np.linspace(0, 100)\n",
91969196
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
91979197
"plt.title(\n",
9198-
" f\"BinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
9198+
" f\"BinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
91999199
");"
92009200
]
92019201
},
@@ -11951,13 +11951,13 @@
1195111951
" lambd1,\n",
1195211952
" bins=20,\n",
1195311953
" alpha=0.5,\n",
11954-
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1)*100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.3f}\",\n",
11954+
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1) * 100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.3f}\",\n",
1195511955
")\n",
1195611956
"plt.hist(\n",
1195711957
" lambd2,\n",
1195811958
" bins=20,\n",
1195911959
" alpha=0.5,\n",
11960-
" label=f\"BinnedNLL\\nvalid={np.mean(valid2)*100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.3f}\",\n",
11960+
" label=f\"BinnedNLL\\nvalid={np.mean(valid2) * 100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.3f}\",\n",
1196111961
")\n",
1196211962
"plt.legend()\n",
1196311963
"\n",
@@ -14031,15 +14031,15 @@
1403114031
"x = np.linspace(0, 100)\n",
1403214032
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
1403314033
"plt.title(\n",
14034-
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
14034+
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
1403514035
")\n",
1403614036
"\n",
1403714037
"plt.sca(ax[1])\n",
1403814038
"plt.hist(minval2, bins=50, density=True)\n",
1403914039
"x = np.linspace(0, 100)\n",
1404014040
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
1404114041
"plt.title(\n",
14042-
" f\"BinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
14042+
" f\"BinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
1404314043
");"
1404414044
]
1404514045
},

tests/test_cost.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,7 @@ def cdf(r, mx, my, mz, sx, sy, sz):
904904
with pytest.raises(
905905
ValueError,
906906
match=(
907-
'use_pdf="numerical" is not supported '
908-
"for multidimensional histograms"
907+
'use_pdf="numerical" is not supported for multidimensional histograms'
909908
),
910909
):
911910
BinnedNLL(n, xe, pdf, use_pdf=use_pdf)

0 commit comments

Comments
 (0)