flopy.mf6.mfbase module
Base classes for Modflow 6
- class ExtFileAction(value)[source]
Bases:
Enum
Defines what to do with external files when the simulation or model’s path change.
- copy_all = 1
- copy_none = 2
- copy_relative_paths = 3
- exception MFDataException(model=None, package=None, path=None, current_process=None, data_element=None, method_caught_in=None, org_type=None, org_value=None, org_traceback=None, message=None, debug=None, mfdata_except=None)[source]
Bases:
Exception
Exception with MODFLOW data. Exception includes detailed error information.
- class MFFileMgmt(path: str | PathLike, mfsim=None)[source]
Bases:
object
Class containing MODFLOW path data
- Parameters:
path (str or PathLike) – Path on disk to the simulation
- add_ext_file(file_path, model_name)[source]
Add an external file to the path list. For internal FloPy use, not intended for end user.
- copy_files(copy_relative_only=True)[source]
Copy files external to updated path.
- Parameters:
copy_relative_only (bool) – Only copy files with relative paths.
- get_model_path(key, last_loaded_path=False)[source]
Returns the model working path for the model key.
- get_updated_path(external_file_path, model_name, ext_file_action)[source]
For internal FloPy use, not intended for end user.
- resolve_path(path, model_name, last_loaded_path=False, move_abs_paths=False)[source]
Resolve a simulation or model path. For internal FloPy use, not intended for end user.
- set_last_accessed_model_path()[source]
Set the last accessed model path to the current model path. For internal FloPy use, not intended for end user.
- set_last_accessed_path()[source]
Set the last accessed simulation path to the current simulation path. For internal FloPy use, not intended for end user.
- set_sim_path(path: str | PathLike, internal_use=False)[source]
Set the file path to the simulation files. Internal use only, call MFSimulation’s set_sim_path method instead.
- Parameters:
path (str or PathLike) – Path to simulation folder
- Return type:
None
Examples
self.simulation_data.mfdata.set_sim_path(‘path/to/workspace’)
- class MFFilePath(file_path, model_name)[source]
Bases:
object
Class that stores a single file path along with the associated model name.
- exception MFInvalidTransientBlockHeaderException[source]
Bases:
Exception
Exception occurs when parsing a transient block header
- class PackageContainer(simulation_data, name)[source]
Bases:
object
Base class for any class containing packages.
- Parameters:
simulation_data (SimulationData) – The simulation’s SimulationData object
name (str) – Name of the package container object
- package_type_dict
Dictionary of packages by package type
- Type:
dictionary
- package_name_dict
Dictionary of packages by package name
- Type:
dictionary
- static get_module_val(module, item, attrb)[source]
Static method that returns a python class module value. For internal FloPy use only, not intended for end users.
- get_package(name=None)[source]
Finds a package by package name, package key, package type, or partial package name. returns either a single package, a list of packages, or None.
- Parameters:
name (str) – Name of the package, ‘RIV’, ‘LPF’, etc.
- Returns:
pp
- Return type:
Package object
- static model_factory(model_type)[source]
Static method that returns the appropriate model type object based on the model_type string. For internal FloPy use only, not intended for end users.
- Parameters:
model_type (str) – Type of model that package is a part of
- Returns:
model
- Return type:
MFModel subclass
- models_by_type = {'gwf': <class 'flopy.mf6.modflow.mfgwf.ModflowGwf'>, 'gwt': <class 'flopy.mf6.modflow.mfgwt.ModflowGwt'>}
- modflow_models = [<class 'flopy.mf6.modflow.mfgwf.ModflowGwf'>, <class 'flopy.mf6.modflow.mfgwt.ModflowGwt'>]
- modflow_packages = [<class 'flopy.mf6.modflow.mfnam.ModflowNam'>, <class 'flopy.mf6.modflow.mftdis.ModflowTdis'>, <class 'flopy.mf6.modflow.mfgnc.ModflowGnc'>, <class 'flopy.mf6.modflow.mfgnc.GncPackages'>, <class 'flopy.mf6.modflow.mfgwfapi.ModflowGwfapi'>, <class 'flopy.mf6.modflow.mfgwfbuy.ModflowGwfbuy'>, <class 'flopy.mf6.modflow.mfgwfchd.ModflowGwfchd'>, <class 'flopy.mf6.modflow.mfgwfcsub.ModflowGwfcsub'>, <class 'flopy.mf6.modflow.mfgwfdis.ModflowGwfdis'>, <class 'flopy.mf6.modflow.mfgwfdisu.ModflowGwfdisu'>, <class 'flopy.mf6.modflow.mfgwfdisv.ModflowGwfdisv'>, <class 'flopy.mf6.modflow.mfgwfdrn.ModflowGwfdrn'>, <class 'flopy.mf6.modflow.mfgwfevt.ModflowGwfevt'>, <class 'flopy.mf6.modflow.mfgwfevta.ModflowGwfevta'>, <class 'flopy.mf6.modflow.mfgwfghb.ModflowGwfghb'>, <class 'flopy.mf6.modflow.mfgwfgnc.ModflowGwfgnc'>, <class 'flopy.mf6.modflow.mfgwfgnc.GwfgncPackages'>, <class 'flopy.mf6.modflow.mfgwfgwf.ModflowGwfgwf'>, <class 'flopy.mf6.modflow.mfgwfgwt.ModflowGwfgwt'>, <class 'flopy.mf6.modflow.mfgwfhfb.ModflowGwfhfb'>, <class 'flopy.mf6.modflow.mfgwfic.ModflowGwfic'>, <class 'flopy.mf6.modflow.mfgwflak.ModflowGwflak'>, <class 'flopy.mf6.modflow.mfgwfmaw.ModflowGwfmaw'>, <class 'flopy.mf6.modflow.mfgwfmvr.ModflowGwfmvr'>, <class 'flopy.mf6.modflow.mfgwfmvr.GwfmvrPackages'>, <class 'flopy.mf6.modflow.mfgwfnam.ModflowGwfnam'>, <class 'flopy.mf6.modflow.mfgwfnpf.ModflowGwfnpf'>, <class 'flopy.mf6.modflow.mfgwfoc.ModflowGwfoc'>, <class 'flopy.mf6.modflow.mfgwfrch.ModflowGwfrch'>, <class 'flopy.mf6.modflow.mfgwfrcha.ModflowGwfrcha'>, <class 'flopy.mf6.modflow.mfgwfriv.ModflowGwfriv'>, <class 'flopy.mf6.modflow.mfgwfsfr.ModflowGwfsfr'>, <class 'flopy.mf6.modflow.mfgwfsto.ModflowGwfsto'>, <class 'flopy.mf6.modflow.mfgwfuzf.ModflowGwfuzf'>, <class 'flopy.mf6.modflow.mfgwfvsc.ModflowGwfvsc'>, <class 'flopy.mf6.modflow.mfgwfwel.ModflowGwfwel'>, <class 'flopy.mf6.modflow.mfgwtadv.ModflowGwtadv'>, <class 'flopy.mf6.modflow.mfgwtapi.ModflowGwtapi'>, <class 'flopy.mf6.modflow.mfgwtcnc.ModflowGwtcnc'>, <class 'flopy.mf6.modflow.mfgwtdis.ModflowGwtdis'>, <class 'flopy.mf6.modflow.mfgwtdisu.ModflowGwtdisu'>, <class 'flopy.mf6.modflow.mfgwtdisv.ModflowGwtdisv'>, <class 'flopy.mf6.modflow.mfgwtdsp.ModflowGwtdsp'>, <class 'flopy.mf6.modflow.mfgwtfmi.ModflowGwtfmi'>, <class 'flopy.mf6.modflow.mfgwtgwt.ModflowGwtgwt'>, <class 'flopy.mf6.modflow.mfgwtic.ModflowGwtic'>, <class 'flopy.mf6.modflow.mfgwtist.ModflowGwtist'>, <class 'flopy.mf6.modflow.mfgwtlkt.ModflowGwtlkt'>, <class 'flopy.mf6.modflow.mfgwtmst.ModflowGwtmst'>, <class 'flopy.mf6.modflow.mfgwtmvt.ModflowGwtmvt'>, <class 'flopy.mf6.modflow.mfgwtmvt.GwtmvtPackages'>, <class 'flopy.mf6.modflow.mfgwtmwt.ModflowGwtmwt'>, <class 'flopy.mf6.modflow.mfgwtnam.ModflowGwtnam'>, <class 'flopy.mf6.modflow.mfgwtoc.ModflowGwtoc'>, <class 'flopy.mf6.modflow.mfgwtsft.ModflowGwtsft'>, <class 'flopy.mf6.modflow.mfgwtsrc.ModflowGwtsrc'>, <class 'flopy.mf6.modflow.mfgwtssm.ModflowGwtssm'>, <class 'flopy.mf6.modflow.mfgwtuzt.ModflowGwtuzt'>, <class 'flopy.mf6.modflow.mfims.ModflowIms'>, <class 'flopy.mf6.modflow.mfmvr.ModflowMvr'>, <class 'flopy.mf6.modflow.mfmvr.MvrPackages'>, <class 'flopy.mf6.modflow.mfmvt.ModflowMvt'>, <class 'flopy.mf6.modflow.mfmvt.MvtPackages'>, <class 'flopy.mf6.modflow.mfutlats.ModflowUtlats'>, <class 'flopy.mf6.modflow.mfutlats.UtlatsPackages'>, <class 'flopy.mf6.modflow.mfutllaktab.ModflowUtllaktab'>, <class 'flopy.mf6.modflow.mfutlobs.ModflowUtlobs'>, <class 'flopy.mf6.modflow.mfutlobs.UtlobsPackages'>, <class 'flopy.mf6.modflow.mfutlsfrtab.ModflowUtlsfrtab'>, <class 'flopy.mf6.modflow.mfutlspc.ModflowUtlspc'>, <class 'flopy.mf6.modflow.mfutlspca.ModflowUtlspca'>, <class 'flopy.mf6.modflow.mfutltas.ModflowUtltas'>, <class 'flopy.mf6.modflow.mfutltas.UtltasPackages'>, <class 'flopy.mf6.modflow.mfutlts.ModflowUtlts'>, <class 'flopy.mf6.modflow.mfutlts.UtltsPackages'>, <class 'flopy.mf6.modflow.mfutltvk.ModflowUtltvk'>, <class 'flopy.mf6.modflow.mfutltvk.UtltvkPackages'>, <class 'flopy.mf6.modflow.mfutltvs.ModflowUtltvs'>, <class 'flopy.mf6.modflow.mfutltvs.UtltvsPackages'>]
- property package_dict
Returns a copy of the package name dictionary.
- static package_factory(package_type: str, model_type: str)[source]
Static method that returns the appropriate package type object based on the package_type and model_type strings. For internal FloPy use only, not intended for end users.
- property package_key_dict
- static package_list()[source]
Static method that returns the list of available packages. For internal FloPy use only, not intended for end users.
Returns a list of MFPackage subclasses
- property package_names
Returns a list of package names.
- packages_by_abbr = {'gnc': <class 'flopy.mf6.modflow.mfgnc.ModflowGnc'>, 'gncpackages': <class 'flopy.mf6.modflow.mfgnc.GncPackages'>, 'gwfapi': <class 'flopy.mf6.modflow.mfgwfapi.ModflowGwfapi'>, 'gwfbuy': <class 'flopy.mf6.modflow.mfgwfbuy.ModflowGwfbuy'>, 'gwfchd': <class 'flopy.mf6.modflow.mfgwfchd.ModflowGwfchd'>, 'gwfcsub': <class 'flopy.mf6.modflow.mfgwfcsub.ModflowGwfcsub'>, 'gwfdis': <class 'flopy.mf6.modflow.mfgwfdis.ModflowGwfdis'>, 'gwfdisu': <class 'flopy.mf6.modflow.mfgwfdisu.ModflowGwfdisu'>, 'gwfdisv': <class 'flopy.mf6.modflow.mfgwfdisv.ModflowGwfdisv'>, 'gwfdrn': <class 'flopy.mf6.modflow.mfgwfdrn.ModflowGwfdrn'>, 'gwfevt': <class 'flopy.mf6.modflow.mfgwfevt.ModflowGwfevt'>, 'gwfevta': <class 'flopy.mf6.modflow.mfgwfevta.ModflowGwfevta'>, 'gwfghb': <class 'flopy.mf6.modflow.mfgwfghb.ModflowGwfghb'>, 'gwfgnc': <class 'flopy.mf6.modflow.mfgwfgnc.ModflowGwfgnc'>, 'gwfgncpackages': <class 'flopy.mf6.modflow.mfgwfgnc.GwfgncPackages'>, 'gwfgwf': <class 'flopy.mf6.modflow.mfgwfgwf.ModflowGwfgwf'>, 'gwfgwt': <class 'flopy.mf6.modflow.mfgwfgwt.ModflowGwfgwt'>, 'gwfhfb': <class 'flopy.mf6.modflow.mfgwfhfb.ModflowGwfhfb'>, 'gwfic': <class 'flopy.mf6.modflow.mfgwfic.ModflowGwfic'>, 'gwflak': <class 'flopy.mf6.modflow.mfgwflak.ModflowGwflak'>, 'gwfmaw': <class 'flopy.mf6.modflow.mfgwfmaw.ModflowGwfmaw'>, 'gwfmvr': <class 'flopy.mf6.modflow.mfgwfmvr.ModflowGwfmvr'>, 'gwfmvrpackages': <class 'flopy.mf6.modflow.mfgwfmvr.GwfmvrPackages'>, 'gwfnam': <class 'flopy.mf6.modflow.mfgwfnam.ModflowGwfnam'>, 'gwfnpf': <class 'flopy.mf6.modflow.mfgwfnpf.ModflowGwfnpf'>, 'gwfoc': <class 'flopy.mf6.modflow.mfgwfoc.ModflowGwfoc'>, 'gwfrch': <class 'flopy.mf6.modflow.mfgwfrch.ModflowGwfrch'>, 'gwfrcha': <class 'flopy.mf6.modflow.mfgwfrcha.ModflowGwfrcha'>, 'gwfriv': <class 'flopy.mf6.modflow.mfgwfriv.ModflowGwfriv'>, 'gwfsfr': <class 'flopy.mf6.modflow.mfgwfsfr.ModflowGwfsfr'>, 'gwfsto': <class 'flopy.mf6.modflow.mfgwfsto.ModflowGwfsto'>, 'gwfuzf': <class 'flopy.mf6.modflow.mfgwfuzf.ModflowGwfuzf'>, 'gwfvsc': <class 'flopy.mf6.modflow.mfgwfvsc.ModflowGwfvsc'>, 'gwfwel': <class 'flopy.mf6.modflow.mfgwfwel.ModflowGwfwel'>, 'gwtadv': <class 'flopy.mf6.modflow.mfgwtadv.ModflowGwtadv'>, 'gwtapi': <class 'flopy.mf6.modflow.mfgwtapi.ModflowGwtapi'>, 'gwtcnc': <class 'flopy.mf6.modflow.mfgwtcnc.ModflowGwtcnc'>, 'gwtdis': <class 'flopy.mf6.modflow.mfgwtdis.ModflowGwtdis'>, 'gwtdisu': <class 'flopy.mf6.modflow.mfgwtdisu.ModflowGwtdisu'>, 'gwtdisv': <class 'flopy.mf6.modflow.mfgwtdisv.ModflowGwtdisv'>, 'gwtdsp': <class 'flopy.mf6.modflow.mfgwtdsp.ModflowGwtdsp'>, 'gwtfmi': <class 'flopy.mf6.modflow.mfgwtfmi.ModflowGwtfmi'>, 'gwtgwt': <class 'flopy.mf6.modflow.mfgwtgwt.ModflowGwtgwt'>, 'gwtic': <class 'flopy.mf6.modflow.mfgwtic.ModflowGwtic'>, 'gwtist': <class 'flopy.mf6.modflow.mfgwtist.ModflowGwtist'>, 'gwtlkt': <class 'flopy.mf6.modflow.mfgwtlkt.ModflowGwtlkt'>, 'gwtmst': <class 'flopy.mf6.modflow.mfgwtmst.ModflowGwtmst'>, 'gwtmvt': <class 'flopy.mf6.modflow.mfgwtmvt.ModflowGwtmvt'>, 'gwtmvtpackages': <class 'flopy.mf6.modflow.mfgwtmvt.GwtmvtPackages'>, 'gwtmwt': <class 'flopy.mf6.modflow.mfgwtmwt.ModflowGwtmwt'>, 'gwtnam': <class 'flopy.mf6.modflow.mfgwtnam.ModflowGwtnam'>, 'gwtoc': <class 'flopy.mf6.modflow.mfgwtoc.ModflowGwtoc'>, 'gwtsft': <class 'flopy.mf6.modflow.mfgwtsft.ModflowGwtsft'>, 'gwtsrc': <class 'flopy.mf6.modflow.mfgwtsrc.ModflowGwtsrc'>, 'gwtssm': <class 'flopy.mf6.modflow.mfgwtssm.ModflowGwtssm'>, 'gwtuzt': <class 'flopy.mf6.modflow.mfgwtuzt.ModflowGwtuzt'>, 'ims': <class 'flopy.mf6.modflow.mfims.ModflowIms'>, 'mvr': <class 'flopy.mf6.modflow.mfmvr.ModflowMvr'>, 'mvrpackages': <class 'flopy.mf6.modflow.mfmvr.MvrPackages'>, 'mvt': <class 'flopy.mf6.modflow.mfmvt.ModflowMvt'>, 'mvtpackages': <class 'flopy.mf6.modflow.mfmvt.MvtPackages'>, 'nam': <class 'flopy.mf6.modflow.mfnam.ModflowNam'>, 'tdis': <class 'flopy.mf6.modflow.mftdis.ModflowTdis'>, 'utlats': <class 'flopy.mf6.modflow.mfutlats.ModflowUtlats'>, 'utlatspackages': <class 'flopy.mf6.modflow.mfutlats.UtlatsPackages'>, 'utllaktab': <class 'flopy.mf6.modflow.mfutllaktab.ModflowUtllaktab'>, 'utlobs': <class 'flopy.mf6.modflow.mfutlobs.ModflowUtlobs'>, 'utlobspackages': <class 'flopy.mf6.modflow.mfutlobs.UtlobsPackages'>, 'utlsfrtab': <class 'flopy.mf6.modflow.mfutlsfrtab.ModflowUtlsfrtab'>, 'utlspc': <class 'flopy.mf6.modflow.mfutlspc.ModflowUtlspc'>, 'utlspca': <class 'flopy.mf6.modflow.mfutlspca.ModflowUtlspca'>, 'utltas': <class 'flopy.mf6.modflow.mfutltas.ModflowUtltas'>, 'utltaspackages': <class 'flopy.mf6.modflow.mfutltas.UtltasPackages'>, 'utlts': <class 'flopy.mf6.modflow.mfutlts.ModflowUtlts'>, 'utltspackages': <class 'flopy.mf6.modflow.mfutlts.UtltsPackages'>, 'utltvk': <class 'flopy.mf6.modflow.mfutltvk.ModflowUtltvk'>, 'utltvkpackages': <class 'flopy.mf6.modflow.mfutltvk.UtltvkPackages'>, 'utltvs': <class 'flopy.mf6.modflow.mfutltvs.ModflowUtltvs'>, 'utltvspackages': <class 'flopy.mf6.modflow.mfutltvs.UtltvsPackages'>}
- class PackageContainerType(value)[source]
Bases:
Enum
Determines whether a package container is a simulation, model, or package.
- model = 2
- package = 3
- simulation = 1
- exception ReadAsArraysException[source]
Bases:
Exception
Exception occurs when loading ReadAsArrays package as non-ReadAsArrays package.