Skip to content

Commit 0b9816b

Browse files
authored
Ensure nChains is greater than 1 (RascalSoftware#141)
* Change nChains to be greater than 1 * fixed tests
1 parent 7538af4 commit 0b9816b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

RATapi/controls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Controls(BaseModel, validate_assignment=True, extra="forbid", use_attribut
118118
nSamples: int = Field(20000, ge=0)
119119
"""[DREAM] The number of samples in the initial population for each chain."""
120120

121-
nChains: int = Field(10, gt=0)
121+
nChains: int = Field(10, gt=1)
122122
"""[DREAM] The number of Markov chains to use in the algorithm."""
123123

124124
jumpProbability: float = Field(0.5, gt=0.0, lt=1.0)

tests/test_controls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def test_dream_nSamples_error(self, value: int) -> None:
859859
@pytest.mark.parametrize("value", [-5, 0])
860860
def test_dream_nChains_error(self, value: int) -> None:
861861
"""Tests the nChains setter error in Dream class."""
862-
with pytest.raises(pydantic.ValidationError, match="Input should be greater than 0"):
862+
with pytest.raises(pydantic.ValidationError, match="Input should be greater than 1"):
863863
self.dream.nChains = value
864864

865865
def test_control_class_dream_str(self, table_str) -> None:

0 commit comments

Comments
 (0)