Skip to content

Commit 4b1cafa

Browse files
committed
chore: update ruff/precommit
1 parent 2584d47 commit 4b1cafa

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

Diff for: .pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ repos:
1818

1919
- repo: https://github.com/astral-sh/ruff-pre-commit
2020
# Ruff version.
21-
rev: v0.7.4
21+
rev: v0.9.3
2222
hooks:
2323
# Run the linter.
2424
- id: ruff
25-
args: [ --fix, --show-fixes ]
25+
args: [ --fix, --show-fixes, --ignore, RUF022 ]
2626
# Run the formatter.
2727
- id: ruff-format
2828

2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: v1.13.0
30+
rev: v1.14.1
3131
hooks:
3232
- id: mypy
3333
files: src
3434
additional_dependencies: ["uhi", "numpy", "matplotlib>3.4"]
3535
args: [--show-error-codes]
3636

3737
- repo: https://github.com/codespell-project/codespell
38-
rev: "v2.3.0"
38+
rev: "v2.4.0"
3939
hooks:
4040
- id: codespell
41-
args: ["-L", "hist,heros"]
41+
args: ["-L", "hist,heros,hep", "--uri-ignore-words-list", "*"]
4242
exclude: "^examples/Examples.ipynb$"
4343

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

Diff for: src/mplhep/_deprecate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ class deprecated_dict(dict):
7171
"""
7272

7373
__slots__ = (
74-
"message",
7574
"_already_warned",
7675
"_warn_once",
7776
"_warning",
77+
"message",
7878
) # no __dict__ - would be redundant
7979

8080
def __init__(

Diff for: src/mplhep/alice.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Log styles
1212
from .styles import alice as style
1313

14-
__all__ = ("style", "lumitext")
14+
__all__ = ("lumitext", "style")
1515

1616

1717
@docstring.copy(label_base.exp_text)

Diff for: src/mplhep/atlas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Log styles
1414
from .styles import atlas as style
1515

16-
__all__ = ("style", "lumitext")
16+
__all__ = ("lumitext", "style")
1717

1818

1919
@docstring.copy(label_base.exp_text)

Diff for: src/mplhep/cms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# import mplhep._deprecate as deprecate
1515

16-
__all__ = ("style", "lumitext")
16+
__all__ = ("lumitext", "style")
1717

1818

1919
@docstring.copy(label_base.exp_text)

Diff for: src/mplhep/error_estimation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def poisson_interval(sumw, sumw2, coverage=_coverage1sd):
2828
substituted to scale the nominal upper bound.
2929
If all bins zero, a warning is generated and interval is set to ``sumw``.
3030
# Taken from Coffea
31-
"""
31+
""" # codespell:ignore
3232
scale = np.empty_like(sumw)
3333
scale[sumw != 0] = sumw2[sumw != 0] / sumw[sumw != 0]
3434
if np.sum(sumw == 0) > 0:

Diff for: src/mplhep/lhcb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from .label import lumitext
2929
from .styles import lhcb as style
3030

31-
__all__ = ("style", "lumitext", "label", "text")
31+
__all__ = ("label", "lumitext", "style", "text")
3232

3333

3434
@docstring.copy(label_base.exp_text)

Diff for: src/mplhep/plot.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -227,21 +227,21 @@ def iterable_not_string(arg):
227227
_chunked_kwargs: list[dict[str, Any]] = []
228228
for _ in range(len(plottables)):
229229
_chunked_kwargs.append({})
230-
for kwarg in kwargs:
230+
for kwarg, kwarg_content in kwargs.items():
231231
# Check if iterable
232232
if iterable_not_string(kwargs[kwarg]):
233233
# Check if tuple of floats or ints (can be used for colors)
234234
if isinstance(kwargs[kwarg], tuple) and all(
235-
isinstance(x, (int, float)) for x in kwargs[kwarg]
235+
isinstance(x, (int, float)) for x in kwarg_content
236236
):
237237
for i in range(len(_chunked_kwargs)):
238-
_chunked_kwargs[i][kwarg] = kwargs[kwarg]
238+
_chunked_kwargs[i][kwarg] = kwarg_content
239239
else:
240240
for i, kw in enumerate(kwargs[kwarg]):
241241
_chunked_kwargs[i][kwarg] = kw
242242
else:
243243
for i in range(len(_chunked_kwargs)):
244-
_chunked_kwargs[i][kwarg] = kwargs[kwarg]
244+
_chunked_kwargs[i][kwarg] = kwarg_content
245245

246246
# Sorting
247247
if sort is not None:

Diff for: src/mplhep/styles/__init__.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@
1616
__all__ = (
1717
"ALICE",
1818
"ATLAS",
19-
"ATLASAlt",
20-
"ATLASTex",
2119
"CMS",
20+
"PLOTHIST",
2221
"ROOT",
22+
"ATLASAlt",
23+
"ATLASTex",
2324
"CMSTex",
24-
"ROOTTex",
2525
"LHCb",
2626
"LHCb1",
2727
"LHCb2",
2828
"LHCbTex",
2929
"LHCbTex1",
3030
"LHCbTex2",
31-
"PLOTHIST",
32-
"set_style",
33-
"use",
31+
"ROOTTex",
32+
"fabiola",
3433
"fira",
3534
"firamath",
36-
"fabiola",
35+
"set_style",
36+
"use",
3737
)
3838

3939

0 commit comments

Comments
 (0)