superscript.py v 0.8.1

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2020-09-21 07:38:18 +00:00
parent 71adc97277
commit 5b89825f0b
2 changed files with 35 additions and 32 deletions

View File

@ -1,5 +1,5 @@
{
"max-threads": 8,
"max-threads": 1,
"team": "",
"competition": "2020ilch",
"key":{

View File

@ -3,10 +3,12 @@
# Notes:
# setup:
__version__ = "0.8.0"
__version__ = "0.8.1"
# changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog:
0.8.1:
- optimized matchloop further by bypassing GIL
0.8.0:
- added multithreading to matchloop
- tweaked user log
@ -122,6 +124,7 @@ import json
import numpy as np
from os import system, name
from pathlib import Path
from multiprocessing import Pool
import matplotlib.pyplot as plt
from concurrent.futures import ThreadPoolExecutor
import time
@ -148,7 +151,7 @@ def main():
print("[OK] configs loaded")
print("[OK] starting threads")
exec_threads = ThreadPoolExecutor(max_workers = config["max-threads"])
exec_threads = Pool(processes = config["max-threads"])
print("[OK] threads started")
apikey = config["key"]["database"]
@ -230,11 +233,7 @@ def load_match(apikey, competition):
return d.get_match_data_formatted(apikey, competition)
def matchloop(apikey, competition, data, tests): # expects 3D array with [Team][Variable][Match]
global exec_threads
def simplestats(data_test):
def simplestats(data_test):
data = np.array(data_test[0])
data = data[np.isfinite(data)]
@ -263,6 +262,10 @@ def matchloop(apikey, competition, data, tests): # expects 3D array with [Team][
if test == "regression_sigmoidal":
return an.regression(ranges, data, ['sig'])
def matchloop(apikey, competition, data, tests): # expects 3D array with [Team][Variable][Match]
global exec_threads
class AutoVivification(dict):
def __getitem__(self, item):
try: