Skip to content

Commit

Permalink
Fixed bug about indexing with array of wrong dimension.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjara committed Dec 22, 2018
1 parent 8a06b48 commit 6baa85d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/performancedynamicsplot.py
Expand Up @@ -57,7 +57,7 @@ def __init__(self, parent=None, widgetSize=(200,140),nTrials=100,winsize=10):
self.addItem(self.perfRightPlot)

self.outcomeIDs = {'correct':1,'error':0,'invalid':2,'free':3,
'nochoice':4,'aftererror':5,'aborted':6}
'nochoice':4,'aftererror':5,'aborted':6}
# FIXME: This should come from somewhere else (to be consisten with the rest)

# -- Graphical adjustments --
Expand Down Expand Up @@ -98,7 +98,7 @@ def update(self,sides=[],sidesLabels={},outcome=[],outcomeLabels={},currentTrial

nValid = np.sum(validTrials) #Maybe just add one every this is called
#nValidLeft = np.sum(validLeft) #Maybe just add one every this is called
correct = outcome==self.outcomeIDs['correct'] # SIZE:nTrials
correct = outcome[:currentTrial]==self.outcomeIDs['correct'] # SIZE:nTrials
# FIXME: the following should not be hardcoded but use sidesLabels
#leftCorrect = ((sides==0) & correct)[:currentTrial][validTrials]
#rightCorrect = ((sides==1) & correct)[:currentTrial][validTrials]
Expand Down Expand Up @@ -166,8 +166,8 @@ def sizeHint(self):
import sys

# -- A workaround to enable re-running the app in ipython after closing --
app=QtGui.QApplication.instance() # checks if QApplication already exists
if not app: # create QApplication if it doesnt exist
app=QtGui.QApplication.instance() # checks if QApplication already exists
if not app: # create QApplication if it doesnt exist
app = QtGui.QApplication(sys.argv)
form = QtGui.QDialog()
form.resize(600,140)
Expand Down

0 comments on commit 6baa85d

Please sign in to comment.