removed autovivification (likely not required)

Signed-off-by: Arthur Lu <learthurgo@gmail.com>

Former-commit-id: f40939d69d
This commit is contained in:
Arthur Lu 2021-10-21 21:29:44 +00:00
parent 375b550153
commit 66bf3a3a3e

View File

@ -3,14 +3,6 @@ import signal
import numpy as np import numpy as np
import tra_analysis as an import tra_analysis as an
class AutoVivification(dict):
def __getitem__(self, item):
try:
return dict.__getitem__(self, item)
except KeyError:
value = self[item] = type(self)()
return value
class Module: class Module:
config = None config = None
data = None data = None
@ -82,7 +74,7 @@ class Match:
tests = test_data["tests"] tests = test_data["tests"]
results = AutoVivification() results = {}
if "basic_stats" in tests: if "basic_stats" in tests:
results["basic_stats"] = an.basic_stats(data) results["basic_stats"] = an.basic_stats(data)
@ -106,7 +98,6 @@ class Match:
def push_results(self): def push_results(self):
short_mapping = {"regression_linear": "lin", "regression_logarithmic": "log", "regression_exponential": "exp", "regression_polynomial": "ply", "regression_sigmoidal": "sig"} short_mapping = {"regression_linear": "lin", "regression_logarithmic": "log", "regression_exponential": "exp", "regression_polynomial": "ply", "regression_sigmoidal": "sig"}
results_short = AutoVivification()
i = 0 i = 0
for result in self.results: for result in self.results:
for variable in result: for variable in result:
@ -114,6 +105,5 @@ class Match:
short = short_mapping[variable] short = short_mapping[variable]
else: else:
short = variable short = variable
d.push_team_match_results(self.data[i]["team"], self.data[i]["competition"], self.data[i]["variable"], short, result[variable]) d.push_team_match_results(self.data[i]["team"], self.data[i]["competition"], self.data[i]["variable"], short, result[variable]) # needs implementation
#results_short[ self.data["team"] ][ self.data["competition"] ][ self.data["variable"] ][short] = result[variable]
i+=1 i+=1