mbdlyb_ui.functional.functions ============================== .. py:module:: mbdlyb_ui.functional.functions .. autoapi-nested-parse:: Copyright (c) 2023 - 2026 TNO-ESI All rights reserved. Classes ------- .. autoapisummary:: mbdlyb_ui.functional.functions.FormRequiredForRelation mbdlyb_ui.functional.functions.FunctionCPTPage mbdlyb_ui.functional.functions.FunctionCreatePage mbdlyb_ui.functional.functions.FunctionDetailPage mbdlyb_ui.functional.functions.FunctionUpdatePage mbdlyb_ui.functional.functions.ObservesRelationCreatePage mbdlyb_ui.functional.functions.ObservesRelationUpdatePage mbdlyb_ui.functional.functions.RequiredForRelationCreatePage mbdlyb_ui.functional.functions.RequiredForRelationRepairPage mbdlyb_ui.functional.functions.RequiredForRelationUpdatePage mbdlyb_ui.functional.functions.SubfunctionRelationCreatePage mbdlyb_ui.functional.functions.SubfunctionRelationTablePage mbdlyb_ui.functional.functions.SubfunctionRelationUpdatePage mbdlyb_ui.functional.functions.TestsRelationCreatePage mbdlyb_ui.functional.functions.TestsRelationUpdatePage Functions --------- .. autoapisummary:: mbdlyb_ui.functional.functions.add_rfr mbdlyb_ui.functional.functions.drop_rfr mbdlyb_ui.functional.functions.function_form mbdlyb_ui.functional.functions.observes_relation_form mbdlyb_ui.functional.functions.repair_rfr_table mbdlyb_ui.functional.functions.requiredfor_relation_form mbdlyb_ui.functional.functions.requiredfor_relation_repair_form mbdlyb_ui.functional.functions.subfunction_relation_form mbdlyb_ui.functional.functions.tests_relation_form Module Contents --------------- .. py:class:: FormRequiredForRelation(idx: int, start_node: mbdlyb.functional.gdb.GFunction, end_node: Optional[mbdlyb.functional.gdb.GFunction] = None, weight: Optional[float] = None, operating_modes: Optional[list[str]] = None) Bases: :py:obj:`mbdlyb_ui.functional.helpers.RequiredForRelation` Represent an editable form required for relation. .. py:attribute:: idx .. py:class:: FunctionCPTPage(function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.CPTPage` Display the function CPT probability table editor. .. py:class:: FunctionCreatePage(cluster_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the function create editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: states :type: mbdlyb_ui.functional.helpers.StateTable .. py:class:: FunctionDetailPage(function_id) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the function detail properties and relations. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:class:: FunctionUpdatePage(function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the function update editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: states :type: mbdlyb_ui.functional.helpers.StateTable .. py:class:: ObservesRelationCreatePage(function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the observes relation create editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: o_relation :type: mbdlyb_ui.functional.helpers.ObservesRelation .. py:class:: ObservesRelationUpdatePage(function_id: str, observable_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the observes relation update editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: o_relation :type: mbdlyb_ui.functional.helpers.ObservesRelation .. py:class:: RequiredForRelationCreatePage(function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the required for relation create editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: rf_relation :type: mbdlyb_ui.functional.helpers.RequiredForRelation .. py:class:: RequiredForRelationRepairPage(function_id: str, dep_function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the required for relation repair editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: rf_relation :type: FormRequiredForRelation .. py:attribute:: rf_relations :type: list[FormRequiredForRelation] .. py:class:: RequiredForRelationUpdatePage(function_id: str, dep_function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the required for relation update editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: rf_relation :type: mbdlyb_ui.functional.helpers.RequiredForRelation .. py:class:: SubfunctionRelationCreatePage(function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the subfunction relation create editing page. .. py:attribute:: sf_relation :type: mbdlyb_ui.functional.helpers.SubfunctionOfRelation .. py:class:: SubfunctionRelationTablePage(function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the subfunction relation table relation table. .. py:attribute:: eligable_sfs :type: dict[str, dict] .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: groups :type: dict[str, list[str]] .. py:class:: SubfunctionRelationUpdatePage(function_id: str, subfunction_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the subfunction relation update editing page. .. py:attribute:: sf_relation :type: mbdlyb_ui.functional.helpers.SubfunctionOfRelation .. py:class:: TestsRelationCreatePage(function_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the tests relation create editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: t_relation :type: mbdlyb_ui.functional.helpers.TestsRelation .. py:class:: TestsRelationUpdatePage(function_id: str, test_id: str) Bases: :py:obj:`mbdlyb_ui.functional.base.FunctionalPage` Display the tests relation update editing page. .. py:attribute:: function :type: mbdlyb.functional.gdb.GFunction .. py:attribute:: t_relation :type: mbdlyb_ui.functional.helpers.TestsRelation .. py:function:: add_rfr(rf_relations: list[FormRequiredForRelation], initial: FormRequiredForRelation) Append a required-for repair relation and refresh the table. :param rf_relations: Editable required-for repair relations. :param initial: Whether to create the first repair relation. .. py:function:: drop_rfr(rf_relations: list[FormRequiredForRelation], rf_relation: FormRequiredForRelation) Remove a required-for repair relation and refresh the table. :param rf_relations: Editable required-for repair relations. :param rf_relation: Required-for relation being edited. .. py:function:: function_form(function: mbdlyb.functional.gdb.GFunction, states: mbdlyb_ui.functional.helpers.StateTable, cluster: mbdlyb.functional.gdb.GCluster, update: bool = True) Render the function name and state editing controls. :param function: Function whose properties are edited. :param states: Editable state names for the function. :param cluster: Parent cluster used to validate the function name. :param update: Whether the function already exists for name validation. .. py:function:: observes_relation_form(o_relation: mbdlyb_ui.functional.helpers.ObservesRelation) Render the observed node and relation weight controls. :param o_relation: Observes relation being edited. .. py:function:: repair_rfr_table(rf_relations: list[FormRequiredForRelation], initial_relation: FormRequiredForRelation, start_options: Optional[dict[str, str]] = None, end_options: Optional[dict[str, str]] = None) Render editable required-for repair relation rows. :param rf_relations: Editable required-for repair relations. :param initial_relation: Original required-for relation used for repair. :param start_options: Available source nodes for the relation. :param end_options: Available target nodes for the relation. .. py:function:: requiredfor_relation_form(rf_relation: mbdlyb_ui.functional.helpers.RequiredForRelation, root: mbdlyb.functional.gdb.GCluster) Render the required-for target, weight, and operating mode controls. :param rf_relation: Required-for relation being edited. :param root: Root cluster used to list eligible relation targets. .. py:function:: requiredfor_relation_repair_form(rf_relations: list[FormRequiredForRelation], initial_relation: FormRequiredForRelation) Render editable repair relations and associated costs. :param rf_relations: Editable required-for repair relations. :param initial_relation: Original required-for relation used for repair. .. py:function:: subfunction_relation_form(sf_relation: mbdlyb_ui.functional.helpers.SubfunctionOfRelation) Render the parent function and relation weight controls. :param sf_relation: Subfunction relation being edited. .. py:function:: tests_relation_form(t_relation: mbdlyb_ui.functional.helpers.TestsRelation) Render the tested node and relation weight controls. :param t_relation: Tests relation being edited.