position= [self.trials.thisIndex]
position.append(repN)
if repN is 1, the next bit of code tries to extend the array:
self[thisType]=misc.extendArr(self[thisType],posArr)#not implemented yet!
and this crashes.
The reason it's sometimes 1 is that I often start my experiment with
practice trials which are a handful of trials sampled randomly from
the trial array. using thisTriaN. When one of those trials is
presented for the second time, the script recognizes it as having been
run before, repN is now 1, and the program crashes with a ValueError
because the array is not properly expanded (see below).
-----------------------------------------------------
Gary Lupyan - lup...@wisc.edu
Assistant Professor of Psychology
University of Wisconsin, Madison
http://sapir.psych.wisc.edu
-----------------------------------------------------
On Wed, Feb 8, 2012 at 12:27 AM, Gary Lupyan <glu...@gmail.com> wrote:
> Hey everyone, I tried once more to update to the most recent psychopy
> version and am still getting a weird valueError when I run my
> experiment. The error happens after ~10 or so trials. I've never
> seen this error before w/ previous versions (e.g., 1.70 runs fine):
>
> File "c:\python25\lib\site-packages\PsychoPy-1.73.03-py2.5.egg\psychopy\data.p
> y", line 606, in next
> self.data.add('ran',1)
> File "c:\python25\lib\site-packages\PsychoPy-1.73.03-py2.5.egg\psychopy\data.p
> y", line 2401, in add
> self[thisType]=misc.extendArr(self[thisType],posArr)#not implemented yet!
> File "c:\python25\lib\site-packages\PsychoPy-1.73.03-py2.5.egg\psychopy\misc.p
> y", line 138, in extendArr
> exec("newArr["+indString+"]=inArray")
> File "<string>", line 1, in <module>
> ValueError: shape mismatch: objects cannot be broadcast to a single shape
> ...
> 19.4291 WARNING need a bigger array for:ran
>
> -----------------------------------------------------
> Gary Lupyan - lup...@wisc.edu
> Assistant Professor of Psychology
> University of Wisconsin, Madison
> http://sapir.psych.wisc.edu
> -----------------------------------------------------
The old code used to decide it's repN simply by, essentially calculating
floor(nTrials/nTrialTypes)
but for 'fullRandom' that doesn't work because you could be on the 2nd
or 3rd repetition of a condition in the first set of trials. That was
causing occasional data loss for fullRandom and we had to start tracking
the actual number of trials presented rather than trying to deduce it.
In the old form when you restart your loop it doesn't matter because the
old trials are forgotten but in the new form they aren't.
I guess we could do something to go through and reset the counts in a a
trial handler. But I would suggest that you simply create a separate
trial handler for your practice trials.
Jon
--
Jonathan Peirce
Nottingham Visual Neuroscience
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
The previous way I was doing it was basically a hack to get around the
non-existence of getFutureTrial :)
-----------------------------------------------------
Gary Lupyan - lup...@wisc.edu
Assistant Professor of Psychology
University of Wisconsin, Madison
http://sapir.psych.wisc.edu
-----------------------------------------------------
Jon