Skip to content

pst_controldata

This module contains several class definitions for obseure parts of the PEST control file: ControlData (' control data'), RegData (' regularization') and SvdData ('* singular value decomposition'). These classes are automatically created and appended to Pst instances; users shouldn't need to deal with these classes explicitly

FFMT = lambda x: '{0:>15.6E}'.format(float(x)) module-attribute

lambda function for string formatting float types into 15-char widths

IFMT = lambda x: '{0:>10d}'.format(int(x)) module-attribute

lambda function for string formatting int types into 10-char widths

SFMT = lambda x: '{0:>20s}'.format(str(x)) module-attribute

lambda function for string formatting str types into 20-char widths

SFMT_LONG = lambda x: '{0:>50s}'.format(str(x)) module-attribute

lambda function for string formatting str types into 50-char widths

ControlData

Bases: object

an object that encapsulates the control data section of the PEST control file

Notes

This class works hard to protect the variables in the control data section. It type checks attempts to change values to make sure the type being passed matches the expected type of the attribute.

formatted_values property

list the entries and current values in the control data section

Returns:

Type Description

pandas.Series: formatted_values for the control data entries

get_dataframe() staticmethod

get a generic (default) control section as a dataframe

Returns:

`pandas.DataFrame`: a dataframe of control data information

parse_values_from_lines(lines, iskeyword=False)

cast the string lines for a pest control file into actual inputs

Parameters:

Name Type Description Default
lines [`str`]

raw ASCII lines from pest control file

required

write(f)

write control data section to a file

Parameters:

Name Type Description Default
f file handle

open file handle to write to

required

write_keyword(f)

write the control data entries to an open file handle using keyword-style format.

Parameters:

Name Type Description Default
f file handle

open file handle to write to

required
Notes

only writes values that have been accessed since instantiation

RegData

Bases: object

an object that encapsulates the regularization section of the PEST control file

write(f)

write the regularization section to an open file handle

Parameters:

Name Type Description Default
f `file handle`

open file handle for writing

required

write_keyword(f)

write the regularization section to an open file handle using the keyword-style format

Parameters:

Name Type Description Default
f `file handle`

open file handle for writing

required

SvdData

Bases: object

encapsulates the singular value decomposition section of the PEST control file

Parameters:

Name Type Description Default
kwargs `dict`

optional keyword arguments

{}

parse_values_from_lines(lines)

parse values from lines of the SVD section of a PEST control file

Parameters:

Name Type Description Default
lines [`strs`]

the raw ASCII lines from the control file

required

write(f)

write an SVD section to a file handle

Parameters:

Name Type Description Default
f `file handle`

open file handle for writing

required

write_keyword(f)

write an SVD section to a file handle using keyword-style format

    Args:
        f (`file handle`): open file handle for writing