Skip to content

Commit

Permalink
update tests to mass fixes; comment some WIP in runoff
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccreight committed Sep 21, 2023
1 parent 0bed797 commit f8fc37c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion autotest/test_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_control_simple(control_simple):
year = year if month >= 10 else year - 1
wy_start = np.datetime64(f"{year}-10-01")
dowy = (current_time - wy_start).astype("timedelta64[D]")
assert dowy == control_simple.current_dowy
assert dowy == (control_simple.current_dowy - 1)

prev_time = control_simple.current_time

Expand Down
12 changes: 6 additions & 6 deletions autotest/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,18 +287,18 @@ def test_model(domain, model_args, tmp_path):
9: {
"PRMSChannel": {
"seg_outflow": {
"drb_2yr": 1430.6364027142613,
"hru_1": 13.416914151483681,
"ucb_2yr": 1694.5412856707849,
"drb_2yr": 1517.232887980279,
"hru_1": 13.696918669514927,
"ucb_2yr": 1694.5697712423928,
},
},
},
99: {
"PRMSChannel": {
"seg_outflow": {
"drb_2yr": 1588.1444684289775,
"hru_1": 19.596412903692578,
"ucb_2yr": 407.2200022510677,
"drb_2yr": 2350.499659332901,
"hru_1": 22.874414994530095,
"ucb_2yr": 733.2293013532435,
},
},
},
Expand Down
16 changes: 8 additions & 8 deletions pywatershed/hydrology/prms_runoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,11 +857,11 @@ def compute_infil(
# if rain/snow event with no antecedent snowpack,
# compute the runoff from the rain first and then proceed with the
# snowmelt computations
double_counting = 0
# double_counting = 0
cond2 = pptmix_nopack != 0
# if pptmix_nopack == ACTIVE:
if cond2:
double_counting += 1
# double_counting += 1
avail_water = avail_water + through_rain
infil = infil + through_rain
if hru_flag == 1:
Expand Down Expand Up @@ -905,9 +905,9 @@ def compute_infil(
else:
# Snowmelt occurred and depleted the snowpack
# this frequently gets counted along with pptmix_nopack
double_counting += 1
if double_counting > 1:
print("snowmelt")
# double_counting += 1
# if double_counting > 1:
# print("snowmelt")

infil, srp, contrib_fraction = perv_comp(
soil_moist_prev,
Expand All @@ -930,9 +930,9 @@ def compute_infil(
# this is through_rain's top/most narrow case
avail_water = avail_water + through_rain
infil = infil + through_rain
double_counting += 1
if double_counting > 1:
print("cond4")
# double_counting += 1
# if double_counting > 1:
# print("cond4")
if hru_flag == 1:
infil, srp, contrib_fraction = perv_comp(
soil_moist_prev,
Expand Down

0 comments on commit f8fc37c

Please sign in to comment.