Skip to content

Commit

Permalink
Move empty override checking to Node
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobson committed Feb 29, 2024
1 parent 2f6b545 commit 2825fbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion wsimod/nodes/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ def apply_overrides(self,
overrides: Dict[str, Any] = {}) -> None:
"""Apply overrides to the node.
The Node does not have any overwriteable parameters. So if any
overrides are passed up to the node, this means that there are unused
parameters from the Node subclass, which is flagged.
Args:
overrides (dict, optional): Dictionary of overrides. Defaults to {}.
"""
pass
if len(overrides) > 0:
print(f"No override behaviour defined for: {overrides.keys()}")

def total_in(self):
"""Sum flow and pollutant amounts entering a node via in_arcs.
Expand Down
3 changes: 1 addition & 2 deletions wsimod/nodes/wtw.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ def apply_overrides(self, overrides = Dict[str, Any]):
self.treatment_throughput_capacity = overrides.pop(
"treatment_throughput_capacity",
self.treatment_throughput_capacity)
if len(overrides) > 0:
print(f"No override behaviour defined for: {overrides.keys()}")
super().apply_overrides(overrides)

def get_excess_throughput(self):
"""How much excess treatment capacity is there.
Expand Down

0 comments on commit 2825fbf

Please sign in to comment.