Skip to content

Commit

Permalink
Debug, numba dose not understand how to extract dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Aug 8, 2024
1 parent 9eb4583 commit 9d19442
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions strax/processing/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ def _overload_endtime(x):
@numba.jit(nopython=True, nogil=True, cache=True)
def diff(data):
"""Return time differences between items in data."""
# we are sure that time is np.int64
if len(data) == 0:
return np.zeros(0, dtype=data.dtype["time"])
results = np.zeros(len(data) - 1, dtype=data.dtype["time"])
return np.zeros(0, dtype=np.int64)
results = np.zeros(len(data) - 1, dtype=np.int64)
max_endtime = strax.endtime(data[0])
for i, (time, endtime) in enumerate(zip(data["time"][1:], strax.endtime(data)[:-1])):
results[i] = time - max_endtime
Expand Down

0 comments on commit 9d19442

Please sign in to comment.