26 'Mother Pitch Category',
31 'Baby Pitch Category',
40 'Min Question Rating',
41 'Max Question Rating',
42 'Mean Question Rating',
57 'Mother Pitch Category',
62 'Baby Pitch Category',
68 'clips c join ratings r on c.id = r.clip_id',
86 'c.Mother_Mean_Pitch',
87 'c.Mother_Pitch_Delta',
88 'c.Mother_Pitch_Category',
93 'c.Baby_Pitch_Category',
95 where_cond =
'c.Batch_Num = ? and r.Participant_Num = ?',
96 order_by =
'c.Batch_Order',
97 params = [batch_num, part_num]
104 'clips c join ratings r on c.id = r.clip_id',
110 'min(r.Question_Rating)',
111 'max(r.Question_Rating)',
112 'avg(r.Question_Rating)',
123 'c.Mother_Max_Pitch',
124 'c.Mother_Min_Pitch',
125 'c.Mother_Mean_Pitch',
126 'c.Mother_Pitch_Delta',
127 'c.Mother_Pitch_Category',
131 'c.Baby_Pitch_Delta',
132 'c.Baby_Pitch_Category',
134 where_cond =
'c.Batch_Num = ?',
135 group_by =
'c.Batch_Order',
142 out_filename =
'%sStats.csv' % (out_dir)
143 out_file = open(out_filename,
'wb')
144 writer = csv.writer(out_file)
150 writer.writerow(cur_row)
155 out_filename =
'%sParticipant%d.csv' % (out_dir, part_num)
156 out_file = open(out_filename,
'wb')
157 writer = csv.writer(out_file)
163 writer.writerow(cur_row)
169 'clips c join ratings r on c.id = r.clip_id',
170 [
'distinct r.Participant_Num'],
171 where_cond =
'c.Batch_Num = ?',
175 out_dir =
'%sbatch%d/' % (save_dir, batch_num)
177 if os.path.exists(out_dir):
178 shutil.rmtree(out_dir)
181 part_nums = map(
lambda line: line[0], rows)
182 for cur_part_num
in part_nums:
192 [
'distinct Batch_Num'],
193 where_cond =
'Batch_Num is not null'
195 batch_nums = map(
lambda line: line[0], rows)
197 for i
in range(len(batch_nums)):
199 progress_fraction_fcn((i + 1) / float(len(batch_nums)))