From e5529dae2111473d4c79bc75d363e362abdd503a Mon Sep 17 00:00:00 2001 From: foefl Date: Thu, 23 Oct 2025 11:24:39 +0200 Subject: [PATCH] final code cleanup, closes #2 --- src/dopt_sensor_anomalies/constants.py | 11 ++--------- src/dopt_sensor_anomalies/errors.py | 6 +++--- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/dopt_sensor_anomalies/constants.py b/src/dopt_sensor_anomalies/constants.py index a525708..43fcef7 100644 --- a/src/dopt_sensor_anomalies/constants.py +++ b/src/dopt_sensor_anomalies/constants.py @@ -5,17 +5,10 @@ LIB_ROOT_PATH: Final[Path] = Path(__file__).parent STOP_FOLDER_NAME: Final[str] = "python" MODEL_FOLDER_NAME: Final[str] = "models" -# TODO: remove comment -THRESHOLD_BW: Final[int] = 63 # threshold to distringuish black (electrodes) and white areas -# model_path = [ -# r"C:\Users\demon\Documents\EKF\Modelle\patchcore_model_links.pth", -# r"C:\Users\demon\Documents\EKF\Modelle\patchcore_model_rechts.pth", -# ] # path to anomaly detection models -BACKBONE: Final[str] = "resnet18" # parameters for AI model +THRESHOLD_BW: Final[int] = 63 +BACKBONE: Final[str] = "resnet18" LAYERS: Final[tuple[str, str]] = ("layer1", "layer2") RATIO: Final[float] = 0.05 NUM_VALID_ELECTRODES: Final[int] = 6 -# TODO: Remove? -# CONTOUR_EXPORT_FILENAME_SUFFIX: Final[str] = "_all_contours" HEATMAP_FILENAME_SUFFIX: Final[str] = "_Heatmap" diff --git a/src/dopt_sensor_anomalies/errors.py b/src/dopt_sensor_anomalies/errors.py index 89b6b9b..f5236b5 100644 --- a/src/dopt_sensor_anomalies/errors.py +++ b/src/dopt_sensor_anomalies/errors.py @@ -1,10 +1,10 @@ class ImageNotReadError(Exception): - """thrown if image was not read successfully""" + """image was not read successfully""" class ContourCalculationError(Exception): - """thrown if contour detection was not successful""" + """contour detection was not successful""" class InvalidElectrodeCount(Exception): - """thrown if the number of electrodes does not match the expected value""" + """the number of electrodes does not match the expected value"""