Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply overrides in Land and surfaces #82

Merged
merged 26 commits into from
Oct 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5c0f623
Apply overrides in Land
liuly12 Mar 5, 2024
3bac612
Apply overrides in Surface
liuly12 Mar 5, 2024
8702d9a
Apply overrides in ImperviousSurface
liuly12 Mar 5, 2024
0ad68ef
Apply overrides in PerviousSurface
liuly12 Mar 5, 2024
33b7150
Apply overrides in GrowingSurface
liuly12 Mar 5, 2024
ebf13e0
Apply overrides in IrrigationSurface
liuly12 Mar 5, 2024
bf5bbf1
Apply overrides in NutrientPool
liuly12 Mar 5, 2024
ac54634
Add test_land_overrides
liuly12 Mar 5, 2024
9eac911
Add test_surface_overrides
liuly12 Mar 5, 2024
6902447
Add test_impervioussurface_overrides
liuly12 Mar 5, 2024
996d804
Add test_pervioussurface_overrides
liuly12 Mar 5, 2024
108c2bc
Add test_growingsurface_overrides
liuly12 Mar 5, 2024
7195683
Add test_nutrientpool_overrides
liuly12 Mar 5, 2024
325ea01
Apply overrides of data_input_dict in Surface and its superclasses
liuly12 Mar 18, 2024
e9a3ea1
Update warning
liuly12 Apr 10, 2024
8a22275
Remove duplicate line
liuly12 Apr 10, 2024
4b32b9b
Update error
liuly12 Apr 10, 2024
9641dbf
Direct assign to self rather than return variables
liuly12 Apr 10, 2024
962d329
Merge branch 'main' into land-surface-overrides
dalonsoa Jul 16, 2024
f0e1ee7
fix the load error
liuly12 Aug 1, 2024
fc5bc58
pre-commit reformatted
liuly12 Aug 1, 2024
c850d51
merge
barneydobson Oct 1, 2024
0862658
Merge branch 'main' into land-surface-overrides
barneydobson Oct 1, 2024
cbb2df9
fix import
barneydobson Oct 1, 2024
eb0f9b6
typo
barneydobson Oct 1, 2024
a0ef857
fix imports
barneydobson Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test_land_overrides
  • Loading branch information
liuly12 committed Mar 5, 2024
commit ac5463494980f2e2aaed1a7bb0ef1fb5dc017900
15 changes: 14 additions & 1 deletion tests/test_land.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
PerviousSurface,
Surface,
)
from wsimod.nodes.nodes import Node
from wsimod.nodes.nodes import Node, DecayTank
from wsimod.nodes.sewer import Sewer
from wsimod.nodes.storage import Reservoir
from wsimod.orchestration.model import to_datetime
Expand Down Expand Up @@ -1168,6 +1168,19 @@ def test_garden(self):
d3 = {"phosphate": 0, "temperature": 0, "volume": 0.2 * 0.5 * 1.5}
self.assertDictAlmostEqual(d3, surface.storage, 16)

def test_land_overrides(self):
constants.set_simple_pollutants()
node = Land(name="")
node.apply_overrides({'surface_residence_time': 4.9,
'subsurface_residence_time': 23.7,
'percolation_residence_time': 56.1
})
self.assertEqual(node.surface_residence_time, 4.9)
self.assertEqual(node.surface_runoff.residence_time, 4.9)
self.assertEqual(node.subsurface_residence_time, 23.7)
self.assertEqual(node.subsurface_runoff.residence_time, 23.7)
self.assertEqual(node.percolation_residence_time, 56.1)
self.assertEqual(node.percolation.residence_time, 56.1)
liuly12 marked this conversation as resolved.
Show resolved Hide resolved

if __name__ == "__main__":
unittest.main()