DeprecationWarning when running a yield statement
Hello
I am working on this script where I run a task, wait for the user to give a mouse response and store the reaction time. Below is the task: Code:
def example_trial(): but when it comes to the yield line it gives me this warning, and I can't figure out what it means and how to fix it Code:
DeprecationWarning: "data" option will be removed in future versions, use "[data] = yield [condition]" instead |
The viztask.waitMouseDown command has been updated and no longer expects the viz.Data object to be passed as an argument. Use the following instead:
Code:
def example_trial(): |
To be clear, this is just a warning. Your existing code should still function properly. Deprecated functions are not removed until the next major version, so you have until Vizard 6 to update your code.
If you would like to simply disable the warnings, then add the following code to the beginning of your script. However, I would strongly recommend that you just update your code. Code:
import warnings |
Dear all
Thanks for the reply. There is no problem for me about updating my code but I would ask you if I can still use the "response.time" variable as it was written in the snippet above in order to calculate user's reaction time and the "response.button" in the snippet below to obtain the mouse button: Code:
if response.button == viz.MOUSEBUTTON_LEFT: regards, armo |
Yes, the data object returned by viztask.waitMouseDown still contains that information.
|
All times are GMT -7. The time now is 02:02 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC