Skip to content

Commit

Permalink
Fix numpy2 crash in mpd_event_generator
Browse files Browse the repository at this point in the history
It was crashing when total_length_b > 2**32
  • Loading branch information
mjkramer committed Jan 22, 2025
1 parent 112e110 commit aa424a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/proto_nd_flow/reco/light/mpd_event_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def __init__(self, **params):
_, self.nbytes_runinfo, self.runinfo =adc64format.mpd_parse_run_start(self.input_file.stream)
# use the first file for the event reference
_, self.chunk_size, test_event = adc64format.mpd_parse_chunk(self.input_file.stream)
self.chunk_size = np.uint64(self.chunk_size) # prevent overflow w/ large files and numpy2
if any(dev_data is None for dev_data in test_event['data']):
print("First event corrupted, check second event")
_, self.chunk_size, test_event = adc64format.mpd_parse_chunk(self.input_file.stream)
Expand Down

0 comments on commit aa424a4

Please sign in to comment.