From 69b4f98dc1de99971b3f5fb56fb07c04fa229e9c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 2 Nov 2020 14:20:10 +0100 Subject: PELT: Do not set jump when len(signal) < num_samples --- lib/pelt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pelt.py b/lib/pelt.py index 8966d56..a215b28 100644 --- a/lib/pelt.py +++ b/lib/pelt.py @@ -87,8 +87,9 @@ class PELT: # long as --pelt isn't active. import ruptures - if self.num_samples is not None: + if self.num_samples is not None and len(signal) > self.num_samples: self.jump = len(signal) // int(self.num_samples) + print(f"jump = {self.jump}") else: self.jump = 1 -- cgit v1.2.3