psychopy.org | Reference | Downloads | Github

continueRoutine = False in Begin Routine tab has no effect

OS: macOS
PsychoPy version: 3.2.3
Standard Standalone?: y
What are you trying to achieve?: stop a routine from being run

I tried to stop a routine from being run by putting continueRoutine = False in the Begin Routine tab of a code component (and placing this component at the top of the routine). However, this setting is overwritten once the code is generated and thus has no effect:

# ------Prepare to start Routine "trial"-------
# update component parameters for each repeat
continueRoutine = False
# (...)
continueRoutine = True

This seems similar to the issue described here.

Jan

That’s an ancient old issue: can’t understand how it has raised its head again if you are using version 3.2.3. Are you able to post your .psyexp file here?

Thanks for your quick response, @Michael. Here you go.

test.psyexp (7.1 KB)

Oh wow, this is bizarre. Can replicate that in 3.2.3 with other files too. Not sure how this hasn’t been causing problems for other people too.

Will need to call on @jon and @dvbridges for this one, as it is due to how Builder generates the .py file, which is not a part of the code base I am very comfortable with.

Jon: looks like there has been some sort of regression to this issue, which you addressed back in 2016:

As noted, not sure how this isn’t causing all sorts of grief to people, as setting continueRoutine = False is such a common technique. Have there been any recent changes that could have impacted this?

Looking further into this, by setting “Use Psychopy version” in the experiment settings, the behaviour was correct up until version 3.1.5, and then from 3.2.0 onwards, the old behaviour re-emerged, of resetting continueRoutine to True immediately before the routine begins.

So Jan, as a short-term workaround you could tell Builder to use version 3.1.5 in the “Experiment settings” of your file (assuming that doesn’t cause issues with some other things that have changed recently, including the improved timing that came with version 3.2.0).

The first time you do this, there may be a slight delay, as PsychoPy will be downloading some of its 3.1.5 code in the background as required.

For us, the offending line in the repository is here:

1 Like

Thanks for looking into this further and the suggested workaround, Michael.

Jan

I had the same problem on a windows machine. Your workaround worked for me as well. Thanks!

For future reference, there is a pull request that should address this issue here:

so I am hoping this problem should be resolved in the next release (3.2.5), which should return to the expected behaviour.

1 Like