py_neuromodulation icon indicating copy to clipboard operation
py_neuromodulation copied to clipboard

Refactor testing module

Open timonmerk opened this issue 3 months ago • 2 comments

Many thanks for your first contribution @SamedVossberg!

Currently branch #323 was merged into main. Due to many changes in that branch, some points should be still adressed for the lsl stream generation and testing.

In general I would want to refactor the nm_generator.py module s.t. it's split into three different modules: 1. MNE-LSL Player, 2. MNE-LSL Stream and 3. Offline generator.

Tests:

  • Test MNE-LSL Stream generation after player was initiated. Check:
  1. if stream is available
  2. if stream sfreq, channel names and types match the ones specified
  3. if the pulled data is equivallent to the one retrieved from the example data

Adapt then the example notebook. Additional, but for now optional, add plain Open-BCI ipynb example.

I will implement some of those changes in a new branch and notify you about remaining points.

Other points:

  • Currently the pynput is located in generator module. I would pull this functionality out from the nm_*.py files. I think lateron it would make sense to create an nm_application file where the keyboard "interrput" is handled.
  • In LSLStream, the example_stream get's currently always set to "example_stream", if the stream_name parameter is None, then check which streams are available and intialize the first one.
  • The plot_7_lsl_example.ipynb can in fact be a .py file, sphinx-gallery can render those into ipynb. Markdown cells are rendered out from comments.

timonmerk avatar May 08 '24 10:05 timonmerk