mythos.energy.configuration

Configuration class for energy models.

Attributes

ERR_MISSING_REQUIRED_PARAMS

ERR_OPT_DEPENDENT_PARAMS

WARN_INIT_PARAMS_NOT_IMPLEMENTED

WARN_DEPENDENT_PARAMS_NOT_INITIALIZED

Classes

BaseConfiguration

Base class for configuration classes.

Module Contents

mythos.energy.configuration.ERR_MISSING_REQUIRED_PARAMS = 'Required properties {props} are not initialized.'
mythos.energy.configuration.ERR_OPT_DEPENDENT_PARAMS = 'Only {req_params} permitted for optimization, but found {given_params}'
mythos.energy.configuration.WARN_INIT_PARAMS_NOT_IMPLEMENTED = 'init_params not implemented'
mythos.energy.configuration.WARN_DEPENDENT_PARAMS_NOT_INITIALIZED = 'Dependent parameters not initialized'
class mythos.energy.configuration.BaseConfiguration[source]

Base class for configuration classes.

This class should not be used directly.

Parameters:
  • params_to_optimize (tuple[str]) – parameters to optimize

  • required_params (tuple[str]) – required parameters

  • non_optimizable_required_params (tuple[str]) – required parameters that are not optimizable

  • dependent_params (tuple[str]) – dependent parameters, these are calculated from the independent parameters

  • OPT_ALL (tuple[str]) – CONSTANT, is a wild card for all parameters

params_to_optimize: tuple[str] = ()
required_params: tuple[str] = ()
non_optimizable_required_params: tuple[str] = ()
dependent_params: tuple[str] = ()
OPT_ALL: tuple[str] = ('*',)
property opt_params: dict[str, mythos.utils.types.Scalar]

Returns the parameters to optimize.

__post_init__() None[source]

Checks validity of the configuration.

init_params() BaseConfiguration[source]

Initializes the dependent parameters in configuration.

Should be implemented in the subclass if dependent parameters are present.

classmethod from_dict(params: dict[str, float], params_to_optimize: tuple[str] = ()) BaseConfiguration[source]

Creates a configuration from a dictionary.

to_dictionary(*, include_dependent: bool, exclude_non_optimizable: bool) dict[str, mythos.utils.types.ARR_OR_SCALAR][source]

Converts the configuration to a dictionary.

__merge__baseconfig(other: BaseConfiguration) BaseConfiguration

Merges two BaseConfiguration objects.

__merge__dict(other: dict[str, Any]) BaseConfiguration

Merges a dictionary with the configuration.

__or__(other: BaseConfiguration | dict[str, mythos.utils.types.ARR_OR_SCALAR]) BaseConfiguration[source]

Convenience method to merge a configuration or a dictionary with the current configuration.

Returns a new configuration object.