Skip to content

Commit 2c49cc8

Browse files
committed
Rename preset factory aliases
1 parent 4d41104 commit 2c49cc8

5 files changed

Lines changed: 20 additions & 24 deletions

File tree

baybe/surrogates/gaussian_process/core.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,10 @@ def from_preset(
225225
)
226226
module = importlib.import_module(module_name)
227227

228-
kernel = kernel_or_factory or getattr(module, "PRESET_KERNEL_FACTORY")
229-
mean = mean_or_factory or getattr(module, "PRESET_MEAN_FACTORY")
230-
likelihood = likelihood_or_factory or getattr(
231-
module, "PRESET_LIKELIHOOD_FACTORY"
232-
)
233-
criterion = criterion_or_factory or getattr(
234-
module, "PRESET_FIT_CRITERION_FACTORY"
235-
)
228+
kernel = kernel_or_factory or getattr(module, "KERNEL_FACTORY")
229+
mean = mean_or_factory or getattr(module, "MEAN_FACTORY")
230+
likelihood = likelihood_or_factory or getattr(module, "LIKELIHOOD_FACTORY")
231+
criterion = criterion_or_factory or getattr(module, "FIT_CRITERION_FACTORY")
236232

237233
return cls(kernel, mean, likelihood, criterion)
238234

baybe/surrogates/gaussian_process/presets/baybe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __call__(
106106

107107

108108
# Preset defaults
109-
PRESET_KERNEL_FACTORY = BayBEKernelFactory()
110-
PRESET_MEAN_FACTORY = BayBEMeanFactory()
111-
PRESET_LIKELIHOOD_FACTORY = BayBELikelihoodFactory()
112-
PRESET_FIT_CRITERION_FACTORY = BayBEFitCriterionFactory()
109+
KERNEL_FACTORY = BayBEKernelFactory()
110+
MEAN_FACTORY = BayBEMeanFactory()
111+
LIKELIHOOD_FACTORY = BayBELikelihoodFactory()
112+
FIT_CRITERION_FACTORY = BayBEFitCriterionFactory()

baybe/surrogates/gaussian_process/presets/chen.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _make(
7979
gc.collect()
8080

8181
# Preset defaults
82-
PRESET_KERNEL_FACTORY = CHENKernelFactory()
83-
PRESET_MEAN_FACTORY = LazyConstantMeanFactory()
84-
PRESET_LIKELIHOOD_FACTORY = LazyGaussianLikelihoodFactory()
85-
PRESET_FIT_CRITERION_FACTORY = CHENFitCriterionFactory
82+
KERNEL_FACTORY = CHENKernelFactory()
83+
MEAN_FACTORY = LazyConstantMeanFactory()
84+
LIKELIHOOD_FACTORY = LazyGaussianLikelihoodFactory()
85+
FIT_CRITERION_FACTORY = CHENFitCriterionFactory

baybe/surrogates/gaussian_process/presets/edbo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def __call__(
186186
gc.collect()
187187

188188
# Preset defaults
189-
PRESET_KERNEL_FACTORY = EDBOKernelFactory()
190-
PRESET_MEAN_FACTORY = EDBOMeanFactory()
191-
PRESET_LIKELIHOOD_FACTORY = EDBOLikelihoodFactory()
192-
PRESET_FIT_CRITERION_FACTORY = EDBOFitCriterionFactory
189+
KERNEL_FACTORY = EDBOKernelFactory()
190+
MEAN_FACTORY = EDBOMeanFactory()
191+
LIKELIHOOD_FACTORY = EDBOLikelihoodFactory()
192+
FIT_CRITERION_FACTORY = EDBOFitCriterionFactory

baybe/surrogates/gaussian_process/presets/edbo_smoothed.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def __call__(
139139
gc.collect()
140140

141141
# Preset defaults
142-
PRESET_KERNEL_FACTORY = SmoothedEDBOKernelFactory()
143-
PRESET_MEAN_FACTORY = SmoothedEDBOMeanFactory()
144-
PRESET_LIKELIHOOD_FACTORY = SmoothedEDBOLikelihoodFactory()
145-
PRESET_FIT_CRITERION_FACTORY = SmoothedEDBOFitCriterionFactory
142+
KERNEL_FACTORY = SmoothedEDBOKernelFactory()
143+
MEAN_FACTORY = SmoothedEDBOMeanFactory()
144+
LIKELIHOOD_FACTORY = SmoothedEDBOLikelihoodFactory()
145+
FIT_CRITERION_FACTORY = SmoothedEDBOFitCriterionFactory

0 commit comments

Comments
 (0)