bycycle-tools / bycycle

Cycle-by-cycle analysis of neural oscillations.

Home Page:https://bycycle-tools.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warning while using compute_features

ShuangquanFeng opened this issue · comments

c:\users\shuan\appdata\local\programs\python\python37-32\lib\site-packages\numpy\core\fromnumeric.py:2920: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
c:\users\shuan\appdata\local\programs\python\python37-32\lib\site-packages\numpy\core_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount

I encountered this warning sometimes while using compute_features. Is that normal?

Hi @ShuangquanFeng, I was able to reproduce this warning when running the unit test for bycycle.burst.detect_bursts_cycles and traced it back to the monotonicity calculation. The warning is caused by a short (length = 1) rise or decay period. In other words, when an adjacent peak/trough are separate by one sample.

This results is a nan value in the monotonicity column of the dataframe output from compute_features. I'll need to make sure the nan value is appropriate and then supress the warning.

This should be resolved as #67 has been merged in. @ShuangquanFeng please reopen if this warning persists when using master, thanks!