raphaelvallat / yasa

YASA (Yet Another Spindle Algorithm): a Python package to analyze polysomnographic sleep recordings.
https://raphaelvallat.com/yasa/
BSD 3-Clause "New" or "Revised" License
428 stars 115 forks source link

Yasa sleepstaging in a process #99

Closed matpadalino87 closed 2 years ago

matpadalino87 commented 2 years ago

Hi !!! I'm using your module to predict by means of sls = yasa.sleepstaging() the sleep stage of a signal in a sub process ( windows - Python 3.8.13 - Spyder AnaConda environment). The process has inside a while loop to which I send 3 signal (eeg,eog,emg) every 30s steps and in this process I'd like to create a raw mne file, a sls model and then to predict the epochs of the sent signals ( the signals obviously are long more than 5 min ). After the creation of the file mne raw (notch filtered) the execution of the process is interrupted (other processes goes well ) but not occur an error and so I try to evidence what happen in the process with the print function ( flush = True) of the outcome of prediction but nothing is printed.

Can you help me? Does exist some limitation of using sleep staging in a sub process (in threading goes well)?

best regards

Matteo Padalino

raphaelvallat commented 2 years ago

Hi @matpadalino87,

I actually have no idea, I've never ran the automatic sleep staging in a sub process. Can you copy-paste here the original code (simplified as much as possible) and the error?

Thanks, Raphael

matpadalino87 commented 2 years ago

Dear @raphaelvallat, I solved the issue and at moment the module goes well!!! It was a problem of architecture of the code, in fact there was a problem on the buffer not a Yasa's compatibility with sub-process. Thanks for your availability!!!

Have nice day, best regards

Matteo