Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent fb2214b commit a8b92c0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@ def test_obj_5D_strcat_intcat_rectangular(use_weights):
storage=storage,
)
for i in range(25):
h.fill(f"testcat{i+1}", i + 1, *(x.T), weight=weights)
h.fill(f"testcat{i + 1}", i + 1, *(x.T), weight=weights)
h = h.compute()

control = bh.Histogram(*h.axes, storage=h.storage_type())
if use_weights:
for i in range(25):
control.fill(
f"testcat{i+1}", i + 1, *(x.compute().T), weight=weights.compute()
f"testcat{i + 1}", i + 1, *(x.compute().T), weight=weights.compute()
)
else:
for i in range(25):
control.fill(f"testcat{i+1}", i + 1, *(x.compute().T))
control.fill(f"testcat{i + 1}", i + 1, *(x.compute().T))

assert np.allclose(h.counts(), control.counts())
if use_weights:
Expand Down Expand Up @@ -183,19 +183,21 @@ def test_obj_5D_strcat_intcat_rectangular_dak(use_weights):
assert h.__dask_optimize__ == dak.lib.optimize.all_optimizations

for i in range(25):
h.fill(f"testcat{i+1}", i + 1, x, y, z, weight=weights[i] if weights else None)
h.fill(
f"testcat{i + 1}", i + 1, x, y, z, weight=weights[i] if weights else None
)
h = h.compute()

control = bh.Histogram(*h.axes, storage=h.storage_type())
x_c, y_c, z_c = x.compute(), y.compute(), z.compute()
if use_weights:
for i in range(25):
control.fill(
f"testcat{i+1}", i + 1, x_c, y_c, z_c, weight=weights[i].compute()
f"testcat{i + 1}", i + 1, x_c, y_c, z_c, weight=weights[i].compute()
)
else:
for i in range(25):
control.fill(f"testcat{i+1}", i + 1, x_c, y_c, z_c)
control.fill(f"testcat{i + 1}", i + 1, x_c, y_c, z_c)

assert np.allclose(h.counts(), control.counts())
if use_weights:
Expand Down

0 comments on commit a8b92c0

Please sign in to comment.