From 7d85a18b4b4dd07b1627340cd0a8cc19860f71cc Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Sat, 3 Apr 2021 20:47:45 +0000 Subject: [PATCH] superscript v 0.8.3 --- .gitignore | 3 ++- src/superscript.py | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 325f585..c1d3443 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ **/*.pyc **/*.egg-info/ -**/config.json \ No newline at end of file +**/config.json +**/tra_analysis/ \ No newline at end of file diff --git a/src/superscript.py b/src/superscript.py index 4c80206..fbc8b99 100644 --- a/src/superscript.py +++ b/src/superscript.py @@ -3,10 +3,12 @@ # Notes: # setup: -__version__ = "0.8.2" +__version__ = "0.8.3" # changelog should be viewed using print(analysis.__changelog__) __changelog__ = """changelog: + 0.8.3: + - updated matchloop with new regression format (requires tra_analysis 3.x) 0.8.2: - readded while true to main function - added more thread config options @@ -284,6 +286,8 @@ def matchloop(apikey, competition, data, tests): # expects 3D array with [Team][ global exec_threads + short_mapping = {"regression_linear": "lin", "regression_logarithmic": "log", "regression_exponential": "exp", "regression_polynomial": "ply", "regression_sigmoidal": "sig"} + class AutoVivification(dict): def __getitem__(self, item): try: @@ -321,7 +325,13 @@ def matchloop(apikey, competition, data, tests): # expects 3D array with [Team][ for result in result_filtered: - return_vector[team_filtered[i]][variable_filtered[i]][test_filtered[i]] = result + filtered = test_filtered[i] + + try: + short = short_mapping[filtered] + return_vector[team_filtered[i]][variable_filtered[i]][test_filtered[i]] = result[short] + except KeyError: # not in mapping + return_vector[team_filtered[i]][variable_filtered[i]][test_filtered[i]] = result i += 1 push_match(apikey, competition, return_vector)