Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #1066

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ repos:

# Ruff linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.8.3'
rev: 'v0.9.4'
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format

# C++ formatting
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.5
rev: v19.1.7
hooks:
- id: clang-format
files: "src"
Expand All @@ -58,7 +58,7 @@ repos:

# Python type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.13.0'
rev: 'v1.14.1'
hooks:
- id: mypy
additional_dependencies: [numpy]
Expand All @@ -73,11 +73,11 @@ repos:
args: [--drop-empty-cells]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: 0.31.1
hooks:
- id: check-github-workflows

- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2024.11.25
rev: 2025.02.03
hooks:
- id: validate-pyproject
4 changes: 2 additions & 2 deletions bench/plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5255,8 +5255,8 @@
"print(\n",
" f\"\"\"\\\n",
"benchmark results\n",
" {data['datetime']}\n",
" {data['machine_info']['cpu']['brand_raw']}\n",
" {data[\"datetime\"]}\n",
" {data[\"machine_info\"][\"cpu\"][\"brand_raw\"]}\n",
"\"\"\"\n",
")\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions doc/notebooks/automatic_differentiation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@
"y = -np.arange(len(times))\n",
"plt.barh(y, x)\n",
"for yi, k, v in zip(y, times, x):\n",
" plt.text(v, yi, f\"{v/xmin:.1f}x\")\n",
" plt.text(v, yi, f\"{v / xmin:.1f}x\")\n",
"plt.yticks(y, times.keys())\n",
"for loc in (\"top\", \"right\"):\n",
" plt.gca().spines[loc].set_visible(False)\n",
Expand Down Expand Up @@ -3886,7 +3886,7 @@
"# check fit quality\n",
"chi2 = m.fval\n",
"ndof = len(data_y) - 3\n",
"plt.title(f\"$\\\\chi^2 / n_\\\\mathrm{{dof}} = {chi2:.2f} / {ndof} = {chi2/ndof:.2f}$\");"
"plt.title(f\"$\\\\chi^2 / n_\\\\mathrm{{dof}} = {chi2:.2f} / {ndof} = {chi2 / ndof:.2f}$\");"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/notebooks/binned_vs_unbinned.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10286,7 +10286,7 @@
"y = [v[2] for v in results.values()]\n",
"plt.plot(x, y, \"o\")\n",
"for xi, yi in zip(x[1:], y[1:]):\n",
" plt.text(xi, yi * 1.2, f\"{y[0]/yi:.0f}x\", ha=\"center\")\n",
" plt.text(xi, yi * 1.2, f\"{y[0] / yi:.0f}x\", ha=\"center\")\n",
"plt.xticks(x, [f\"{x}\" for x in results.keys()])\n",
"plt.ylabel(\"time / sec\")\n",
"plt.semilogy();"
Expand Down
4 changes: 2 additions & 2 deletions doc/notebooks/numba.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@
"source": [
"for signature, code in norm_pdf.inspect_asm().items():\n",
" print(\n",
" f\"signature: {signature}\\n{'-'*(len(str(signature)) + 11)}\\n{code[:1000]}\\n[...]\"\n",
" f\"signature: {signature}\\n{'-' * (len(str(signature)) + 11)}\\n{code[:1000]}\\n[...]\"\n",
" )"
]
},
Expand Down Expand Up @@ -2283,7 +2283,7 @@
"from collections import Counter\n",
"\n",
"for signature, code in norm_pdf.inspect_asm().items():\n",
" print(f\"signature: {signature}\\n{'-'*(len(str(signature)) + 11)}\")\n",
" print(f\"signature: {signature}\\n{'-' * (len(str(signature)) + 11)}\")\n",
" instructions = []\n",
" for line in code.split(\"\\n\"):\n",
" instr = line.strip().split(\"\\t\")[0]\n",
Expand Down
16 changes: 8 additions & 8 deletions doc/notebooks/weighted_histograms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6927,13 +6927,13 @@
" lambd1,\n",
" bins=20,\n",
" alpha=0.5,\n",
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1)*100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.2f}\",\n",
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1) * 100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.2f}\",\n",
")\n",
"plt.hist(\n",
" lambd2,\n",
" bins=20,\n",
" alpha=0.5,\n",
" label=f\"BinnedNLL\\nvalid={np.mean(valid2)*100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.2f}\",\n",
" label=f\"BinnedNLL\\nvalid={np.mean(valid2) * 100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.2f}\",\n",
")\n",
"plt.legend()\n",
"\n",
Expand Down Expand Up @@ -9187,15 +9187,15 @@
"x = np.linspace(0, 100)\n",
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
"plt.title(\n",
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
")\n",
"\n",
"plt.sca(ax[1])\n",
"plt.hist(minval2, bins=50, density=True)\n",
"x = np.linspace(0, 100)\n",
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
"plt.title(\n",
" f\"BinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
" f\"BinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
");"
]
},
Expand Down Expand Up @@ -11951,13 +11951,13 @@
" lambd1,\n",
" bins=20,\n",
" alpha=0.5,\n",
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1)*100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.3f}\",\n",
" label=f\"ExtendedBinnedNLL\\nvalid={np.mean(valid1) * 100:.0f}%\\nmean = {np.mean(lambd1):.2f}\\nstd.dev. = {np.std(lambd1):.3f}\",\n",
")\n",
"plt.hist(\n",
" lambd2,\n",
" bins=20,\n",
" alpha=0.5,\n",
" label=f\"BinnedNLL\\nvalid={np.mean(valid2)*100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.3f}\",\n",
" label=f\"BinnedNLL\\nvalid={np.mean(valid2) * 100:.0f}%\\nmean = {np.mean(lambd2):.2f}\\nstd.dev. = {np.std(lambd2):.3f}\",\n",
")\n",
"plt.legend()\n",
"\n",
Expand Down Expand Up @@ -14031,15 +14031,15 @@
"x = np.linspace(0, 100)\n",
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
"plt.title(\n",
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
" f\"ExtendedBinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval1):.2f} median = {np.median(minval1):.2f}\"\n",
")\n",
"\n",
"plt.sca(ax[1])\n",
"plt.hist(minval2, bins=50, density=True)\n",
"x = np.linspace(0, 100)\n",
"plt.plot(x, chi2(bins - 2).pdf(x))\n",
"plt.title(\n",
" f\"BinnedNLL minimum value\\nndf = {bins-2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
" f\"BinnedNLL minimum value\\nndf = {bins - 2} mean = {np.mean(minval2):.2f} median = {np.median(minval2):.2f}\"\n",
");"
]
},
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,7 @@ def cdf(r, mx, my, mz, sx, sy, sz):
with pytest.raises(
ValueError,
match=(
'use_pdf="numerical" is not supported '
"for multidimensional histograms"
'use_pdf="numerical" is not supported for multidimensional histograms'
),
):
BinnedNLL(n, xe, pdf, use_pdf=use_pdf)
Expand Down