makebrainwaves / BrainWaves

An easy-to-use platform for EEG experimentation in the classroom
MIT License
60 stars 26 forks source link

[VWIP] Python overhaul #75

Closed teonbrooks closed 4 years ago

teonbrooks commented 5 years ago

This is the initial attempts to gut out the dependency on a local Python kernel and the communication between the app and kernel. Pyodide offers a full working kernel implemented in WebAssembly. This PR attempts to identify pain points, necessary patches for upstream dependencies, and testing ground for change.

teonbrooks commented 5 years ago

you can follow along with the wishlist of things for brainwaves x pyodide here.

jdpigeon commented 5 years ago

Does this PR deprecate #74?

teonbrooks commented 5 years ago

yes. closes #74.

74 was done to show pyodide working without breaking anything.

jdpigeon commented 5 years ago

I think we'll make this PR the place for a complete Jupyter replacement. Hopefully can find some time to get to the matplotlib integration step soon.

teonbrooks commented 5 years ago

cool. getting a matplotlib plot to work should be straightforward. there is just a little bit we would need to tweak but I have it documented. getting the epochs viewer will be a bit more work. i think it would be a matter of getting some event listeners in place. happy to hack on this with you, should be around town for a bit

teonbrooks commented 5 years ago

@jdpigeon should we make a to-do list of things we have left to address here?

teonbrooks commented 5 years ago

At this point we have been able to handle the follow:

We have the following left:

Some things to keep in mind:

teonbrooks commented 4 years ago

closes https://github.com/makebrainwaves/BrainWaves/issues/43

teonbrooks commented 4 years ago

hey @jdpigeon, could you rebase this branch to the latest master and I will then cherry-pick some of the commits from my local branch to get it all up-to-date

teonbrooks commented 4 years ago

stumbled upon this, which might be useful: https://pyodide.readthedocs.io/en/stable/using_pyodide_from_webworker.html https://github.com/iodide-project/pyodide/blob/master/src/webworker.js

since the data processing is happening in python world and js only need images, maybe those can be passed with the onMessage. it will take python off the main thread and speed up the app.

jdpigeon commented 4 years ago

stumbled upon this, which might be useful: https://pyodide.readthedocs.io/en/stable/using_pyodide_from_webworker.html https://github.com/iodide-project/pyodide/blob/master/src/webworker.js

since the data processing is happening in python world and js only need images, maybe those can be passed with the onMessage. it will take python off the main thread and speed up the app.

That sounds brilliant. Thanks Teon

jdpigeon commented 4 years ago

Moving this branch from teonbrooks to makebrainwaves. Should be easier to bring through the home stretch that way.