psychopy.org | Reference | Downloads | Github

Having issues manipulating nDots in staircase metacognition task

Having an issue with manipulating the quantity of dots. I believe the issue is referring to the lines of code below.

The error message l am currently getting is: ValueError: operands could not be broadcast together with shapes (20,) (5,)

Lines of code:

target = visual.DotStim(
    win, nDots=(expInfo['refnDots']), dotSize=randrange(5.0, 10.0), 
    speed=0, dir=0.0, coherence=0.5,
    fieldPos=(-8.0, 0.0), fieldSize=8.0,fieldShape='circle',
    signalDots='same', noiseDots='position',dotLife=0,
    color=[-1.000,-1.000,-1.000], colorSpace='rgb', opacity=1,
    depth=-1.0)

for thisIncrement in staircase:  # will continue the staircase until it terminates!
    # set location of stimuli
    targetSide= random.choice([-1,1])  # will be either +1(right) or -1(left)
    foil.setFieldPos([-5*targetSide, 0])  # possibly be setSize
    target.setFieldPos([5*targetSide, 0])  # in other location

    # set dot quantity of probe
    target.nDots=(expInfo['refnDots'] + thisIncrement) # change foil.setOri(expInfo['refOrientation'] + thisIncrement) also was origninally foil

    # draw all stimuli
    foil.draw()
    target.draw()
    fixation.draw()
    win.flip()

Thanks

No one will read through hundreds of lines of code to try to figure out where your error occurred.

You need to provide a usable level of information: for a start: show us the line where the error occurred (and any neighbouring code needed for context), and the full text of the error message.

Thank you. Have updated the message.