Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion flopy/modflow/mf.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def load(
os.path.join(model_ws, f)
)

ml = Modflow(
ml = cls(
modelname,
version=version,
exe_name=exe_name,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfag.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ def load(cls, f, model, nper=0, ext_unit_dict=None):
"Something went wrong at: {}".format(line)
)

return ModflowAg(
return cls(
model,
options=options,
time_series=time_series,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfbas.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True, **kwargs):
)

# create bas object and return
bas = ModflowBas(
bas = cls(
model,
ibound=ibound,
strt=strt,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfbcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def load(cls, f, model, ext_unit_dict=None):
model.add_pop_key_list(ipakcb)

# create instance of bcf object
bcf = ModflowBcf(
bcf = cls(
model,
ipakcb=ipakcb,
intercellt=intercellt,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfchd.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True):
return Package.load(
f,
model,
ModflowChd,
cls,
nper=nper,
check=check,
ext_unit_dict=ext_unit_dict,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfde4.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def load(cls, f, model, ext_unit_dict=None):
ext_unit_dict, filetype=ModflowDe4.ftype()
)

de4 = ModflowDe4(
de4 = cls(
model,
itmx=itmx,
mxup=mxup,
Expand Down
41 changes: 1 addition & 40 deletions flopy/modflow/mfdis.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,45 +809,6 @@ def check(self, f=None, verbose=True, level=1, checktype=None):
chk.summarize()
return chk

# if f is not None:
# if isinstance(f, str):
# pth = os.path.join(self.parent.model_ws, f)
# f = open(pth, 'w', 0)
#
# errors = False
# txt = '\n{} PACKAGE DATA VALIDATION:\n'.format(self.name[0])
# t = ''
# t1 = ''
# inactive = self.parent.bas6.ibound.array == 0
# # thickness errors
# d = self.thickness.array
# d[inactive] = 1.
# if d.min() <= 0:
# errors = True
# t = '{} ERROR: Negative or zero cell thickness specified.\n'.format(t)
# if level > 0:
# idx = np.column_stack(np.where(d <= 0.))
# t1 = self.level1_arraylist(idx, d, self.thickness.name, t1)
# else:
# t = '{} Specified cell thickness is OK.\n'.format(t)
#
# # add header to level 0 text
# txt += t
#
# if level > 0:
# if errors:
# txt += '\n DETAILED SUMMARY OF {} ERRORS:\n'.format(self.name[0])
# # add level 1 header to level 1 text
# txt += t1
#
# # write errors to summary file
# if f is not None:
# f.write('{}\n'.format(txt))
#
# # write errors to stdout
# if verbose:
# print(txt)

@classmethod
def load(cls, f, model, ext_unit_dict=None, check=True):
"""
Expand Down Expand Up @@ -1067,7 +1028,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True):
)

# create dis object instance
dis = ModflowDis(
dis = cls(
model,
nlay=nlay,
nrow=nrow,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfdisu.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def load(cls, f, model, ext_unit_dict=None, check=False):
)

# create dis object instance
disu = ModflowDisU(
disu = cls(
model,
nodes=nodes,
nlay=nlay,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfdrn.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True):
return Package.load(
f,
model,
ModflowDrn,
cls,
nper=nper,
check=check,
ext_unit_dict=ext_unit_dict,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfdrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True):
return Package.load(
f,
model,
ModflowDrt,
cls,
nper=nper,
check=check,
ext_unit_dict=ext_unit_dict,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfevt.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None):
args["unitnumber"] = unitnumber
args["filenames"] = filenames

evt = ModflowEvt(model, **args)
evt = cls(model, **args)

# return evt object
return evt
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mffhb.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None):
nfhbx1 = 0
nfhbx2 = 0

fhb = ModflowFhb(
fhb = cls(
model,
nbdtim=nbdtim,
nflw=nflw,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfflwob.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True):
model.add_pop_key_list(iufbobsv)

# create ModflowFlwob object instance
flwob = ModflowFlwob(
flwob = cls(
model,
iufbobsv=iufbobsv,
tomultfb=tomultfb,
Expand Down
3 changes: 1 addition & 2 deletions flopy/modflow/mfgage.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,13 @@ def load(cls, f, model, nper=None, ext_unit_dict=None):
for file in files:
filenames.append(os.path.basename(file))

gagepak = ModflowGage(
return cls(
model,
numgage=numgage,
gage_data=gage_data,
filenames=filenames,
unitnumber=unitnumber,
)
return gagepak

@staticmethod
def ftype():
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfghb.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True):
return Package.load(
f,
model,
ModflowGhb,
cls,
nper=nper,
check=check,
ext_unit_dict=ext_unit_dict,
Expand Down
4 changes: 1 addition & 3 deletions flopy/modflow/mfgmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ def load(cls, f, model, ext_unit_dict=None):
)
model.add_pop_key_list(iunitmhc)

# create the gmg object
gmg = ModflowGmg(
return cls(
model,
mxiter=mxiter,
iiter=iiter,
Expand All @@ -429,7 +428,6 @@ def load(cls, f, model, ext_unit_dict=None):
chglimit=chglimit,
unitnumber=unitnumber,
)
return gmg

@staticmethod
def ftype():
Expand Down
3 changes: 1 addition & 2 deletions flopy/modflow/mfhfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def load(cls, f, model, ext_unit_dict=None):
ext_unit_dict, filetype=ModflowHfb.ftype()
)

hfb = ModflowHfb(
return cls(
model,
nphfb=0,
mxfb=0,
Expand All @@ -423,7 +423,6 @@ def load(cls, f, model, ext_unit_dict=None):
unitnumber=unitnumber,
filenames=filenames,
)
return hfb

@staticmethod
def ftype():
Expand Down
5 changes: 1 addition & 4 deletions flopy/modflow/mfhob.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True):
)
model.add_pop_key_list(iuhobsv)

# create hob object instance
hob = ModflowHob(
return cls(
model,
iuhobsv=iuhobsv,
hobdry=hobdry,
Expand All @@ -502,8 +501,6 @@ def load(cls, f, model, ext_unit_dict=None, check=True):
filenames=filenames,
)

return hob

@staticmethod
def ftype():
return "HOB"
Expand Down
7 changes: 2 additions & 5 deletions flopy/modflow/mfhyd.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ def load(cls, f, model, ext_unit_dict=None):
)
model.add_pop_key_list(ihydun)

# create hyd instance
hyd = ModflowHyd(
# return hyd instance
return cls(
model,
nhyd=nhyd,
ihydun=ihydun,
Expand All @@ -377,9 +377,6 @@ def load(cls, f, model, ext_unit_dict=None):
filenames=filenames,
)

# return hyd instance
return hyd

@staticmethod
def ftype():
return "HYD"
Expand Down
3 changes: 1 addition & 2 deletions flopy/modflow/mflak.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None):
)
ipos += 1

lakpak = ModflowLak(
return cls(
model,
options=options,
nlakes=nlakes,
Expand All @@ -928,7 +928,6 @@ def load(cls, f, model, nper=None, ext_unit_dict=None):
unitnumber=unitnumber,
filenames=filenames,
)
return lakpak

@staticmethod
def ftype():
Expand Down
3 changes: 1 addition & 2 deletions flopy/modflow/mflmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def load(cls, f, model, ext_unit_dict=None):
ext_unit_dict, filetype=ModflowLmt.ftype()
)

lmt = ModflowLmt(
return cls(
model,
output_file_name=output_file_name,
output_file_unit=output_file_unit,
Expand All @@ -267,7 +267,6 @@ def load(cls, f, model, ext_unit_dict=None):
unitnumber=unitnumber,
filenames=filenames,
)
return lmt

@staticmethod
def ftype():
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mflpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True):
model.add_pop_key_list(ipakcb)

# create instance of lpf class
lpf = ModflowLpf(
lpf = cls(
model,
ipakcb=ipakcb,
laytyp=laytyp,
Expand Down
5 changes: 1 addition & 4 deletions flopy/modflow/mfmlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,13 @@ def load(cls, f, model, nrow=None, ncol=None, ext_unit_dict=None):
ext_unit_dict, filetype=ModflowMlt.ftype()
)

# create mlt dictionary
mlt = ModflowMlt(
return cls(
model,
mult_dict=mult_dict,
unitnumber=unitnumber,
filenames=filenames,
)

return mlt

@staticmethod
def mult_function(mult_dict, line):
"""
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfmnw1.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def load(cls, f, model, nper=None, gwt=False, nsol=1, ext_unit_dict=None):
if openfile:
f.close()

return ModflowMnw1(
return cls(
model,
mxmnw=mxmnw,
ipakcb=ipakcb,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfmnw2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ def load(cls, f, model, nper=None, gwt=False, nsol=1, ext_unit_dict=None):
filenames[1] = os.path.basename(value.filename)
model.add_pop_key_list(key)

return ModflowMnw2(
return cls(
model,
mnwmax=mnwmax,
nodtot=nodtot,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfmnwi.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def load(cls, f, model, nper=None, gwt=False, nsol=1, ext_unit_dict=None):
)
idx += 1

return ModflowMnwi(
return cls(
model,
wel1flag=wel1flag,
qsumflag=qsumflag,
Expand Down
2 changes: 1 addition & 1 deletion flopy/modflow/mfnwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def load(cls, f, model, ext_unit_dict=None):
kwargs["filenames"] = filenames

# create and return an instance of the nwt class
return ModflowNwt(model, **kwargs)
return cls(model, **kwargs)

@staticmethod
def ftype():
Expand Down
5 changes: 1 addition & 4 deletions flopy/modflow/mfoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,7 @@ def load(
for u in unitnumber:
model.add_pop_key_list(u)

# create instance of oc class
oc = ModflowOc(
return cls(
model,
ihedfm=ihedfm,
iddnfm=iddnfm,
Expand All @@ -1118,8 +1117,6 @@ def load(
filenames=filenames,
)

return oc

@staticmethod
def ftype():
return "OC"
Expand Down
4 changes: 2 additions & 2 deletions flopy/modflow/mfpar.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ def set_pval(self, model, ext_unit_dict):

return

@classmethod
def load(cls, f, npar, verbose=False):
@staticmethod
def load(f, npar, verbose=False):
"""
Load property parameters from an existing package.

Expand Down
Loading