Checking whether signal is empty?
In extractGsrFeatures in gsr.py there is a check:
if np.any(signal):
tonic = peakutils.baseline(signal, 10)
else:
tonic = signal
Here, signal
is an argument to the function.
I don't think this makes much sense.
An empty signal will not produce any features anyway, so I would never expect np.any(signal)
to be False
.
Instead, it might make sense to check np.any(peaks)
.
If this evaluates to False
, the calculation of the tonic component (i.e., component without any peaks) can indeed be reduced to simple assignment.