diff --git a/src/seer/anomaly_detection/detectors/mp_utils.py b/src/seer/anomaly_detection/detectors/mp_utils.py index bf84f34d..5dfe2571 100644 --- a/src/seer/anomaly_detection/detectors/mp_utils.py +++ b/src/seer/anomaly_detection/detectors/mp_utils.py @@ -42,6 +42,10 @@ def get_mp_dist_from_mp( mp_dist = normalizer.normalize(mp_dist) if pad_to_len is not None: + if pad_to_len < len(mp_dist): + raise Exception( + "Requested length should be greater than or equal to current mp_dist" + ) nan_value_count = np.empty(pad_to_len - len(mp_dist)) nan_value_count.fill(np.nan) mp_dist_updated = np.concatenate((nan_value_count, mp_dist))