diff --git a/flepimop/gempyor_pkg/src/gempyor/model_info.py b/flepimop/gempyor_pkg/src/gempyor/model_info.py index 82956dd9e..3ba989cf3 100644 --- a/flepimop/gempyor_pkg/src/gempyor/model_info.py +++ b/flepimop/gempyor_pkg/src/gempyor/model_info.py @@ -19,7 +19,7 @@ def __init__(self, config: confuse.ConfigView): self.tf = config["end_date"].as_date() if self.tf <= self.ti: raise ValueError( - f"Time to finish ('{self.tf}') is less than or equal to time to start ('{self.ti}')." + f"Final time ('{self.tf}') is less than or equal to initial time('{self.ti}')." ) self.n_days = (self.tf - self.ti).days + 1 self.dates = pd.date_range(start=self.ti, end=self.tf, freq="D") @@ -76,7 +76,7 @@ def __init__( # Auto-detect old config if config["interventions"].exists(): raise ValueError( - "This config has an intervention section, which is only compatible with a previous version (1.1) of flepiMoP." + "This config has an intervention section, which is only compatible with a previous version (v1.1) of flepiMoP. " ) # 1. Create a setup name that contains every scenario. @@ -172,14 +172,14 @@ def __init__( ) # TODO create a Stacked from all elif self.seir_modifiers_scenario is not None: raise ValueError( - "A seir modifiers scenario was provided to `ModelInfo` but there is no `seir_modifiers` section in the config." + "A `seir_modifiers_scenario` argument was provided to `ModelInfo` but there is no `seir_modifiers` section in the config." ) else: logging.info("Running `ModelInfo` with seir but without SEIR Modifiers") elif self.seir_modifiers_scenario is not None: raise ValueError( - "A seir modifiers scenario was provided to `ModelInfo` but there is no `seir_modifiers` section in the config." + "A `seir_modifiers_scenario` argument was provided to `ModelInfo` but there is no `seir` section in the config." ) else: logging.critical("Running ModelInfo without SEIR") @@ -208,7 +208,7 @@ def __init__( elif self.outcome_modifiers_scenario is not None: if config["outcome_modifiers"].exists(): raise ValueError( - "An outcome modifiers scenario was provided to `ModelInfo` but there is no `outcome_modifiers` section in the config." + "A `outcome_modifiers_scenario` argument was provided to `ModelInfo` but there is no `outcome_modifiers` section in the config." ) else: self.outcome_modifiers_scenario = None @@ -218,7 +218,7 @@ def __init__( ) elif self.outcome_modifiers_scenario is not None: raise ValueError( - "An outcome modifiers scenario was provided to `ModelInfo` but there is no `outcome_modifiers` section in the config." + "A `outcome_modifiers_scenario` argument was provided to `ModelInfo` but there is no `outcomes` section in the config." ) else: logging.info("Running `ModelInfo` without outcomes.") diff --git a/flepimop/gempyor_pkg/src/gempyor/seeding.py b/flepimop/gempyor_pkg/src/gempyor/seeding.py index c341ed93c..a2ae8bb88 100644 --- a/flepimop/gempyor_pkg/src/gempyor/seeding.py +++ b/flepimop/gempyor_pkg/src/gempyor/seeding.py @@ -158,8 +158,6 @@ def get_from_config(self, sim_id: int, modinf) -> nb.typed.Dict: ) elif method == "FolderDraw" or method == "FromFile": amounts = seeding["amount"] - else: - raise ValueError(f"Unknown seeding method given, '{method}'.") return _DataFrame2NumbaDict(df=seeding, amounts=amounts, modinf=modinf) diff --git a/flepimop/gempyor_pkg/src/gempyor/statistics.py b/flepimop/gempyor_pkg/src/gempyor/statistics.py index b6ced5e6d..180dbe80e 100644 --- a/flepimop/gempyor_pkg/src/gempyor/statistics.py +++ b/flepimop/gempyor_pkg/src/gempyor/statistics.py @@ -257,8 +257,8 @@ def llik(self, model_data: xr.DataArray, gt_data: xr.DataArray) -> xr.DataArray: } if self.dist not in dist_map: raise ValueError( - f"Invalid distribution specified [received: '{self.dist}']. " - f"Valid distributions: '{dist_map}'." + f"Invalid distribution specified: '{self.dist}'. " + f"Valid distributions: '{dist_map.keys()}'." ) if self.dist in ["pois", "nbinom"]: model_data = model_data.astype(int)