Skip to content

Commit

Permalink
fixup: allow for constant uniform dist to make SPE1 pass
Browse files Browse the repository at this point in the history
  • Loading branch information
markusdregi committed May 11, 2021
1 parent b27a242 commit 75556dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ert3/config/_parameters_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _ensure_lower_upper(cls, values): # type: ignore
if low is None or up is None:
return values

if low < up:
if low <= up:
return values

raise ValueError(
Expand Down
3 changes: 1 addition & 2 deletions tests/ert3/config/test_parameters_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_invalid_gauss(input_, err_msg):


@pytest.mark.parametrize(
("lower_bound", "upper_bound"), ((-10.1, -5.3), (-1, 2), (0, 100))
("lower_bound", "upper_bound"), ((-10.1, -5.3), (-1, 2), (0, 100), (1, 1))
)
def test_valid_uniform(lower_bound, upper_bound):
raw_config = [
Expand Down Expand Up @@ -107,7 +107,6 @@ def test_valid_uniform(lower_bound, upper_bound):
@pytest.mark.parametrize(
("input_", "err_msg"),
(
({"lower_bound": 0, "upper_bound": 0}, "Expected lower_bound"),
({"lower_bound": 2, "upper_bound": 1}, "Expected lower_bound"),
({"lower_bound": 0}, "Expected distribution inputs"),
({"upper_bound": 0}, "Expected distribution inputs"),
Expand Down

0 comments on commit 75556dd

Please sign in to comment.