Skip to content

Commit

Permalink
Update swmmanywhere.py
Browse files Browse the repository at this point in the history
enable skipping config validation
  • Loading branch information
Dobson committed Mar 25, 2024
1 parent 0c627b7 commit d44faac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion swmmanywhere/swmmanywhere.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)

Expand Down

0 comments on commit d44faac

Please sign in to comment.