Validation Module
- validation.validate_trajectory(trajectory: list[tuple[float, float]])
Validate that the input is a non-empty list of coordinate tuples with valid latitude and longitude values.
- Parameters:
trajectory (list[tuple[float, float]]) – A list of tuples representing coordinates (latitude, longitude).
- Raises:
if trajectory is not a non-empty list of coordinate tuples
if any tuple does not contain exactly two elements
if latitude or longitude are not numeric types
if latitude is not between -90 and 90, or longitude is not between -180 and 180
- validation.validate_numeric_list(sequence: list[float])
Validate that the input is a non-empty list of numeric values.
- Parameters:
- Raises:
If sequence is not a non-empty list.
If any element in sequence is not a numeric type.
- validation.validate_scalar(value, name='value')
Validate that the input value is a scalar (integer or float).
- Parameters:
- Raises:
ValueError – If value is not a numeric type.
- validation.validate_positive_scalar(value: int | float, name='value')
Validate that the input value is a positive scalar (integer or float).
- Parameters:
- Raises:
ValueError – If value is not a non-negative numeric type.
- validation.validate_distance_parameters(p: list[float], q: list[float])
Validate that two numeric lists are provided and that they have the same length.
- Parameters:
- Raises:
If either p or q is not a numeric list.
If p and q do not have the same length.
- validation.validate_dtw(seq1: list[tuple[float, float]], seq2: list[tuple[float, float]])
Validate parameters for the Dynamic Time Warping (DTW) algorithm.
- validation.validate_ers(r: list[float], s: list[float], sigma: float = 1.0, cost_deletion: float = 1.0, cost_insertion: float = 1.0, subcost_within_sigma: float = 0.0, subcost_outside_sigma: float = 1.0)
Validate parameters for the Edit Distance on Real Sequences (ERS) algorithm.
- Parameters:
- Raises:
if any list parameter is not a numeric list
if any cost parameter is not a positive scalar
- validation.validate_erp(r: list[float], s: list[float], g: float)
Validate parameters for the Edit Distance with Real Penalty (ERP) algorithm.
- validation.validate_euclidean(p: list[float], q: list[float])
Validate parameters for Euclidean distance calculation between two numeric lists.
- Parameters:
- Raises:
if p or q is not a numeric list
if p and q do not have the same length
- validation.validate_frechet(p: list[float], q: list[float])
Validate parameters for Fréchet distance calculation between two numeric lists.
- Parameters:
- Raises:
if p or q is not a numeric list
- validation.validate_hausdorff(p: list[float], q: list[float])
Validate parameters for Hausdorff distance calculation between two numeric lists.
- Parameters:
- Raises:
if p or q is not a numeric list
- validation.validate_lcss(r: list[float], s: list[float], sigma: float)
Validate parameters for Longest Common Subsequence Similarity (LCSS) calculation.