Skip to content

Commit

Permalink
feat(mflistreader): read WEL Reductions from List File (#630)
Browse files Browse the repository at this point in the history
* Read WEL Reductions from List File

Adds a method to the ListBudget class to read in data from the list file on automatic reductions to WEL extractions. This method supports both NWT and USG list files. Adds auto tests for both success and failure. I couldn't find any included data sets with reductions written to the LST, so I updated a USG data set to allow for the auto test.

* Removed Trailing Whitespace

Removed trailing whitespace id'd by codacy.

* Updated to work with python 2.7

Updated code to run with python 2.7.  Used autopep8 to formalize some formatting.
  • Loading branch information
ConstableCatnip authored and langevin-usgs committed Aug 17, 2019
1 parent 5c3f984 commit ac38a1e
Show file tree
Hide file tree
Showing 5 changed files with 3,449 additions and 1,935 deletions.
31 changes: 31 additions & 0 deletions autotest/t011_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import flopy
import numpy as np
from nose.tools import raises


def test_mflistfile():
Expand Down Expand Up @@ -55,6 +56,36 @@ def test_mflistfile():

return

def test_mflist_reducedpumping():
'''
test reading reduced pumping data from list file
'''
pth = os.path.join('..', 'examples', 'data', 'mfusg_test',
'03B_conduit_unconfined', 'output')
list_file = os.path.join(pth, 'ex3B.lst')
mflist = flopy.utils.MfusgListBudget(list_file)
assert isinstance(mflist.get_reduced_pumping(), np.recarray)

return

@raises(AssertionError)
def test_mflist_reducedpumping_fail():
'''
test failure for reading reduced pumping data from list file
'''
pth = os.path.join('..', 'examples', 'data', 'mfusg_test',
'03A_conduit_unconfined', 'output')
list_file = os.path.join(pth, 'ex3A.lst')
# Catch before flopy to avoid masking file not found assert
if not os.path.isfile(list_file):
msg = '{} {}'.format(list_file, 'not found')
raise FileNotFoundError(msg)
mflist = flopy.utils.MfusgListBudget(list_file)
mflist.get_reduced_pumping()

return

if __name__ == '__main__':
test_mflistfile()
test_mflist_reducedpumping()
test_mflist_reducedpumping_fail()
1 change: 0 additions & 1 deletion examples/data/mfusg_test/03B_conduit_unconfined/ex3B.nam
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ DATA(BINARY) 30 ex3B.hds
DATA(BINARY) 31 ex3B.ddn
DATA(BINARY) 35 ex3B.cln.cbb
DATA(BINARY) 36 ex3B.cln.hds
DATA 55 ex3B.cln.afr
2 changes: 1 addition & 1 deletion examples/data/mfusg_test/03B_conduit_unconfined/ex3B.wel
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
1 50 autoflowreduce iunitafr 55
1 50 autoflowreduce iunitafr 7
0 0 1 Stress Period 1
1 -62840.
Loading

0 comments on commit ac38a1e

Please sign in to comment.