Is that possible that Python-convert-to-PsychJS function will support NumPy in the future?

It’s frustrating when trying to publish online experiments without NumPy, especially for people who have never used JavaScript… Since many modules of NumPy (or things like the random module of Python) are quite handy, for instance, the random module.

I note that there may be available JS packages like numjs and d3. Are they (or some of their useful functions, like d3.randomExponential) possible to be integrated into the PsychJS (so that we can use something like np.random.exponential and np.random.choice) ?

Hi there,

It’s easy enough to port any single function, but porting all of numpy into JS is a big task (knowing all the points where numpy calls and d3 calls differ, for instance, and making them equivalent) and a moving target (numpy is still under constant development). So the issue is knowing how much and where to draw the line of what is supported.

I wonder if we can provide some general framework for how to do this and users can add functions to that framework as needed.

Open to suggestions



Thank you! Looking forward to a mature ecosystem of PsychoPy and Open Psychological Science :smiley: