chump.config
The primary objective driving the development of CHUMP is to streamline post-processing by automating repetitive tasks, while ensuring applicability. The interface for user input and production of output is simplified through the use of a configuration file. This technique is a form of configurable programming, frequently employed in computer engineering to overcome limitations of traditional graphical user interfaces (GUIs). A significant benefit of this approach is that users can adjust settings through the configuration file without the need for script rewrites or application recompilations. The configuration file is an easy-to-use ASCII input file that can be created by non-programmers.
YAML (https://yaml.org/) and TOML (https://toml.io/) are two human-readable data serialization formats supported by CHUMP. The configuration file written in these two formats can be parsed and stored as a hierarchical dictionary structure. This dictionary structure is then used to define various data objects with different levels of complexity. One notable advantage of this approach is the seamless unpacking of the dictionary with double asterisks as arbitrary keyword arguments in Python functions. This facilitates the convenient utilization of the configuration data to specify diverse parameters and options in the Python code. Furthermore, both YAML and TOML natively support assignment of date/time, array/list, boolean values. In addition, CHUMP allows for the implementation of object property inheritance and overwriting by defining the parent object.
config
class is the app entry to load configuration file. It also sets up global parameters which
will be used for all objects if it is not overwritten.
inlucde
tells chump
to insert the contents of other files into the main configuration file.
This provides flexibility how different section of the configuration file can be organized.
When include
is used, it should be placed as the first parameter. Nested include
(include files which also include other files) is allowed.
Example:
>>> include = ['../model/mf.toml', '../obsdata/obs.toml']
set the the working directory, default is the directory from which the chump is called.
Example:
>>> masterdir = '../../model'
set the global coordinate reference system using a string of certain format. See details in https://geopandas.org/en/stable/docs/user_guide/projections.html.
When err_as_oms = true
, residual = observed - simulated
; otherwise residual = simulated - observed
; default is true
.
set the global starting date for time related data. The time will be parsed into datetime formats using the starting date and time unit. If not set, the time will be in numeric formats.
metadata
set the metadata for all the PDF created from this PDF, if not overwritten.
Example:
>>> metadata = {title='SSPA Project 111',
>>> author='SSPAmodler',
>>> subject='Groundwater model results'}