psychopy.org | Reference | Downloads | Github

Missing csv data files

Hi
There was something of an issue a while ago about cvs data files not being saved and I have just had the same issue on a PC with the current 84.2. I am hoping that with proper file naming this won’t recur but have we any idea why this happens? The upsetting thing was that it was fine for about 10 subjects and then it started not saving the cvs data.
Any help gratefully received,
Philip.

most common cause of this is someone pushing the red stop button but from your info it’s impossible to diagnose further

my separate experiments have independently stopped saving everything except the log file, which looks normal. I went and tried some of the demos, and they aren’t saving any data except for the log file, either.

I am having a similar issue in that nothing has changed with my OS (that I know of?), I closed and restarted everything including the computer itself, and I have made really no edits to my experiments at all. The experiments are otherwise unconnected, but all have the same issue.

I don’t know what to post for context/codes/etc. because everything was working and saving fine before, and like I said, I haven’t changed anything.

I am using builder mainly with a bit of coding (within builder and in the script editor) on a current Macbook. What could possibly be the problem? Should I un-install anything? I am new to python and I don’t know where to begin.

Any help is extremely gratefully welcomed, as I’d like to begin testing as soon as possible and I had thought I had everything ready to go.

There are some differences in the experiments that worked in the past and now by comparing lastrun files. Could this explain anything?

This is a file that saved data output:

# Store info about the experiment session
expName = u'stroop'  # from the Builder filename that created this script
expInfo = {'participant':'', 'session':'01'}
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName)
if dlg.OK == False:
    core.quit()  # user pressed cancel
expInfo['date'] = data.getDateStr()  # add a simple timestamp
expInfo['expName'] = expName

# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc
filename = _thisDir + os.sep + u'data' + os.sep + '%s_%s' % (expInfo['participant'], expInfo['date'])

# An ExperimentHandler isn't essential but helps with data saving
thisExp = data.ExperimentHandler(name=expName, version='',
    extraInfo=expInfo, runtimeInfo=None,
    originPath=u'/Users/Me/Documents/PsychoPy Demos/stroopExtended/stroop.psyexp',
    savePickle=True, saveWideText=True,
    dataFileName=filename)

And this is what my non-data saving experiment looks like

# Store info about the experiment session
expName = 'RhythmPercept_discrim'  # from the Builder filename that created this script
expInfo = {u'session': u'001', u'participant': u'', u'order': u'A OR B?'}
dlg = gui.DlgFromDict(dictionary=expInfo, title=expName)
if dlg.OK == False:
    core.quit()  # user pressed cancel
expInfo['date'] = data.getDateStr()  # add a simple timestamp
expInfo['expName'] = expName

# Data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc
filename = _thisDir + os.sep + u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date'])

# An ExperimentHandler isn't essential but helps with data saving
thisExp = data.ExperimentHandler(name=expName, version='',
    extraInfo=expInfo, runtimeInfo=None,
    originPath=u'/Users/Me/Desktop/MPhil/Materials/RhythmDiscrim/RhythmPercept_discrim.psyexp',
    savePickle=True, saveWideText=True,
    dataFileName=filename)

Anything obvious jump out?

Edited again in case someone else has this problem and a better solution hasn’t been posted below: I put the following code component into my trial routine (I added it to both the begin routine and end experiment properties, since it doesn’t seem effective in any other combination that I tried)

thisExp.saveAsWideText(thisExp.dataFileName+'.csv', delim=',')

To reiterate what I said above, “The most common cause of this is someone pushing the red stop button”. When you get to the end of your experiment does it exit cleanly, or do you have to push the red button?

For the demos not even to work is very unusual, but then again, you say that stroop does work, so I don’t understand.

If you’ve got custom code in your experiment then showing us that code would be very useful (this is a basic thing to keep in mind always).

Thanks for your response!

The exit is clean, it just closes the window at the end. But I would hate to lose data for this reason, since when I am actually running the experiment I am sure it will unexpectedly stop for one reason or another :slight_smile:

the stroop task saves data, but the extended stroop task does not.

The custom code I use is to take a break during the trials loop. This is in my ‘take a break’ routine.

if trialLoop.thisTrialN not in [20]:
    continueRoutine=False

The only work around I have managed to find is from this archived discussion. I added the following code to the ‘begin routine’ and the ‘end experiment’ properties of my trial routine. This results in a lot of CSV files but at least they’re appearing, and the file for the final repetition of the routine has all the data.

thisExp.saveAsWideText(thisExp.dataFileName+'.csv', delim=',')

I should add that since I included the above code, a wideText file has begun to appear, but it only includes information from the practice section of my experiment, which does not use a loop or a conditions file.

I tried reverse-engineering my problem and it only starts when I include a conditions file with more than one WAV file. There are no unusual characters, underscores, etc. Just numbers and letters in the filenames.

The experiment “unexpectedly stopping” isn’t a problem. If you add an error to your experiment (even on the final line) it should still save the data. The issue is just the red stop button, which is more like pulling out the plug!

I don’t know what’s going wrong in your case. Maybe something to do with the sound files then (although that wouldn’t explain why extended stroop doesn’t work).

What version of psychopy are you using?

Hi Jon, yes, it’s so confusing! But I think you’re right about sound files.

I’m building an SRT type task now that was sound-free and working fine. Then I added a short WAV to my trial for auditory feedback, and it stopped saving data. The WAV isn’t part of the conditions file (it’s just constant), so perhaps it is just using sound that does it.

I also only seem to get the parachute segmentation error (very erratically) when I have a sound component.

The only data that is saved is the log file, which stops appending after Set sound=C

I’m using V1.8 on OS 10.12

My best guess is that this is indeed caused by a problem in pyo.
I’ve just released a new version of PsychoPy and the mac version (where we’ve seen this issue) has a new version of pyo included. With any luck the bug there has been fixed (i.e. I think it is/was a bug in pyo not a bug in PsychoPy itself). If not then you should try changing the sound library in the psychopy preferences. If you put sounddevice as the preferred (first) library, or pygame (if sound latencies aren’t important) then you should get rid of probs with pyo.

But, as I say, with any luck this has been fixed in the latest versions of pyo anyway

Thanks, that’s great! I’ll give it a try and let you know what happens.