add docstring

This commit is contained in:
Florian Förster 2025-10-23 09:49:22 +02:00
parent d87e8d4d9c
commit bdf6456111

View File

@ -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.")