neuromodulation / py_neuromodulation

Real-time analysis of intracranial neurophysiology recordings.
https://neuromodulation.github.io/py_neuromodulation/
MIT License
41 stars 9 forks source link

Add NMPreprocessor protocol and Preprocessors class #317

Closed toni-neurosc closed 2 months ago

toni-neurosc commented 2 months ago

This change gives Preprocessor classes the same treatment that Feature classes were being given in my other PR #307 , that is:

I also added some utilities that can be shared by nm_features too:

This was quite a difficult modification due to the differences in the arguments taken by the different Preprocessor classes, so it requires quite a bit of "meta-programming" to get it working without errors. But I took some valuable lessons regarding typing and also regarding the different "settings" needs of the different preprocessors.

toni-neurosc commented 2 months ago

Awesome, merging #305 here did indeed fix the testing errors. Merging this into main then.