Skip to content

Commit c68836b

Browse files
authored
fix: allow start=stop=0 for empty files in uproot.dask (#1540)
allow start=stop=0 in uproot.dask
1 parent 6da64a1 commit c68836b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/uproot/_dask.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def __call__(self, file_path_object_path_istep_nsteps_ischunk):
543543
start, stop = (istep_or_start * events_per_steps), min(
544544
(istep_or_start + 1) * events_per_steps, num_entries
545545
)
546-
elif (not 0 <= start < num_entries) or (not 0 <= stop <= num_entries):
546+
elif (not 0 <= start <= num_entries) or (not 0 <= stop <= num_entries):
547547
raise ValueError(
548548
f"""explicit entry start ({start}) or stop ({stop}) from uproot.dask 'files' argument is out of bounds for file
549549
@@ -703,7 +703,7 @@ def real_filter_branch(branch):
703703
chunk_args.append((i, start, stop))
704704
else:
705705
for start, stop in explicit_chunks[i]:
706-
if (not 0 <= start < entry_stop) or (not 0 <= stop <= entry_stop):
706+
if (not 0 <= start <= entry_stop) or (not 0 <= stop <= entry_stop):
707707
raise ValueError(
708708
f"""explicit entry start ({start}) or stop ({stop}) from uproot.dask 'files' argument is out of bounds for file
709709
@@ -1394,7 +1394,7 @@ def _call_impl(
13941394
num_entries = ttree.num_entries
13951395
if is_chunk:
13961396
start, stop = i_step_or_start, n_steps_or_stop
1397-
if (not 0 <= start < num_entries) or (not 0 <= stop <= num_entries):
1397+
if (not 0 <= start <= num_entries) or (not 0 <= stop <= num_entries):
13981398
raise ValueError(
13991399
f"""explicit entry start ({start}) or stop ({stop}) from uproot.dask 'files' argument is out of bounds for file
14001400
@@ -1685,7 +1685,7 @@ def real_filter_branch(branch):
16851685
partition_args.append((i, start, stop))
16861686
else:
16871687
for start, stop in explicit_chunks[i]:
1688-
if (not 0 <= start < entry_stop) or (not 0 <= stop <= entry_stop):
1688+
if (not 0 <= start <= entry_stop) or (not 0 <= stop <= entry_stop):
16891689
raise ValueError(
16901690
f"""explicit entry start ({start}) or stop ({stop}) from uproot.dask 'files' argument is out of bounds for file
16911691

0 commit comments

Comments
 (0)