OS (e.g. Win10): MacOs 13.3.1
PsychoPy version (e.g. 1.84.x): 2023.2.1
Standard Standalone? (y/n) If not then what?: Y
Hi everyone,
I have been attempting to use a Cedrus Riponda model E with PsychoPy. I have the ftd2xx drivers installed and am able to interface with the response pad using the pyxid2 package in the Psychopy coder. However, when I attempt to use the Cedrus component in Builder, I am given the following error message:
File "/Users/x/Library/CloudStorage/x/Psychopy Experiments/CedrusTests/testing_lastrun.py", line 538, in run
trials.addData('buttonBox.duration', buttonBox.duration)
File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/pyxid2/pyxid_impl.py", line 434, in __getattr__
return getattr(self._impl, attrname)
AttributeError: 'NoneType' object has no attribute 'duration'
It seems to me that the issue lies in PsychoPy calling on the pyxid2 package to log the duration of the Cedrus component. This issue is not solved no matter the actual duration of the component in builder. Additionally, deselecting “Save onset/offset times” in the data tab of the component properties view does not solve it.
I’ve fixed the issue by modifying the pyxid2 package to hard-code in an arbitrary response to this request from PsychoPy:
def __getattr__(self, attrname):
if attrname == "duration":
return 1
else:
return getattr(self._impl, attrname)
While this is functional, it is obviously not optimal to have to modify the package itself. Are there other solutions to this issue? I would imagine the best way about it is to stop PsychoPy from attempting to log the duration at all since it isn’t needed for the experiment but I haven’t been able to figure out how to do this.
Thank you for any advice!
Gavin