diff --git a/src/cli/data.py b/src/cli/data.py index d262bd3..5df9ac9 100644 --- a/src/cli/data.py +++ b/src/cli/data.py @@ -4,7 +4,7 @@ import pandas as pd def pull_new_tba_matches(apikey, competition, cutoff): api_key= apikey - x=requests.get("https://www.thebluealliance.com/api/v3/event/"+competition+"/matches/simple", headers={"X-TBA-Auth_Key":api_key}, verify=False) + x=requests.get("https://www.thebluealliance.com/api/v3/event/"+competition+"/matches/simple", headers={"X-TBA-Auth-Key":api_key}, verify=False) out = [] for i in x.json(): if i["actual_time"] != None and i["actual_time"]-cutoff >= 0 and i["comp_level"] == "qm": @@ -52,8 +52,9 @@ def get_metrics_data_formatted(client, competition): def get_pit_data_formatted(client, competition): db = client.data_scouting - mdata = db.teamlist - x=mdata.find_one({"competition":competition}) + mdata = db.teamlist.competition + x=mdata.find_one({"competition":competition}) # x should be a list of teams given the soecified competition + print(x) out = {} for i in x: try: @@ -155,7 +156,7 @@ def load_metric(client, competition, match, group_name, metrics): elo = {"score": metrics["elo"]["score"]} gl2 = {"score": metrics["gl2"]["score"], "rd": metrics["gl2"]["rd"], "vol": metrics["gl2"]["vol"]} - ts = {"mu": metrics["ts"]["mu"], "sigm+a": metrics["ts"]["sigma"]} + ts = {"mu": metrics["ts"]["mu"], "sigma": metrics["ts"]["sigma"]} group[team] = {"elo": elo, "gl2": gl2, "ts": ts} diff --git a/src/cli/module.py b/src/cli/module.py index 763a348..217c832 100644 --- a/src/cli/module.py +++ b/src/cli/module.py @@ -263,7 +263,7 @@ class Metric (Module): temp_vector.update(red) temp_vector.update(blu) - d.push_metric(self.client, self.competition, temp_vector) + d.push_metric(self.apikey, self.competition, temp_vector) def _push_results(self): pass diff --git a/src/cli/superscript.py b/src/cli/superscript.py index 25c2518..970ab52 100644 --- a/src/cli/superscript.py +++ b/src/cli/superscript.py @@ -210,7 +210,8 @@ def main(send, verbose = False, profile = False, debug = False): client = pymongo.MongoClient(apikey) send(stdout, INF, "established connection to database") - send(stdout, INF, "analysis backtimed to: " + str(get_previous_time(client))) + previous_time = get_previous_time(client) + send(stdout, INF, "analysis backtimed to: " + str(previous_time)) config = resolve_config_conflicts(send, client, config, preference, sync) @@ -222,7 +223,7 @@ def main(send, verbose = False, profile = False, debug = False): for m in config_modules: if m in modules: start = time.time() - current_module = modules[m](config_modules[m], client, tbakey, loop_start, competition) + current_module = modules[m](config_modules[m], client, tbakey, previous_time, competition) valid = current_module.validate_config() if not valid: continue