superscript.py v 0.0.1.000

This commit is contained in:
art 2020-03-03 19:39:58 -06:00
parent f9b0343aa1
commit 5915827d15
3 changed files with 27 additions and 3 deletions

View File

@ -53,3 +53,9 @@ def get_data_formatted(apikey, competition):
except:
pass
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)

View File

@ -3,10 +3,12 @@
# Notes:
# setup:
__version__ = "0.0.0.009"
__version__ = "0.0.1.000"
# changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
0.0.1.000:
- tested working, can push to database
0.0.0.009:
- tested working
- prints out stats for the time being, will push to database later
@ -63,11 +65,21 @@ except:
def main():
while(True):
print("loading config")
competition, config = load_config("config.csv")
print("config loaded")
print("loading database keys")
apikey = an.load_csv("keys.txt")[0][0]
print("loaded keys")
print("loading data")
data = d.get_data_formatted(apikey, competition)
print("loaded data")
print("running tests")
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):
config_vector = {}
@ -117,6 +129,12 @@ def simplestats(data, test):
if(test == "regression_sigmoidal"):
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
pass