flownet.config_parser._config_parser module
- flownet.config_parser._config_parser._check_defined(path_in_config_dict: dict, parameter: str)
- Parameters
path_in_config_dict (str) – a location in the config schema dictionary
parameter (str) – a parameter/dictionary found at the given location
- Returns
The keys that are different from None in the parameter/dictionary given as input
- flownet.config_parser._config_parser._check_distribution(path_in_config_dict: dict, parameter: str)
Helper function that performs a number of checks to make sure that the values defined in the config file for the parameter in question makes sense
- Parameters
path_in_config_dict (str) – a location in the config schema dictionary
parameter (str) – a parameter/dictionary found at the given location
- Returns
Nothing
- Raises
ValueError – If the choice of input distribution is not valid
ValueError – If the combination of min/max/base/mean/stddev deinfed in the config is not right for the chosen distribution
- flownet.config_parser._config_parser._check_for_negative_values(path_in_config_dict: dict, parameter: str)
Helper function to check if there are any negative values defined for a given parameter.
- Parameters
path_in_config_dict (str) – a location in the config schema dictionary
parameter (str) – a parameter/dictionary found at the given location
- Returns
Nothing
- Raises
ValueError – If a parameter has negative input value defined for min/max/mean/base/stddev
- flownet.config_parser._config_parser._check_if_all_region_priors_defined(path_in_config_dict: dict, unique_regions: numpy.ndarray, parameter_name: str)
The function checks that prior distributions are defined for all regions is the simulation model if the option ‘regions_from_sim’ is selected for equilibration or relative permeability.
If all regions do not have specific input for all regions in the simulation model, a region with default values needs to be defined.
- Parameters
path_in_config_dict – a location in the config schema dictionary
unique_regions – a list of the unique region numbers in the input simulation model
parameter_name – the name of the output region parameter
- Returns
Nothing
- Raises
ValueError – If there are multiple definitions of models parameters for the same region
ValueError – If there are model parameters defined for a region that does no exist in the simulation model
ValueError – If default values for model parameters are required but not defined
- flownet.config_parser._config_parser._check_interpolate(path_in_config_dict: dict, parameter: str)
Helper function to check the parameter in question is defined correctly for using interpolation between SCAL recommendation curves in pyscal
- Parameters
path_in_config_dict (str) – a location in the config schema dictionary
parameter (str) – a parameter/dictionary found at the given location
- Returns
Nothing
- Raises
ValueError – If the relative permeability input does not contain information for min/base/max when the interpolation option is selected
- flownet.config_parser._config_parser._check_order_of_values(path_in_config_dict: dict, parameter: str)
Helper function to check the order of the defined values for a given parameter. If defined, the following should be true:
Min < Base
Min < Mean
Min < Max
Mean < Max
Base < Max
- Parameters
path_in_config_dict (str) – a location in the config schema dictionary
parameter (str) – a parameter/dictionary found at the given location
- Returns
Nothing
- Raises
ValueError – If the order of the defined min/base/mean/max values for a parameter is not correct
- flownet.config_parser._config_parser.create_schema(config_folder: Optional[pathlib.Path] = None) Dict
Returns a configsuite type schema, where configuration value types are defined, together with which values are optional and/or has default values.
- Parameters
config_folder – Optional path to folder with config file
- Returns
Dictionary to be used as configsuite type schema
- flownet.config_parser._config_parser.create_schema_without_arguments() Dict
- flownet.config_parser._config_parser.parse_config(base_config: pathlib.Path, update_config: Optional[pathlib.Path] = None) <property object at 0x7f15b0f78830>
Takes in path to a yaml configuration file, parses it, populates with default values where that is defined and the has not provided his/her own value. Also error checks input arguments, and making sure they are of expected type.
- Parameters
base_config – Path to the main configuration file.
update_config – Optional configuration file with key/values to override in main configuration file.
- Returns
Parsed config, where values can be extracted like e.g. ‘config.ert.queue.system’.