OS: Win10
PsychoPy version: 2020-2-6
What are you trying to achieve?:
I want to present one of different image stimuli each time the routine is repeated. Depending on what the exact stimulus is, the position should vary. For this purpose I have a .csv file which assigns the position (stim1_pos) to the stimulus (stim1). But the position is depending on the screen size. So, I’ve implemented the credit card method and it works fine for the size of the stimulus (stim1 → (3.1 * x_scale, 3.1 * y_scale)). However, now I wanr the position to be read from the conditions file via $stim1_pos. The corresponding column is indicated for instance with: [0,0] (which works fine) or [0, -0.04 * y_scale] (which doesn’t work).
What specifically went wrong when you tried that?:
The routine won’t start because y_scale is not defined when the conditions file is called for the position. However, y_scale is defined when in the exact same stim1 Properties the size is specified with (3.1 * x_scale, 3.1 * y_scale).
I have included the error message. Hope that helps…
“C:\Users…”, line 1072, in
trialList=data.importConditions(‘conditions\practice.xlsx’),
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\data\utils.py”, line 338, in importConditions
trialList, fieldNames = _attemptImport(fileName=fileName)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\data\utils.py”, line 256, in _attemptImport
trialList, fieldNames = pandasToDictList(trialsArr)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\data\utils.py”, line 313, in pandasToDictList
val = eval(val)
File “”, line 1, in
NameError: name ‘y_scale’ is not defined