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:
ltcptgeneral 2019-03-20 16:16:48 -05:00
parent 3e47a232cc
commit c74b0f34a6
8 changed files with 29 additions and 7 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -1104,4 +1104,4 @@ def stdev(data, xbar=None):
try: try:
return var.sqrt() return var.sqrt()
except AttributeError: except AttributeError:
return math.sqrt(var) return math.sqrt(var)

View File

@ -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 21 29,63,35,37,26,51,35,58,30,61,45 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
2 26,62,45,37,42,29,59,44,40
3 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

View File

@ -1 +1 @@
2022 2011 1101 821374 5 2022 2451 16
1 2022 2011 1101 821374 5 2022 2451 16

View File

@ -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,9 +201,24 @@ 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():
while True: while True: