Skip to content

Commit

Permalink
Use numba.typed.List to fix a deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Feb 3, 2024
1 parent 8240715 commit 2ca2e8b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fuse/plugins/pmt_and_daq/pmt_response_and_daq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import straxen
import strax
from numba import njit
from numba.typed import List
import numpy as np
import logging

Expand Down Expand Up @@ -233,6 +234,10 @@ def compute(self, propagated_photons, pulse_windows, start, end):

photons, unique_photon_pulse_ids = split_photons(propagated_photons)

# convert photons to numba list for njit
_photons = List()
[_photons.append(x) for x in photons]

if n_chunks>1:
for pulse_group in pulse_window_chunks[:-1]:

Expand All @@ -242,7 +247,7 @@ def compute(self, propagated_photons, pulse_windows, start, end):

buffer_level = build_waveform(
pulse_group,
photons,
_photons,
unique_photon_pulse_ids,
waveform_buffer,
self.dt,
Expand Down Expand Up @@ -273,7 +278,7 @@ def compute(self, propagated_photons, pulse_windows, start, end):

buffer_level = build_waveform(
pulse_window_chunks[-1],
photons,
_photons,
unique_photon_pulse_ids,
waveform_buffer,
self.dt,
Expand Down

0 comments on commit 2ca2e8b

Please sign in to comment.