psychopy/psychopy — Issue #82: visual.DotStim throws error when fieldSize is tuple.
Author: smathot
Created: 2011-11-04 14:36:56+00:00
State: open

I looked into it for a bit, but the code in DotStim was a little too complicated :p The problem appears to arise when the fieldSize is a tuple. This has been verified with 1.71.01 on Windows XP and Linux.

This:
dot = visual.DotStim(self.experiment.window, fieldSize=(100,100))

Raises:
Traceback (most recent call last):
File "/home/sebastiaan/git/opensesame/libopensesame/inline_script.py", line 112, in run
exec(self.crun)
File "", line 4, in
File "/usr/lib/pymodules/python2.7/psychopy/visual.py", line 1571, in draw
self._update_dotsXY()
File "/usr/lib/pymodules/python2.7/psychopy/visual.py", line 1686, in _update_dotsXY
self._dotsXY[dead,:] = self._newDotsXY(sum(dead))
IndexError: index (1) out of range (0<=index<0) in dimension 0

This works fine:
dot = visual.DotStim(self.experiment.window, nDots=100, fieldSize=100)