Skip to content

Commit

Permalink
Use set rather than list
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Alonso Álvarez <[email protected]>
  • Loading branch information
liuly12 and dalonsoa authored Oct 9, 2024
1 parent 9be6ab8 commit ce74892
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wsimod/nodes/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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(
Expand Down

0 comments on commit ce74892

Please sign in to comment.