mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-12-28 10:39:09 +00:00
delete on start
This commit is contained in:
parent
25e4babd71
commit
ac8002aaf8
@ -11,6 +11,7 @@ def pull_new_tba_matches(apikey, competition, cutoff):
|
||||
for i in json:
|
||||
if i["actual_time"] != None and i["comp_level"] == "qm":
|
||||
out.append({"match" : i['match_number'], "blue" : list(map(lambda x: int(x[3:]), i['alliances']['blue']['team_keys'])), "red" : list(map(lambda x: int(x[3:]), i['alliances']['red']['team_keys'])), "winner": i["winning_alliance"]})
|
||||
out.sort(key=lambda x: x['match'])
|
||||
return out
|
||||
|
||||
def pull_new_tba_matches_manual(apikey, competition, cutoff):
|
||||
@ -27,6 +28,12 @@ def get_team_match_data(client, competition, team_num):
|
||||
out[i['match']] = i['data']
|
||||
return pd.DataFrame(out)
|
||||
|
||||
def clear_metrics(client, competition):
|
||||
db = client.data_processing
|
||||
data = db.team_metrics
|
||||
data.delete_many({competition: competition})
|
||||
return True
|
||||
|
||||
def get_team_pit_data(client, competition, team_num):
|
||||
db = client.data_scouting
|
||||
mdata = db.pitdata
|
||||
|
@ -3,6 +3,7 @@ import data as d
|
||||
import signal
|
||||
import numpy as np
|
||||
from tra_analysis import Analysis as an
|
||||
from tqdm import tqdm
|
||||
|
||||
class Module(metaclass = abc.ABCMeta):
|
||||
|
||||
@ -173,6 +174,8 @@ class Metric (Module):
|
||||
|
||||
def _process_data(self):
|
||||
|
||||
d.clear_metrics(self.apikey, self.competition)
|
||||
|
||||
elo_N = self.config["tests"]["elo"]["N"]
|
||||
elo_K = self.config["tests"]["elo"]["K"]
|
||||
|
||||
@ -180,9 +183,7 @@ class Metric (Module):
|
||||
|
||||
red = {}
|
||||
blu = {}
|
||||
|
||||
for match in matches:
|
||||
|
||||
for match in tqdm(matches, desc="Metrics"):
|
||||
red = d.load_metric(self.apikey, self.competition, match, "red", self.config["tests"])
|
||||
blu = d.load_metric(self.apikey, self.competition, match, "blue", self.config["tests"])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user