From 2c867a985b35dd66ff4fa6ece0ea1f27dad60376 Mon Sep 17 00:00:00 2001 From: StephanDeHoop Date: Tue, 17 Dec 2024 16:04:48 +0100 Subject: [PATCH] Require Model and realizations.len() > 0 --- src/everest/config/everest_config.py | 3 +-- src/everest/config/model_config.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/everest/config/everest_config.py b/src/everest/config/everest_config.py index ce22b353649..1e464652473 100644 --- a/src/everest/config/everest_config.py +++ b/src/everest/config/everest_config.py @@ -114,8 +114,7 @@ class EverestConfig(BaseModelWithPropertySupport): # type: ignore default=OptimizationConfig(), description="Optimizer options", ) - model: ModelConfig | None = Field( - default=ModelConfig(), + model: ModelConfig = Field( description="Configuration of the Everest model", ) diff --git a/src/everest/config/model_config.py b/src/everest/config/model_config.py index 9fe95affe02..84b67594e7f 100644 --- a/src/everest/config/model_config.py +++ b/src/everest/config/model_config.py @@ -5,10 +5,10 @@ class ModelConfig(BaseModel, extra="forbid"): # type: ignore realizations: list[NonNegativeInt] = Field( - default_factory=lambda: [], description="""List of realizations to use in optimization ensemble. Typically, this is a list [0, 1, ..., n-1] of all realizations in the ensemble.""", + min_length=1, ) data_file: str | None = Field( default=None,