deepcharles / ruptures

ruptures: change point detection in Python
BSD 2-Clause "Simplified" License
1.59k stars 162 forks source link

fix: sanity_check usage when n_bkps is not explicitly specified #190

Closed oboulant closed 3 years ago

oboulant commented 3 years ago

In cases where the n_bkps is not explicitly specified, current sanity_check() usage does not reflect how it should be used. Indeed, in some cases, finding 0 n_bkps is a fine results. Therefore, we should not make the assumption that there is at least 1 break point in the following cases :

There is one special case :

Tests are also modified accordingly.

closes https://github.com/deepcharles/ruptures/issues/188

codecov[bot] commented 3 years ago

Codecov Report

Merging #190 (dc878fb) into master (d211c5c) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #190   +/-   ##
=======================================
  Coverage   96.31%   96.31%           
=======================================
  Files          40       40           
  Lines         978      978           
=======================================
  Hits          942      942           
  Misses         36       36           
Impacted Files Coverage Δ
src/ruptures/detection/binseg.py 100.00% <ø> (ø)
src/ruptures/detection/bottomup.py 100.00% <ø> (ø)
src/ruptures/detection/kernelcpd.py 100.00% <ø> (ø)
src/ruptures/detection/pelt.py 100.00% <ø> (ø)
src/ruptures/detection/window.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d211c5c...dc878fb. Read the comment docs.