diff --git a/wsimod/nodes/storage.py b/wsimod/nodes/storage.py index 546201a4..38fab451 100644 --- a/wsimod/nodes/storage.py +++ b/wsimod/nodes/storage.py @@ -612,7 +612,7 @@ def apply_overrides(self, overrides=Dict[str, Any]): overrides (Dict[str, Any]): Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. """ - overwrite_params = [ + overwrite_params = set([ "length", "width", "velocity", @@ -631,10 +631,10 @@ def apply_overrides(self, overrides=Dict[str, Any]): "muptPpar", "max_temp_lag", "max_phosphorus_lag", - ] + ]) - for param in overwrite_params: - setattr(self, param, overrides.pop(param, getattr(self, param))) + for param in overwrite_params.intersection(overrides.keys()): + setattr(self, param, overrides.pop(param)) if "area" in overrides.keys(): print(