Skip to content

Commit

Permalink
Merge pull request #1001 from CoffeaTeam/stricter-test-dask-opt-fix
Browse files Browse the repository at this point in the history
fix: test delta-r + metric return with and without optimization
  • Loading branch information
lgray committed Jan 19, 2024
2 parents fcd7087 + 36d4b07 commit 7d384a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"awkward>=2.5.2",
"uproot>=5.2.1",
"dask[array]>=2023.4.0",
"dask-awkward>=2024.1.1",
"dask-awkward>=2024.1.2",
"dask-histogram>=2023.10.0",
"correctionlib>=2.3.3",
"pyarrow>=6.0.0",
Expand Down
7 changes: 3 additions & 4 deletions tests/test_nanoevents_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,14 @@ def test_inherited_method_transpose(lcoord, threecoord, twocoord):
assert record_arrays_equal(b - c, -(c - b))


def test_dask_metric_table_and_nearest():
@pytest.mark.parametrize("optimization_enabled", [True, False])
def test_dask_metric_table_and_nearest(optimization_enabled):
import dask
from dask_awkward.lib.testutils import assert_eq

from coffea.nanoevents import NanoEventsFactory

with dask.config.set({"awkward.optimization.enabled": False}):
with dask.config.set({"awkward.optimization.enabled": optimization_enabled}):
eagerevents = NanoEventsFactory.from_root(
{"tests/samples/nano_dy.root": "Events"},
delayed=False,
Expand Down Expand Up @@ -572,7 +573,6 @@ def test_dask_metric_table_and_nearest():
out_dask, metric_dask = dask.compute(
*daskevents.Electron.nearest(daskevents.TrigObj, return_metric=True)
)
# NB: make this more strict when we fix optimization and parameter dtype issues fixed!
assert_eq(out_eager, out_dask)
assert_eq(metric_eager, metric_dask)

Expand All @@ -584,6 +584,5 @@ def test_dask_metric_table_and_nearest():
daskevents.TrigObj, return_metric=True, threshold=0.4
)
)
# NB: make this more strict when we fix optimization and parameter dtype issues fixed!
assert_eq(out_eager_thresh, out_dask_thresh)
assert_eq(metric_eager_thresh, metric_dask_thresh)

0 comments on commit 7d384a6

Please sign in to comment.