psychopy/psychopy — Issue #114: Nested Loops overwrite inner loop's psydat files [Builder]
Author: kastman
Created: 2012-02-29 20:35:37+00:00
State: open

This one is moderately serious, as it entails data lost from the builder and only recoverable by parsing the .log:

In the builder, if two loops are nested, the trial handler appears to be overwriting the inner loop's .psydat file on each pass of the outer loop. What's left over is a .psydat for the outer loop, and the last TrialHandler from the inner loop.

When saving to other formats (e.g. xlsx) this is handled by appending extra sheets for each pass of the inner loop (e.g. trials, trials1, trials2). What's the best way to handle it for psydat? The most intuitive [to me] would be to save them all as an array and just append to the array, but that changes the format of .psydat, so I don't think it would work. You could save them all as new files (don't overwrite, just append a counter to the filename if it exists already) but this is suboptimal and would leave lots of files lying around.

Any ideas for fixes? Here's a very simple example showing the lost .psydats. https://gist.github.com/1944171