flopy.mf6.data.mfdatautil module

class ArrayTemplateGenerator(path)[source]

Bases: flopy.mf6.data.mfdatautil.TemplateGenerator

Class that builds a data template for MFArrays. This is a generic class that is initialized with a path that identifies the data to be built.

Parameters:path (string) – tuple containing path of data is described in dfn files (<model>,<package>,<block>,<data name>)
empty: (model: MFModel, layered: boolean, data_storage_type_list: boolean,
default_value: int/float) : variable

Builds a template for the data you need to specify for a specific data type (ie. “hk”) in a specific model. The data type and dimensions is determined by “path” during initialization of this class and the model is passed in to this method as the “model” parameter. If the data is transient a dictionary containing a single stress period will be returned. If “layered” is set to true, data will be returned as a list ndarrays, one for each layer. data_storage_type_list is a list of DataStorageType, one type for each layer. If “default_value” is specified the data template will be populated with that value, otherwise each ndarray in the data template will be populated with np.empty (0 or 0.0 if the DataStorageType is a constant).

empty(model=None, layered=False, data_storage_type_list=None, default_value=None)[source]
class ListTemplateGenerator(path)[source]

Bases: flopy.mf6.data.mfdatautil.TemplateGenerator

Class that builds a data template for MFLists. This is a generic class that is initialized with a path that identifies the data to be built.

Parameters:path (string) – tuple containing path of data is described in dfn files (<model>,<package>,<block>,<data name>)
empty: (maxbound: int, aux_vars: list, boundnames: boolean, nseg: int) :
dictionary

Builds a template for the data you need to specify for a specific data type (ie. “stress_period_data”) in a specific model. The data type is determined by “path” during initialization of this class. If the data is transient a dictionary containing a single stress period will be returned. The number of entries in the recarray are determined by the “maxbound” parameter. The “aux_vars” parameter is a list of aux var names to be used in this data list. If boundnames is set to true and boundname field will be included in the recarray. nseg is only used on list data that contains segments. If timeseries is true, a template that is compatible with time series data is returned.

dtype(model, aux_vars=None, boundnames=False, nseg=None, timeseries=False, cellid_expanded=False)[source]
empty(model, maxbound=None, aux_vars=None, boundnames=False, nseg=None, timeseries=False, stress_periods=None, cellid_expanded=False)[source]
class MFComment(comment, path, sim_data, line_number=0)[source]

Bases: object

Represents a variable in a MF6 input file

Parameters:
  • comment (string or list) – comment to be displayed in output file
  • path (string) – tuple representing location in the output file
  • line_number (integer) – line number to display comment in output file
comment

comment to be displayed in output file

Type:string or list
path

tuple representing location in the output file

Type:string
line_number

line number to display comment in output file

Type:integer
write : (file)

writes the comment to file

add_text(additional_text)[source]

adds text to the comment

get_file_entry(eoln_suffix=True)[source]

returns the comment text in the format to write to package files

is_empty(include_whitespace=True)[source]

checks to see if comment is just an empty string ‘’. if include_whitespace is set to false a string with only whitespace is considered empty

is_comment(text, include_empty_line=False) : boolean

returns true if text is a comment. an empty line is considered a comment if include_empty_line is true.

Notes

Examples

add_text(additional_text, new_line=False)[source]
get_file_entry(eoln_suffix=True)[source]
static is_comment(text, include_empty_line=False)[source]
is_empty(include_whitespace=True)[source]
write(fd, eoln_suffix=True)[source]
class MFDocString(description)[source]

Bases: object

Helps build a python class doc string

Parameters:description (string) – description of the class
indent

indent to use in doc string

Type:string
description

description of the class

Type:string
parameter_header

header for parameter section of doc string

Type:string
parameters

list of docstrings for class parameters

Type:list
add_parameter : (param_descr : string, beginning_of_list : bool)

adds doc string for a parameter with description ‘param_descr’ to the end of the list unless beginning_of_list is True

get_doc_string : () : string

builds and returns the docstring for the class

add_parameter(param_descr, beginning_of_list=False, model_parameter=False)[source]
get_doc_string(model_doc_string=False)[source]
class TemplateGenerator(path)[source]

Bases: object

Abstract base class for building a data template for different data types. This is a generic class that is initialized with a path that identifies the data to be built.

Parameters:path (string) – tuple containing path of data is described in dfn files (<model>,<package>,<block>,<data name>)
build_type_header(ds_type, data=None)[source]
convert_data(data, data_dimensions, data_type, data_item=None)[source]
get_first_val(arr)[source]
iterable(obj)[source]
to_string(val, data_type, sim_data, data_dim, is_cellid=False, possible_cellid=False, data_item=None)[source]