OS: Win10
PsychoPy version: 2024.2.4 Py 3.10
Standard Standalone Installation? (y/n) If not then what?: Standalone
Do you want it to also run online? (y/n) No
What are you trying to achieve?:
I want to implement a Quest plus procedure in the Builder using a condition file for setting its parameters. When the file is loaded at the beginning of the trial loop, the task stops and the following error appears:
File "C:\Users\Ugo.TAppData\Local\Programs\PsychoPy\lib\site-packages\xarray\core\variable.py", line 2335, in _binary_op
f(self_data, other_data) if not reflexive else f(other_data, self_data)
numpy.core._exceptions._UFuncNoLoopError: ufunc 'subtract' did not contain a loop with signature matching types (dtype('<U12'), dtype('float64')) -> None
The complete traceback:
Traceback (most recent call last):
0.9548 CRITICAL The QUEST+ staircase implementation is currently being tested and may be subject to change.
File "C:\Users\Ugo.T\Desktop\NAN1\NAN1_1TASK_ANALYSES\NAN1_1TASK\ContrastTask\ContrastTask_QUEST_plus_lastrun.py", line 3252, in <module>
run(
File "C:\Users\Ugo.T\Desktop\NAN1\NAN1_1TASK_ANALYSES\NAN1_1TASK\ContrastTask\ContrastTask_QUEST_plus_lastrun.py", line 1123, in run
steady_trials = data.MultiStairHandler(stairType='questplus', name='steady_trials',
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\data\staircase.py", line 1836, in __init__
self._createStairs()
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\data\staircase.py", line 1900, in _createStairs
thisStair = QuestPlusHandler(**args)
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\data\staircase.py", line 1577, in __init__
self._qp = qp.QuestPlusWeibull(
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\questplus\qp.py", line 541, in __init__
super().__init__(
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\questplus\qp.py", line 96, in __init__
self.likelihoods = self._gen_likelihoods()
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\questplus\qp.py", line 237, in _gen_likelihoods
prop_correct = f(
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\questplus\psychometric_function.py", line 105, in weibull
p = 1 - delta - (1 - gamma - delta) * np.exp(-(10 ** (beta * (x - t))))
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\xarray\core\_typed_ops.py", line 412, in __sub__
return self._binary_op(other, operator.sub)
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\xarray\core\dataarray.py", line 4781, in _binary_op
f(self.variable, other_variable_or_arraylike)
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\xarray\core\_typed_ops.py", line 636, in __sub__
return self._binary_op(other, operator.sub)
File "C:\Users\Ugo.T\AppData\Local\Programs\PsychoPy\lib\site-packages\xarray\core\variable.py", line 2335, in _binary_op
f(self_data, other_data) if not reflexive else f(other_data, self_data)
numpy.core._exceptions._UFuncNoLoopError: ufunc 'subtract' did not contain a loop with signature matching types (dtype('<U12'), dtype('float64')) -> None
What did you try to make it work?:
By looking in the source code of the Quest plus procedure, it seems that the first step is to generate a psychometric function with the initial parameters. The issue comes specifically from the intensityVals parameter which is not interpreted by Psychopy as a dictionary but as a string when importing the condition file. I’ve tried several syntaxes:
- {‘contrast’: [0, 0.1, 0.2]}
- {contrast: [0, 0.1, 0.2]}
- ‘contrast’: [0, 0.1, 0.2]
- contrast: [0, 0.1, 0.2]
- contrast=[0, 0.1, 0.2]
And none of them work, even by changing the punctuation. I’ve tried to define the intensityVals dictionnary inside a Code Component and feed it to the QuestPlusHandler once the condition file is loaded, without any positive outcome. I’ve also tried to code the Quest plus procedure inside the Builder but it seems quite sketchy and causes more unwanted issues.
How did you managed to implement this procedure in the Builder?
Thanks in advance for any suggestion or help!
Ugo