mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-11-09 22:44:44 +00:00
patched issue in multiprocessing,
moved ConfigurationError to exceptions.py, made pull use load_config in config.py
This commit is contained in:
parent
2f83604e14
commit
aed03369c9
@ -3,6 +3,7 @@ import json
|
||||
from multiprocessing import Pool
|
||||
import os
|
||||
from cerberus import Validator
|
||||
from exceptions import ConfigurationError
|
||||
|
||||
from data import set_database_config, get_database_config
|
||||
from interface import stderr, stdout, INF, ERR
|
||||
@ -134,12 +135,6 @@ sample_json = """
|
||||
}
|
||||
"""
|
||||
|
||||
class ConfigurationError (Exception):
|
||||
code = None
|
||||
def __init__(self, str, code):
|
||||
super().__init__(str)
|
||||
self.code = code
|
||||
|
||||
def parse_config_persistent(send, config):
|
||||
v = Validator(load_validation_schema(), allow_unknown = True)
|
||||
isValidated = v.validate(config)
|
||||
|
@ -3,3 +3,9 @@ class APIError(Exception):
|
||||
def __init__(self, str, endpoint):
|
||||
super().__init__(str)
|
||||
self.endpoint = endpoint
|
||||
|
||||
class ConfigurationError (Exception):
|
||||
code = None
|
||||
def __init__(self, str, code):
|
||||
super().__init__(str)
|
||||
self.code = code
|
@ -2,7 +2,7 @@ import abc
|
||||
import data as d
|
||||
import signal
|
||||
import numpy as np
|
||||
import tra_analysis as an
|
||||
from tra_analysis import Analysis as an
|
||||
|
||||
class Module(metaclass = abc.ABCMeta):
|
||||
|
||||
@ -54,7 +54,7 @@ class Match (Module):
|
||||
def _load_data(self):
|
||||
self.data = d.load_match(self.apikey, self.competition)
|
||||
|
||||
def _simplestats(data_test):
|
||||
def _simplestats(self, data_test):
|
||||
|
||||
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||
|
||||
@ -103,7 +103,10 @@ class Match (Module):
|
||||
input_vector.append((team, variable, test, data[team][variable]))
|
||||
|
||||
self.data = input_vector
|
||||
self.results = list(exec_threads.map(self._simplestats, self.data))
|
||||
#self.results = list(exec_threads.map(self._simplestats, self.data))
|
||||
self.results = []
|
||||
for test_var_data in self.data:
|
||||
self.results.append(self._simplestats(test_var_data))
|
||||
|
||||
def _push_results(self):
|
||||
|
||||
|
@ -1,13 +1,11 @@
|
||||
import requests
|
||||
import json
|
||||
from exceptions import APIError
|
||||
|
||||
def load_config(path):
|
||||
with open(path, "r") as f:
|
||||
return json.load(f)
|
||||
from config import load_config
|
||||
|
||||
url = "https://titanscouting.epochml.org"
|
||||
config_tra = load_config("config.json")
|
||||
config_tra = {}
|
||||
load_config("config.json", config_tra)
|
||||
trakey = config_tra['persistent']['key']['tra']
|
||||
|
||||
def get_team_competition():
|
||||
|
Loading…
Reference in New Issue
Block a user