Peano
Loading...
Searching...
No Matches
MyAssert.py
Go to the documentation of this file.
1def test_array_within_threshold(arr, lower_threshold=-1e-8, upper_threshold=1e-8):
2 # Assert: kein Wert < lower_threshold
3 min_val = arr.min()
4 assert (
5 min_val >= lower_threshold
6 ), f"Array enthält Wert unter {lower_threshold}: min={min_val}"
7
8 # Assert: kein Wert > upper_threshold
9 max_val = arr.max()
10 assert (
11 max_val <= upper_threshold
12 ), f"Array enthält Wert über {upper_threshold}: max={max_val}"
test_array_within_threshold(arr, lower_threshold=-1e-8, upper_threshold=1e-8)
Definition MyAssert.py:1