reformatted imports to work better on other machines, plus added benchmarking to project

This commit is contained in:
PatchOfScotland
2023-03-13 11:32:45 +01:00
parent c01df1b190
commit 40ed98000b
48 changed files with 907 additions and 173 deletions

View File

View File

@@ -6,8 +6,8 @@ Author(s): David Marchant
from typing import Any, Tuple
from core.correctness.validation import check_type
from core.correctness.vars import DEBUG_INFO, DEBUG_WARNING
from meow_base.core.correctness.validation import check_type
from meow_base.core.correctness.vars import DEBUG_INFO, DEBUG_WARNING
def setup_debugging(print:Any=None, logging:int=0)->Tuple[Any,int]:

View File

@@ -11,7 +11,7 @@ from os import makedirs, remove, rmdir, walk
from os.path import exists, isfile, join
from typing import Any, Dict, List
from core.correctness.validation import valid_path
from meow_base.core.correctness.validation import valid_path
def make_dir(path:str, can_exist:bool=True, ensure_clean:bool=False):

View File

@@ -6,8 +6,8 @@ Author(s): David Marchant
from hashlib import sha256
from core.correctness.vars import HASH_BUFFER_SIZE, SHA256
from core.correctness.validation import check_type, valid_existing_file_path
from meow_base.core.correctness.vars import HASH_BUFFER_SIZE, SHA256
from meow_base.core.correctness.validation import check_type, valid_existing_file_path
def _get_file_sha256(file_path):
sha256_hash = sha256()

View File

@@ -8,16 +8,16 @@ from datetime import datetime
from os.path import basename, dirname, relpath, splitext
from typing import Any, Dict, Union, List
from core.base_pattern import BasePattern
from core.base_recipe import BaseRecipe
from core.base_rule import BaseRule
from core.correctness.validation import check_type, valid_dict, valid_list
from core.correctness.vars import EVENT_PATH, EVENT_RULE, EVENT_TYPE, \
from meow_base.core.base_pattern import BasePattern
from meow_base.core.base_recipe import BaseRecipe
from meow_base.core.base_rule import BaseRule
from meow_base.core.correctness.validation import check_type, valid_dict, valid_list
from meow_base.core.correctness.vars import EVENT_PATH, EVENT_RULE, EVENT_TYPE, \
EVENT_TYPE_WATCHDOG, JOB_CREATE_TIME, JOB_EVENT, JOB_ID, JOB_PATTERN, \
JOB_RECIPE, JOB_REQUIREMENTS, JOB_RULE, JOB_STATUS, JOB_TYPE, \
STATUS_QUEUED, WATCHDOG_BASE, WATCHDOG_HASH, SWEEP_JUMP, SWEEP_START, \
SWEEP_STOP
from functionality.naming import generate_job_id, generate_rule_id
from meow_base.functionality.naming import generate_job_id, generate_rule_id
# mig trigger keyword replacements
KEYWORD_PATH = "{PATH}"
@@ -208,7 +208,7 @@ def create_rule(pattern:BasePattern, recipe:BaseRecipe,
# TODO fix me
# Imported here to avoid circular imports at top of file
import rules
import meow_base.rules
all_rules = {
(r.pattern_type, r.recipe_type):r for r in BaseRule.__subclasses__()
}

View File

@@ -7,7 +7,7 @@ Author(s): David Marchant
from typing import List
from random import SystemRandom
from core.correctness.vars import CHAR_LOWERCASE, CHAR_UPPERCASE
from meow_base.core.correctness.vars import CHAR_LOWERCASE, CHAR_UPPERCASE
#TODO Make this guaranteed unique

View File

@@ -10,7 +10,7 @@ from os import getenv
from papermill.translators import papermill_translators
from typing import Any, Dict, List
from core.correctness.validation import check_script, check_type
from meow_base.core.correctness.validation import check_script, check_type
# Adapted from: https://github.com/rasmunk/notebook_parameterizer
def parameterize_jupyter_notebook(jupyter_notebook:Dict[str,Any],

View File

@@ -12,7 +12,7 @@ from multiprocessing.connection import Connection, wait as multi_wait
if osName == 'nt':
from multiprocessing.connection import PipeConnection
from multiprocessing.queues import Queue
from core.correctness.vars import VALID_CHANNELS
from meow_base.core.correctness.vars import VALID_CHANNELS
def wait(inputs:List[VALID_CHANNELS])->List[VALID_CHANNELS]:

View File

@@ -11,7 +11,7 @@ from os.path import basename
from sys import version_info, prefix, base_prefix
from typing import Any, Dict, List, Tuple, Union
from core.correctness.validation import check_type
from meow_base.core.correctness.validation import check_type
REQUIREMENT_PYTHON = "python"
REQ_PYTHON_MODULES = "modules"