bluemira.base.designer ====================== .. py:module:: bluemira.base.designer .. autoapi-nested-parse:: Interface for designer classes. Attributes ---------- .. autoapisummary:: bluemira.base.designer._DesignerReturnT Classes ------- .. autoapisummary:: bluemira.base.designer.Designer Functions --------- .. autoapisummary:: bluemira.base.designer.run_designer Module Contents --------------- .. py:data:: _DesignerReturnT .. py:class:: Designer(params: bluemira.base.parameter_frame.typed.ParameterFrameLike, build_config: bluemira.base.builder.BuildConfig | None = None, *, verbose: bool = True) Bases: :py:obj:`abc.ABC`, :py:obj:`Generic`\ [\ :py:obj:`_DesignerReturnT`\ ] .. autoapi-inheritance-diagram:: bluemira.base.designer.Designer :parts: 1 :private-bases: Base class for 'Designers' that solver design problems as part of building a reactor component. :param params: The parameters required by the designer. :param build_config: The build configuration options for the designer. :param verbose: control how much logging the designer will output .. rubric:: Notes If there are no parameters associated with a concrete builder, set `param_cls` to `None` and pass `None` into this class's constructor. .. py:attribute:: KEY_RUN_MODE :value: 'run_mode' .. py:attribute:: params .. py:attribute:: build_config .. py:attribute:: _verbose :value: True .. py:method:: execute() -> _DesignerReturnT Execute the designer with the run mode specified by the build config. By default the run mode is 'run'. :returns: The result of the designer's run_mode method. .. py:method:: run() -> _DesignerReturnT :abstractmethod: Run the design problem. .. py:method:: mock() -> _DesignerReturnT :abstractmethod: Return a mock of a design. Optionally implemented. .. py:method:: read() -> _DesignerReturnT :abstractmethod: Read a design from a file. The file path should be specified in the build config. Optionally implemented. .. py:property:: param_cls :type: type[bluemira.base.parameter_frame.typed.ParameterFrameT] :abstractmethod: The ParameterFrame class defining this designer's parameters. .. py:property:: run_mode :type: str Get the run mode of this designer. .. py:method:: _get_run_func(mode: str) -> collections.abc.Callable Retrieve the function corresponding to the given run mode. :param mode: The run mode to retrieve the function for. :returns: The function corresponding to the given run mode. :raises ValueError: Run mode doesnt exist .. py:function:: run_designer(designer_cls: type[Designer[_DesignerReturnT]], params: bluemira.base.parameter_frame.typed.ParameterFrameLike, build_config: dict, **kwargs) -> _DesignerReturnT Make and run a designer, returning the result. :param designer_cls: The designer class to use. :param params: The parameters required by the designer. :param build_config: The build configuration options for the designer. :param kwargs: Additional keyword arguments to pass to the designer. :returns: The result of the designer's run_mode method.