diff --git a/src/hist/__init__.py b/src/hist/__init__.py index bbe9a66f..457f307c 100644 --- a/src/hist/__init__.py +++ b/src/hist/__init__.py @@ -25,14 +25,15 @@ from .version import version as __version__ __all__ = ( - "__version__", - "Hist", "BaseHist", + "Hist", "NamedHist", "Stack", + "__version__", "accumulators", "axis", "loc", + "new", "numpy", "overflow", "rebin", @@ -40,7 +41,6 @@ "sum", "tag", "underflow", - "new", ) diff --git a/src/hist/_compat/typing.py b/src/hist/_compat/typing.py index 5b1bc54b..e92533ec 100644 --- a/src/hist/_compat/typing.py +++ b/src/hist/_compat/typing.py @@ -16,7 +16,7 @@ Ufunc = Any -__all__ = ["Ufunc", "ArrayLike", "Self"] +__all__ = ["ArrayLike", "Self", "Ufunc"] def __dir__() -> list[str]: diff --git a/src/hist/accumulators.py b/src/hist/accumulators.py index d3b99201..13f95e5e 100644 --- a/src/hist/accumulators.py +++ b/src/hist/accumulators.py @@ -2,4 +2,4 @@ from boost_histogram.accumulators import Mean, Sum, WeightedMean, WeightedSum -__all__ = ("Sum", "Mean", "WeightedSum", "WeightedMean") +__all__ = ("Mean", "Sum", "WeightedMean", "WeightedSum") diff --git a/src/hist/axestuple.py b/src/hist/axestuple.py index 0c5275e0..cecfe3fa 100644 --- a/src/hist/axestuple.py +++ b/src/hist/axestuple.py @@ -8,7 +8,7 @@ from ._compat.builtins import zip -__all__ = ("NamedAxesTuple", "AxesTuple", "ArrayTuple") +__all__ = ("ArrayTuple", "AxesTuple", "NamedAxesTuple") def __dir__() -> tuple[str, ...]: diff --git a/src/hist/axis/__init__.py b/src/hist/axis/__init__.py index 8d58c598..2514a24d 100644 --- a/src/hist/axis/__init__.py +++ b/src/hist/axis/__init__.py @@ -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", ) diff --git a/src/hist/axis/transform.py b/src/hist/axis/transform.py index fa911c59..a8c4ed54 100644 --- a/src/hist/axis/transform.py +++ b/src/hist/axis/transform.py @@ -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") diff --git a/src/hist/intervals.py b/src/hist/intervals.py index e5ec2548..50c7d27f 100644 --- a/src/hist/intervals.py +++ b/src/hist/intervals.py @@ -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, ...]: diff --git a/src/hist/quick_construct.py b/src/hist/quick_construct.py index 95861caf..2bf8e2f6 100644 --- a/src/hist/quick_construct.py +++ b/src/hist/quick_construct.py @@ -19,8 +19,8 @@ class QuickConstruct: """ __slots__ = ( - "hist_class", "axes", + "hist_class", ) def __repr__(self) -> str: diff --git a/src/hist/storage.py b/src/hist/storage.py index 045e2bd2..0eedb1e8 100644 --- a/src/hist/storage.py +++ b/src/hist/storage.py @@ -12,12 +12,12 @@ ) __all__ = ( - "Storage", - "Int64", - "Double", "AtomicInt64", + "Double", + "Int64", + "Mean", + "Storage", "Unlimited", "Weight", - "Mean", "WeightedMean", ) diff --git a/src/hist/tag.py b/src/hist/tag.py index a6c6bd81..ff125d27 100644 --- a/src/hist/tag.py +++ b/src/hist/tag.py @@ -11,4 +11,4 @@ underflow, ) -__all__ = ("Slicer", "Locator", "at", "loc", "overflow", "underflow", "rebin", "sum") +__all__ = ("Locator", "Slicer", "at", "loc", "overflow", "rebin", "sum", "underflow") diff --git a/tests/test_general.py b/tests/test_general.py index bcd86229..4be9eaf2 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/tests/test_named.py b/tests/test_named.py index 81385802..25760448 100644 --- a/tests/test_named.py +++ b/tests/test_named.py @@ -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}] @@ -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}] @@ -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}] @@ -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}]