Skip to content

Commit

Permalink
test(costl2): add cost on segment of length 1
Browse files Browse the repository at this point in the history
  • Loading branch information
deepcharles committed May 17, 2022
1 parent d24493f commit 5c80d06
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def test_costs_5D_names(signal_bkps_5D, cost_name):
cost.error(100, signal.shape[0])
cost.error(10, 50)
cost.sum_of_costs(bkps)
if cost_name == "l2":
assert cost.error(1, 2)==0., "CostL2 on segment of size 1 returns 0."

with pytest.raises(NotEnoughPoints):
if cost_name == "cosine":
cost.min_size = 4
Expand Down

0 comments on commit 5c80d06

Please # to comment.