From d44faacbff8c443e0b8686efeda3dc9e237e7c39 Mon Sep 17 00:00:00 2001 From: Dobson Date: Mon, 25 Mar 2024 13:03:47 +0000 Subject: [PATCH] Update swmmanywhere.py enable skipping config validation --- swmmanywhere/swmmanywhere.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/swmmanywhere/swmmanywhere.py b/swmmanywhere/swmmanywhere.py index 8eab2685..438dd116 100644 --- a/swmmanywhere/swmmanywhere.py +++ b/swmmanywhere/swmmanywhere.py @@ -186,11 +186,12 @@ def check_parameters_to_sample(config: dict): raise ValueError(f"{param} not found in parameters dictionary.") return config -def load_config(config_path: Path): +def load_config(config_path: Path, validation: bool = True): """Load, validate, and convert Paths in a configuration file. Args: config_path (Path): The path to the configuration file. + validation (bool, optional): Whether to validate the configuration. Returns: dict: The configuration. @@ -204,6 +205,9 @@ def load_config(config_path: Path): # Load the config config = yaml.safe_load(f) + if not validation: + return config + # Validate the config jsonschema.validate(instance = config, schema = schema)