Skip to content

Commit 8cc1441

Browse files
committed
atol factor and func to get test data
1 parent fece39a commit 8cc1441

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_envelopes.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@
1010
with open("test/envelopes.pickle", "rb") as filename:
1111
test_data = pickle.load(filename)
1212

13+
ABS_TOL_FACTOR = 1e-11
14+
15+
16+
def get_atol(test_type: str) -> float:
17+
"""Get the absolute tolerance corresponding to a specific test data
18+
19+
Parameters
20+
----------
21+
test_type : str
22+
String representing the test type to be used as a key in the test_data dict
23+
24+
Returns
25+
-------
26+
float
27+
Absolute tolerance for the desired value of this test type
28+
"""
29+
return ABS_TOL_FACTOR * np.max(test_data[test_type])
30+
1331

1432
@pytest.mark.unit
1533
def test_pwc_shape():

0 commit comments

Comments
 (0)