Cython Integration and Test Case Enhancements #1

Merged
foefl merged 10 commits from test_cython into main 2025-10-22 10:17:38 +00:00
Showing only changes of commit bc3674e61b - Show all commits

View File

@ -1,4 +1,5 @@
import csv import csv
import warnings
from os import path from os import path
from pathlib import Path from pathlib import Path
from typing import Any, Final, cast from typing import Any, Final, cast
@ -24,6 +25,13 @@ from dopt_sensor_anomalies import constants as const
from dopt_sensor_anomalies import errors from dopt_sensor_anomalies import errors
from dopt_sensor_anomalies import types as t from dopt_sensor_anomalies import types as t
# Suppress the specific HuggingFace cache symlink warning
warnings.filterwarnings(
"ignore",
message=".*huggingface_hub.*cache-system uses symlinks.*",
category=UserWarning,
)
# input parameters: user-defined # input parameters: user-defined
file_path: Path = Path(r"C:\Users\demon\Documents\EKF\Analyse_fuer_Florian\bild2.bmp") file_path: Path = Path(r"C:\Users\demon\Documents\EKF\Analyse_fuer_Florian\bild2.bmp")
pixels_per_metric_X: float = 0.251 pixels_per_metric_X: float = 0.251
@ -160,7 +168,7 @@ def measure_length(
num_contours = len(filtered_cnts) num_contours = len(filtered_cnts)
if num_contours != const.NUM_VALID_ELECTRODES: if num_contours != const.NUM_VALID_ELECTRODES:
raise errors.InvalidElectrodeCount( raise errors.InvalidElectrodeCount(
f"Number of counted electroedes does not match the " f"Number of counted electrodes does not match the "
f"expected value: count = {num_contours}, expected = {const.NUM_VALID_ELECTRODES}" f"expected value: count = {num_contours}, expected = {const.NUM_VALID_ELECTRODES}"
) )