Cannot Use Dotstim (Even in Builder Mode)

Hi, everyone. When I use the function Dotstim, my compiler just told me that :slight_smile:
/Users/dragon/opt/anaconda3/envs/py37/bin/python /Users/dragon/Desktop/CN/DOT/dotde.py
pygame 2.0.1 (SDL 2.0.14, Python 3.7.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
2021-04-17 01:25:04.427 python[1032:17128] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7ffa7e4b9150>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2021-04-17 01:25:04.427 python[1032:17128] Warning: Expected min height of view: (<NSButton: 0x7ff9ef921ac0>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2021-04-17 01:25:04.430 python[1032:17128] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7ff9ef925140>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2021-04-17 01:25:04.433 python[1032:17128] Warning: Expected min height of view: (<NSPopoverTouchBarItemButton: 0x7ff9ef92ed70>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2.9650 WARNING Monitor specification not found. Creating a temporary one…

Process finished with exit code 0

and Here is my test code which generated the warning:
from psychopy import visual, core, event
import numpy as np
#win.getMovieFrame(buffer=‘back’)
#create a window to draw in
myWin = visual.Window((600,600), allowGUI=False)

direction = [1, 2] # One left, Two Right
nTrialsPerCond = 10
nTrials = nTrialsPerCond * len(direction)

#INITIALISE SOME STIMULI
dotsLeft = visual.DotStim(win=myWin, fieldSize=300, fieldShape=‘circle’, coherence=0.5, dotSize=20, dir=0, speed=2)
dotsRight = visual.DotStim(win=myWin, fieldSize=300, fieldShape=‘circle’, coherence=0.5, dotSize=20, dir=180, speed=2)

trialClock = core.Clock()

t = 0
while t < 1.5:
t = trialClock.getTime()
dotsLeft.draw() #redraw it
myWin.flip()
#update the screen
#handle key presses each frame
for keys in event.getKeys():
if keys in [‘escape’,‘q’]:
core.quit()
#win.saveMovieFrames(fileName=‘some file.mp4’)

And I cannot use the dot component in the builder mode. I have no idea of what I should do to figure it out. I supposed that there might be some problems with my MacOS Big Sur (I use MBP 18), but when I borrowed my friend’s HP (Windows), I still could not use the dot component. Other functions and components seem to work well.

1 Like

Hi Draco and Community,

I have the same problem, I tried to run an RDK in the builder in a Mac and in a PC and in both no stimulus appeared, and I had the same error, that is:

1651.8799 INFO Loaded monitor calibration from [‘2021_04_19 13:13’]
Generating PsychoPy script…

################## Running: /Applications/attempt3_lastrun.py ##################
2021-04-20 11:17:33.176 python[2494:112886] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/f4/lxqw8xks5mdgwwxgf_dc24y00000gp/T/org.opensciencetools.psychopy.savedState
Traceback (most recent call last):
File “/Applications/attempt3_lastrun.py”, line 93, in
depth=0.0)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/contrib/lazy_import.py”, line 120, in call
return obj(*args, **kwargs)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/visual/dot.py”, line 255, in init
self.dotLife = dotLife
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/tools/attributetools.py”, line 32, in set
newValue = self.func(obj, value)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/visual/dot.py”, line 326, in dotLife
self._dotsLife = abs(self.dotLife) * np.random.rand(self.nDots)
File “mtrand.pyx”, line 1169, in numpy.random.mtrand.RandomState.rand
File “mtrand.pyx”, line 423, in numpy.random.mtrand.RandomState.random_sample
File “_common.pyx”, line 270, in numpy.random._common.double_fill
TypeError: ‘float’ object cannot be interpreted as an integer

Experiment ended.

I’m new in Psychopy and I also have no idea of what to do, if someone has any suggestion it would be great! Thank you all

2 Likes

Hello,

I have the same problem, too, not just in Dots but also in Noise Stim.

I’m using PsychoPy 2021.1.4.

Thanks.

Qiliang

I think this explains the underlying problem, and a temporary solution

1 Like

Thank you!

1 Like