mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-12-27 09:59:10 +00:00
superscript.py v 0.0.1.000
This commit is contained in:
parent
f9b0343aa1
commit
5915827d15
Binary file not shown.
@ -53,3 +53,9 @@ def get_data_formatted(apikey, competition):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
def push_team_data(apikey, competition, team_num, data):
|
||||||
|
client = pymongo.MongoClient(apikey)
|
||||||
|
db = client.arthur_data_processing
|
||||||
|
mdata = db.team_tests
|
||||||
|
mdata.replace_one({"competition" : competition, "team": team_num}, {"_id": competition+str(team_num)+"am", "competition" : competition, "team" : team_num, "data" : data}, True)
|
@ -3,10 +3,12 @@
|
|||||||
# Notes:
|
# Notes:
|
||||||
# setup:
|
# setup:
|
||||||
|
|
||||||
__version__ = "0.0.0.009"
|
__version__ = "0.0.1.000"
|
||||||
|
|
||||||
# changelog should be viewed using print(analysis.__changelog__)
|
# changelog should be viewed using print(analysis.__changelog__)
|
||||||
__changelog__ = """changelog:
|
__changelog__ = """changelog:
|
||||||
|
0.0.1.000:
|
||||||
|
- tested working, can push to database
|
||||||
0.0.0.009:
|
0.0.0.009:
|
||||||
- tested working
|
- tested working
|
||||||
- prints out stats for the time being, will push to database later
|
- prints out stats for the time being, will push to database later
|
||||||
@ -63,11 +65,21 @@ except:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
while(True):
|
while(True):
|
||||||
|
print("loading config")
|
||||||
competition, config = load_config("config.csv")
|
competition, config = load_config("config.csv")
|
||||||
|
print("config loaded")
|
||||||
|
print("loading database keys")
|
||||||
apikey = an.load_csv("keys.txt")[0][0]
|
apikey = an.load_csv("keys.txt")[0][0]
|
||||||
|
print("loaded keys")
|
||||||
|
print("loading data")
|
||||||
data = d.get_data_formatted(apikey, competition)
|
data = d.get_data_formatted(apikey, competition)
|
||||||
|
print("loaded data")
|
||||||
|
print("running tests")
|
||||||
results = simpleloop(data, config)
|
results = simpleloop(data, config)
|
||||||
print(results)
|
print("finished tests")
|
||||||
|
print("pushing to database")
|
||||||
|
push_to_database(apikey, competition, results)
|
||||||
|
print("pushed to database")
|
||||||
|
|
||||||
def load_config(file):
|
def load_config(file):
|
||||||
config_vector = {}
|
config_vector = {}
|
||||||
@ -117,6 +129,12 @@ def simplestats(data, test):
|
|||||||
if(test == "regression_sigmoidal"):
|
if(test == "regression_sigmoidal"):
|
||||||
return an.regression('cpu', list(range(len(data))), data, ['sig'])
|
return an.regression('cpu', list(range(len(data))), data, ['sig'])
|
||||||
|
|
||||||
|
def push_to_database(apikey, competition, results):
|
||||||
|
|
||||||
|
for team in results:
|
||||||
|
|
||||||
|
d.push_team_data(apikey, competition, team, results[team])
|
||||||
|
|
||||||
def metricsloop(group_data, observations, database, tests): # listener based metrics update
|
def metricsloop(group_data, observations, database, tests): # listener based metrics update
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user