Skip to content

Commit 0ea292b

Browse files
authored
Updates DREAM defaults (#39)
* Updates DREAM defaults * Corrects nSamples
1 parent 2ed5719 commit 0ea292b

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

RATpy/controls.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class Controls:
3838
propScale: float = 0.1
3939
nsTolerance: float = 0.1
4040
# Dream
41-
nSamples: int = 50000
41+
nSamples: int = 20000
4242
nChains: int = 10
4343
jumpProbability: float = 0.5
4444
pUnitGamma: float = 0.2
45-
boundHandling: BoundHandling = BoundHandling.Fold
46-
adaptPCR: bool = False
45+
boundHandling: BoundHandling = BoundHandling.Reflect
46+
adaptPCR: bool = True
4747

4848

4949
class Calculate(BaseModel, validate_assignment=True, extra="forbid"):
@@ -109,12 +109,12 @@ class Dream(Calculate):
109109
"""Defines the additional fields for the Dream procedure."""
110110

111111
procedure: Literal[Procedures.Dream] = Procedures.Dream
112-
nSamples: int = Field(50000, ge=0)
112+
nSamples: int = Field(20000, ge=0)
113113
nChains: int = Field(10, gt=0)
114114
jumpProbability: float = Field(0.5, gt=0.0, lt=1.0)
115115
pUnitGamma: float = Field(0.2, gt=0.0, lt=1.0)
116-
boundHandling: BoundHandling = BoundHandling.Fold
117-
adaptPCR: bool = False
116+
boundHandling: BoundHandling = BoundHandling.Reflect
117+
adaptPCR: bool = True
118118

119119

120120
def set_controls(

tests/test_controls.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,12 @@ def setup_class(self):
479479
("resampleParams", [0.9, 50]),
480480
("display", Display.Iter),
481481
("procedure", Procedures.Dream),
482-
("nSamples", 50000),
482+
("nSamples", 20000),
483483
("nChains", 10),
484484
("jumpProbability", 0.5),
485485
("pUnitGamma", 0.2),
486-
("boundHandling", BoundHandling.Fold),
486+
("boundHandling", BoundHandling.Reflect),
487+
("adaptPCR", True),
487488
],
488489
)
489490
def test_dream_property_values(self, control_property: str, value: Any) -> None:
@@ -501,7 +502,8 @@ def test_dream_property_values(self, control_property: str, value: Any) -> None:
501502
("nChains", 1000),
502503
("jumpProbability", 0.7),
503504
("pUnitGamma", 0.3),
504-
("boundHandling", BoundHandling.Reflect),
505+
("boundHandling", BoundHandling.Fold),
506+
("adaptPCR", False),
505507
],
506508
)
507509
def test_dream_property_setters(self, control_property: str, value: Any) -> None:
@@ -568,12 +570,12 @@ def test_control_class_dream_repr(self) -> None:
568570
"| calcSldDuringFit | False |\n"
569571
"| resampleParams | [0.9, 50] |\n"
570572
"| display | iter |\n"
571-
"| nSamples | 50000 |\n"
573+
"| nSamples | 20000 |\n"
572574
"| nChains | 10 |\n"
573575
"| jumpProbability | 0.5 |\n"
574576
"| pUnitGamma | 0.2 |\n"
575-
"| boundHandling | fold |\n"
576-
"| adaptPCR | False |\n"
577+
"| boundHandling | reflect |\n"
578+
"| adaptPCR | True |\n"
577579
"+------------------+-----------+"
578580
)
579581

tests/test_inputs.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,12 @@ def standard_layers_controls():
488488
controls.nMCMC = 0.0
489489
controls.propScale = 0.1
490490
controls.nsTolerance = 0.1
491-
controls.nSamples = 50000
491+
controls.nSamples = 20000
492492
controls.nChains = 10
493493
controls.jumpProbability = 0.5
494494
controls.pUnitGamma = 0.2
495-
controls.boundHandling = BoundHandling.Fold
495+
controls.boundHandling = BoundHandling.Reflect
496+
controls.adaptPCR = True
496497
controls.checks.fitParam = [1, 0, 0, 0]
497498
controls.checks.fitBackgroundParam = [0]
498499
controls.checks.fitQzshift = []
@@ -532,11 +533,12 @@ def custom_xy_controls():
532533
controls.nMCMC = 0.0
533534
controls.propScale = 0.1
534535
controls.nsTolerance = 0.1
535-
controls.nSamples = 50000
536+
controls.nSamples = 20000
536537
controls.nChains = 10
537538
controls.jumpProbability = 0.5
538539
controls.pUnitGamma = 0.2
539-
controls.boundHandling = BoundHandling.Fold
540+
controls.boundHandling = BoundHandling.Reflect
541+
controls.adaptPCR = True
540542
controls.checks.fitParam = [1, 0, 0, 0]
541543
controls.checks.fitBackgroundParam = [0]
542544
controls.checks.fitQzshift = []

0 commit comments

Comments
 (0)