From 201752a55e281a800345587e420f41131b943b53 Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Fri, 6 Mar 2020 11:16:24 -0600 Subject: [PATCH] testing part 2 better electric boogaloo --- data analysis/superscript.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/data analysis/superscript.py b/data analysis/superscript.py index 18d95ed6..192c5905 100644 --- a/data analysis/superscript.py +++ b/data analysis/superscript.py @@ -176,12 +176,16 @@ def simplestats(data, test): if(test == "regression_sigmoidal"): return an.regression(list(range(len(data))), data, ['sig']) -def push_to_database(apikey, competition, results, pit): +def push_to_database(apikey, competition, results, metrics, pit): for team in results: d.push_team_tests_data(apikey, competition, team, results[team]) + for team in temp_vector: + + d.push_team_metrics_data(apikey, competition, team, temp_vector[team]) + for variable in pit: d.push_team_pit_data(apikey, competition, variable, pit[variable]) @@ -198,11 +202,12 @@ def metricsloop(tbakey, apikey, competition, timestamp): # listener based metric red = {} blu = {} + red = load_metrics(apikey, competition, match, "red") + blu = load_metrics(apikey, competition, match, "blue") + + for match in matches: - - red = load_metrics(apikey, competition, match, "red") - blu = load_metrics(apikey, competition, match, "blue") - + elo_red_total = 0 elo_blu_total = 0 @@ -275,14 +280,6 @@ def metricsloop(tbakey, apikey, competition, timestamp): # listener based metric blu[team]["gl2"]["rd"] = blu[team]["gl2"]["rd"] + blu_gl2_delta["rd"] blu[team]["gl2"]["vol"] = blu[team]["gl2"]["vol"] + blu_gl2_delta["vol"] - temp_vector = {} - temp_vector.update(red) - temp_vector.update(blu) - - for team in temp_vector: - - d.push_team_metrics_data(apikey, competition, team, temp_vector[team]) - """ not functional for now red_trueskill = [] blu_trueskill = [] @@ -309,6 +306,11 @@ def metricsloop(tbakey, apikey, competition, timestamp): # listener based metric """ + return_vector.update(red) + return_vector.update(blue) + + return return_vector + def load_metrics(apikey, competition, match, group_name): group = {}