diff --git a/code/algorithms/search/exports.py b/code/algorithms/search/exports.py deleted file mode 100644 index 1662b4b..0000000 --- a/code/algorithms/search/exports.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# EXPORTS -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -from code.algorithms.search.sequential import SequentialSearch; -from code.algorithms.search.binary import BinarySearch; -from code.algorithms.search.interpol import InterpolationSearch; -from code.algorithms.search.jump import JumpSearchLinear; -from code.algorithms.search.jump import JumpSearchExponentiell; -from code.algorithms.search.ith_smallest import FindIthSmallest; -from code.algorithms.search.ith_smallest import FindIthSmallestDC; -from code.algorithms.search.poison import FindPoison; -from code.algorithms.search.poison import FindPoisonFast; diff --git a/code/requirements b/code/python/requirements similarity index 79% rename from code/requirements rename to code/python/requirements index fe3cd85..608e7a7 100644 --- a/code/requirements +++ b/code/python/requirements @@ -1,3 +1,4 @@ +pip>=21.3.1 argparse>=1.4.0 pyyaml>=5.4.1 typing>=3.7.4.3 diff --git a/code/__init__.py b/code/python/src/__init__.py similarity index 100% rename from code/__init__.py rename to code/python/src/__init__.py diff --git a/code/algorithms/__init__.py b/code/python/src/algorithms/__init__.py similarity index 100% rename from code/algorithms/__init__.py rename to code/python/src/algorithms/__init__.py diff --git a/code/algorithms/exports.py b/code/python/src/algorithms/exports.py similarity index 68% rename from code/algorithms/exports.py rename to code/python/src/algorithms/exports.py index faf28de..0601527 100644 --- a/code/algorithms/exports.py +++ b/code/python/src/algorithms/exports.py @@ -5,5 +5,5 @@ # EXPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from code.algorithms.search.exports import *; -from code.algorithms.sum.exports import *; +from src.algorithms.search.exports import *; +from src.algorithms.sum.exports import *; diff --git a/code/algorithms/methods.py b/code/python/src/algorithms/methods.py similarity index 98% rename from code/algorithms/methods.py rename to code/python/src/algorithms/methods.py index 3f7ebe6..0f73d0e 100644 --- a/code/algorithms/methods.py +++ b/code/python/src/algorithms/methods.py @@ -7,8 +7,8 @@ import functools; -from code.core.log import *; -from code.setup.display import *; +from src.core.log import *; +from src.setup.display import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # CLASSES diff --git a/code/algorithms/search/__init__.py b/code/python/src/algorithms/search/__init__.py similarity index 100% rename from code/algorithms/search/__init__.py rename to code/python/src/algorithms/search/__init__.py diff --git a/code/algorithms/search/binary.py b/code/python/src/algorithms/search/binary.py similarity index 94% rename from code/algorithms/search/binary.py rename to code/python/src/algorithms/search/binary.py index 74e3cc0..e03046c 100644 --- a/code/algorithms/search/binary.py +++ b/code/python/src/algorithms/search/binary.py @@ -5,11 +5,11 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from local.maths import *; -from local.typing import *; +from src.local.maths import *; +from src.local.typing import *; -from code.core.log import *; -from code.algorithms.methods import *; +from src.core.log import *; +from src.algorithms.methods import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS diff --git a/code/python/src/algorithms/search/exports.py b/code/python/src/algorithms/search/exports.py new file mode 100644 index 0000000..e37e289 --- /dev/null +++ b/code/python/src/algorithms/search/exports.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# EXPORTS +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +from src.algorithms.search.sequential import SequentialSearch; +from src.algorithms.search.binary import BinarySearch; +from src.algorithms.search.interpol import InterpolationSearch; +from src.algorithms.search.jump import JumpSearchLinear; +from src.algorithms.search.jump import JumpSearchExponentiell; +from src.algorithms.search.ith_smallest import FindIthSmallest; +from src.algorithms.search.ith_smallest import FindIthSmallestDC; +from src.algorithms.search.poison import FindPoison; +from src.algorithms.search.poison import FindPoisonFast; diff --git a/code/algorithms/search/interpol.py b/code/python/src/algorithms/search/interpol.py similarity index 95% rename from code/algorithms/search/interpol.py rename to code/python/src/algorithms/search/interpol.py index 821322f..43d4163 100644 --- a/code/algorithms/search/interpol.py +++ b/code/python/src/algorithms/search/interpol.py @@ -5,11 +5,11 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from local.maths import *; -from local.typing import *; +from src.local.maths import *; +from src.local.typing import *; -from code.core.log import *; -from code.algorithms.methods import *; +from src.core.log import *; +from src.algorithms.methods import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS diff --git a/code/algorithms/search/ith_smallest.py b/code/python/src/algorithms/search/ith_smallest.py similarity index 94% rename from code/algorithms/search/ith_smallest.py rename to code/python/src/algorithms/search/ith_smallest.py index 5126fd0..d6a37c0 100644 --- a/code/algorithms/search/ith_smallest.py +++ b/code/python/src/algorithms/search/ith_smallest.py @@ -5,12 +5,12 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from local.maths import *; -from local.typing import *; +from src.local.maths import *; +from src.local.typing import *; -from code.core.log import *; -from code.algorithms.search.sequential import SequentialSearch; -from code.algorithms.methods import *; +from src.core.log import *; +from src.algorithms.search.sequential import SequentialSearch; +from src.algorithms.methods import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS diff --git a/code/algorithms/search/jump.py b/code/python/src/algorithms/search/jump.py similarity index 94% rename from code/algorithms/search/jump.py rename to code/python/src/algorithms/search/jump.py index ee9f282..9bb8951 100644 --- a/code/algorithms/search/jump.py +++ b/code/python/src/algorithms/search/jump.py @@ -5,12 +5,12 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from local.maths import *; -from local.typing import *; +from src.local.maths import *; +from src.local.typing import *; -from code.core.log import *; -from code.algorithms.search.sequential import SequentialSearch; -from code.algorithms.methods import *; +from src.core.log import *; +from src.algorithms.search.sequential import SequentialSearch; +from src.algorithms.methods import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS diff --git a/code/algorithms/search/poison.py b/code/python/src/algorithms/search/poison.py similarity index 97% rename from code/algorithms/search/poison.py rename to code/python/src/algorithms/search/poison.py index 4cf9daa..7c5fb9e 100644 --- a/code/algorithms/search/poison.py +++ b/code/python/src/algorithms/search/poison.py @@ -5,11 +5,11 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from local.maths import *; -from local.typing import *; +from src.local.maths import *; +from src.local.typing import *; -from code.core.log import *; -from code.algorithms.methods import *; +from src.core.log import *; +from src.algorithms.methods import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS diff --git a/code/algorithms/search/sequential.py b/code/python/src/algorithms/search/sequential.py similarity index 92% rename from code/algorithms/search/sequential.py rename to code/python/src/algorithms/search/sequential.py index 50efbf0..ac2fd6f 100644 --- a/code/algorithms/search/sequential.py +++ b/code/python/src/algorithms/search/sequential.py @@ -5,11 +5,11 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from local.maths import *; -from local.typing import *; +from src.local.maths import *; +from src.local.typing import *; -from code.core.log import *; -from code.algorithms.methods import *; +from src.core.log import *; +from src.algorithms.methods import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS diff --git a/code/algorithms/sum/__init__.py b/code/python/src/algorithms/sum/__init__.py similarity index 100% rename from code/algorithms/sum/__init__.py rename to code/python/src/algorithms/sum/__init__.py diff --git a/code/algorithms/sum/exports.py b/code/python/src/algorithms/sum/exports.py similarity index 64% rename from code/algorithms/sum/exports.py rename to code/python/src/algorithms/sum/exports.py index 414d067..13cbac9 100644 --- a/code/algorithms/sum/exports.py +++ b/code/python/src/algorithms/sum/exports.py @@ -5,5 +5,5 @@ # EXPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from code.algorithms.sum.maxsubsum import MaxSubSum; -from code.algorithms.sum.maxsubsum import MaxSubSumDC; +from src.algorithms.sum.maxsubsum import MaxSubSum; +from src.algorithms.sum.maxsubsum import MaxSubSumDC; diff --git a/code/algorithms/sum/maxsubsum.py b/code/python/src/algorithms/sum/maxsubsum.py similarity index 97% rename from code/algorithms/sum/maxsubsum.py rename to code/python/src/algorithms/sum/maxsubsum.py index bb2ed0b..b922227 100644 --- a/code/algorithms/sum/maxsubsum.py +++ b/code/python/src/algorithms/sum/maxsubsum.py @@ -5,11 +5,11 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from local.maths import *; -from local.typing import *; +from src.local.maths import *; +from src.local.typing import *; -from code.core.log import *; -from code.algorithms.methods import *; +from src.core.log import *; +from src.algorithms.methods import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS diff --git a/code/core/__init__.py b/code/python/src/core/__init__.py similarity index 100% rename from code/core/__init__.py rename to code/python/src/core/__init__.py diff --git a/code/core/config.py b/code/python/src/core/config.py similarity index 97% rename from code/core/config.py rename to code/python/src/core/config.py index 456bc84..1bd8d0c 100644 --- a/code/core/config.py +++ b/code/python/src/core/config.py @@ -5,8 +5,8 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from code.local.typing import *; -from code.local.config import *; +from src.local.typing import *; +from src.local.config import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES diff --git a/code/core/log.py b/code/python/src/core/log.py similarity index 96% rename from code/core/log.py rename to code/python/src/core/log.py index e65677c..cc3a8fa 100644 --- a/code/core/log.py +++ b/code/python/src/core/log.py @@ -5,14 +5,14 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from code.local.io import *; -from code.local.misc import *; -from code.local.system import *; -from code.local.typing import *; +from src.local.io import *; +from src.local.misc import *; +from src.local.system import *; +from src.local.typing import *; from datetime import timedelta; -from code.core.metrics import *; +from src.core.metrics import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES diff --git a/code/core/metrics.py b/code/python/src/core/metrics.py similarity index 100% rename from code/core/metrics.py rename to code/python/src/core/metrics.py diff --git a/code/local/__init__.py b/code/python/src/local/__init__.py similarity index 100% rename from code/local/__init__.py rename to code/python/src/local/__init__.py diff --git a/code/local/config.py b/code/python/src/local/config.py similarity index 100% rename from code/local/config.py rename to code/python/src/local/config.py diff --git a/code/local/io.py b/code/python/src/local/io.py similarity index 100% rename from code/local/io.py rename to code/python/src/local/io.py diff --git a/code/local/maths.py b/code/python/src/local/maths.py similarity index 100% rename from code/local/maths.py rename to code/python/src/local/maths.py diff --git a/code/local/misc.py b/code/python/src/local/misc.py similarity index 100% rename from code/local/misc.py rename to code/python/src/local/misc.py diff --git a/code/local/system.py b/code/python/src/local/system.py similarity index 100% rename from code/local/system.py rename to code/python/src/local/system.py diff --git a/code/local/typing.py b/code/python/src/local/typing.py similarity index 100% rename from code/local/typing.py rename to code/python/src/local/typing.py diff --git a/code/main.py b/code/python/src/main.py similarity index 90% rename from code/main.py rename to code/python/src/main.py index 571bcaa..ec2565c 100644 --- a/code/main.py +++ b/code/python/src/main.py @@ -8,13 +8,14 @@ import os; import sys; -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))); +sys.path.insert(0, os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))); +os.chdir(os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..', '..', '..'))); -from code.core.log import *; -from code.core.config import *; -from code.setup.display import *; -from code.setup.cli import *; -from code.algorithms.exports import *; +from src.core.log import *; +from src.core.config import *; +from src.setup.display import *; +from src.setup.cli import *; +from src.algorithms.exports import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES/CONSTANTS @@ -30,7 +31,7 @@ def enter(quiet: bool, debug: bool, mode: str, path: Any, **_): SetQuietMode(quiet); SetDebugMode(debug); configpath = path if isinstance(path, str) else PATH_TO_CONFIG; - if mode == 'all': + if mode in 'run': LoopThroughCases(path=configpath); else: DisplayHelpMessage(); diff --git a/code/setup/__init__.py b/code/python/src/setup/__init__.py similarity index 100% rename from code/setup/__init__.py rename to code/python/src/setup/__init__.py diff --git a/code/setup/cli.py b/code/python/src/setup/cli.py similarity index 88% rename from code/setup/cli.py rename to code/python/src/setup/cli.py index 5dd9681..2812928 100644 --- a/code/setup/cli.py +++ b/code/python/src/setup/cli.py @@ -5,9 +5,9 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from code.local.typing import *; +from src.local.typing import *; -from code.core.log import *; +from src.core.log import *; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # GLOBAL VARIABLES @@ -30,7 +30,7 @@ def GetArgumentParser() -> argparse.ArgumentParser: '''), formatter_class=argparse.RawTextHelpFormatter, ); - parser.add_argument('mode', nargs=1, choices=['all'], help='all = Führt alle Testfälle in der config.yml Datei durch.'); + parser.add_argument('mode', nargs=1, choices=['run'], help='run = Führt alle Testfälle in der config.yml Datei durch.'); parser.add_argument('--path', nargs=1, type=str, help='Pfad zur alternativen Configdatei.'); parser.add_argument('--debug', action='store_true', help='Debugging Messages stummschalten.') parser.add_argument('-q', '--quiet', action='store_true', help='Alle console-messages bis auf Errors stummschalten.') diff --git a/code/setup/display.py b/code/python/src/setup/display.py similarity index 96% rename from code/setup/display.py rename to code/python/src/setup/display.py index ccd6a42..dcfa165 100644 --- a/code/setup/display.py +++ b/code/python/src/setup/display.py @@ -5,10 +5,10 @@ # IMPORTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -from code.local.typing import *; +from src.local.typing import *; -from code.core.log import *; -from code.setup.cli import GetArgumentParser; +from src.core.log import *; +from src.setup.cli import GetArgumentParser; # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # METHODS display help