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

BF: Don't overwrite extraInfo variables in TrialHandler.saveAsWideText() (#814) #815

Merged
merged 1 commit into from Feb 10, 2015

Conversation

Projects
None yet
4 participants
@onesandzeroes
Contributor

onesandzeroes commented Jan 28, 2015

Fixes #814. I think the fix for this is pretty straightforward, we just fill in the extraInfo
values along with the rest while looping through the header. I've changed the tests
against None to use is rather than != since I was changing those sections
anyway, but if people want to suggest any other improvements I'm happy to
include them.

@coveralls

This comment has been minimized.

coveralls commented Jan 28, 2015

Coverage Status

Coverage decreased (-0.0%) to 50.84% when pulling a820194 on onesandzeroes:data-saving into 0781dc3 on psychopy:master.

@peircej

This comment has been minimized.

Member

peircej commented Feb 5, 2015

Hi there @onesandzeroes
Apologies for the delay. I thought this was working already in our main datafiles, but that was maybe just for the ExperimentHandler that it was working, not the TrialHandler.
@alexholcombe you were looking at data outputs recently for ExperimentHandler and talking about porting your fixes to TrialHandler (if I remember correctly?). Would this commit give you any probs that you know of?

cheers both

@onesandzeroes

This comment has been minimized.

Contributor

onesandzeroes commented Feb 5, 2015

Here's some quick code to repro if you want to confirm, I've run this against the current git master and it definitely seems like the bug is still there:

import random
from psychopy import data

trials = data.TrialHandler(
    [
        {'colour': 'red', 'size': 4, 'condition': 1},
        {'colour': 'blue', 'size': 5, 'condition': 2},
        {'colour': 'green', 'size': 6, 'condition': 1}
    ],
    nReps=1,
    extraInfo={'subject_id': 101, 'day': 'Tuesday'}
)

for trial in trials:
    trials.data.add('rt', random.uniform(500, 800))

trials.saveAsWideText('trialhandler_bug_example')
@alexholcombe

This comment has been minimized.

Contributor

alexholcombe commented Feb 6, 2015

I'm sure it worked at some time before with trialHandler, but maybe my test
wasn't comprehensive enough, I really don't remember sorry and I'm under a
grant deadline now. What onesandzeroes did looks good!
Alex

On Thu, Feb 5, 2015 at 12:50 PM, onesandzeroes notifications@github.com
wrote:

Here's some quick code to repro if you want to confirm, I've run this
against the current git master and it definitely seems like the bug is
still there:

import randomfrom psychopy import data

trials = data.TrialHandler(
[
{'colour': 'red', 'size': 4, 'condition': 1},
{'colour': 'blue', 'size': 5, 'condition': 2},
{'colour': 'green', 'size': 6, 'condition': 1}
],
nReps=1,
extraInfo={'subject_id': 101, 'day': 'Tuesday'}
)
for trial in trials:
trials.data.add('rt', random.uniform(500, 800))

trials.saveAsWideText('trialhandler_bug_example')


Reply to this email directly or view it on GitHub
#815 (comment).

Alex Holcombe | Associate Professor
School of Psychology | Faculty of Science
The University of Sydney
Web http://www.psych.usyd.edu.au/staff/alexh/lab/, Twitter
https://twitter.com/ceptional, Map
http://openwetware.org/wiki/Holcombe:Location

peircej added a commit that referenced this pull request Feb 10, 2015

Merge pull request #815 from onesandzeroes/data-saving
BF: Don't overwrite extraInfo variables in TrialHandler.saveAsWideText() (#814)

@peircej peircej merged commit d240a6a into psychopy:master Feb 10, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment