bluemira.base.builder ===================== .. py:module:: bluemira.base.builder .. autoapi-nested-parse:: Interfaces for builder classes. Attributes ---------- .. autoapisummary:: bluemira.base.builder.BuildConfig Classes ------- .. autoapisummary:: bluemira.base.builder.Builder Module Contents --------------- .. py:type:: BuildConfig :canonical: dict[str, Union[int, float, str, 'BuildConfig']] Type alias for representing nested build configuration information. .. py:class:: Builder(params: bluemira.base.parameter_frame.typed.ParameterFrameLike, build_config: dict | None = None, *, verbose=True) Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: bluemira.base.builder.Builder :parts: 1 :private-bases: Base class for component builders. :param params: The parameters required by the builder. :param build_config: The build configuration for the builder. :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:: params .. py:attribute:: build_config .. py:attribute:: name .. py:attribute:: build .. py:property:: param_cls :type: type[bluemira.base.parameter_frame.ParameterFrame] | None :abstractmethod: The class to hold this Builders's parameters. .. py:method:: get_material(component_name: str | None = None) -> matproplib.material.Material | None Get the material for a component from the build config. This will lookup the component_name in the "material" section of the build config to get the material name. It will then use that to get the corresponding material from the material cache. If no component_name is given, it's assumed the material name is directly given by the "material" key in the build config. See `establish_material_cache` and `get_cached_material` for more information on how the material cache is used. If no material is found or there is no "material" key in the build_config, a warning is raised and None returned. :param component_name: The name of the component. :returns: The material for the component. :raises MaterialsError: If the material build config is not a string when no component name is given. .. py:method:: component_tree(xz: list[bluemira.base.components.ComponentT] | None, xy: list[bluemira.base.components.ComponentT] | None, xyz: list[bluemira.base.components.ComponentT] | None) -> bluemira.base.components.Component Adds views of components to an overall component tree. :param xz: xz view of component :param xy: xy view of component :param xyz: xyz view of component :returns: The component tree :rtype: component