expreccs.utils.inputvalues module#

Load, validate, and normalize TOML configuration for expreccs.

The module combines validated simulation input with command-line and runtime settings, derives grid and saturation-table dimensions, and preprocesses OPM Flow TUNING records. Validation reports unknown values, missing variables, and incompatible shapes through the shared terminal-formatting helpers.

process_input(dic, in_file)[source]#

Load TOML input and add validated values to the runtime configuration.

Parameters:
dicdict[str, Any]

Shared mutable expreccs configuration and runtime data.

in_filestr

Path to the TOML configuration file.

Parameters:
Return type:

None

process_tuning(dic)[source]#

Detect and normalize OPM TUNING schedule records.

Parameters:
dicdict[str, Any]

Shared mutable expreccs configuration and runtime data.

Parameters:

dic (dict[str, Any])

Return type:

None

_finite_number(value)[source]#

Check whether a value is a finite, non-Boolean number.

Parameters:
valueAny

Value to inspect.

Returns:
bool

Whether the value is a finite non-Boolean number.

Parameters:

value (Any)

Return type:

bool

_add_error(errors, message)[source]#

Append one configuration-validation error.

Parameters:
errorslist[str]

Accumulated validation messages.

messagestr

Message to append or display.

Parameters:
Return type:

None

_validate_numeric_array(cfg_file, key, errors, *, length=None, positive=False, integer=False)[source]#

Validate a one-dimensional numeric configuration array.

Parameters:
cfg_filedict[str, Any]

TOML configuration values.

keystr

Configuration variable name.

errorslist[str]

Accumulated validation messages.

Returns:
bool

Whether the array is valid.

Parameters:
Return type:

bool

_validate_numeric_matrix(cfg_file, key, errors, columns)[source]#

Validate a numeric configuration matrix.

Parameters:
cfg_filedict[str, Any]

TOML configuration values.

keystr

Configuration variable name.

errorslist[str]

Accumulated validation messages.

columnsint

Required number of matrix columns.

Returns:
bool

Whether the matrix is valid.

Parameters:
Return type:

bool

check_entries(cfg_file)[source]#

Validate and normalize TOML configuration entries.

Parameters:
cfg_filedict[str, Any]

TOML configuration values.

Returns:
dict[str, Any]

Validated TOML configuration.

Raises:
SystemExit

If an input value is invalid or required input cannot be used.

Parameters:

cfg_file (dict[str, Any])

Return type:

dict[str, Any]