mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-10 06:54:44 +00:00
superscript.py - v 1.0.6.000
changelog: - added pulldata function - service now pulls in, computes data, and outputs data as planned
This commit is contained in:
parent
3e47a232cc
commit
c74b0f34a6
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ data analysis/keys/keytemp.json
|
||||
data analysis/__pycache__/analysis.cpython-37.pyc
|
||||
apps/android/source/app/src/main/res/drawable-v24/uuh.png
|
||||
apps/android/source/app/src/main/java/com/example/titanscouting/tits.java
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1104,4 +1104,4 @@ def stdev(data, xbar=None):
|
||||
try:
|
||||
return var.sqrt()
|
||||
except AttributeError:
|
||||
return math.sqrt(var)
|
||||
return math.sqrt(var)
|
||||
|
@ -1 +1,3 @@
|
||||
21, 23, 39, 50, 89, 97, 191, 213, 233, 236, 272, 289, 308, 310, 314, 317, 329, 355, 428, 436
1, 25, 34, 106, 112, 132, 146, 167, 184, 223, 256, 267, 304, 337, 339, 370, 411, 460, 485, 494
7, 11, 55, 81, 92, 144, 151, 157, 165, 174, 177, 220, 241, 312, 320, 341, 343, 347, 419, 473
6, 9, 11, 28, 31, 194, 200, 201, 246, 298, 340, 351, 355, 364, 388, 395, 414, 422, 429, 442
33, 73, 102, 103, 137, 183, 200, 212, 218, 242, 249, 264, 294, 302, 310, 378, 400, 408, 457, 473
|
||||
29,63,35,37,26,51,35,58,30,61,45
|
||||
26,62,45,37,42,29,59,44,40
|
||||
35,63,62,18,56,65,42,77,82,63,76,50,47,69,57,65,85,70,38,67,89,74,71,67,70,71,95,77,45
|
||||
|
|
@ -1 +1 @@
|
||||
2022
2011
1101
821374
5
|
||||
2022
2451
16
|
|
@ -3,9 +3,12 @@
|
||||
#Notes:
|
||||
#setup:
|
||||
|
||||
__version__ = "1.0.5.003"
|
||||
__version__ = "1.0.6.000"
|
||||
|
||||
__changelog__ = """changelog:
|
||||
1.0.6.000:
|
||||
- added pulldata function
|
||||
- service now pulls in, computes data, and outputs data as planned
|
||||
1.0.5.003:
|
||||
- hotfix: actually pushes data correctly now
|
||||
1.0.5.002:
|
||||
@ -51,7 +54,8 @@ import warnings
|
||||
import glob
|
||||
import numpy as np
|
||||
import time
|
||||
import tbarequest as tbS
|
||||
import tbarequest as tba
|
||||
import csv
|
||||
|
||||
def titanservice():
|
||||
|
||||
@ -197,9 +201,24 @@ def titanservice():
|
||||
#db.collection(u'stats').document(u'stats-noNN').set(score_out)
|
||||
|
||||
def pulldata():
|
||||
#TODO
|
||||
pass
|
||||
teams = analysis.load_csv('data/teams.csv')
|
||||
scores = []
|
||||
for i in range(len(teams)):
|
||||
team_scores = []
|
||||
request_data_object = tba.req_team_matches(teams[i][0], 2019, "UDvKmPjPRfwwUdDX1JxbmkyecYBJhCtXeyVk9vmO2i7K0Zn4wqQPMfzuEINXJ7e5")
|
||||
json_data = request_data_object.json()
|
||||
json_data = sorted(json_data, key=lambda k: k.get('actual_time', 0), reverse=False)
|
||||
for j in range(len(json_data)):
|
||||
if "frc" + teams[i][0] in json_data[j].get('alliances').get('blue').get('team_keys'):
|
||||
team_scores.append(json_data[j].get('alliances').get('blue').get('score'))
|
||||
elif "frc" + teams[i][0] in json_data[j].get('alliances').get('red').get('team_keys'):
|
||||
team_scores.append(json_data[j].get('alliances').get('red').get('score'))
|
||||
scores.append(team_scores)
|
||||
|
||||
with open("data/scores.csv", "w+", newline = '') as file:
|
||||
writer = csv.writer(file, delimiter = ',')
|
||||
writer.writerows(scores)
|
||||
|
||||
def service():
|
||||
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user