Skip to content

Commit

Permalink
fixup! Deprecate sampler.backend
Browse files Browse the repository at this point in the history
  • Loading branch information
yngve-sk committed Jan 29, 2025
1 parent 3a6dcaf commit 3f0f631
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/everest/config/sampler_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class SamplerConfig(BaseModel): # type: ignore

@model_validator(mode="after")
def validate_backend_and_method(self): # pylint: disable=E0213
if not get_ropt_plugin_manager().is_supported("sampler", f"{self.ropt_method}"):
raise ValueError(f"Sampler '{self.backend}/{self.method}' not found")
if not get_ropt_plugin_manager().is_supported("sampler", f"{self.method}"):
raise ValueError(f"Sampler '{self.method}' not found")

if self.backend is not None:
message = (
Expand All @@ -55,10 +55,6 @@ def validate_backend_and_method(self): # pylint: disable=E0213

return self

@property
def ropt_method(self) -> str:
return f"{self.backend}/{self.method}"

model_config = ConfigDict(
extra="forbid",
)

0 comments on commit 3f0f631

Please sign in to comment.