Skip to content

Commit 2ecc40a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b0d7da5 commit 2ecc40a

File tree

17 files changed

+45
-41
lines changed

17 files changed

+45
-41
lines changed

docs/demo/scripts/customise_interactions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
from wsimod.nodes.sewer import Sewer
3838

39-
4039
my_sewer = Sewer(name="mr_sewer")
4140
print(my_sewer.push_set_handler)
4241

tests/run_all_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@author: Barney
55
66
"""
7+
78
import os
89
import unittest
910

tests/test_land.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_atmospheric_dep(self):
7878

7979
d1 = {"ammonia": 1, "nitrate": 4, "phosphate": 2, "volume": 0, "temperature": 0}
8080
d2 = {"volume": 0, "temperature": 0, "phosphate": 0}
81-
(r1, r2) = surface.atmospheric_deposition()
81+
r1, r2 = surface.atmospheric_deposition()
8282
self.assertDictAlmostEqual(d1, r1)
8383
self.assertDictAlmostEqual(d2, r2)
8484

@@ -93,7 +93,7 @@ def test_precip_dep(self):
9393

9494
d1 = {"ammonia": 1, "nitrate": 4, "phosphate": 2, "volume": 0, "temperature": 0}
9595
d2 = {"volume": 0, "temperature": 0, "phosphate": 0}
96-
(r1, r2) = surface.precipitation_deposition()
96+
r1, r2 = surface.precipitation_deposition()
9797
self.assertDictAlmostEqual(d1, r1)
9898
self.assertDictAlmostEqual(d2, r2)
9999

@@ -164,7 +164,7 @@ def test_simple_dep(self):
164164

165165
surface = Surface(pollutant_load=d1, area=1)
166166

167-
(in_, out_) = surface.simple_deposition()
167+
in_, out_ = surface.simple_deposition()
168168

169169
d2 = {"volume": 0, "temperature": 0, "phosphate": 0}
170170
self.assertDictAlmostEqual(d1, in_)
@@ -193,7 +193,7 @@ def test_urban_precip(self):
193193
d1 = {"volume": 0.1 * 1.5, "temperature": 0, "phosphate": 0}
194194
d2 = {"phosphate": 0, "volume": 0.01 * 1.5 * 0.9, "temperature": 0}
195195
d3 = {"phosphate": 0, "temperature": 10, "volume": (0.1 - 0.01 * 0.9) * 1.5}
196-
(r1, r2) = surface.precipitation_evaporation()
196+
r1, r2 = surface.precipitation_evaporation()
197197
self.assertDictAlmostEqual(d1, r1, 17)
198198
self.assertDictAlmostEqual(d2, r2, 17)
199199
self.assertDictAlmostEqual(d3, surface.storage, 17)
@@ -206,7 +206,7 @@ def test_urban_precip(self):
206206
"temperature": 10,
207207
"volume": (0.1 - (0.01 + 0.02) * 0.9) * 1.5,
208208
}
209-
(r1, r2) = surface.precipitation_evaporation()
209+
r1, r2 = surface.precipitation_evaporation()
210210
self.assertDictAlmostEqual(d3, r1, 17)
211211
self.assertDictAlmostEqual(d4, r2, 17)
212212
self.assertDictAlmostEqual(d5, surface.storage, 17)
@@ -279,7 +279,7 @@ def test_ihacres1(self):
279279

280280
node.t = 1
281281

282-
(r1, r2) = surface.ihacres()
282+
r1, r2 = surface.ihacres()
283283

284284
d1 = {"volume": 0.1 * 1.5, "phosphate": 0, "temperature": 0}
285285

@@ -350,7 +350,7 @@ def test_ihacres2(self):
350350

351351
node.t = 1
352352

353-
(r1, r2) = surface.ihacres()
353+
r1, r2 = surface.ihacres()
354354

355355
evaporation_ = (
356356
0.01
@@ -407,7 +407,7 @@ def test_ihacres3(self):
407407

408408
node.t = 1
409409

410-
(r1, r2) = surface.ihacres()
410+
r1, r2 = surface.ihacres()
411411

412412
d1 = {"volume": 0.1 * 1.5, "phosphate": 0, "temperature": 0}
413413

@@ -472,7 +472,7 @@ def test_perv_route(self):
472472
surface.subsurface_flow = d2
473473
surface.percolation = d3
474474

475-
(r1, r2) = surface.route()
475+
r1, r2 = surface.route()
476476
self.assertDictAlmostEqual(d4, r1)
477477
self.assertDictAlmostEqual(d4, r2)
478478
self.assertDictAlmostEqual(d1, land.surface_runoff.storage)
@@ -508,7 +508,7 @@ def test_soil_temp(self):
508508
"phosphate": 0.2,
509509
}
510510

511-
(r1, r2) = surface.calculate_soil_temperature()
511+
r1, r2 = surface.calculate_soil_temperature()
512512
self.assertDictAlmostEqual(d1, r1)
513513
self.assertDictAlmostEqual(d1, r2)
514514
self.assertDictAlmostEqual(d2, surface.storage, 14)
@@ -727,7 +727,7 @@ def test_fertiliser(self):
727727
node.monthyear = 1
728728
surface.parent = node
729729

730-
(r1, r2) = surface.fertiliser()
730+
r1, r2 = surface.fertiliser()
731731

732732
d1 = surface.empty_vqip()
733733

@@ -752,7 +752,7 @@ def test_manure(self):
752752
node.monthyear = 1
753753
surface.parent = node
754754

755-
(r1, r2) = surface.manure()
755+
r1, r2 = surface.manure()
756756

757757
d1 = surface.empty_vqip()
758758

@@ -844,7 +844,7 @@ def test_soil_pool(self):
844844

845845
nut_p = surface.nutrient_pool
846846
cf = nut_p.temperature_dependence_factor * nut_p.soil_moisture_dependence_factor
847-
(r1, r2) = surface.soil_pool_transformation()
847+
r1, r2 = surface.soil_pool_transformation()
848848

849849
fast_ = {"N": isoil["org-nitrogen"], "P": isoil["org-phosphorus"]} # original
850850
dissolved_inorganic_ = {
@@ -919,7 +919,7 @@ def test_crop_uptake(self):
919919
surface.days_after_sow = date.dayofyear - surface.sowing_day
920920
_ = surface.calc_crop_cover()
921921

922-
(r1, r2) = surface.calc_crop_uptake()
922+
r1, r2 = surface.calc_crop_uptake()
923923

924924
d1 = surface.empty_vqip()
925925
self.assertDictAlmostEqual(r1, d1)
@@ -956,7 +956,7 @@ def test_erosion1(self):
956956
node.t = date
957957
surface.parent = node
958958
_ = surface.ihacres()
959-
(r1, r2) = surface.erosion()
959+
r1, r2 = surface.erosion()
960960
d1 = surface.empty_vqip()
961961
self.assertDictAlmostEqual(d1, r2)
962962
d1["phosphate"] = 0.0019497135091285024
@@ -979,7 +979,7 @@ def test_erosion2(self):
979979
node.t = date
980980
surface.parent = node
981981
_ = surface.ihacres()
982-
(r1, r2) = surface.erosion()
982+
r1, r2 = surface.erosion()
983983
d1 = surface.empty_vqip()
984984
self.assertDictAlmostEqual(d1, r2)
985985
d1["phosphate"] = 1.0244298083948e-06
@@ -1002,7 +1002,7 @@ def test_erosion3(self):
10021002
node.t = date
10031003
surface.parent = node
10041004
_ = surface.ihacres()
1005-
(r1, r2) = surface.erosion()
1005+
r1, r2 = surface.erosion()
10061006
d1 = surface.empty_vqip()
10071007
self.assertDictAlmostEqual(d1, r2)
10081008
d1["phosphate"] = 8.3285749289e-09
@@ -1014,7 +1014,7 @@ def test_denitrification(self):
10141014
constants.set_default_pollutants()
10151015
surface, ivol, isoil = self.create_growing_surface()
10161016
surface.calc_temperature_dependence_factor()
1017-
(r1, r2) = surface.denitrification()
1017+
r1, r2 = surface.denitrification()
10181018
d1 = surface.empty_vqip()
10191019
self.assertDictAlmostEqual(d1, r1)
10201020
d1["nitrate"] = 0.03295446191742672
@@ -1024,7 +1024,7 @@ def test_desorption(self):
10241024
constants.set_default_pollutants()
10251025
surface, ivol, isoil = self.create_growing_surface()
10261026
surface.nutrient_pool.adsorbed_inorganic_pool.storage["P"] = 1e6
1027-
(r1, r2) = surface.adsorption()
1027+
r1, r2 = surface.adsorption()
10281028
d1 = surface.empty_vqip()
10291029
self.assertDictAlmostEqual(d1, r2)
10301030
d1["phosphate"] = 29534.602916697728
@@ -1054,7 +1054,7 @@ def test_adsorption(self):
10541054

10551055
surface.fertiliser()
10561056

1057-
(r1, r2) = surface.adsorption()
1057+
r1, r2 = surface.adsorption()
10581058
d1 = surface.empty_vqip()
10591059
self.assertDictAlmostEqual(d1, r1)
10601060
d1["phosphate"] = 1.5761692429741743

tests/test_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@author: Barney
55
66
"""
7+
78
import os
89
import pytest
910
import unittest

wsimod/core/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
@author: bdobson
55
"""
6+
67
from wsimod.core import constants
78

89
M3_S_TO_ML_D = 86.4

wsimod/core/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Converted to totals on Thur Apr 21 2022
77
"""
8+
89
from math import log10
910

1011
from wsimod.core import constants

wsimod/demo/create_oxford.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
@author: Barney
55
"""
6+
67
import os
78
import re
89

wsimod/nodes/catchment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Converted to totals on 2022-05-03
77
"""
8+
89
from wsimod.core import constants
910
from wsimod.nodes.nodes import Node
1011

wsimod/nodes/demand.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Converted to totals BD 2022-05-03
77
"""
8+
89
from typing import Any, Dict
910

1011
from wsimod.core import constants

wsimod/nodes/land.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
@author: Barney
55
"""
6+
67
import sys
78
from bisect import bisect_left
89
from math import exp, log, log10, sin
@@ -633,10 +634,8 @@ def apply_overrides(self, overrides=Dict[str, Any]):
633634
self.et0_to_e = overrides.pop("et0_to_e", self.et0_to_e)
634635
if "depth" in overrides.keys():
635636
overrides.pop("depth")
636-
print(
637-
"ERROR: specifying depth is depreciated in overrides for \
638-
impervious surface, please specify pore_depth instead"
639-
)
637+
print("ERROR: specifying depth is depreciated in overrides for \
638+
impervious surface, please specify pore_depth instead")
640639
self.pore_depth = overrides.pop("pore_depth", self.pore_depth)
641640
self.depth = self.pore_depth
642641
self.capacity = self.area * self.depth
@@ -1411,10 +1410,8 @@ def apply_overrides(self, overrides=Dict[str, Any]):
14111410

14121411
if "depth" in overrides.keys():
14131412
overrides.pop("depth")
1414-
print(
1415-
"ERROR: specifying depth is depreciated in overrides for \
1416-
GrowingSurface, please specify rooting_depth instead"
1417-
)
1413+
print("ERROR: specifying depth is depreciated in overrides for \
1414+
GrowingSurface, please specify rooting_depth instead")
14181415
self.rooting_depth = overrides.pop("rooting_depth", self.rooting_depth)
14191416
overrides["depth"] = self.rooting_depth
14201417
super().apply_overrides(overrides)

0 commit comments

Comments
 (0)