From bdf6456111b22aeea87abd00f8eb864cf2abd28d Mon Sep 17 00:00:00 2001 From: foefl Date: Thu, 23 Oct 2025 09:49:22 +0200 Subject: [PATCH] add docstring --- src/dopt_sensor_anomalies/_find_paths.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/dopt_sensor_anomalies/_find_paths.py b/src/dopt_sensor_anomalies/_find_paths.py index e2c0ac7..dd8a76f 100644 --- a/src/dopt_sensor_anomalies/_find_paths.py +++ b/src/dopt_sensor_anomalies/_find_paths.py @@ -35,7 +35,27 @@ def get_model_folder() -> Path: return model_folder -def get_detection_models(model_folder: Path) -> t.DetectionModels: +def get_detection_models( + model_folder: Path, +) -> t.DetectionModels: + """retrieve the model paths both for the left and the right side as a TypedDict + + Parameters + ---------- + model_folder : Path + the found path to the folder containing the models + + Returns + ------- + t.DetectionModels + TypedDict with key "left" and "right" with the corresponding paths to each model + + Raises + ------ + ValueError + raised if there are no or too many model files are found for one side + """ + left_model_search = tuple(model_folder.glob("*left_hand_side*.pth")) if len(left_model_search) == 0: raise ValueError("No model for the left hand side found.")