Skip to content

Commit

Permalink
fix(mfsfr2.check): negative segments for lakes no longer included in …
Browse files Browse the repository at this point in the history
…segment numbering order check (#915)

fixes #269
  • Loading branch information
aleaf committed Jun 23, 2020
1 parent d5672f5 commit 796b7b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions autotest/t009_test.py
Expand Up @@ -184,6 +184,8 @@ def test_sfr():
/ sfr.reach_data.rchlen[reach_inds]
chk = sfr.check()
assert sfr.reach_data.slope.min() < 0.0001 and 'minimum slope' in chk.warnings
# negative segments for lakes shouldn't be included in segment numbering order check
assert 'segment numbering order' not in chk.warnings
sfr.reach_data.slope[0] = 1.1
chk.slope(maximum_slope=1.0)
assert 'maximum slope' in chk.warnings
Expand Down Expand Up @@ -581,7 +583,7 @@ def test_sfr_plot():


if __name__ == '__main__':
# test_sfr()
test_sfr()
# test_ds_6d_6e_disordered()
# test_disordered_reachdata_fields()
# test_sfr_renumbering()
Expand All @@ -590,6 +592,6 @@ def test_sfr_plot():
# test_transient_example()
# mtest_sfr_plot()
# test_assign_layers()
test_SfrFile()
#test_SfrFile()
# test_const()
pass
2 changes: 1 addition & 1 deletion flopy/modflow/mfsfr2.py
Expand Up @@ -2163,7 +2163,7 @@ def numbering(self):
print(headertxt.strip())
# for per, segment_data in self.segment_data.items():

inds = (sd.outseg < sd.nseg) & (sd.outseg != 0)
inds = (sd.outseg < sd.nseg) & (sd.outseg > 0)

if len(txt) == 0 and np.any(inds):
decreases = np.array(sd[inds])[['nseg', 'outseg']]
Expand Down

0 comments on commit 796b7b1

Please sign in to comment.