Skip to content

Commit

Permalink
Adding stats data to the return value of /experiment/<experimenti_d>
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Hanif committed Dec 5, 2019
1 parent e469ede commit af02af0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ def data():

@app.route('/experiment/<experiment_id>')
def experiment(experiment_id):
return r.get(experiment_id+'_statistics').decode('utf-8')
aggregator = dict()
exp_one_data = r.get(experiment_id).decode('ascii')
df_data_1 = pd.read_csv(io.StringIO(exp_one_data), delimiter=',', header='infer')

aggregator["data"] = df_data_1.to_dict()
aggregator['stats'] = r.get(experiment_id+'_statistics').decode('utf-8')
return ujson.dumps(aggregator)


@app.route('/', methods=['GET', 'POST'])
Expand Down

0 comments on commit af02af0

Please sign in to comment.