Do single `ShmArray.array` read on zero-time filtering
parent
2c6ae5d994
commit
08e8990fe3
|
@ -209,8 +209,13 @@ def detect_null_time_gap(
|
|||
NOTE: for now presumes only ONE gap XD
|
||||
|
||||
'''
|
||||
zero_pred: np.ndarray = shm.array['time'] == 0
|
||||
zero_t: np.ndarray = shm.array[zero_pred]
|
||||
# ensure we read buffer state only once so that ShmArray rt
|
||||
# circular-buffer updates don't cause a indexing/size mismatch.
|
||||
array: np.ndarray = shm.array
|
||||
|
||||
zero_pred: np.ndarray = array['time'] == 0
|
||||
zero_t: np.ndarray = array[zero_pred]
|
||||
|
||||
if zero_t.size:
|
||||
istart, iend = zero_t['index'][[0, -1]]
|
||||
start, end = shm._array['time'][
|
||||
|
|
Loading…
Reference in New Issue