14 Commits

Author SHA1 Message Date
ltcptgeneral
375befd0c4 analysis pkg v 1.0.0.9 2020-03-17 20:03:49 -05:00
ltcptgeneral
893d1fb1d0 analysis.py v 1.1.13.007 2020-03-16 22:05:52 -05:00
ltcptgeneral
6a426ae4cd a 2020-03-10 00:45:42 -05:00
ltcptgeneral
50c064ffa4 worked 2020-03-09 22:58:51 -05:00
ltcptgeneral
1b0a9967c8 test1 2020-03-09 22:58:11 -05:00
ltcptgeneral
2605f7c29f Merge pull request #6 from titanscout2022/testing
Testing
2020-03-09 20:42:30 -05:00
ltcptgeneral
6f5a3edd88 superscript.py v 0.0.5.000 2020-03-09 20:35:11 -05:00
ltcptgeneral
457146b0e4 working 2020-03-09 20:29:44 -05:00
ltcptgeneral
f7fd8ffcf9 working 2020-03-09 20:18:30 -05:00
art
77bc792426 removed unessasary stuff 2020-03-09 10:29:59 -05:00
ltcptgeneral
39146cc555 Merge pull request #5 from titanscout2022/comp-edits
Comp edits
2020-03-09 10:28:48 -05:00
Dev Singh
2daa09c040 hi 2020-03-06 21:21:37 -06:00
Dev Singh
68d27a6302 add reqs 2020-03-06 20:44:40 -06:00
Dev Singh
7fc18b7c35 add Procfile 2020-03-06 20:41:53 -06:00
20 changed files with 62 additions and 34 deletions

5
.gitignore vendored
View File

@@ -18,4 +18,7 @@ data analysis/arthur_pull.ipynb
data analysis/keys.txt
data analysis/check_for_new_matches.ipynb
data analysis/test.ipynb
data analysis/visualize_pit.ipynb
data analysis/visualize_pit.ipynb
data analysis/config/keys.config
analysis-master/analysis/__pycache__/
data analysis/__pycache__/

View File

@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: analysis
Version: 1.0.0.8
Version: 1.0.0.9
Summary: analysis package developed by Titan Scouting for The Red Alliance
Home-page: https://github.com/titanscout2022/tr2022-strategy
Author: The Titan Scouting Team

View File

@@ -7,10 +7,12 @@
# current benchmark of optimization: 1.33 times faster
# setup:
__version__ = "1.1.13.006"
__version__ = "1.1.13.007"
# changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
1.1.13.007:
- fixed bug with trueskill
1.1.13.006:
- cleaned up imports
1.1.13.005:
@@ -461,13 +463,13 @@ def trueskill(teams_data, observations): # teams_data is array of array of tuple
team_ratings = []
for team in teams_data:
team_temp = []
team_temp = ()
for player in team:
player = Trueskill.Rating(player[0], player[1])
team_temp.append(player)
team_temp = team_temp + (player,)
team_ratings.append(team_temp)
return Trueskill.rate(teams_data, observations)
return Trueskill.rate(team_ratings, ranks=observations)
class RegressionMetrics():

0
analysis-master/build.sh Executable file → Normal file
View File

View File

@@ -7,10 +7,12 @@
# current benchmark of optimization: 1.33 times faster
# setup:
__version__ = "1.1.13.006"
__version__ = "1.1.13.007"
# changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
1.1.13.007:
- fixed bug with trueskill
1.1.13.006:
- cleaned up imports
1.1.13.005:
@@ -461,13 +463,13 @@ def trueskill(teams_data, observations): # teams_data is array of array of tuple
team_ratings = []
for team in teams_data:
team_temp = []
team_temp = ()
for player in team:
player = Trueskill.Rating(player[0], player[1])
team_temp.append(player)
team_temp = team_temp + (player,)
team_ratings.append(team_temp)
return Trueskill.rate(teams_data, observations)
return Trueskill.rate(team_ratings, ranks=observations)
class RegressionMetrics():

Binary file not shown.

Binary file not shown.

View File

@@ -2,7 +2,7 @@ import setuptools
setuptools.setup(
name="analysis", # Replace with your own username
version="1.0.0.008",
version="1.0.0.009",
author="The Titan Scouting Team",
author_email="titanscout2022@gmail.com",
description="analysis package developed by Titan Scouting for The Red Alliance",

View File

@@ -0,0 +1 @@
2020ilch

View File

View File

@@ -1,4 +1,3 @@
2020ilch
balls-blocked,basic_stats,historical_analysis,regression_linear,regression_logarithmic,regression_exponential,regression_polynomial,regression_sigmoidal
balls-collected,basic_stats,historical_analysis,regression_linear,regression_logarithmic,regression_exponential,regression_polynomial,regression_sigmoidal
balls-lower-teleop,basic_stats,historical_analysis,regression_linear,regression_logarithmic,regression_exponential,regression_polynomial,regression_sigmoidal

View File

@@ -3,10 +3,12 @@
# Notes:
# setup:
__version__ = "0.0.4.002"
__version__ = "0.0.5.000"
# changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
0.0.5.000:
improved user interface
0.0.4.002:
- removed unessasary code
0.0.4.001:
@@ -83,6 +85,8 @@ from analysis import analysis as an
import data as d
import numpy as np
import matplotlib.pyplot as plt
from os import system, name
from pathlib import Path
import time
import warnings
@@ -91,16 +95,16 @@ def main():
while(True):
current_time = time.time()
print("time: " + str(current_time))
print("[OK] time: " + str(current_time))
print(" loading config")
competition, config = load_config("config.csv")
print(" config loaded")
start = time.time()
config = load_config(Path("config/stats.config"))
competition = an.load_csv(Path("config/competition.config"))[0][0]
print("[OK] configs loaded")
print(" loading database keys")
apikey = an.load_csv("keys.txt")[0][0]
tbakey = an.load_csv("keys.txt")[1][0]
print(" loaded keys")
apikey = an.load_csv(Path("config/keys.config"))[0][0]
tbakey = an.load_csv(Path("config/keys.config"))[1][0]
print("[OK] loaded keys")
previous_time = d.get_analysis_flags(apikey, "latest_update")
@@ -113,38 +117,55 @@ def main():
previous_time = previous_time["latest_update"]
print(" analysis backtimed to: " + str(previous_time))
print("[OK] analysis backtimed to: " + str(previous_time))
print(" loading data")
print("[OK] loading data")
start = time.time()
data = d.get_match_data_formatted(apikey, competition)
pit_data = d.pit = d.get_pit_data_formatted(apikey, competition)
print(" loaded data")
print("[OK] loaded data in " + str(time.time() - start) + " seconds")
print(" running tests")
print("[OK] running tests")
start = time.time()
results = simpleloop(data, config)
print(" finished tests")
print("[OK] finished tests in " + str(time.time() - start) + " seconds")
print(" running metrics")
print("[OK] running metrics")
start = time.time()
metricsloop(tbakey, apikey, competition, previous_time)
print(" finished metrics")
print("[OK] finished metrics in " + str(time.time() - start) + " seconds")
print(" running pit analysis")
print("[OK] running pit analysis")
start = time.time()
pit = pitloop(pit_data, config)
print(" finished pit analysis")
print("[OK] finished pit analysis in " + str(time.time() - start) + " seconds")
d.set_analysis_flags(apikey, "latest_update", {"latest_update":current_time})
print(" pushing to database")
print("[OK] pushing to database")
start = time.time()
push_to_database(apikey, competition, results, pit)
print(" pushed to database")
print("[OK] pushed to database in " + str(time.time() - start) + " seconds")
clear()
def clear():
# for windows
if name == 'nt':
_ = system('cls')
# for mac and linux(here, os.name is 'posix')
else:
_ = system('clear')
def load_config(file):
config_vector = {}
file = an.load_csv(file)
for line in file[1:]:
for line in file:
config_vector[line[0]] = line[1:]
return (file[0][0], config_vector)
return config_vector
def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match]