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

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

Merged
merged 1 commit into from Feb 10, 2015

Conversation

@onesandzeroes
Copy link
Contributor

@onesandzeroes 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
Copy link

@coveralls 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
Copy link
Member

@peircej 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
Copy link
Contributor Author

@onesandzeroes 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
Copy link
Contributor

@alexholcombe 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
BF: Don't overwrite extraInfo variables in TrialHandler.saveAsWideText() (#814)
@peircej peircej merged commit d240a6a into psychopy:master Feb 10, 2015
1 check passed
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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants