flopy.utils.optionblock module¶
-
class
OptionBlock
(options_line, package, block=True)[source]¶ Bases:
object
Parent class to for option blocks within Modflow-nwt models. This class contains base information and routines that can be shared throughout all option block classes.
Parameters: - options_line (str) – single line based options string
- package (flopy.pakbase.Package instance) – valid packages include ModflowWel, ModflowSfr2, ModflowUzf1
- block (bool) – flag to write as single line or block type
-
dtype
= 'dtype'¶
-
classmethod
load_options
(options, package)[source]¶ Loader for the options class. Reads in an options block and uses context from option util dictionaries to check the validity of the data
Parameters: - options (str or file) – string path to a file or file object
- package (flopy.package type) – valid packages include flopy.modflow.ModflowWel, flopy.modflow.ModflowUzf1, flopy.modflow.ModflowSfr2
Returns: Return type: OptionBlock object
-
n_nested
= 'nvars'¶
-
nested
= 'nested'¶
-
optional
= 'optional'¶
-
simple_flag
= {'dtype': <class 'numpy.bool_'>, 'nested': False, 'optional': False}¶
-
simple_float
= {'dtype': <class 'float'>, 'nested': False, 'optional': False}¶
-
simple_int
= {'dtype': <class 'int'>, 'nested': False, 'optional': False}¶
-
simple_str
= {'dtype': <class 'str'>, 'nested': False, 'optional': False}¶
-
simple_tabfile
= {'dtype': <class 'numpy.bool_'>, 'nested': True, 'nvars': 2, 'vars': {'maxval': {'dtype': <class 'int'>, 'nested': False, 'optional': False}, 'numtab': {'dtype': <class 'int'>, 'nested': False, 'optional': False}}}¶
-
single_line_options
¶ Method to get the single line representation of the Options Block
Returns: t Return type: (str) single line representation of Options
-
update_from_package
(pak)[source]¶ Updater method to check the package and update OptionBlock attribute values based on package values.
Parameters: pak (flopy.package) – valid packages include ModflowWel, ModflowSfr2, and ModflowUzf1 instances
-
vars
= 'vars'¶
-
class
OptionUtil
[source]¶ Bases:
object
-
static
isfloat
(s)[source]¶ Simple method to check that a string is a valid floating point variable
Parameters: s (str) – Returns: Return type: bool
-
static