Skip to content

Commit

Permalink
Merge pull request #162 from dask-contrib/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
martindurant authored Jan 14, 2025
2 parents 45fcd40 + a8b92c0 commit 284edc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
- id: ruff-format
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 284edc5

Please sign in to comment.