filter user warning about huggingface symlinks, fix typo

This commit is contained in:
Florian Förster 2025-10-22 12:12:30 +02:00
parent c45411e8ee
commit bc3674e61b

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}"
) )