ohbm / hackathon2019

Website and projects for the OHBM Hackathon in Rome 2019
https://ohbm.github.io/hackathon2019
83 stars 59 forks source link

Neurofeedback in Python - how to transform Pyff (stimulus delivery) from the old Python 2 into the new Python 3 Realm. #78

Open jnvandermeer opened 5 years ago

jnvandermeer commented 5 years ago

Neurofeedback in Python - how to transform Pyff (stimulus delivery) from the old Python 2 into the new Python 3 Realm.

Background

Pyff is a Python module that can be combined with Psychopy to perform Neurofeedback experiments. Pyff can load in and run stimulus paradigms and communicate via TCP/IP to other computers to update stimuli in real-time. In order to do so, it starts up a seeparate process with a main thread (since all screen refresh/3D/graphical stuff needs to be in a main thread), and a separate thread that monitors incoming network traffic.

This spearate thread relies heavily on asyncio/asynchat to prevent the that thread from killing itself if something goes wrong with the network traffic part (which usually does). Asynchat/Asyncio is a type of asynchronous programming where the interpreter can continue with other code while one line dealing with network traffic is waiting. Asynchronous programming has underdone many iterations, and one of the major one is that it is now implemented in python 3's async module and asyncio/asynchat no longer exists in favor of the more general async module.

The documentation is however quite bad. The work I propose is to take a look to see if pyff python 2's asyncio/asynchat can be deciphered into equivalent async code, and furthermore to more fully convert pyff into the python 3 realm.

knowledge

Preferably something about async programming

github repository

https://github.com/jnvandermeer/nf-stim-review 2to3 program

This would be a good match for the traintrack python2 to python3 issue raised earlier (issue #25)