Skip to content

Commit

Permalink
Apply overrides in ImperviousSurface
Browse files Browse the repository at this point in the history
as well as remove redundant super().apply_overrides(overrides) in Surface
  • Loading branch information
liuly12 committed Mar 2, 2024
1 parent bd7e9bd commit 5c9d866
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion wsimod/nodes/land.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ def apply_overrides(self, overrides = Dict[str, Any]):
pollutant_load = overrides.pop("pollutant_load", {})
for key, value in pollutant_load.items():
self.pollutant_load[key].update(value)
super().apply_overrides(overrides)

def run(self):
"""Call run function (called from Land node)."""
Expand Down Expand Up @@ -598,7 +597,28 @@ def __init__(self, pore_depth=0, et0_to_e=1, **kwargs):
self.inflows.append(self.precipitation_evaporation)

self.outflows.append(self.push_to_sewers)

def apply_overrides(self, overrides = Dict[str, Any]):
"""Override parameters.
Enables a user to override any of the following parameters:
eto_to_e, pore_depth.
Args:
overrides (Dict[str, Any]): Dict describing which parameters should
be overridden (keys) and new values (values). Defaults to {}.
"""
self.et0_to_e = overrides.pop("et0_to_e",
self.et0_to_e)
if 'depth' in overrides.keys():
overrides.pop('depth')
print('ERROR: specifying depth is depreciated in overrides for impervious surface, please specify pore_depth instead')
self.pore_depth = overrides.pop("pore_depth",
self.pore_depth)
self.depth = self.pore_depth
self.capacity = self.area * self.depth
super().apply_overrides(overrides)

def precipitation_evaporation(self):
"""Inflow function that is a simple rainfall-evaporation model, updating the.
Expand Down

0 comments on commit 5c9d866

Please sign in to comment.