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

chore: update pre-commit hooks #593

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.8.1
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
6 changes: 3 additions & 3 deletions src/hist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@
from .version import version as __version__

__all__ = (
"__version__",
"Hist",
"BaseHist",
"Hist",
"NamedHist",
"Stack",
"__version__",
"accumulators",
"axis",
"loc",
"new",
"numpy",
"overflow",
"rebin",
"storage",
"sum",
"tag",
"underflow",
"new",
)


Expand Down
2 changes: 1 addition & 1 deletion src/hist/_compat/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Ufunc = Any


__all__ = ["Ufunc", "ArrayLike", "Self"]
__all__ = ["ArrayLike", "Self", "Ufunc"]


def __dir__() -> list[str]:
Expand Down
2 changes: 1 addition & 1 deletion src/hist/accumulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from boost_histogram.accumulators import Mean, Sum, WeightedMean, WeightedSum

__all__ = ("Sum", "Mean", "WeightedSum", "WeightedMean")
__all__ = ("Mean", "Sum", "WeightedMean", "WeightedSum")
2 changes: 1 addition & 1 deletion src/hist/axestuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from ._compat.builtins import zip

__all__ = ("NamedAxesTuple", "AxesTuple", "ArrayTuple")
__all__ = ("ArrayTuple", "AxesTuple", "NamedAxesTuple")


def __dir__() -> tuple[str, ...]:
Expand Down
14 changes: 7 additions & 7 deletions src/hist/axis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
from . import transform

__all__ = (
"AxisProtocol",
"ArrayTuple",
"AxesMixin",
"Regular",
"Variable",
"Integer",
"AxisProtocol",
"Boolean",
"IntCategory",
"Integer",
"NamedAxesTuple",
"Regular",
"StrCategory",
"Boolean",
"Variable",
"transform",
"NamedAxesTuple",
"ArrayTuple",
)


Expand Down
2 changes: 1 addition & 1 deletion src/hist/axis/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from boost_histogram.axis.transform import AxisTransform, Function, Pow, log, sqrt

__all__ = ("AxisTransform", "Pow", "Function", "sqrt", "log")
__all__ = ("AxisTransform", "Function", "Pow", "log", "sqrt")
2 changes: 1 addition & 1 deletion src/hist/intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
raise

__all__ = ("poisson_interval", "clopper_pearson_interval", "ratio_uncertainty")
__all__ = ("clopper_pearson_interval", "poisson_interval", "ratio_uncertainty")


def __dir__() -> tuple[str, ...]:
Expand Down
2 changes: 1 addition & 1 deletion src/hist/quick_construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class QuickConstruct:
"""

__slots__ = (
"hist_class",
"axes",
"hist_class",
)

def __repr__(self) -> str:
Expand Down
8 changes: 4 additions & 4 deletions src/hist/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
)

__all__ = (
"Storage",
"Int64",
"Double",
"AtomicInt64",
"Double",
"Int64",
"Mean",
"Storage",
"Unlimited",
"Weight",
"Mean",
"WeightedMean",
)
2 changes: 1 addition & 1 deletion src/hist/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
underflow,
)

__all__ = ("Slicer", "Locator", "at", "loc", "overflow", "underflow", "rebin", "sum")
__all__ = ("Locator", "Slicer", "at", "loc", "overflow", "rebin", "sum", "underflow")
8 changes: 4 additions & 4 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_general_fill_regular():
z_one_only = h[{2: bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert z_one_only[idx_x, idx_y] == 1
elif idx_x == 5 and idx_y == 4:
assert z_one_only[idx_x, idx_y] == 3
Expand Down Expand Up @@ -173,7 +173,7 @@ def test_general_fill_variable():
z_one_only = h[{2: bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert z_one_only[idx_x, idx_y] == 1
elif idx_x == 5 and idx_y == 4:
assert z_one_only[idx_x, idx_y] == 3
Expand All @@ -195,7 +195,7 @@ def test_general_fill_integer():
z_one_only = h[{2: bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert z_one_only[idx_x, idx_y] == 1
elif idx_x == 5 and idx_y == 4:
assert z_one_only[idx_x, idx_y] == 3
Expand Down Expand Up @@ -225,7 +225,7 @@ def test_general_fill_int_cat():
z_one_only = h[{2: bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert z_one_only[idx_x, idx_y] == 1
elif idx_x == 5 and idx_y == 4:
assert z_one_only[idx_x, idx_y] == 3
Expand Down
8 changes: 4 additions & 4 deletions tests/test_named.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_named_fill():
z_one_only = h[{"z": bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert (
z_one_only[idx_x, idx_y]
== z_one_only[{"x": idx_x, "y": idx_y}]
Expand Down Expand Up @@ -193,7 +193,7 @@ def test_named_fill():
z_one_only = h[{"z": bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert (
z_one_only[idx_x, idx_y]
== z_one_only[{"x": idx_x, "y": idx_y}]
Expand Down Expand Up @@ -226,7 +226,7 @@ def test_named_fill():
z_one_only = h[{"z": bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert (
z_one_only[idx_x, idx_y]
== z_one_only[{"x": idx_x, "y": idx_y}]
Expand Down Expand Up @@ -259,7 +259,7 @@ def test_named_fill():
z_one_only = h[{"z": bh.loc(1)}]
for idx_x in range(10):
for idx_y in range(10):
if idx_x == 3 and idx_y == 4 or idx_x == 4 and idx_y == 4:
if (idx_x == 3 and idx_y == 4) or (idx_x == 4 and idx_y == 4):
assert (
z_one_only[idx_x, idx_y]
== z_one_only[{"x": idx_x, "y": idx_y}]
Expand Down
Loading