This commit is contained in:
Jacob Levine
2019-03-08 21:56:15 -06:00
6 changed files with 26 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
2022,4,5,10,15,8,954978,84,74 4,5,10,15,8,954978,84,74
2011,3,6,9,12,15,7,856,9 3,6,9,12,15,7,856,9
1101,4,16,32,64,128,2,4234,-56 4,16,32,64,128,2,4234,-56
821374,7,8,9,79.33333333,170.3333333,636647,5874.666667,-121 7,8,9,79.33333333,170.3333333,636647,5874.666667,-121
5,4,8,8,103.8333333,230.3333333,1114135,7949.666667,-186 4,8,8,103.8333333,230.3333333,1114135,7949.666667,-186
1 2022 4 5 10 15 8 954978 84 74
2 2011 3 6 9 12 15 7 856 9
3 1101 4 16 32 64 128 2 4234 -56
4 821374 7 8 9 79.33333333 170.3333333 636647 5874.666667 -121
5 5 4 8 8 103.8333333 230.3333333 1114135 7949.666667 -186

View File

@@ -1,5 +1,5 @@
2022,1,2,3,4,5,6,7,8 1,2,3,4,5,6,7,8
2011,5,6,7,8,9,10,11,12 5,6,7,8,9,10,11,12
1101,1000,2000,3000,4000,5000,6000,7000,8000 1000,2000,3000,4000,5000,6000,7000,8000
821374,0,0,0,0,0,0,0,1 0,0,0,0,0,0,0,1
5,3,5,6,7,8.5,9.8,11.1,12.4 3,5,6,7,8.5,9.8,11.1,12.4
1 2022 1 2 3 4 5 6 7 8
2 2011 5 6 7 8 9 10 11 12
3 1101 1000 2000 3000 4000 5000 6000 7000 8000
4 821374 0 0 0 0 0 0 0 1
5 5 3 5 6 7 8.5 9.8 11.1 12.4

View File

@@ -1 +1 @@
2022, 21, 23, 39, 50, 89, 97, 191, 213, 233, 236, 272, 289, 308, 310, 314, 317, 329, 355, 428, 436 21, 23, 39, 50, 89, 97, 191, 213, 233, 236, 272, 289, 308, 310, 314, 317, 329, 355, 428, 436
1 2022 21 23 39 50 89 97 191 213 233 236 272 289 308 310 314 317 329 355 428 436 1 436 2011 25 1 34 106 112 132 146 167 184 223 256 267 304 337 339 370 411 460 485 494 7 11 494 1101 55 7 81 92 144 151 157 165 174 177 220 241 312 320 341 343 347 419 473 6 9 11 473 821374 28 6 31 194 200 201 246 298 340 351 355 364 388 395 414 422 429 442 33 73 102 103 442 5 137 33 183 200 212 218 242 249 264 294 302 310 378 400 408 457 473

View File

@@ -3,9 +3,11 @@
#Notes: #Notes:
#setup: #setup:
__version__ = "1.0.5.002" __version__ = "1.0.5.003"
__changelog__ = """changelog: __changelog__ = """changelog:
1.0.5.003:
- hotfix: actually pushes data correctly now
1.0.5.002: 1.0.5.002:
- more information given - more information given
- performance improvements - performance improvements
@@ -36,7 +38,7 @@ __author__ = (
"Arthur Lu <arthurlu@ttic.edu>, " "Arthur Lu <arthurlu@ttic.edu>, "
"Jacob Levine <jlevine@ttic.edu>," "Jacob Levine <jlevine@ttic.edu>,"
) )
s
import firebase_admin import firebase_admin
from firebase_admin import credentials from firebase_admin import credentials
from firebase_admin import firestore from firebase_admin import firestore
@@ -72,7 +74,7 @@ def titanservice():
end = time.time() end = time.time()
print("[OK] loaded data in " + str(end - start) + "seconds") print("[OK] loaded data in " + str(end - start) + " seconds")
#assumes that team number is in the first column, and that the order of teams is the same across all files #assumes that team number is in the first column, and that the order of teams is the same across all files
#unhelpful comment #unhelpful comment
@@ -117,10 +119,10 @@ def titanservice():
measure_stats.append(teams[i] + list(analysis.basic_stats(line, 0, 0)) + list(analysis.histo_analysis(line, 1, -3, 3)) + ofbest_curve + r2best_curve) measure_stats.append(teams[i] + list(analysis.basic_stats(line, 0, 0)) + list(analysis.histo_analysis(line, 1, -3, 3)) + ofbest_curve + r2best_curve)
stats.append(list(measure_stats)) stats.append(list(measure_stats))
nishant = [] nishant = []
for i in range(len(scores)): for i in range(len(scores)):
ofbest_curve = [None] ofbest_curve = [None]
r2best_curve = [None] r2best_curve = [None]
@@ -168,21 +170,23 @@ def titanservice():
score_out = {} score_out = {}
#print(stats) #print(stats)
#print(stats[0])
for i in range(len(teams)): #for i in range(len(teams)):
json_out[str(teams[i][0])] = (stats[0][i]) # json_out[str(teams[i][0])] = (stats[0][i])
for i in range(len(teams)): for i in range(len(teams)):
score_out[str(teams[i][0])] = (nishant[i]) score_out[str(teams[i][0])] = (nishant[i])
print(json_out)
#print(json_out.get('5')) #print(json_out.get('5'))
location = db.collection(u'stats').document(u'stats-noNN') location = db.collection(u'stats').document(u'stats-noNN')
for i in range(len(teams)): for i in range(len(teams)):
general_general_stats = location.collection(teams[i][0]) general_general_stats = location.collection(teams[i][0])
for j in range(len(files)): for j in range(len(files)):
json_out[str(teams[i][0])] = (stats[j][i])
general_general_stats.document(files[j]).set({'stats':json_out.get(teams[i][0])}) general_general_stats.document(files[j]).set({'stats':json_out.get(teams[i][0])})
for i in range(len(teams)): for i in range(len(teams)):
@@ -232,7 +236,7 @@ def service():
time.sleep(300 - (end - start)) #executes once every 5 minutes time.sleep(300 - (end - start)) #executes once every 5 minutes
warnings.simplefilter("ignore") warnings.simplefilter("ignore")
# Use a service account #Use a service account
cred = credentials.Certificate('keys/keytemp.json') cred = credentials.Certificate('keys/keytemp.json')
firebase_admin.initialize_app(cred) firebase_admin.initialize_app(cred)