Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'auto-redo if min on-time crit not met' checkbox triggering error #32

Closed
shariliu opened this issue Nov 5, 2021 · 1 comment
Closed

Comments

@shariliu
Copy link

shariliu commented Nov 5, 2021

I and @sabrinapiccolo are currently using the latest online version of pyhab to set up a VOE experiment. I have found that if I have the 'automatically redo trial if min on-time criterion not met' box checked in the trial settings, as soon as I indicate an off look, the control window disappears and I get the following console output. If this box is unchecked, then the experiment runs fine. Dropbox link to project: https://www.dropbox.com/sh/w4u9aj21cy3ph49/AABHC_L3XA68EiHwJarZcI8-a?dl=0

2021-11-05 17:39:18.308 python[8692:274783] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/18/nbn3vbdx2jv900brph6lq3180000gn/T/org.opensciencetools.psychopy.savedState
Traceback (most recent call last):
  File "/Users/ShariLiu/Dropbox (MIT)/Research/Studies/_NIRS/Goals-Simple/github:goal-simple/goal-simpleLauncher.py", line 78, in <module>
    run()
  File "/Users/ShariLiu/Dropbox (MIT)/Research/Studies/_NIRS/Goals-Simple/github:goal-simple/goal-simpleLauncher.py", line 45, in run
    run()
  File "/Users/ShariLiu/Dropbox (MIT)/Research/Studies/_NIRS/Goals-Simple/github:goal-simple/goal-simpleLauncher.py", line 40, in run
    experiment.run()
  File "/Users/ShariLiu/Dropbox (MIT)/Research/Studies/_NIRS/Goals-Simple/github:goal-simple/PyHab/PyHabClass.py", line 2323, in run
    self.SetupWindow()
  File "/Users/ShariLiu/Dropbox (MIT)/Research/Studies/_NIRS/Goals-Simple/github:goal-simple/PyHab/PyHabClass.py", line 2467, in SetupWindow
    self.doExperiment()  # Get this show on the road!
  File "/Users/ShariLiu/Dropbox (MIT)/Research/Studies/_NIRS/Goals-Simple/github:goal-simple/PyHab/PyHabClass.py", line 1223, in doExperiment
    x = self.doTrial(trialNum, self.actualTrialOrder[trialNum - 1], disMovie)  # the actual trial, returning one of four status values at the end
  File "/Users/ShariLiu/Dropbox (MIT)/Research/Studies/_NIRS/Goals-Simple/github:goal-simple/PyHab/PyHabClass.py", line 1454, in doTrial
    if localType in self.autoRedo and nowO
ff >= self.onTimeDeadline[localType] and not deadlineChecked:
KeyError: 'fam'
##### Experiment ended. #####
jfkominsky added a commit that referenced this issue Nov 6, 2021
Auto-redo expected that it would always be used mid-trial, even though the builder assumes that it could also be used to check at trial end, leading to a crash. Now it adds a layer of checking whether it needs to do mid-trial checks at all.
@jfkominsky
Copy link
Owner

jfkominsky commented Nov 6, 2021

Thanks for spotting this! The auto-redo system in the builder is set up so it can check during the trial or check at the end of the trial, but in this code it was assuming it would always be used to check during a trial. If you grab the most recent version of PyHabClass.py from the online-edition branch and replace the PyHabClass file in your experiment's PyHab folder, it should now work as intended.

jfkominsky added a commit that referenced this issue Nov 6, 2021
The same problem in online edition applies here: auto-redo in PyHabClass assumed that it would always be used for a mid-trial check, but if it's not, there's a key error when it looks for the on-time deadline. No longer does this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants