Skip to content

Commit

Permalink
Update test_experimenter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
barneydobson committed Mar 16, 2024
1 parent 48e8863 commit 4f070f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_experimenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from swmmanywhere import parameters
from swmmanywhere.paper import experimenter


def assert_close(a: float, b: float, rtol: float = 1e-3) -> None:
"""Assert that two floats are close."""
assert np.isclose(a, b, rtol=rtol).all()
Expand All @@ -27,7 +28,9 @@ def test_generate_samples():
seed = 1,
groups = False)
assert len(samples) == 48
assert set([x['param'] for x in samples]) == {'min_v','max_v','chahinian_slope_scaling'}
assert set([x['param'] for x in samples]) == {'min_v',
'max_v',
'chahinian_slope_scaling'}
assert_close(samples[0]['value'], 0.31093)

samples = experimenter.generate_samples(N = 2,
Expand Down

0 comments on commit 4f070f7

Please sign in to comment.