Skip to content

Commit 0635d90

Browse files
committed
fix: cleanup tests and sets
1 parent fb4fa54 commit 0635d90

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/boost_histogram/_internal/hist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,10 @@ def _compute_inplace_op(
364364
len(other.shape), self.ndim
365365
)
366366
)
367-
elif all(a in [b, 1] for a, b in zip(other.shape, self.shape)):
367+
elif all(a in {b, 1} for a, b in zip(other.shape, self.shape)):
368368
view = self.view(flow=False)
369369
getattr(view, name)(other)
370-
elif all(a in [b, 1] for a, b in zip(other.shape, self.axes.extent)):
370+
elif all(a in {b, 1} for a, b in zip(other.shape, self.axes.extent)):
371371
view = self.view(flow=True)
372372
getattr(view, name)(other)
373373
else:

tests/test_accumulators.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ def test_sum_mean(list1, list2):
115115

116116
ab = a + b
117117
assert ab.value == approx(c.value)
118-
assert ab.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
118+
assert ab.variance == approx(c.variance, nan_ok=True, abs=1e-7, rel=1e-3)
119119
assert ab.count == approx(c.count)
120120

121121
a += b
122122
assert a.value == approx(c.value)
123-
assert a.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
123+
assert a.variance == approx(c.variance, nan_ok=True, abs=1e-7, rel=1e-3)
124124
assert a.count == approx(c.count)
125125

126126

@@ -129,7 +129,7 @@ def test_sum_mean(list1, list2):
129129
st.lists(float_st, min_size=n, max_size=n),
130130
st.lists(
131131
st.floats(
132-
allow_nan=False, allow_infinity=False, min_value=1e-4, max_value=1e5
132+
allow_nan=False, allow_infinity=False, min_value=1e-2, max_value=1e5
133133
),
134134
min_size=n,
135135
max_size=n,
@@ -151,12 +151,12 @@ def test_sum_weighed_mean(pair1, pair2):
151151

152152
ab = a + b
153153
assert ab.value == approx(c.value)
154-
assert ab.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
154+
assert ab.variance == approx(c.variance, nan_ok=True, abs=1e-7, rel=1e-3)
155155
assert ab.sum_of_weights == approx(c.sum_of_weights)
156156
assert ab.sum_of_weights_squared == approx(c.sum_of_weights_squared)
157157

158158
a += b
159159
assert a.value == approx(c.value)
160-
assert a.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
160+
assert a.variance == approx(c.variance, nan_ok=True, abs=1e-7, rel=1e-3)
161161
assert a.sum_of_weights == approx(c.sum_of_weights)
162162
assert a.sum_of_weights_squared == approx(c.sum_of_weights_squared)

0 commit comments

Comments
 (0)