cashocs.io.config#
Management of configuration files.
Functions
|
Loads a config object from a config file. |
Classes
|
Special type indicating an unconstrained type. |
|
Class for handling the config in cashocs. |
|
ConfigParser implementing interpolation. |
- class cashocs.io.config.Config(config_file=None)[source]#
Bases:
ConfigParser
Class for handling the config in cashocs.
Initializes self.
- Parameters:
config_file (Optional[str]) – Path to the config file.
- getlist(section, option, **kwargs)[source]#
Extracts a list from a config file.
- Parameters:
section (str) – The section where the list is placed.
option (str) – The option which contains the list.
**kwargs (Any) – A list of keyword arguments that get passed to :py:meth:
self.get
- Returns:
The list which is specified in section
section
and keyoption
.- Return type:
List
- cashocs.io.config.load_config(path)[source]#
Loads a config object from a config file.
Loads the config from a .ini file via the configparser package.
- Parameters:
path (str) – The path to the .ini file storing the configuration.
- Returns:
The output config file, which includes the path to the .ini file.
- Return type:
ConfigParser