Skip to content

Commit

Permalink
add tolerance in test statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
StRigaud committed Aug 22, 2024
1 parent f3a3240 commit 0d431ff
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/test_statistics_of_labelled_pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@ def test_statistics_of_labelled_pixels():
assert result["label"] == [1.0, 2.0, 3.0, 4.0]
assert result["max_intensity"] == [14.0, 13.0, 12.0, 11.0]
assert result["min_intensity"] == [0.0, 0.0, 0.0, 0.0]
assert result["mean_intensity"] == [
4.666666507720947,
3.777777910232544,
2.8888888359069824,
2.0,
]
assert np.allclose(
np.asarray(result["mean_intensity"]),
np.asarray(
[
4.666666507720947,
3.777777910232544,
2.8888888359069824,
2.0,
]
),
atol=0.00001,
)
assert result["sum_intensity"] == [42.0, 34.0, 26.0, 18.0]
assert result["area"] == [9.0, 9.0, 9.0, 9.0]

0 comments on commit 0d431ff

Please sign in to comment.