mythos.energy.configuration =========================== .. py:module:: mythos.energy.configuration .. autoapi-nested-parse:: Configuration class for energy models. Attributes ---------- .. autoapisummary:: mythos.energy.configuration.ERR_MISSING_REQUIRED_PARAMS mythos.energy.configuration.ERR_OPT_DEPENDENT_PARAMS mythos.energy.configuration.WARN_INIT_PARAMS_NOT_IMPLEMENTED mythos.energy.configuration.WARN_DEPENDENT_PARAMS_NOT_INITIALIZED Classes ------- .. autoapisummary:: mythos.energy.configuration.BaseConfiguration Module Contents --------------- .. py:data:: ERR_MISSING_REQUIRED_PARAMS :value: 'Required properties {props} are not initialized.' .. py:data:: ERR_OPT_DEPENDENT_PARAMS :value: 'Only {req_params} permitted for optimization, but found {given_params}' .. py:data:: WARN_INIT_PARAMS_NOT_IMPLEMENTED :value: 'init_params not implemented' .. py:data:: WARN_DEPENDENT_PARAMS_NOT_INITIALIZED :value: 'Dependent parameters not initialized' .. py:class:: BaseConfiguration Base class for configuration classes. This class should not be used directly. :param params_to_optimize: parameters to optimize :type params_to_optimize: tuple[str] :param required_params: required parameters :type required_params: tuple[str] :param non_optimizable_required_params: required parameters that are not optimizable :type non_optimizable_required_params: tuple[str] :param dependent_params: dependent parameters, these are calculated from the independent parameters :type dependent_params: tuple[str] :param OPT_ALL: CONSTANT, is a wild card for all parameters :type OPT_ALL: tuple[str] .. py:attribute:: params_to_optimize :type: tuple[str] :value: () .. py:attribute:: required_params :type: tuple[str] :value: () .. py:attribute:: non_optimizable_required_params :type: tuple[str] :value: () .. py:attribute:: dependent_params :type: tuple[str] :value: () .. py:attribute:: OPT_ALL :type: tuple[str] :value: ('*',) .. py:property:: opt_params :type: dict[str, mythos.utils.types.Scalar] Returns the parameters to optimize. .. py:method:: __post_init__() -> None Checks validity of the configuration. .. py:method:: init_params() -> BaseConfiguration Initializes the dependent parameters in configuration. Should be implemented in the subclass if dependent parameters are present. .. py:method:: from_dict(params: dict[str, float], params_to_optimize: tuple[str] = ()) -> BaseConfiguration :classmethod: Creates a configuration from a dictionary. .. py:method:: to_dictionary(*, include_dependent: bool, exclude_non_optimizable: bool) -> dict[str, mythos.utils.types.ARR_OR_SCALAR] Converts the configuration to a dictionary. .. py:method:: __merge__baseconfig(other: BaseConfiguration) -> BaseConfiguration Merges two BaseConfiguration objects. .. py:method:: __merge__dict(other: dict[str, Any]) -> BaseConfiguration Merges a dictionary with the configuration. .. py:method:: __or__(other: Union[BaseConfiguration, dict[str, mythos.utils.types.ARR_OR_SCALAR]]) -> BaseConfiguration Convenience method to merge a configuration or a dictionary with the current configuration. Returns a new configuration object.