labstreaminglayer / pylsl

Python bindings (pylsl) for liblsl
MIT License
142 stars 58 forks source link

Add getter and setter for channel label/type/units to a StreamInfo #75

Closed mscheltienne closed 5 months ago

mscheltienne commented 10 months ago

From mne-lsl, slightly stepped down in term of error checking on the input, this PR adds the methods:

to a StreamInfo, to easily interact and add those basic informations to the XMLElement object.


Also ran black, isort, and codespell to improve and standardize the code-style. Those commits can be reverted if you prefer.

cboulay commented 5 months ago

I'm sorry I slept on this. It looks good, thank you! I personally prefer properties over getters and setters, but I think it works in this case the getter is better because the XML access is fairly slow and we don't want auto-inspection of these properties. Also using a method hints to the user that it will not return immediately, unlike a property where that might be expected.