Skip to content

Commit

Permalink
DOCS: updated StairHandler demo to reflect deprecation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
peircej committed Aug 12, 2014
1 parent c1ee7bf commit 40de3d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions psychopy/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ class QuestHandler(StairHandler):
# get response
...
# inform QUEST of the response, needed to calculate next level
staircase.addData(thisResp)
staircase.addResponse(thisResp)
...
# can now access 1 of 3 suggested threshold levels
staircase.mean()
Expand Down Expand Up @@ -2123,7 +2123,7 @@ def importData(self, intensities, results):
for intensity, result in zip(intensities,results):
try:
self.next()
self.addData(result, intensity)
self.addResponse(result, intensity)
except StopIteration: # would get a stop iteration if stopInterval set
pass # TODO: might want to check if nTrials is still good
def calculateNextIntensity(self):
Expand Down Expand Up @@ -2306,7 +2306,7 @@ def __init__(self, stairType='simple', method='random',
#do something with thisIntensity and thisOri
stairs.addData(correctIncorrect)#this is ESSENTIAL
stairs.addResponse(correctIncorrect)#this is ESSENTIAL
#save data as multiple formats
stairs.saveDataAsExcel(fileName)#easy to browse
Expand Down
8 changes: 4 additions & 4 deletions psychopy/demos/coder/experiment control/JND_staircase_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
globalClock = core.Clock()#to keep track of time
trialClock = core.Clock()#to keep track of time
win = visual.Window([800,600],allowGUI=False, monitor='testMonitor', units='deg')
foil = visual.PatchStim(win, sf=1, size=4, mask='gauss', ori=expInfo['refOrientation'])
target = visual.PatchStim(win, sf=1, size=4, mask='gauss', ori=expInfo['refOrientation'])
fixation = visual.PatchStim(win, color='black', tex=None, mask='circle',size=0.2)
foil = visual.GratingStim(win, sf=1, size=4, mask='gauss', ori=expInfo['refOrientation'])
target = visual.GratingStim(win, sf=1, size=4, mask='gauss', ori=expInfo['refOrientation'])
fixation = visual.GratingStim(win, color='black', tex=None, mask='circle',size=0.2)
message1 = visual.TextStim(win, pos=[0,+3],text='Hit a key when ready.')
message2 = visual.TextStim(win, pos=[0,-3], text="Then press left or right to identify the %.1fdegree probe." %(expInfo['refOrientation']))

Expand Down Expand Up @@ -83,7 +83,7 @@
event.clearEvents('mouse')#only really needed for pygame windows

#add the data to the staircase so it can calculate the next level
staircase.addData(thisResp)
staircase.addResponse(thisResp)
dataFile.write('%i %.3f %i\n' %(targetSide, thisIncrement, thisResp))

#staircase has ended
Expand Down

0 comments on commit 40de3d4

Please sign in to comment.