mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-12-30 19:39:09 +00:00
reintroduce cutoff usage
This commit is contained in:
parent
69c6059ff8
commit
8e5fa7eace
@ -9,7 +9,7 @@ def pull_new_tba_matches(apikey, competition, cutoff):
|
|||||||
json = x.json()
|
json = x.json()
|
||||||
out = []
|
out = []
|
||||||
for i in json:
|
for i in json:
|
||||||
if i["actual_time"] != None and i["comp_level"] == "qm":
|
if i["actual_time"] != None and i["comp_level"] == "qm" and i["actual_time"]-cutoff >= 0:
|
||||||
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.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'])
|
out.sort(key=lambda x: x['match'])
|
||||||
return out
|
return out
|
||||||
@ -17,8 +17,8 @@ def pull_new_tba_matches(apikey, competition, cutoff):
|
|||||||
def pull_new_tba_matches_manual(apikey, competition, cutoff):
|
def pull_new_tba_matches_manual(apikey, competition, cutoff):
|
||||||
filename = competition+"-wins.json"
|
filename = competition+"-wins.json"
|
||||||
with open(filename, 'r') as f:
|
with open(filename, 'r') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_team_match_data(client, competition, team_num):
|
def get_team_match_data(client, competition, team_num):
|
||||||
db = client.data_scouting
|
db = client.data_scouting
|
||||||
|
@ -205,7 +205,6 @@ def main(logger, verbose, profile, debug, socket_send = None):
|
|||||||
config.resolve_config_conflicts(logger, client)
|
config.resolve_config_conflicts(logger, client)
|
||||||
|
|
||||||
config_modules, competition = config.modules, config.competition
|
config_modules, competition = config.modules, config.competition
|
||||||
clear_metrics(client, config.competition)
|
|
||||||
for m in config_modules:
|
for m in config_modules:
|
||||||
if m in modules:
|
if m in modules:
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
Loading…
Reference in New Issue
Block a user