mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-06 06:57:21 +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:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ data analysis/keys/keytemp.json
|
|||||||
data analysis/__pycache__/analysis.cpython-37.pyc
|
data analysis/__pycache__/analysis.cpython-37.pyc
|
||||||
apps/android/source/app/src/main/res/drawable-v24/uuh.png
|
apps/android/source/app/src/main/res/drawable-v24/uuh.png
|
||||||
apps/android/source/app/src/main/java/com/example/titanscouting/tits.java
|
apps/android/source/app/src/main/java/com/example/titanscouting/tits.java
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1,3 @@
|
|||||||
21, 23, 39, 50, 89, 97, 191, 213, 233, 236, 272, 289, 308, 310, 314, 317, 329, 355, 428, 436
|
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
|
2022
|
|
@@ -3,9 +3,12 @@
|
|||||||
#Notes:
|
#Notes:
|
||||||
#setup:
|
#setup:
|
||||||
|
|
||||||
__version__ = "1.0.5.003"
|
__version__ = "1.0.6.000"
|
||||||
|
|
||||||
__changelog__ = """changelog:
|
__changelog__ = """changelog:
|
||||||
|
1.0.6.000:
|
||||||
|
- added pulldata function
|
||||||
|
- service now pulls in, computes data, and outputs data as planned
|
||||||
1.0.5.003:
|
1.0.5.003:
|
||||||
- hotfix: actually pushes data correctly now
|
- hotfix: actually pushes data correctly now
|
||||||
1.0.5.002:
|
1.0.5.002:
|
||||||
@@ -51,7 +54,8 @@ import warnings
|
|||||||
import glob
|
import glob
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
import time
|
||||||
import tbarequest as tbS
|
import tbarequest as tba
|
||||||
|
import csv
|
||||||
|
|
||||||
def titanservice():
|
def titanservice():
|
||||||
|
|
||||||
@@ -197,8 +201,23 @@ def titanservice():
|
|||||||
#db.collection(u'stats').document(u'stats-noNN').set(score_out)
|
#db.collection(u'stats').document(u'stats-noNN').set(score_out)
|
||||||
|
|
||||||
def pulldata():
|
def pulldata():
|
||||||
#TODO
|
teams = analysis.load_csv('data/teams.csv')
|
||||||
pass
|
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():
|
def service():
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user