Skip to content

Commit a8cc498

Browse files
authored
Merge pull request MIT-LCP#267 from lbugnon/patch-1
Add size check before monotonicaly check
2 parents a3a6756 + 8b2cece commit a8cc498

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

wfdb/processing/evaluate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ class Comparitor(object):
4646
4747
"""
4848
def __init__(self, ref_sample, test_sample, window_width, signal=None):
49-
if min(np.diff(ref_sample)) < 0 or min(np.diff(test_sample)) < 0:
50-
raise ValueError(('The sample locations must be monotonically'
51-
+ ' increasing'))
49+
if len(ref_sample) > 1 and len(test_sample) > 1:
50+
if min(np.diff(ref_sample)) < 0 or min(np.diff(test_sample)) < 0:
51+
raise ValueError(('The sample locations must be monotonically'
52+
+ ' increasing'))
5253

5354
self.ref_sample = ref_sample
5455
self.test_sample = test_sample

0 commit comments

Comments
 (0)