Skip to content

Commit bceae0e

Browse files
style: pre-commit fixes
1 parent 49f6bc6 commit bceae0e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/boost_histogram/_internal/hist.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,13 @@ def __init__(
233233
raise TypeError("Unsupported storage")
234234

235235
@classmethod
236-
def _clone(cls: Type[H], _hist: "Histogram | CppHistogram", *, other: "Histogram" = None, memo: Any = NOTHING) -> H:
236+
def _clone(
237+
cls: Type[H],
238+
_hist: "Histogram | CppHistogram",
239+
*,
240+
other: "Histogram" = None,
241+
memo: Any = NOTHING,
242+
) -> H:
237243
"""
238244
Clone a histogram (possibly of a different base). Does not trigger __init__.
239245
This will copy data from `other=` if non-None, otherwise metadata gets copied from the input.
@@ -269,7 +275,6 @@ def _new_hist(self: H, _hist: CppHistogram, memo: Any = NOTHING) -> H:
269275
"""
270276
return self.__class__._clone(_hist, other=self, memo=memo)
271277

272-
273278
def _from_histogram_cpp(self, other: CppHistogram) -> None:
274279
"""
275280
Import a Cpp histogram.
@@ -279,7 +284,6 @@ def _from_histogram_cpp(self, other: CppHistogram) -> None:
279284
self.metadata = None
280285
self.axes = self._generate_axes_()
281286

282-
283287
def _from_histogram_object(self, other: "Histogram") -> None:
284288
"""
285289
Convert self into a new histogram object based on another, possibly

tests/test_subclassing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def test_copy():
3838
class MyHist(bh.Histogram):
3939
def __init__(self, var, bins, weight, **kwargs):
4040
super().__init__(
41-
bh.axis.Regular(*bins),
42-
storage=bh.storage.Weight(),
43-
**kwargs
41+
bh.axis.Regular(*bins), storage=bh.storage.Weight(), **kwargs
4442
)
4543

4644
self.fill(var, weight=weight)

0 commit comments

Comments
 (0)