Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions ml_tto/tests/test_scan_cropping.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ def test_cropping_by_concavity_returns_masks_and_model(self):
)

# check the returned values
assert np.isnan(y_cropped[0]) # the first point should be cropped
assert np.isnan(y_cropped[-2]) # the second to last point should be cropped
assert np.any(concavity_mask)
assert np.all(np.isnan(y_cropped[concavity_mask]))
assert np.allclose(y_cropped[~concavity_mask], y[~concavity_mask])

# assert that the concavity mask correctly identifies the first and last points as not concave down
assert concavity_mask[0] == True
assert concavity_mask[-2] == True

# assert that the concavity values are negative for the points that are concave down
assert concavity_values[0] < 0
assert concavity_values[-2] < 0
# concavity mask is the inverse of positive concavity
assert np.array_equal(concavity_mask, concavity_values <= 0)
assert concavity_values[3] > 0 # the middle point should be concave up