Skip to content

Commit

Permalink
add reproducer as test
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray committed Jan 29, 2025
1 parent 71cf50f commit faf0a9a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/samples/small_lumi.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Data tag : 24v2 , Norm tag: None
#run:fill,ls,time,beamstatus,E(GeV),delivered(/pb),recorded(/pb),avgpu,source
370790:9073,54:54,07/16/23 22:51:10,STABLE BEAMS,6800,0.265372231,0.005674056,33.0,AVG
368229:8853,74:74,05/31/23 00:23:51,STABLE BEAMS,6800,0.106034314,0.101855712,27.4,AVG
19 changes: 19 additions & 0 deletions tests/test_lumi_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,22 @@ def test_lumilist_client_fromfile():
(result,) = dask.compute(lumilist.array)

assert result.to_list() == [[1, 13889]]


def test_1259_avoid_pickle_numba_dict():

runs_eager = ak.Array([368229, 368229, 368229, 368229])
runs = dak.from_awkward(runs_eager, 2)
lumis_eager = ak.Array([74, 74, 74, 74])
lumis = dak.from_awkward(lumis_eager, 2)

def count_lumi(runs, lumis):
total_lumi = 0
my_lumilist = LumiList(runs, lumis)
my_lumidata = LumiData("tests/samples/small_lumi.csv")
total_lumi += my_lumidata.get_lumi(my_lumilist)
return total_lumi

with Client() as _:
output = count_lumi(runs, lumis)
dask.compute(output)[0]

0 comments on commit faf0a9a

Please sign in to comment.