From 9983191105f4175627de44396a6638df7b070701 Mon Sep 17 00:00:00 2001 From: jdhughes-usgs Date: Wed, 2 Sep 2020 20:21:13 -0400 Subject: [PATCH] refactor(rtd): refactor functions to hide private functions (#989) --- flopy/discretization/structuredgrid.py | 3 +- flopy/discretization/unstructuredgrid.py | 3 +- flopy/discretization/vertexgrid.py | 3 +- flopy/modflow/mfag.py | 8 ++--- flopy/modflow/mfbas.py | 10 +++--- flopy/modflow/mfbcf.py | 12 +++---- flopy/modflow/mfbct.py | 8 ++--- flopy/modflow/mfchd.py | 22 ++++++++---- flopy/modflow/mfde4.py | 10 +++--- flopy/modflow/mfdis.py | 10 +++--- flopy/modflow/mfdisu.py | 10 +++--- flopy/modflow/mfdrn.py | 25 ++++++++----- flopy/modflow/mfdrt.py | 23 +++++++----- flopy/modflow/mfevt.py | 25 ++++++++----- flopy/modflow/mffhb.py | 27 ++++++++------ flopy/modflow/mfgage.py | 28 ++++++++++----- flopy/modflow/mfghb.py | 25 +++++++------ flopy/modflow/mfgmg.py | 12 +++---- flopy/modflow/mfhfb.py | 24 +++++++------ flopy/modflow/mfhob.py | 12 +++---- flopy/modflow/mfhyd.py | 12 +++---- flopy/modflow/mflak.py | 25 ++++++++----- flopy/modflow/mflmt.py | 10 +++--- flopy/modflow/mflpf.py | 12 +++---- flopy/modflow/mfmlt.py | 10 +++--- flopy/modflow/mfmnw1.py | 10 +++--- flopy/modflow/mfmnw2.py | 12 +++---- flopy/modflow/mfmnwi.py | 18 +++++----- flopy/modflow/mfnwt.py | 10 +++--- flopy/modflow/mfoc.py | 10 +++--- flopy/modflow/mfpbc.py | 21 +++++++---- flopy/modflow/mfpcg.py | 10 +++--- flopy/modflow/mfpcgn.py | 16 ++++----- flopy/modflow/mfpks.py | 10 +++--- flopy/modflow/mfpval.py | 10 +++--- flopy/modflow/mfrch.py | 25 ++++++++----- flopy/modflow/mfriv.py | 25 ++++++++----- flopy/modflow/mfsfr2.py | 14 ++++---- flopy/modflow/mfsip.py | 10 +++--- flopy/modflow/mfsms.py | 10 +++--- flopy/modflow/mfsor.py | 10 +++--- flopy/modflow/mfstr.py | 27 ++++++++------ flopy/modflow/mfsub.py | 16 ++++----- flopy/modflow/mfswi2.py | 16 ++++----- flopy/modflow/mfswr1.py | 10 +++--- flopy/modflow/mfswt.py | 14 ++++---- flopy/modflow/mfupw.py | 14 ++++---- flopy/modflow/mfuzf1.py | 45 ++++++++++++++++++------ flopy/modflow/mfwel.py | 39 +++++++++++++++----- flopy/modflow/mfzon.py | 10 +++--- flopy/modflowlgr/mflgr.py | 8 +++++ flopy/mt3d/mtadv.py | 14 ++++---- flopy/mt3d/mtbtn.py | 14 ++++---- flopy/mt3d/mtcts.py | 6 ++-- flopy/mt3d/mtdsp.py | 16 ++++----- flopy/mt3d/mtgcg.py | 14 ++++---- flopy/mt3d/mtlkt.py | 16 ++++----- flopy/mt3d/mtphc.py | 12 +++---- flopy/mt3d/mtrct.py | 14 ++++---- flopy/mt3d/mtsft.py | 16 ++++----- flopy/mt3d/mtssm.py | 16 ++++----- flopy/mt3d/mttob.py | 12 +++---- flopy/mt3d/mtuzt.py | 16 ++++----- flopy/pakbase.py | 6 ++-- flopy/seawat/swtvdf.py | 10 +++--- flopy/seawat/swtvsc.py | 10 +++--- flopy/utils/mfreadnam.py | 2 +- flopy/utils/zonbud.py | 44 ++++++++++------------- 68 files changed, 582 insertions(+), 445 deletions(-) diff --git a/flopy/discretization/structuredgrid.py b/flopy/discretization/structuredgrid.py index 013c647069..0391ca9c5e 100644 --- a/flopy/discretization/structuredgrid.py +++ b/flopy/discretization/structuredgrid.py @@ -778,7 +778,8 @@ def get_cell_vertices(self, i, j): used in the Shapefile export utilities :param i: (int) cell row number :param j: (int) cell column number - :return: list of x,y cell vertices + Returns + ------- list of x,y cell vertices """ self._copy_cache = False cell_verts = [ diff --git a/flopy/discretization/unstructuredgrid.py b/flopy/discretization/unstructuredgrid.py index 6001d0e044..e1214e0ded 100644 --- a/flopy/discretization/unstructuredgrid.py +++ b/flopy/discretization/unstructuredgrid.py @@ -219,7 +219,8 @@ def get_cell_vertices(self, cellid): Method to get a set of cell vertices for a single cell used in the Shapefile export utilities :param cellid: (int) cellid number - :return: list of x,y cell vertices + Returns + ------- list of x,y cell vertices """ self._copy_cache = False cell_vert = list(zip(self.xvertices[cellid], self.yvertices[cellid])) diff --git a/flopy/discretization/vertexgrid.py b/flopy/discretization/vertexgrid.py index db0b04ff1d..3e043b72a1 100644 --- a/flopy/discretization/vertexgrid.py +++ b/flopy/discretization/vertexgrid.py @@ -258,7 +258,8 @@ def get_cell_vertices(self, cellid): Method to get a set of cell vertices for a single cell used in the Shapefile export utilities :param cellid: (int) cellid number - :return: list of x,y cell vertices + Returns + ------- list of x,y cell vertices """ self._copy_cache = False cell_verts = list(zip(self.xvertices[cellid], self.yvertices[cellid])) diff --git a/flopy/modflow/mfag.py b/flopy/modflow/mfag.py index 00d812e788..de632eb37e 100644 --- a/flopy/modflow/mfag.py +++ b/flopy/modflow/mfag.py @@ -202,14 +202,14 @@ def __init__( # setup the package parent class if unitnumber is None: - unitnumber = ModflowAg.defaultunit() + unitnumber = ModflowAg._defaultunit() if filenames is None: filenames = [None] elif isinstance(filenames, str): filenames = [filenames] - name = [ModflowAg.ftype()] + name = [ModflowAg._ftype()] units = [unitnumber] extra = [""] @@ -903,11 +903,11 @@ def load(cls, f, model, nper=0, ext_unit_dict=None): ) @staticmethod - def defaultunit(): + def _defaultunit(): return 69 @staticmethod - def ftype(): + def _ftype(): return "AG" @property diff --git a/flopy/modflow/mfbas.py b/flopy/modflow/mfbas.py index 30e502c722..4e01914240 100644 --- a/flopy/modflow/mfbas.py +++ b/flopy/modflow/mfbas.py @@ -82,11 +82,11 @@ class ModflowBas(Package): """ @staticmethod - def ftype(): + def _ftype(): return "BAS6" @staticmethod - def defaultunit(): + def _defaultunit(): return 13 def __init__( @@ -109,7 +109,7 @@ def __init__( """ if unitnumber is None: - unitnumber = ModflowBas.defaultunit() + unitnumber = ModflowBas._defaultunit() # set filenames if filenames is None: @@ -118,7 +118,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowBas.ftype()] + name = [ModflowBas._ftype()] units = [unitnumber] extra = [""] @@ -394,7 +394,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True, **kwargs): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowBas.ftype() + ext_unit_dict, filetype=ModflowBas._ftype() ) # create bas object and return diff --git a/flopy/modflow/mfbcf.py b/flopy/modflow/mfbcf.py index baaa2c8cce..5dbf48bafa 100644 --- a/flopy/modflow/mfbcf.py +++ b/flopy/modflow/mfbcf.py @@ -115,7 +115,7 @@ def __init__( ): if unitnumber is None: - unitnumber = ModflowBcf.defaultunit() + unitnumber = ModflowBcf._defaultunit() # set filenames if filenames is None: @@ -130,13 +130,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowBcf.ftype() + ipakcb, fname=fname, package=ModflowBcf._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowBcf.ftype()] + name = [ModflowBcf._ftype()] units = [unitnumber] extra = [""] @@ -520,7 +520,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowBcf.ftype() + ext_unit_dict, filetype=ModflowBcf._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -554,9 +554,9 @@ def load(cls, f, model, ext_unit_dict=None): return bcf @staticmethod - def ftype(): + def _ftype(): return "BCF6" @staticmethod - def defaultunit(): + def _defaultunit(): return 15 diff --git a/flopy/modflow/mfbct.py b/flopy/modflow/mfbct.py index 428d3d1767..15f1424414 100644 --- a/flopy/modflow/mfbct.py +++ b/flopy/modflow/mfbct.py @@ -40,12 +40,12 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowBct.defaultunit() + unitnumber = ModflowBct._defaultunit() # Call ancestor's init to set self.parent, extension, name and unit # number Package.__init__( - self, model, extension, ModflowBct.ftype(), unitnumber + self, model, extension, ModflowBct._ftype(), unitnumber ) self.url = "bct.htm" @@ -168,9 +168,9 @@ def write_file(self): return @staticmethod - def ftype(): + def _ftype(): return "BCT" @staticmethod - def defaultunit(): + def _defaultunit(): return 35 diff --git a/flopy/modflow/mfchd.py b/flopy/modflow/mfchd.py index 5c8ff28e7f..3797e1a84d 100644 --- a/flopy/modflow/mfchd.py +++ b/flopy/modflow/mfchd.py @@ -115,7 +115,7 @@ def __init__( # set default unit number if one is not specified if unitnumber is None: - unitnumber = ModflowChd.defaultunit() + unitnumber = ModflowChd._defaultunit() # set filenames if filenames is None: @@ -124,7 +124,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowChd.ftype()] + name = [ModflowChd._ftype()] units = [unitnumber] extra = [""] @@ -163,8 +163,16 @@ def __init__( self.options = options self.parent.add_package(self) - def ncells(self): - # Returns the maximum number of cells that have recharge (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have constant heads (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of chd cells + + """ return self.stress_period_data.mxact def write_file(self): @@ -222,7 +230,7 @@ def get_default_dtype(structured=True): return dtype @staticmethod - def get_sfac_columns(): + def _get_sfac_columns(): return ["shead", "ehead"] @classmethod @@ -274,9 +282,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): ) @staticmethod - def ftype(): + def _ftype(): return "CHD" @staticmethod - def defaultunit(): + def _defaultunit(): return 24 diff --git a/flopy/modflow/mfde4.py b/flopy/modflow/mfde4.py index 09be4c0e1f..c44b76b216 100644 --- a/flopy/modflow/mfde4.py +++ b/flopy/modflow/mfde4.py @@ -135,7 +135,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowDe4.defaultunit() + unitnumber = ModflowDe4._defaultunit() # set filenames if filenames is None: @@ -144,7 +144,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowDe4.ftype()] + name = [ModflowDe4._ftype()] units = [unitnumber] extra = [""] @@ -310,7 +310,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowDe4.ftype() + ext_unit_dict, filetype=ModflowDe4._ftype() ) de4 = cls( @@ -330,9 +330,9 @@ def load(cls, f, model, ext_unit_dict=None): return de4 @staticmethod - def ftype(): + def _ftype(): return "DE4" @staticmethod - def defaultunit(): + def _defaultunit(): return 28 diff --git a/flopy/modflow/mfdis.py b/flopy/modflow/mfdis.py index d9f9dc6ec3..8c8c9308f0 100644 --- a/flopy/modflow/mfdis.py +++ b/flopy/modflow/mfdis.py @@ -149,7 +149,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowDis.defaultunit() + unitnumber = ModflowDis._defaultunit() # set filenames if filenames is None: @@ -158,7 +158,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowDis.ftype()] + name = [ModflowDis._ftype()] units = [unitnumber] extra = [""] @@ -1024,7 +1024,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowDis.ftype() + ext_unit_dict, filetype=ModflowDis._ftype() ) # create dis object instance @@ -1063,11 +1063,11 @@ def load(cls, f, model, ext_unit_dict=None, check=True): return dis @staticmethod - def ftype(): + def _ftype(): return "DIS" @staticmethod - def defaultunit(): + def _defaultunit(): return 11 diff --git a/flopy/modflow/mfdisu.py b/flopy/modflow/mfdisu.py index 329767d0b5..6ca724904a 100644 --- a/flopy/modflow/mfdisu.py +++ b/flopy/modflow/mfdisu.py @@ -231,7 +231,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowDisU.defaultunit() + unitnumber = ModflowDisU._defaultunit() # set filenames if filenames is None: @@ -240,7 +240,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowDisU.ftype()] + name = [ModflowDisU._ftype()] units = [unitnumber] extra = [""] @@ -794,7 +794,7 @@ def load(cls, f, model, ext_unit_dict=None, check=False): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowDisU.ftype() + ext_unit_dict, filetype=ModflowDisU._ftype() ) # create dis object instance @@ -920,11 +920,11 @@ def write_file(self): return @staticmethod - def ftype(): + def _ftype(): return "DISU" @staticmethod - def defaultunit(): + def _defaultunit(): return 11 # def get_node_coordinates(self): diff --git a/flopy/modflow/mfdrn.py b/flopy/modflow/mfdrn.py index aa3c527d03..26dd2df390 100644 --- a/flopy/modflow/mfdrn.py +++ b/flopy/modflow/mfdrn.py @@ -122,7 +122,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowDrn.defaultunit() + unitnumber = ModflowDrn._defaultunit() # set filenames if filenames is None: @@ -137,7 +137,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowDrn.ftype() + ipakcb, fname=fname, package=ModflowDrn._ftype() ) else: ipakcb = 0 @@ -152,7 +152,7 @@ def __init__( if self.is_drt: name = ["DRT"] else: - name = [ModflowDrn.ftype()] + name = [ModflowDrn._ftype()] units = [unitnumber] extra = [""] @@ -224,9 +224,16 @@ def get_default_dtype(structured=True, is_drt=False): ) return dtype - def ncells(self): - # Returns the maximum number of cells that have drains (developed for MT3DMS SSM package) - # print 'Function must be implemented properly for drn package' + def _ncells(self): + """Maximum number of cells that have drains (developed for MT3DMS + SSM package). + + Returns + ------- + ncells: int + maximum number of drain cells + + """ return self.stress_period_data.mxact def write_file(self, check=True): @@ -284,7 +291,7 @@ def get_empty(ncells=0, aux_names=None, structured=True, is_drt=False): return create_empty_recarray(ncells, dtype, default_value=-1.0e10) @staticmethod - def get_sfac_columns(): + def _get_sfac_columns(): return ["cond"] @classmethod @@ -335,9 +342,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): ) @staticmethod - def ftype(): + def _ftype(): return "DRN" @staticmethod - def defaultunit(): + def _defaultunit(): return 21 diff --git a/flopy/modflow/mfdrt.py b/flopy/modflow/mfdrt.py index af84946148..8664a07a37 100644 --- a/flopy/modflow/mfdrt.py +++ b/flopy/modflow/mfdrt.py @@ -120,7 +120,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowDrt.defaultunit() + unitnumber = ModflowDrt._defaultunit() # set filenames if filenames is None: @@ -135,7 +135,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowDrt.ftype() + ipakcb, fname=fname, package=ModflowDrt._ftype() ) else: ipakcb = 0 @@ -150,7 +150,7 @@ def __init__( if not found: options.append("RETURNFLOW") - name = [ModflowDrt.ftype()] + name = [ModflowDrt._ftype()] units = [unitnumber] extra = [""] @@ -219,9 +219,16 @@ def get_default_dtype(structured=True): ) return dtype - def ncells(self): - # Returns the maximum number of cells that have drains (developed for MT3DMS SSM package) - # print 'Function must be implemented properly for drt package' + def _ncells(self): + """Maximum number of cells that have drains with return flows + (developed for MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of drt cells + + """ return self.stress_period_data.mxact def write_file(self, check=True): @@ -321,9 +328,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): ) @staticmethod - def ftype(): + def _ftype(): return "DRT" @staticmethod - def defaultunit(): + def _defaultunit(): return 21 diff --git a/flopy/modflow/mfevt.py b/flopy/modflow/mfevt.py index c7842c5284..d73a149cef 100644 --- a/flopy/modflow/mfevt.py +++ b/flopy/modflow/mfevt.py @@ -101,7 +101,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowEvt.defaultunit() + unitnumber = ModflowEvt._defaultunit() # set filenames if filenames is None: @@ -116,13 +116,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowEvt.ftype() + ipakcb, fname=fname, package=ModflowEvt._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowEvt.ftype()] + name = [ModflowEvt._ftype()] units = [unitnumber] extra = [""] @@ -170,9 +170,16 @@ def __init__( self.np = 0 self.parent.add_package(self) - def ncells(self): - # Returns the maximum number of cells that have - # evapotranspiration (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have evapotranspiration (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of evt cells + + """ nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper return nrow * ncol @@ -405,7 +412,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowEvt.ftype() + ext_unit_dict, filetype=ModflowEvt._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -423,9 +430,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): return evt @staticmethod - def ftype(): + def _ftype(): return "EVT" @staticmethod - def defaultunit(): + def _defaultunit(): return 22 diff --git a/flopy/modflow/mffhb.py b/flopy/modflow/mffhb.py index 3a7621e5ab..2c02cc9f0a 100644 --- a/flopy/modflow/mffhb.py +++ b/flopy/modflow/mffhb.py @@ -159,7 +159,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowFhb.defaultunit() + unitnumber = ModflowFhb._defaultunit() # set filenames if filenames is None: @@ -174,13 +174,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowFhb.ftype() + ipakcb, fname=fname, package=ModflowFhb._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowFhb.ftype()] + name = [ModflowFhb._ftype()] units = [unitnumber] extra = [""] @@ -337,9 +337,16 @@ def get_default_dtype(nbdtim=1, structured=True, head=False): dtype.append((name, np.float32)) return np.dtype(dtype) - def ncells(self): - # Return the maximum number of cells that have a fhb flow or - # head boundary. (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have fhb (developed for MT3DMS + SSM package). + + Returns + ------- + ncells: int + maximum number of fhb cells + + """ return self.nflw + self.nhed def write_file(self): @@ -467,7 +474,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): iufhb = None if ext_unit_dict is not None: iufhb, fname = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowFhb.ftype() + ext_unit_dict, filetype=ModflowFhb._ftype() ) # Dataset 0 -- header @@ -744,7 +751,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowFhb.ftype() + ext_unit_dict, filetype=ModflowFhb._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -780,9 +787,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): return fhb @staticmethod - def ftype(): + def _ftype(): return "FHB" @staticmethod - def defaultunit(): + def _defaultunit(): return 40 diff --git a/flopy/modflow/mfgage.py b/flopy/modflow/mfgage.py index b5fb14ea9c..0059e4a412 100644 --- a/flopy/modflow/mfgage.py +++ b/flopy/modflow/mfgage.py @@ -95,7 +95,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowGage.defaultunit() + unitnumber = ModflowGage._defaultunit() # set filenames if filenames is None: @@ -183,11 +183,14 @@ def __init__( iu = abs(gage_data["unit"][n]) fname = files[n] model.add_output_file( - iu, fname=fname, binflag=False, package=ModflowGage.ftype() + iu, + fname=fname, + binflag=False, + package=ModflowGage._ftype(), ) # Fill namefile items - name = [ModflowGage.ftype()] + name = [ModflowGage._ftype()] units = [unitnumber] extra = [""] @@ -241,9 +244,16 @@ def get_empty(ncells=0, aux_names=None, structured=True): dtype = ModflowGage.get_default_dtype() return create_empty_recarray(ncells, dtype, default_value=-1.0e10) - def ncells(self): - # Return 0 for the gage package - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have gages (developed for MT3DMS + SSM package). Return zero because gage is not added to SSM package. + + Returns + ------- + ncells: int + 0 + + """ return 0 def write_file(self): @@ -389,7 +399,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): filenames = [] if ext_unit_dict is not None: for key, value in ext_unit_dict.items(): - if value.filetype == ModflowGage.ftype(): + if value.filetype == ModflowGage._ftype(): unitnumber = key filenames.append(os.path.basename(value.filename)) for file in files: @@ -404,9 +414,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "GAGE" @staticmethod - def defaultunit(): + def _defaultunit(): return 120 diff --git a/flopy/modflow/mfghb.py b/flopy/modflow/mfghb.py index c4b3ad535e..ea41d98931 100644 --- a/flopy/modflow/mfghb.py +++ b/flopy/modflow/mfghb.py @@ -124,7 +124,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowGhb.defaultunit() + unitnumber = ModflowGhb._defaultunit() # set filenames if filenames is None: @@ -139,13 +139,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowGhb.ftype() + ipakcb, fname=fname, package=ModflowGhb._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowGhb.ftype()] + name = [ModflowGhb._ftype()] units = [unitnumber] extra = [""] @@ -187,10 +187,15 @@ def __init__( ) self.stress_period_data = MfList(self, stress_period_data) - def ncells(self): - """ - Returns the maximum number of cells that have a ghb cell - (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have general head boundaries + (developed for MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of ghb cells + """ return self.stress_period_data.mxact @@ -260,7 +265,7 @@ def get_default_dtype(structured=True): return dtype @staticmethod - def get_sfac_columns(): + def _get_sfac_columns(): return ["cond"] @classmethod @@ -314,9 +319,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): ) @staticmethod - def ftype(): + def _ftype(): return "GHB" @staticmethod - def defaultunit(): + def _defaultunit(): return 23 diff --git a/flopy/modflow/mfgmg.py b/flopy/modflow/mfgmg.py index 065ec8d8f9..3ade8fa1f7 100644 --- a/flopy/modflow/mfgmg.py +++ b/flopy/modflow/mfgmg.py @@ -213,7 +213,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowGmg.defaultunit() + unitnumber = ModflowGmg._defaultunit() # set filenames if filenames is None: @@ -232,13 +232,13 @@ def __init__( fname=fname, extension="gmg.out", binflag=False, - package=ModflowGmg.ftype(), + package=ModflowGmg._ftype(), ) else: iunitmhc = 0 # Fill namefile items - name = [ModflowGmg.ftype()] + name = [ModflowGmg._ftype()] units = [unitnumber] extra = [""] @@ -402,7 +402,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowGmg.ftype() + ext_unit_dict, filetype=ModflowGmg._ftype() ) if iunitmhc > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -430,9 +430,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "GMG" @staticmethod - def defaultunit(): + def _defaultunit(): return 27 diff --git a/flopy/modflow/mfhfb.py b/flopy/modflow/mfhfb.py index 586a4e5b6b..f6adb3099f 100644 --- a/flopy/modflow/mfhfb.py +++ b/flopy/modflow/mfhfb.py @@ -116,7 +116,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowHfb.defaultunit() + unitnumber = ModflowHfb._defaultunit() # set filenames if filenames is None: @@ -125,7 +125,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowHfb.ftype()] + name = [ModflowHfb._ftype()] units = [unitnumber] extra = [""] @@ -181,10 +181,14 @@ def __init__( self.parent.add_package(self) - def ncells(self): - """ - Returns the maximum number of cell pairs that have horizontal - flow barriers (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cell pairs that have horizontal flow barriers + (developed for MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of hfb cells """ return self.nhfbnp @@ -250,7 +254,7 @@ def get_default_dtype(structured=True): return dtype @staticmethod - def get_sfac_columns(): + def _get_sfac_columns(): return ["hydchr"] @classmethod @@ -409,7 +413,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowHfb.ftype() + ext_unit_dict, filetype=ModflowHfb._ftype() ) return cls( @@ -425,9 +429,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "HFB6" @staticmethod - def defaultunit(): + def _defaultunit(): return 29 diff --git a/flopy/modflow/mfhob.py b/flopy/modflow/mfhob.py index a035f26d2a..12c6ae5e30 100755 --- a/flopy/modflow/mfhob.py +++ b/flopy/modflow/mfhob.py @@ -100,7 +100,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowHob.defaultunit() + unitnumber = ModflowHob._defaultunit() # set filenames if filenames is None: @@ -123,13 +123,13 @@ def __init__( fname=fname, extension="hob.out", binflag=False, - package=ModflowHob.ftype(), + package=ModflowHob._ftype(), ) else: iuhobsv = 0 # Fill namefile items - name = [ModflowHob.ftype()] + name = [ModflowHob._ftype()] units = [unitnumber] extra = [""] @@ -482,7 +482,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowHob.ftype() + ext_unit_dict, filetype=ModflowHob._ftype() ) if iuhobsv is not None: if iuhobsv > 0: @@ -502,11 +502,11 @@ def load(cls, f, model, ext_unit_dict=None, check=True): ) @staticmethod - def ftype(): + def _ftype(): return "HOB" @staticmethod - def defaultunit(): + def _defaultunit(): return 39 diff --git a/flopy/modflow/mfhyd.py b/flopy/modflow/mfhyd.py index 784cabef5d..d3341d81cc 100644 --- a/flopy/modflow/mfhyd.py +++ b/flopy/modflow/mfhyd.py @@ -129,7 +129,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowHyd.defaultunit() + unitnumber = ModflowHyd._defaultunit() # set filenames if filenames is None: @@ -150,11 +150,11 @@ def __init__( ihydun, fname=fname, extension="hyd.bin", - package=ModflowHyd.ftype(), + package=ModflowHyd._ftype(), ) # Fill namefile items - name = [ModflowHyd.ftype()] + name = [ModflowHyd._ftype()] units = [unitnumber] extra = [""] @@ -358,7 +358,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowHyd.ftype() + ext_unit_dict, filetype=ModflowHyd._ftype() ) if ihydun > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -378,9 +378,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "HYD" @staticmethod - def defaultunit(): + def _defaultunit(): return 36 diff --git a/flopy/modflow/mflak.py b/flopy/modflow/mflak.py index d6ae3dcd15..d6b5002097 100644 --- a/flopy/modflow/mflak.py +++ b/flopy/modflow/mflak.py @@ -287,7 +287,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowLak.defaultunit() + unitnumber = ModflowLak._defaultunit() # set filenames tabdata = False @@ -310,7 +310,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowLak.ftype() + ipakcb, fname=fname, package=ModflowLak._ftype() ) else: ipakcb = 0 @@ -347,7 +347,7 @@ def __init__( model.add_external(fname, iu) # Fill namefile items - name = [ModflowLak.ftype()] + name = [ModflowLak._ftype()] units = [unitnumber] extra = [""] @@ -495,9 +495,16 @@ def __init__( return - def ncells(self): - # Return the maximum number of cells that have a stream - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that can have lakes (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of lak cells + + """ nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper return nlay * nrow * ncol @@ -892,7 +899,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): filenames = [None for x in range(n)] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowLak.ftype() + ext_unit_dict, filetype=ModflowLak._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -930,9 +937,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "LAK" @staticmethod - def defaultunit(): + def _defaultunit(): return 119 diff --git a/flopy/modflow/mflmt.py b/flopy/modflow/mflmt.py index e3673cbb8b..5ad5f066e5 100644 --- a/flopy/modflow/mflmt.py +++ b/flopy/modflow/mflmt.py @@ -89,7 +89,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowLmt.defaultunit() + unitnumber = ModflowLmt._defaultunit() # set filenames if filenames is None: @@ -98,7 +98,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowLmt.ftype()] + name = [ModflowLmt._ftype()] units = [unitnumber] extra = [""] @@ -254,7 +254,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowLmt.ftype() + ext_unit_dict, filetype=ModflowLmt._ftype() ) return cls( @@ -269,9 +269,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "LMT6" @staticmethod - def defaultunit(): + def _defaultunit(): return 30 diff --git a/flopy/modflow/mflpf.py b/flopy/modflow/mflpf.py index e2dfdb4314..19e77794d1 100644 --- a/flopy/modflow/mflpf.py +++ b/flopy/modflow/mflpf.py @@ -216,7 +216,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowLpf.defaultunit() + unitnumber = ModflowLpf._defaultunit() # set filenames if filenames is None: @@ -231,13 +231,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowLpf.ftype() + ipakcb, fname=fname, package=ModflowLpf._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowLpf.ftype()] + name = [ModflowLpf._ftype()] units = [unitnumber] extra = [""] @@ -714,7 +714,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowLpf.ftype() + ext_unit_dict, filetype=ModflowLpf._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -759,9 +759,9 @@ def load(cls, f, model, ext_unit_dict=None, check=True): return lpf @staticmethod - def ftype(): + def _ftype(): return "LPF" @staticmethod - def defaultunit(): + def _defaultunit(): return 15 diff --git a/flopy/modflow/mfmlt.py b/flopy/modflow/mfmlt.py index ac0bf6a2bd..6f61fa1149 100644 --- a/flopy/modflow/mfmlt.py +++ b/flopy/modflow/mfmlt.py @@ -72,7 +72,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowMlt.defaultunit() + unitnumber = ModflowMlt._defaultunit() # set filenames if filenames is None: @@ -81,7 +81,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowMlt.ftype()] + name = [ModflowMlt._ftype()] units = [unitnumber] extra = [""] @@ -229,7 +229,7 @@ def load(cls, f, model, nrow=None, ncol=None, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowMlt.ftype() + ext_unit_dict, filetype=ModflowMlt._ftype() ) return cls( @@ -278,9 +278,9 @@ def mult_function(mult_dict, line): return multarray @staticmethod - def ftype(): + def _ftype(): return "MULT" @staticmethod - def defaultunit(): + def _defaultunit(): return 1002 diff --git a/flopy/modflow/mfmnw1.py b/flopy/modflow/mfmnw1.py index 75b8ffabc7..01788a5a62 100644 --- a/flopy/modflow/mfmnw1.py +++ b/flopy/modflow/mfmnw1.py @@ -97,7 +97,7 @@ def __init__( ): # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowMnw1.defaultunit() + unitnumber = ModflowMnw1._defaultunit() # set filenames if filenames is None: @@ -112,7 +112,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowMnw1.ftype() + ipakcb, fname=fname, package=ModflowMnw1._ftype() ) else: ipakcb = 0 @@ -125,7 +125,7 @@ def __init__( self, model, extension, - ModflowMnw1.ftype(), + ModflowMnw1._ftype(), unitnumber, filenames=fname, ) @@ -365,11 +365,11 @@ def write_file(self): f.close() @staticmethod - def ftype(): + def _ftype(): return "MNW1" @staticmethod - def defaultunit(): + def _defaultunit(): return 33 diff --git a/flopy/modflow/mfmnw2.py b/flopy/modflow/mfmnw2.py index d7f1603747..a9023a201b 100644 --- a/flopy/modflow/mfmnw2.py +++ b/flopy/modflow/mfmnw2.py @@ -1018,7 +1018,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowMnw2.defaultunit() + unitnumber = ModflowMnw2._defaultunit() # set filenames if filenames is None: @@ -1033,13 +1033,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowMnw2.ftype() + ipakcb, fname=fname, package=ModflowMnw2._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowMnw2.ftype()] + name = [ModflowMnw2._ftype()] units = [unitnumber] extra = [""] @@ -1455,7 +1455,7 @@ def load(cls, f, model, nper=None, gwt=False, nsol=1, ext_unit_dict=None): filenames = [None, None] if ext_unit_dict is not None: for key, value in ext_unit_dict.items(): - if value.filetype == ModflowMnw2.ftype(): + if value.filetype == ModflowMnw2._ftype(): unitnumber = key filenames[0] = os.path.basename(value.filename) @@ -1877,11 +1877,11 @@ def write_file( f_mnw.close() @staticmethod - def ftype(): + def _ftype(): return "MNW2" @staticmethod - def defaultunit(): + def _defaultunit(): return 34 diff --git a/flopy/modflow/mfmnwi.py b/flopy/modflow/mfmnwi.py index 54e69090f5..820a506738 100644 --- a/flopy/modflow/mfmnwi.py +++ b/flopy/modflow/mfmnwi.py @@ -71,7 +71,7 @@ def __init__( ): # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowMnwi.defaultunit() + unitnumber = ModflowMnwi._defaultunit() # determine the number of unique unit numbers in dataset 3 unique_units = [] @@ -100,7 +100,7 @@ def __init__( fname=fname, extension="wel1", binflag=False, - package=ModflowMnwi.ftype(), + package=ModflowMnwi._ftype(), ) else: wel1flag = 0 @@ -113,7 +113,7 @@ def __init__( fname=fname, extension="qsum", binflag=False, - package=ModflowMnwi.ftype(), + package=ModflowMnwi._ftype(), ) else: qsumflag = 0 @@ -126,7 +126,7 @@ def __init__( fname=fname, extension="bynd", binflag=False, - package=ModflowMnwi.ftype(), + package=ModflowMnwi._ftype(), ) else: byndflag = 0 @@ -139,11 +139,11 @@ def __init__( fname=fname, extension="{:04d}.mnwobs".format(iu), binflag=False, - package=ModflowMnwi.ftype(), + package=ModflowMnwi._ftype(), ) idx += 1 - name = [ModflowMnwi.ftype()] + name = [ModflowMnwi._ftype()] units = [unitnumber] extra = [""] @@ -260,7 +260,7 @@ def load(cls, f, model, nper=None, gwt=False, nsol=1, ext_unit_dict=None): filenames = [None for x in range(nfn)] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowMnwi.ftype() + ext_unit_dict, filetype=ModflowMnwi._ftype() ) if wel1flag > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -389,9 +389,9 @@ def write_file(self): f.close() @staticmethod - def ftype(): + def _ftype(): return "MNWI" @staticmethod - def defaultunit(): + def _defaultunit(): return 58 diff --git a/flopy/modflow/mfnwt.py b/flopy/modflow/mfnwt.py index ee7a4e2ab2..1f22e8127f 100644 --- a/flopy/modflow/mfnwt.py +++ b/flopy/modflow/mfnwt.py @@ -245,7 +245,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowNwt.defaultunit() + unitnumber = ModflowNwt._defaultunit() # set filenames if filenames is None: @@ -254,7 +254,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowNwt.ftype()] + name = [ModflowNwt._ftype()] units = [unitnumber] extra = [""] @@ -550,7 +550,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowNwt.ftype() + ext_unit_dict, filetype=ModflowNwt._ftype() ) kwargs["unitnumber"] = unitnumber kwargs["filenames"] = filenames @@ -559,9 +559,9 @@ def load(cls, f, model, ext_unit_dict=None): return cls(model, **kwargs) @staticmethod - def ftype(): + def _ftype(): return "NWT" @staticmethod - def defaultunit(): + def _defaultunit(): return 32 diff --git a/flopy/modflow/mfoc.py b/flopy/modflow/mfoc.py index 3d2bf63f47..54a96afbd9 100644 --- a/flopy/modflow/mfoc.py +++ b/flopy/modflow/mfoc.py @@ -163,7 +163,7 @@ def __init__( """ if unitnumber is None: - unitnumber = ModflowOc.defaultunit() + unitnumber = ModflowOc._defaultunit() elif isinstance(unitnumber, list): if len(unitnumber) < 5: for idx in range(len(unitnumber), 6): @@ -296,7 +296,7 @@ def __init__( iu, fname=fname, extension=extension[4], binflag=binflag ) - name = [ModflowOc.ftype()] + name = [ModflowOc._ftype()] extra = [""] extension = [extension[0]] unitnumber = unitnumber[0] @@ -1066,7 +1066,7 @@ def load( unitnumber = [14, 0, 0, 0, 0] if ext_unit_dict is not None: for key, value in ext_unit_dict.items(): - if value.filetype == ModflowOc.ftype(): + if value.filetype == ModflowOc._ftype(): unitnumber[0] = key fname = os.path.basename(value.filename) else: @@ -1118,9 +1118,9 @@ def load( ) @staticmethod - def ftype(): + def _ftype(): return "OC" @staticmethod - def defaultunit(): + def _defaultunit(): return [14, 0, 0, 0, 0] diff --git a/flopy/modflow/mfpbc.py b/flopy/modflow/mfpbc.py index 461a080aea..a3fef51dc6 100644 --- a/flopy/modflow/mfpbc.py +++ b/flopy/modflow/mfpbc.py @@ -19,12 +19,12 @@ def __init__( ): # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowPbc.defaultunit() + unitnumber = ModflowPbc._defaultunit() # Call ancestor's init to set self.parent, extension, name and # unit number Package.__init__( - self, model, extension, ModflowPbc.ftype(), unitnumber + self, model, extension, ModflowPbc._ftype(), unitnumber ) self.heading = ( "# {} package for ".format(self.name[0]) @@ -74,9 +74,16 @@ def __init__( self.np = 0 self.parent.add_package(self) - def ncells(self): - # Returns the maximum number of cells that have recharge - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have pbc boundaries (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of pbc cells + + """ return self.mxactp def write_file(self): @@ -117,9 +124,9 @@ def write_file(self): f_pbc.close() @staticmethod - def ftype(): + def _ftype(): return "PBC" @staticmethod - def defaultunit(): + def _defaultunit(): return 30 diff --git a/flopy/modflow/mfpcg.py b/flopy/modflow/mfpcg.py index 9b19e90a08..7cee565bb3 100644 --- a/flopy/modflow/mfpcg.py +++ b/flopy/modflow/mfpcg.py @@ -118,7 +118,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowPcg.defaultunit() + unitnumber = ModflowPcg._defaultunit() # set filenames if filenames is None: @@ -127,7 +127,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowPcg.ftype()] + name = [ModflowPcg._ftype()] units = [unitnumber] extra = [""] @@ -339,7 +339,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowPcg.ftype() + ext_unit_dict, filetype=ModflowPcg._ftype() ) return cls( @@ -361,9 +361,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "PCG" @staticmethod - def defaultunit(): + def _defaultunit(): return 27 diff --git a/flopy/modflow/mfpcgn.py b/flopy/modflow/mfpcgn.py index 26259ec594..a1b23c7817 100644 --- a/flopy/modflow/mfpcgn.py +++ b/flopy/modflow/mfpcgn.py @@ -206,7 +206,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowPcgn.defaultunit() + unitnumber = ModflowPcgn._defaultunit() # set filenames if filenames is None: @@ -226,7 +226,7 @@ def __init__( fname=fname, extension="pcgni", binflag=False, - package=ModflowPcgn.ftype(), + package=ModflowPcgn._ftype(), ) else: unit_pc = 0 @@ -239,7 +239,7 @@ def __init__( fname=fname, extension="pcgnt", binflag=False, - package=ModflowPcgn.ftype(), + package=ModflowPcgn._ftype(), ) else: unit_ts = 0 @@ -253,12 +253,12 @@ def __init__( fname=fname, extension="pcgno", binflag=False, - package=ModflowPcgn.ftype(), + package=ModflowPcgn._ftype(), ) else: ipunit = -1 - name = [ModflowPcgn.ftype()] + name = [ModflowPcgn._ftype()] units = [unitnumber] extra = [""] @@ -543,7 +543,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None, None, None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowPcgn.ftype() + ext_unit_dict, filetype=ModflowPcgn._ftype() ) if unit_pc > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -583,9 +583,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "PCGN" @staticmethod - def defaultunit(): + def _defaultunit(): return 27 diff --git a/flopy/modflow/mfpks.py b/flopy/modflow/mfpks.py index c49d31e221..d0c4310ae2 100644 --- a/flopy/modflow/mfpks.py +++ b/flopy/modflow/mfpks.py @@ -110,7 +110,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowPks.defaultunit() + unitnumber = ModflowPks._defaultunit() # set filenames if filenames is None: @@ -119,7 +119,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowPks.ftype()] + name = [ModflowPks._ftype()] units = [unitnumber] extra = [""] @@ -284,15 +284,15 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowPks.ftype() + ext_unit_dict, filetype=ModflowPks._ftype() ) return cls(model, unitnumber=unitnumber, filenames=filenames) @staticmethod - def ftype(): + def _ftype(): return "PKS" @staticmethod - def defaultunit(): + def _defaultunit(): return 27 diff --git a/flopy/modflow/mfpval.py b/flopy/modflow/mfpval.py index 4493321007..6dfd13d62a 100644 --- a/flopy/modflow/mfpval.py +++ b/flopy/modflow/mfpval.py @@ -72,7 +72,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowPval.defaultunit() + unitnumber = ModflowPval._defaultunit() # set filenames if filenames is None: @@ -81,7 +81,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowPval.ftype()] + name = [ModflowPval._ftype()] units = [unitnumber] extra = [""] @@ -215,7 +215,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowPval.ftype() + ext_unit_dict, filetype=ModflowPval._ftype() ) return cls( @@ -226,9 +226,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "PVAL" @staticmethod - def defaultunit(): + def _defaultunit(): return 1005 diff --git a/flopy/modflow/mfrch.py b/flopy/modflow/mfrch.py index 49b7ce567e..8c1ed33849 100644 --- a/flopy/modflow/mfrch.py +++ b/flopy/modflow/mfrch.py @@ -106,7 +106,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowRch.defaultunit() + unitnumber = ModflowRch._defaultunit() # set filenames if filenames is None: @@ -121,13 +121,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowRch.ftype() + ipakcb, fname=fname, package=ModflowRch._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowRch.ftype()] + name = [ModflowRch._ftype()] units = [unitnumber] extra = [""] @@ -300,9 +300,16 @@ def check( chk.summarize() return chk - def ncells(self): - # Returns the maximum number of cells that have recharge - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have recharge (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of rch cells + + """ nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper return nrow * ncol @@ -518,7 +525,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowRch.ftype() + ext_unit_dict, filetype=ModflowRch._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -545,9 +552,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): return rch @staticmethod - def ftype(): + def _ftype(): return "RCH" @staticmethod - def defaultunit(): + def _defaultunit(): return 19 diff --git a/flopy/modflow/mfriv.py b/flopy/modflow/mfriv.py index e0ed25804d..61afd9d62a 100644 --- a/flopy/modflow/mfriv.py +++ b/flopy/modflow/mfriv.py @@ -131,7 +131,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowRiv.defaultunit() + unitnumber = ModflowRiv._defaultunit() # set filenames if filenames is None: @@ -146,13 +146,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowRiv.ftype() + ipakcb, fname=fname, package=ModflowRiv._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowRiv.ftype()] + name = [ModflowRiv._ftype()] units = [unitnumber] extra = [""] @@ -298,12 +298,19 @@ def get_default_dtype(structured=True): return dtype @staticmethod - def get_sfac_columns(): + def _get_sfac_columns(): return ["cond"] - def ncells(self): - # Return the maximum number of cells that have river - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have rivers (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of riv cells + + """ return self.stress_period_data.mxact def write_file(self, check=True): @@ -396,9 +403,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): ) @staticmethod - def ftype(): + def _ftype(): return "RIV" @staticmethod - def defaultunit(): + def _defaultunit(): return 18 diff --git a/flopy/modflow/mfsfr2.py b/flopy/modflow/mfsfr2.py index 23ededc759..ba46411693 100644 --- a/flopy/modflow/mfsfr2.py +++ b/flopy/modflow/mfsfr2.py @@ -367,7 +367,7 @@ def __init__( """ # set default unit number of one is not specified if unit_number is None: - unit_number = ModflowSfr2.defaultunit() + unit_number = ModflowSfr2._defaultunit() # set filenames if filenames is None: @@ -383,7 +383,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowSfr2.ftype() + ipakcb, fname=fname, package=ModflowSfr2._ftype() ) else: ipakcb = 0 @@ -403,13 +403,13 @@ def __init__( abs(istcb2), fname=fname, binflag=binflag, - package=ModflowSfr2.ftype(), + package=ModflowSfr2._ftype(), ) else: istcb2 = 0 # Fill namefile items - name = [ModflowSfr2.ftype()] + name = [ModflowSfr2._ftype()] units = [unit_number] extra = [""] @@ -1056,7 +1056,7 @@ def load(cls, f, model, nper=None, gwt=False, nsol=1, ext_unit_dict=None): filenames = [None, None, None] if ext_unit_dict is not None: for key, value in ext_unit_dict.items(): - if value.filetype == ModflowSfr2.ftype(): + if value.filetype == ModflowSfr2._ftype(): unitnumber = key filenames[0] = os.path.basename(value.filename) @@ -2243,11 +2243,11 @@ def export_transient_variable(self, f, varname, **kwargs): recarray2shp(ra, geoms, f, **kwargs) @staticmethod - def ftype(): + def _ftype(): return "SFR" @staticmethod - def defaultunit(): + def _defaultunit(): return 17 diff --git a/flopy/modflow/mfsip.py b/flopy/modflow/mfsip.py index 6db7ad019a..92e1111af3 100644 --- a/flopy/modflow/mfsip.py +++ b/flopy/modflow/mfsip.py @@ -102,7 +102,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowSip.defaultunit() + unitnumber = ModflowSip._defaultunit() # set filenames if filenames is None: @@ -111,7 +111,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowSip.ftype()] + name = [ModflowSip._ftype()] units = [unitnumber] extra = [""] @@ -268,7 +268,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowSip.ftype() + ext_unit_dict, filetype=ModflowSip._ftype() ) return cls( @@ -285,9 +285,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "SIP" @staticmethod - def defaultunit(): + def _defaultunit(): return 25 diff --git a/flopy/modflow/mfsms.py b/flopy/modflow/mfsms.py index 738ab63446..3a183ae868 100644 --- a/flopy/modflow/mfsms.py +++ b/flopy/modflow/mfsms.py @@ -275,7 +275,7 @@ def __init__( ): # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowSms.defaultunit() + unitnumber = ModflowSms._defaultunit() # set filenames if filenames is None: @@ -284,7 +284,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowSms.ftype()] + name = [ModflowSms._ftype()] units = [unitnumber] extra = [""] @@ -626,7 +626,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowSms.ftype() + ext_unit_dict, filetype=ModflowSms._ftype() ) return cls( @@ -666,9 +666,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "SMS" @staticmethod - def defaultunit(): + def _defaultunit(): return 32 diff --git a/flopy/modflow/mfsor.py b/flopy/modflow/mfsor.py index fd91673f29..bf54f2ad8d 100644 --- a/flopy/modflow/mfsor.py +++ b/flopy/modflow/mfsor.py @@ -86,7 +86,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowSor.defaultunit() + unitnumber = ModflowSor._defaultunit() # set filenames if filenames is None: @@ -95,7 +95,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowSor.ftype()] + name = [ModflowSor._ftype()] units = [unitnumber] extra = [""] @@ -209,16 +209,16 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowSor.ftype() + ext_unit_dict, filetype=ModflowSor._ftype() ) # return sor object return cls(model, unitnumber=unitnumber, filenames=filenames) @staticmethod - def ftype(): + def _ftype(): return "SOR" @staticmethod - def defaultunit(): + def _defaultunit(): return 26 diff --git a/flopy/modflow/mfstr.py b/flopy/modflow/mfstr.py index 65c69e85ed..7fbc1fe412 100644 --- a/flopy/modflow/mfstr.py +++ b/flopy/modflow/mfstr.py @@ -250,7 +250,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowStr.defaultunit() + unitnumber = ModflowStr._defaultunit() # set filenames if filenames is None: @@ -266,7 +266,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowStr.ftype() + ipakcb, fname=fname, package=ModflowStr._ftype() ) else: ipakcb = 0 @@ -274,7 +274,7 @@ def __init__( if istcb2 is not None: fname = filenames[2] model.add_output_file( - istcb2, fname=fname, package=ModflowStr.ftype() + istcb2, fname=fname, package=ModflowStr._ftype() ) else: ipakcb = 0 @@ -286,7 +286,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowStr.ftype()] + name = [ModflowStr._ftype()] units = [unitnumber] extra = [""] @@ -557,9 +557,16 @@ def get_default_dtype(structured=True): ) return dtype, dtype2 - def ncells(self): - # Return the maximum number of cells that have a stream - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have streams (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of str cells + + """ return self.mxacts def write_file(self): @@ -983,7 +990,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): filenames = [None, None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowStr.ftype() + ext_unit_dict, filetype=ModflowStr._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -1014,9 +1021,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "STR" @staticmethod - def defaultunit(): + def _defaultunit(): return 118 diff --git a/flopy/modflow/mfsub.py b/flopy/modflow/mfsub.py index 10e9a13130..a0fe752834 100644 --- a/flopy/modflow/mfsub.py +++ b/flopy/modflow/mfsub.py @@ -255,7 +255,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowSub.defaultunit() + unitnumber = ModflowSub._defaultunit() # set filenames if filenames is None: @@ -271,7 +271,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowSub.ftype() + ipakcb, fname=fname, package=ModflowSub._ftype() ) else: ipakcb = 0 @@ -282,7 +282,7 @@ def __init__( idsave, fname=fname, extension="rst", - package=ModflowSub.ftype(), + package=ModflowSub._ftype(), ) else: idsave = 0 @@ -310,12 +310,12 @@ def __init__( iu = ids15[k] fname = filenames[idx + 3] model.add_output_file( - iu, fname=fname, extension=ext, package=ModflowSub.ftype() + iu, fname=fname, extension=ext, package=ModflowSub._ftype() ) idx += 1 extensions = [extension] - name = [ModflowSub.ftype()] + name = [ModflowSub._ftype()] units = [unitnumber] extra = [""] @@ -905,7 +905,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None for x in range(9)] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowSub.ftype() + ext_unit_dict, filetype=ModflowSub._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -963,9 +963,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "SUB" @staticmethod - def defaultunit(): + def _defaultunit(): return 32 diff --git a/flopy/modflow/mfswi2.py b/flopy/modflow/mfswi2.py index 80b6a2937a..c3ecb671e2 100644 --- a/flopy/modflow/mfswi2.py +++ b/flopy/modflow/mfswi2.py @@ -229,7 +229,7 @@ def __init__( """Package constructor.""" # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowSwi2.defaultunit() + unitnumber = ModflowSwi2._defaultunit() # set filenames if filenames is None: @@ -248,7 +248,7 @@ def __init__( iswizt, fname=fname, extension="zta", - package=ModflowSwi2.ftype(), + package=ModflowSwi2._ftype(), ) else: iswizt = 0 @@ -258,7 +258,7 @@ def __init__( if ipakcb is not None: fname = filenames[2] model.add_output_file( - ipakcb, fname=fname, package=ModflowSwi2.ftype() + ipakcb, fname=fname, package=ModflowSwi2._ftype() ) else: ipakcb = 0 @@ -313,13 +313,13 @@ def __init__( fname=fname, binflag=binflag, extension=ext, - package=ModflowSwi2.ftype(), + package=ModflowSwi2._ftype(), ) else: iswiobs = 0 # Fill namefile items - name = [ModflowSwi2.ftype()] + name = [ModflowSwi2._ftype()] units = [unitnumber] extra = [""] @@ -767,7 +767,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None, None, None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowSwi2.ftype() + ext_unit_dict, filetype=ModflowSwi2._ftype() ) if iswizt > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -813,9 +813,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "SWI2" @staticmethod - def defaultunit(): + def _defaultunit(): return 29 diff --git a/flopy/modflow/mfswr1.py b/flopy/modflow/mfswr1.py index a11cf5a7ad..8d2cafeea5 100644 --- a/flopy/modflow/mfswr1.py +++ b/flopy/modflow/mfswr1.py @@ -64,7 +64,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowSwr1.defaultunit() + unitnumber = ModflowSwr1._defaultunit() # set filenames if filenames is None: @@ -73,7 +73,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowSwr1.ftype()] + name = [ModflowSwr1._ftype()] units = [unitnumber] extra = [""] @@ -181,16 +181,16 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowSwr1.ftype() + ext_unit_dict, filetype=ModflowSwr1._ftype() ) # return swr object return cls(model, unitnumber=unitnumber, filenames=filenames) @staticmethod - def ftype(): + def _ftype(): return "SWR" @staticmethod - def defaultunit(): + def _defaultunit(): return 36 diff --git a/flopy/modflow/mfswt.py b/flopy/modflow/mfswt.py index 5984469863..642c707cdc 100644 --- a/flopy/modflow/mfswt.py +++ b/flopy/modflow/mfswt.py @@ -369,7 +369,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowSwt.defaultunit() + unitnumber = ModflowSwt._defaultunit() # set filenames if filenames is None: @@ -385,7 +385,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowSwt.ftype() + ipakcb, fname=fname, package=ModflowSwt._ftype() ) else: ipakcb = 0 @@ -417,12 +417,12 @@ def __init__( iu = ids16[k] fname = filenames[idx + 2] model.add_output_file( - iu, fname=fname, extension=ext, package=ModflowSwt.ftype() + iu, fname=fname, extension=ext, package=ModflowSwt._ftype() ) idx += 1 extensions = [extension] - name = [ModflowSwt.ftype()] + name = [ModflowSwt._ftype()] units = [unitnumber] extra = [""] @@ -913,7 +913,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None for x in range(15)] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowSwt.ftype() + ext_unit_dict, filetype=ModflowSwt._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -971,9 +971,9 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "SWT" @staticmethod - def defaultunit(): + def _defaultunit(): return 35 diff --git a/flopy/modflow/mfupw.py b/flopy/modflow/mfupw.py index 0e8a071eae..37b9d1a7c1 100644 --- a/flopy/modflow/mfupw.py +++ b/flopy/modflow/mfupw.py @@ -164,13 +164,13 @@ def __init__( if model.version != "mfnwt": err = ( "Error: model version must be mfnwt to use " - + "{} package".format(ModflowUpw.ftype()) + + "{} package".format(ModflowUpw._ftype()) ) raise Exception(err) # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowUpw.defaultunit() + unitnumber = ModflowUpw._defaultunit() # set filenames if filenames is None: @@ -185,13 +185,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowUpw.ftype() + ipakcb, fname=fname, package=ModflowUpw._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowUpw.ftype()] + name = [ModflowUpw._ftype()] units = [unitnumber] extra = [""] @@ -600,7 +600,7 @@ def load(cls, f, model, ext_unit_dict=None, check=True): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowUpw.ftype() + ext_unit_dict, filetype=ModflowUpw._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -640,9 +640,9 @@ def load(cls, f, model, ext_unit_dict=None, check=True): return upw @staticmethod - def ftype(): + def _ftype(): return "UPW" @staticmethod - def defaultunit(): + def _defaultunit(): return 31 diff --git a/flopy/modflow/mfuzf1.py b/flopy/modflow/mfuzf1.py index 49cf53d811..0652018ad8 100644 --- a/flopy/modflow/mfuzf1.py +++ b/flopy/modflow/mfuzf1.py @@ -401,7 +401,7 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowUzf1.defaultunit() + unitnumber = ModflowUzf1._defaultunit() # set filenames nlen = 3 @@ -420,7 +420,7 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - abs(ipakcb), fname=fname, package=ModflowUzf1.ftype() + abs(ipakcb), fname=fname, package=ModflowUzf1._ftype() ) else: ipakcb = 0 @@ -431,7 +431,7 @@ def __init__( abs(iuzfcb2), fname=fname, extension="uzfcb2.bin", - package=ModflowUzf1.ftype(), + package=ModflowUzf1._ftype(), ) else: iuzfcb2 = 0 @@ -456,7 +456,7 @@ def __init__( fname=fname, binflag=False, extension=uzgagext, - package=ModflowUzf1.ftype(), + package=ModflowUzf1._ftype(), ) ipos += 1 # handle case where iftunit is listed in the values @@ -467,7 +467,7 @@ def __init__( uzgag[-np.abs(key)] = [] # Fill namefile items - name = [ModflowUzf1.ftype()] + name = [ModflowUzf1._ftype()] units = [unitnumber] extra = [""] @@ -676,6 +676,14 @@ def __setattr__(self, key, value): @property def nuzgag(self): + """Number of uzf gages + + Returns + ------- + nuzgag : int + Number of uzf gages + + """ if self.uzgag is None: return 0 else: @@ -683,6 +691,14 @@ def nuzgag(self): @property def uzgag(self): + """Get the uzf gage data + + Returns + ------- + uzgag : dict + Dictionary containing uzf gage data for each gage + + """ return self._uzgag def _2list(self, arg): @@ -698,9 +714,16 @@ def _2list(self, arg): lst = arg return lst - def ncells(self): - # Returns the maximum number of cells that have recharge - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have uzf (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of uzf cells + + """ nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper return nrow * ncol @@ -1108,7 +1131,7 @@ def load_util2d(name, dtype, per=None): filenames = [None for x in range(3 + nuzgag)] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowUzf1.ftype() + ext_unit_dict, filetype=ModflowUzf1._ftype() ) if abs(ipakcb) > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -1159,11 +1182,11 @@ def load_util2d(name, dtype, per=None): ) @staticmethod - def ftype(): + def _ftype(): return "UZF" @staticmethod - def defaultunit(): + def _defaultunit(): return 19 diff --git a/flopy/modflow/mfwel.py b/flopy/modflow/mfwel.py index d40905d15c..30de6f114f 100644 --- a/flopy/modflow/mfwel.py +++ b/flopy/modflow/mfwel.py @@ -158,7 +158,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowWel.defaultunit() + unitnumber = ModflowWel._defaultunit() # set filenames if filenames is None: @@ -173,13 +173,13 @@ def __init__( if ipakcb is not None: fname = filenames[1] model.add_output_file( - ipakcb, fname=fname, package=ModflowWel.ftype() + ipakcb, fname=fname, package=ModflowWel._ftype() ) else: ipakcb = 0 # Fill namefile items - name = [ModflowWel.ftype()] + name = [ModflowWel._ftype()] units = [unitnumber] extra = [""] @@ -269,17 +269,38 @@ def __init__( @property def phiramp_unit(self): + """Get phiramp unit + + Returns + ------- + iunitramp: int + unit number of phiramp file + + """ err = "phiramp_unit will be replaced " "with iunitramp for consistency" warnings.warn(err, DeprecationWarning) return self.iunitramp @phiramp_unit.setter def phiramp_unit(self, phiramp_unit): + """Set phiramp unit + + Returns + ------- + + """ self.iunitramp = phiramp_unit - def ncells(self): - # Returns the maximum number of cells that have a well - # (developed for MT3DMS SSM package) + def _ncells(self): + """Maximum number of cells that have wells (developed for + MT3DMS SSM package). + + Returns + ------- + ncells: int + maximum number of wel cells + + """ return self.stress_period_data.mxact def write_file(self, f=None): @@ -382,7 +403,7 @@ def get_empty(ncells=0, aux_names=None, structured=True): return create_empty_recarray(ncells, dtype, default_value=-1.0e10) @staticmethod - def get_sfac_columns(): + def _get_sfac_columns(): return ["flux"] @classmethod @@ -434,9 +455,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None, check=True): ) @staticmethod - def ftype(): + def _ftype(): return "WEL" @staticmethod - def defaultunit(): + def _defaultunit(): return 20 diff --git a/flopy/modflow/mfzon.py b/flopy/modflow/mfzon.py index 634e8ee94d..d6cc335e4f 100644 --- a/flopy/modflow/mfzon.py +++ b/flopy/modflow/mfzon.py @@ -75,7 +75,7 @@ def __init__( """ # set default unit number of one is not specified if unitnumber is None: - unitnumber = ModflowZon.defaultunit() + unitnumber = ModflowZon._defaultunit() # set filenames if filenames is None: @@ -84,7 +84,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [ModflowZon.ftype()] + name = [ModflowZon._ftype()] units = [unitnumber] extra = [""] @@ -221,7 +221,7 @@ def load(cls, f, model, nrow=None, ncol=None, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=ModflowZon.ftype() + ext_unit_dict, filetype=ModflowZon._ftype() ) return cls( @@ -232,9 +232,9 @@ def load(cls, f, model, nrow=None, ncol=None, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "ZONE" @staticmethod - def defaultunit(): + def _defaultunit(): return 1001 diff --git a/flopy/modflowlgr/mflgr.py b/flopy/modflowlgr/mflgr.py index c48bae16b8..ecb33fbc6e 100644 --- a/flopy/modflowlgr/mflgr.py +++ b/flopy/modflowlgr/mflgr.py @@ -196,6 +196,14 @@ def __repr__(self): @property def ngrids(self): + """Get the number of grids in the LGR model + + Returns + ------- + ngrid : int + number of grids (parent and children) + + """ try: return 1 + self.children except: diff --git a/flopy/mt3d/mtadv.py b/flopy/mt3d/mtadv.py index b97d0ac321..43f4d91588 100644 --- a/flopy/mt3d/mtadv.py +++ b/flopy/mt3d/mtadv.py @@ -188,9 +188,9 @@ def __init__( ): if unitnumber is None: - unitnumber = Mt3dAdv.defaultunit() + unitnumber = Mt3dAdv._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dAdv.reservedunit() + unitnumber = Mt3dAdv._reservedunit() # set filenames if filenames is None: @@ -199,7 +199,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dAdv.ftype()] + name = [Mt3dAdv._ftype()] units = [unitnumber] extra = [""] @@ -413,7 +413,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dAdv.ftype() + ext_unit_dict, filetype=Mt3dAdv._ftype() ) # Construct and return adv package @@ -439,13 +439,13 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "ADV" @staticmethod - def defaultunit(): + def _defaultunit(): return 32 @staticmethod - def reservedunit(): + def _reservedunit(): return 2 diff --git a/flopy/mt3d/mtbtn.py b/flopy/mt3d/mtbtn.py index e7c775fbb5..8b3c574b22 100644 --- a/flopy/mt3d/mtbtn.py +++ b/flopy/mt3d/mtbtn.py @@ -232,9 +232,9 @@ def __init__( ): if unitnumber is None: - unitnumber = Mt3dBtn.defaultunit() + unitnumber = Mt3dBtn._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dBtn.reservedunit() + unitnumber = Mt3dBtn._reservedunit() # set filenames if filenames is None: @@ -243,7 +243,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dBtn.ftype()] + name = [Mt3dBtn._ftype()] units = [unitnumber] extra = [""] @@ -1239,7 +1239,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dBtn.ftype() + ext_unit_dict, filetype=Mt3dBtn._ftype() ) return cls( @@ -1295,13 +1295,13 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "BTN" @staticmethod - def defaultunit(): + def _defaultunit(): return 31 @staticmethod - def reservedunit(): + def _reservedunit(): return 1 diff --git a/flopy/mt3d/mtcts.py b/flopy/mt3d/mtcts.py index 82a84bb147..ee599a8556 100644 --- a/flopy/mt3d/mtcts.py +++ b/flopy/mt3d/mtcts.py @@ -321,13 +321,13 @@ def get_default_CTS_dtype(ncomp=1, iforce=0): # dtype = dtype @staticmethod - def ftype(): + def _ftype(): return "CTS" @staticmethod - def defaultunit(): + def _defaultunit(): return 5 @staticmethod - def reservedunit(): + def _reservedunit(): return 5 diff --git a/flopy/mt3d/mtdsp.py b/flopy/mt3d/mtdsp.py index a9437268f5..22e56e09cd 100644 --- a/flopy/mt3d/mtdsp.py +++ b/flopy/mt3d/mtdsp.py @@ -117,9 +117,9 @@ def __init__( ): if unitnumber is None: - unitnumber = Mt3dDsp.defaultunit() + unitnumber = Mt3dDsp._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dDsp.reservedunit() + unitnumber = Mt3dDsp._reservedunit() # set filenames if filenames is None: @@ -128,7 +128,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dDsp.ftype()] + name = [Mt3dDsp._ftype()] units = [unitnumber] extra = [""] @@ -294,7 +294,7 @@ def load( Returns ------- - adv : Mt3dDsp object + dsk : Mt3dDsp object Mt3dDsp object. Examples @@ -440,7 +440,7 @@ def load( filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dDsp.ftype() + ext_unit_dict, filetype=Mt3dDsp._ftype() ) return cls( @@ -456,13 +456,13 @@ def load( ) @staticmethod - def ftype(): + def _ftype(): return "DSP" @staticmethod - def defaultunit(): + def _defaultunit(): return 33 @staticmethod - def reservedunit(): + def _reservedunit(): return 3 diff --git a/flopy/mt3d/mtgcg.py b/flopy/mt3d/mtgcg.py index 5b75c6b621..a6d883e547 100644 --- a/flopy/mt3d/mtgcg.py +++ b/flopy/mt3d/mtgcg.py @@ -94,9 +94,9 @@ def __init__( ): if unitnumber is None: - unitnumber = Mt3dGcg.defaultunit() + unitnumber = Mt3dGcg._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dGcg.reservedunit() + unitnumber = Mt3dGcg._reservedunit() # set filenames if filenames is None: @@ -105,7 +105,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dGcg.ftype()] + name = [Mt3dGcg._ftype()] units = [unitnumber] extra = [""] @@ -236,7 +236,7 @@ def load(cls, f, model, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dGcg.ftype() + ext_unit_dict, filetype=Mt3dGcg._ftype() ) # Construct and return gcg package @@ -254,13 +254,13 @@ def load(cls, f, model, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "GCG" @staticmethod - def defaultunit(): + def _defaultunit(): return 35 @staticmethod - def reservedunit(): + def _reservedunit(): return 9 diff --git a/flopy/mt3d/mtlkt.py b/flopy/mt3d/mtlkt.py index 455d063275..ffccb293a1 100644 --- a/flopy/mt3d/mtlkt.py +++ b/flopy/mt3d/mtlkt.py @@ -122,9 +122,9 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = Mt3dLkt.reservedunit() + unitnumber = Mt3dLkt._reservedunit() elif unitnumber == 0: - unitnumber = Mt3dLkt.reservedunit() + unitnumber = Mt3dLkt._reservedunit() # set filenames if filenames is None: @@ -154,13 +154,13 @@ def __init__( fname=fname, extension=None, binflag=False, - package=Mt3dLkt.ftype(), + package=Mt3dLkt._ftype(), ) else: icbclk = 0 # Fill namefile items - name = [Mt3dLkt.ftype()] + name = [Mt3dLkt._ftype()] units = [unitnumber] extra = [""] @@ -503,7 +503,7 @@ def load( filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dLkt.ftype() + ext_unit_dict, filetype=Mt3dLkt._ftype() ) if icbclk > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -544,13 +544,13 @@ def get_default_dtype(ncomp=1): return dtype @staticmethod - def ftype(): + def _ftype(): return "LKT" @staticmethod - def defaultunit(): + def _defaultunit(): return 45 @staticmethod - def reservedunit(): + def _reservedunit(): return 18 diff --git a/flopy/mt3d/mtphc.py b/flopy/mt3d/mtphc.py index d6d13c60ba..28629992c8 100644 --- a/flopy/mt3d/mtphc.py +++ b/flopy/mt3d/mtphc.py @@ -32,9 +32,9 @@ def __init__( ): if unitnumber is None: - unitnumber = Mt3dPhc.defaultunit() + unitnumber = Mt3dPhc._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dPhc.reservedunit() + unitnumber = Mt3dPhc._reservedunit() # set filenames if filenames is None: @@ -43,7 +43,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dPhc.ftype()] + name = [Mt3dPhc._ftype()] units = [unitnumber] extra = [""] @@ -134,13 +134,13 @@ def write_file(self): return @staticmethod - def ftype(): + def _ftype(): return "PHC" @staticmethod - def defaultunit(): + def _defaultunit(): return 38 @staticmethod - def reservedunit(): + def _reservedunit(): return 38 diff --git a/flopy/mt3d/mtrct.py b/flopy/mt3d/mtrct.py index d8a043e07d..e9f5580d8e 100644 --- a/flopy/mt3d/mtrct.py +++ b/flopy/mt3d/mtrct.py @@ -181,9 +181,9 @@ def __init__( """ if unitnumber is None: - unitnumber = Mt3dRct.defaultunit() + unitnumber = Mt3dRct._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dRct.reservedunit() + unitnumber = Mt3dRct._reservedunit() # set filenames if filenames is None: @@ -192,7 +192,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dRct.ftype()] + name = [Mt3dRct._ftype()] units = [unitnumber] extra = [""] @@ -795,7 +795,7 @@ def load( filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dRct.ftype() + ext_unit_dict, filetype=Mt3dRct._ftype() ) # Construct and return rct package @@ -817,13 +817,13 @@ def load( ) @staticmethod - def ftype(): + def _ftype(): return "RCT" @staticmethod - def defaultunit(): + def _defaultunit(): return 36 @staticmethod - def reservedunit(): + def _reservedunit(): return 8 diff --git a/flopy/mt3d/mtsft.py b/flopy/mt3d/mtsft.py index 7074a72199..9721f8ae6e 100644 --- a/flopy/mt3d/mtsft.py +++ b/flopy/mt3d/mtsft.py @@ -210,9 +210,9 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = Mt3dSft.defaultunit() + unitnumber = Mt3dSft._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dSft.reservedunit() + unitnumber = Mt3dSft._reservedunit() # set filenames if filenames is None: # if filename not passed @@ -242,13 +242,13 @@ def __init__( fname=fname, extension=None, binflag=False, - package=Mt3dSft.ftype(), + package=Mt3dSft._ftype(), ) else: ioutobs = 0 # Fill namefile items - name = [Mt3dSft.ftype()] + name = [Mt3dSft._ftype()] units = [unitnumber] extra = [""] @@ -793,7 +793,7 @@ def load( filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dSft.ftype() + ext_unit_dict, filetype=Mt3dSft._ftype() ) if abs(ioutobs) > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -826,13 +826,13 @@ def load( ) @staticmethod - def ftype(): + def _ftype(): return "SFT" @staticmethod - def defaultunit(): + def _defaultunit(): return 19 @staticmethod - def reservedunit(): + def _reservedunit(): return 19 diff --git a/flopy/mt3d/mtssm.py b/flopy/mt3d/mtssm.py index bc40a32bae..1aed602485 100644 --- a/flopy/mt3d/mtssm.py +++ b/flopy/mt3d/mtssm.py @@ -169,9 +169,9 @@ def __init__( ): if unitnumber is None: - unitnumber = Mt3dSsm.defaultunit() + unitnumber = Mt3dSsm._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dSsm.reservedunit() + unitnumber = Mt3dSsm._reservedunit() # set filenames if filenames is None: @@ -180,7 +180,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dSsm.ftype()] + name = [Mt3dSsm._ftype()] units = [unitnumber] extra = [""] @@ -273,7 +273,7 @@ def __init__( if (p.label == "BAS6") and (p.instance != None): self.mxss += (p.instance.ibound.array < 0).sum() elif p.instance != None: - self.mxss += p.instance.ncells() + self.mxss += p.instance._ncells() else: self.mxss = mxss @@ -813,7 +813,7 @@ def load( filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dSsm.ftype() + ext_unit_dict, filetype=Mt3dSsm._ftype() ) # Construct and return ssm package @@ -829,13 +829,13 @@ def load( ) @staticmethod - def ftype(): + def _ftype(): return "SSM" @staticmethod - def defaultunit(): + def _defaultunit(): return 34 @staticmethod - def reservedunit(): + def _reservedunit(): return 4 diff --git a/flopy/mt3d/mttob.py b/flopy/mt3d/mttob.py index 3a66c9b6d0..893cf8cbfd 100644 --- a/flopy/mt3d/mttob.py +++ b/flopy/mt3d/mttob.py @@ -20,9 +20,9 @@ def __init__( ): if unitnumber is None: - unitnumber = Mt3dTob.defaultunit() + unitnumber = Mt3dTob._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dTob.reservedunit() + unitnumber = Mt3dTob._reservedunit() # set filenames if filenames is None: @@ -31,7 +31,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [Mt3dTob.ftype()] + name = [Mt3dTob._ftype()] units = [unitnumber] extra = [""] @@ -120,13 +120,13 @@ def write_file(self): return @staticmethod - def ftype(): + def _ftype(): return "TOB" @staticmethod - def defaultunit(): + def _defaultunit(): return 37 @staticmethod - def reservedunit(): + def _reservedunit(): return 12 diff --git a/flopy/mt3d/mtuzt.py b/flopy/mt3d/mtuzt.py index 79f674176d..3f4115df1e 100644 --- a/flopy/mt3d/mtuzt.py +++ b/flopy/mt3d/mtuzt.py @@ -149,9 +149,9 @@ def __init__( # set default unit number of one is not specified if unitnumber is None: - unitnumber = Mt3dUzt.defaultunit() + unitnumber = Mt3dUzt._defaultunit() elif unitnumber == 0: - unitnumber = Mt3dUzt.reservedunit() + unitnumber = Mt3dUzt._reservedunit() # set filenames if filenames is None: @@ -171,13 +171,13 @@ def __init__( fname=fname, extension=extension, binflag=False, - package=Mt3dUzt.ftype(), + package=Mt3dUzt._ftype(), ) else: icbcuz = 0 # Fill namefile items - name = [Mt3dUzt.ftype()] + name = [Mt3dUzt._ftype()] units = [unitnumber] extra = [""] @@ -770,7 +770,7 @@ def load( filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=Mt3dUzt.ftype() + ext_unit_dict, filetype=Mt3dUzt._ftype() ) if icbcuz > 0: iu, filenames[1] = model.get_ext_dict_attr( @@ -793,13 +793,13 @@ def load( ) @staticmethod - def ftype(): + def _ftype(): return "UZT2" @staticmethod - def defaultunit(): + def _defaultunit(): return 7 @staticmethod - def reservedunit(): + def _reservedunit(): return 7 diff --git a/flopy/pakbase.py b/flopy/pakbase.py index 519f3935be..a95076dee0 100644 --- a/flopy/pakbase.py +++ b/flopy/pakbase.py @@ -675,7 +675,7 @@ def add_to_dtype(dtype, field_names, field_types): return np.dtype(newdtypes) @staticmethod - def get_sfac_columns(): + def _get_sfac_columns(): """ This should be overriden for individual packages that support an sfac multiplier for individual list columns @@ -997,7 +997,7 @@ def load(f, model, pak_type, ext_unit_dict=None, **kwargs): partype = ["shead", "ehead"] # get the list columns that should be scaled with sfac - sfac_columns = pak_type.get_sfac_columns() + sfac_columns = pak_type._get_sfac_columns() # read parameter data if nppak > 0: @@ -1138,7 +1138,7 @@ def load(f, model, pak_type, ext_unit_dict=None, **kwargs): filenames = [None, None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=pak_type.ftype() + ext_unit_dict, filetype=pak_type._ftype() ) if ipakcb > 0: iu, filenames[1] = model.get_ext_dict_attr( diff --git a/flopy/seawat/swtvdf.py b/flopy/seawat/swtvdf.py index c7021b427a..a2ab3d630a 100644 --- a/flopy/seawat/swtvdf.py +++ b/flopy/seawat/swtvdf.py @@ -209,7 +209,7 @@ def __init__( ): if unitnumber is None: - unitnumber = SeawatVdf.defaultunit() + unitnumber = SeawatVdf._defaultunit() # set filenames if filenames is None: @@ -218,7 +218,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [SeawatVdf.ftype()] + name = [SeawatVdf._ftype()] units = [unitnumber] extra = [""] @@ -536,7 +536,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=SeawatVdf.ftype() + ext_unit_dict, filetype=SeawatVdf._ftype() ) # Construct and return vdf package @@ -564,9 +564,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "VDF" @staticmethod - def defaultunit(): + def _defaultunit(): return 37 diff --git a/flopy/seawat/swtvsc.py b/flopy/seawat/swtvsc.py index c4ece4595b..ad488112b2 100644 --- a/flopy/seawat/swtvsc.py +++ b/flopy/seawat/swtvsc.py @@ -155,7 +155,7 @@ def __init__( ) if unitnumber is None: - unitnumber = SeawatVsc.defaultunit() + unitnumber = SeawatVsc._defaultunit() # set filenames if filenames is None: @@ -164,7 +164,7 @@ def __init__( filenames = [filenames] # Fill namefile items - name = [SeawatVsc.ftype()] + name = [SeawatVsc._ftype()] units = [unitnumber] extra = [""] @@ -504,7 +504,7 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): filenames = [None] if ext_unit_dict is not None: unitnumber, filenames[0] = model.get_ext_dict_attr( - ext_unit_dict, filetype=SeawatVsc.ftype() + ext_unit_dict, filetype=SeawatVsc._ftype() ) # Construct and return vsc package @@ -528,9 +528,9 @@ def load(cls, f, model, nper=None, ext_unit_dict=None): ) @staticmethod - def ftype(): + def _ftype(): return "VSC" @staticmethod - def defaultunit(): + def _defaultunit(): return 38 diff --git a/flopy/utils/mfreadnam.py b/flopy/utils/mfreadnam.py index 029527ae05..a3a8bb3dd4 100644 --- a/flopy/utils/mfreadnam.py +++ b/flopy/utils/mfreadnam.py @@ -208,7 +208,7 @@ def parsenamefile(namfilename, packages, verbose=True): if key == 0: ftype_lower = ftype.lower() if ftype_lower in packages: - key = packages[ftype_lower].reservedunit() + key = packages[ftype_lower]._reservedunit() else: key = ftype ext_unit_dict[key] = NamData(ftype, fname, filehandle, packages) diff --git a/flopy/utils/zonbud.py b/flopy/utils/zonbud.py index 133f3aa329..3f406bb0ed 100644 --- a/flopy/utils/zonbud.py +++ b/flopy/utils/zonbud.py @@ -252,7 +252,7 @@ def __init__( return def get_model_shape(self): - """ + """Get model shape Returns ------- @@ -583,23 +583,6 @@ def _compute_budget(self, kstpkper=None, totim=None): return - # def _get_internal_flow_record_names(self): - # """ - # Get internal flow record names - # - # Returns - # ------- - # iflow_recnames : np.recarray - # recarray of internal flow terms - # - # """ - # iflow_recnames = OrderedDict() - # for z, a in iter(self._zonenamedict.items()): - # iflow_recnames[z] = '{}'.format(a) - # dtype = np.dtype([('zone', '