From a111fa989149b1b09f5740fec3362b8e6f249c0e Mon Sep 17 00:00:00 2001 From: "Alex H. Room" <69592136+alexhroom@users.noreply.github.com> Date: Mon, 24 Mar 2025 07:32:22 +0000 Subject: [PATCH 1/2] Change nChains to be greater than 1 --- RATapi/controls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RATapi/controls.py b/RATapi/controls.py index 50f18c99..28b52d8a 100644 --- a/RATapi/controls.py +++ b/RATapi/controls.py @@ -118,7 +118,7 @@ class Controls(BaseModel, validate_assignment=True, extra="forbid", use_attribut nSamples: int = Field(20000, ge=0) """[DREAM] The number of samples in the initial population for each chain.""" - nChains: int = Field(10, gt=0) + nChains: int = Field(10, gt=1) """[DREAM] The number of Markov chains to use in the algorithm.""" jumpProbability: float = Field(0.5, gt=0.0, lt=1.0) From 1f56de3295f4e0a300a8c784b67291ad7cb3d0f6 Mon Sep 17 00:00:00 2001 From: alexhroom Date: Mon, 24 Mar 2025 09:04:37 +0000 Subject: [PATCH 2/2] fixed tests --- tests/test_controls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_controls.py b/tests/test_controls.py index 73b776bd..5c4400a3 100644 --- a/tests/test_controls.py +++ b/tests/test_controls.py @@ -859,7 +859,7 @@ def test_dream_nSamples_error(self, value: int) -> None: @pytest.mark.parametrize("value", [-5, 0]) def test_dream_nChains_error(self, value: int) -> None: """Tests the nChains setter error in Dream class.""" - with pytest.raises(pydantic.ValidationError, match="Input should be greater than 0"): + with pytest.raises(pydantic.ValidationError, match="Input should be greater than 1"): self.dream.nChains = value def test_control_class_dream_str(self, table_str) -> None: