gentnerlab / pyoperant

python package for operant conditioning
BSD 3-Clause "New" or "Revised" License
13 stars 15 forks source link

isolate data storage & logging in Subject object #85

Open neuromusic opened 9 years ago

neuromusic commented 9 years ago

this Subject object would have a set of methods to allow the behavioral protocol to save &/or query data

# define a subject
subj = Subject(name='B999',datastore='csv',datadir='/home/user/data')
# save a trial using whatever datastore the subject is using. csv? mongodb?
subj.save_trial(trial_object)
# query the accuracy over the past hundred trials
recent_acc = subj.data[-100:]['correct'].mean()