psychopy.org | Reference | Downloads | Github

Builder gives the error: "Variable name $random is in use (by numpy function). Try another name" when randomizing the Stop duration after 2020.2.6. update

Hello there, I’m trying to design a Posner Cueing experiment, and to randomize the inter-trial intervals, I have been using a cross polygon component with the stop time defined as random() + 1 in the polygon properties GUI, so that it can give me a number between 1 and 2 each trial. However, since I’ve updated PsychoPy to 2020.2.6., it gives me the error “Variable name random is in use (by numpy function). Try another name”, below the properties window, in red text. When I try with $, it gives me the same error. It has worked before the update, and now, I can’t randomize the duration of the initial segment. I would greatly appreciate any help with this problem.

Thank you!
Öykü

That red text at the bottom is more of a warning than an error - does it not allow you continue?

We need to add in some conditions for that validation so that it doesn’t flag up use cases like this, but it should just give you a warning but let you continue anyway, so if it’s not then let me know as that’s a problem in and of itself!

Thanks for the reply.

The warning text does not prevent me from running my experiment while the code is still there on stop time, but unfortunately, the random() code is still not implemented, and I get a fixed stop time instead of a random number between ones I’ve specified above.

That’s an odd one, could you share the .psyexp file? I’ll try running it and look in more detail at what’s going wrong