xffl.workflow.templates.cwl =========================== .. py:module:: xffl.workflow.templates.cwl .. autoapi-nested-parse:: Collection of CWL-related template code Attributes ---------- .. autoapisummary:: xffl.workflow.templates.cwl.logger Classes ------- .. autoapisummary:: xffl.workflow.templates.cwl.CWLConfig xffl.workflow.templates.cwl.Workflow xffl.workflow.templates.cwl.AggregateStep xffl.workflow.templates.cwl.MainWorkflow xffl.workflow.templates.cwl.RoundWorkflow xffl.workflow.templates.cwl.TrainingStep Module Contents --------------- .. py:data:: logger :type: logging.Logger Default xFFL logger .. py:class:: CWLConfig Bases: :py:obj:`xffl.workflow.config.YamlConfig` Class modelling a CWL configuration file as a YamlConfig object .. py:method:: get_default_content() -> collections.abc.MutableMapping[str, Any] :classmethod: Returns a basic CWL configuration to be updated and saved into a .yml :return: Basic CWL configuration for xFFL :rtype: MutableMapping[str, Any] .. py:method:: add_inputs(facility_name: str, extra_inputs: collections.abc.MutableMapping[str, Any]) -> None Adds the CWL inputs to the YAML content :param facility_name: Facility's name :param extra_inputs: Extra inputs :type facility_name: str :type extra_inputs: MutableMapping[str, Any] .. py:class:: Workflow Bases: :py:obj:`abc.ABC` Abstract base class describing workflow-like objects .. py:attribute:: cwl :type: cwl_utils.parser.cwl_v1_2.Process .. py:method:: get_default_definition() -> cwl_utils.parser.cwl_v1_2.Process :classmethod: Returns the default workflow definition :return: Default workflow definition :rtype: cwl.Process() .. py:method:: save() -> collections.abc.MutableMapping[str, Any] Returns the current CWL Workflow definition :return: Current CWL Workflow definition :rtype: MutableMapping[str, Any] .. py:method:: add_inputs(facility_name: str, extra_inputs: collections.abc.MutableMapping[str, Any]) -> None :abstractmethod: Add the given extra inputs to the Workflow definition :param facility_name: Facility's name :type facility_name: str :param extra_inputs: Command line argument required by the executable script :type extra_inputs: MutableMapping[str, str] .. py:class:: AggregateStep Bases: :py:obj:`Workflow` Workflow describing the Federated Learning aggregation step .. py:method:: get_default_definition() -> cwl_utils.parser.cwl_v1_2.Process :classmethod: Get the CWL file standard content for a xFFL application aggregation step :return: CWL object instance of the xFFL aggregation step :rtype: cwl.Process() .. py:method:: add_inputs(facility_name: str, extra_inputs: collections.abc.MutableMapping[str, Any]) -> None Add the given extra inputs to the AggregateStep definition :param facility_name: Facility's name :type facility_name: str :param extra_inputs: Command line argument required by the executable script :type extra_inputs: MutableMapping[str, str] .. py:class:: MainWorkflow Bases: :py:obj:`Workflow` Main description of a Federated Learning workflow .. py:method:: get_default_definition() -> cwl_utils.parser.cwl_v1_2.Process :classmethod: Get the CWL main file standard content for a xFFL application :return: CWL object instance of the xFFL main workflow :rtype: cwl.Process .. py:method:: add_inputs(facility_name: str, extra_inputs: collections.abc.MutableMapping[str, Any]) -> None Add the given extra inputs to the MainWorkflow definition :param facility_name: Facility's name :type facility_name: str :param extra_inputs: Command line argument required by the executable script [name: cwl type] :type extra_inputs: MutableMapping[str, str] .. py:class:: RoundWorkflow Bases: :py:obj:`Workflow` Round workflow CWL description .. py:method:: get_default_definition() -> cwl_utils.parser.cwl_v1_2.Process :classmethod: Get the CWL round file standard content for a xFFL application :return: round.cwl template :rtype: cwl.Process .. py:method:: get_training_step(name: str) -> cwl_utils.parser.cwl_v1_2.Process :classmethod: Get the CWL file standard content for a xFFL application step :param name: Name of the facility on which the step will be executed :type name: str :return: Dict template of a CWL xFFL step :rtype: cwl.Process .. py:method:: add_inputs(facility_name: str, extra_inputs: collections.abc.MutableMapping[str, Any]) -> None Add the given extra inputs to the RoundWorkflow definition :param facility_name: Facility's name :type facility_name: str :param extra_inputs: Command line argument required by the executable script [name: cwl type] :type extra_inputs: MutableMapping[str, str] .. py:method:: update_merge_step() -> None Updates the merge step .. py:class:: TrainingStep Bases: :py:obj:`Workflow` Workflow modelling a training step .. py:method:: get_default_definition() -> cwl_utils.parser.cwl_v1_2.Process :classmethod: Get the CWL file standard content for a xFFL application training step :return: CWL object instance of a xFFL training step :rtype: cwl.Process .. py:method:: add_inputs(facility_name: str | None, extra_inputs: collections.abc.MutableMapping[str, Any]) -> None Add the given extra inputs to the TrainingStep definition :param facility_name: Facility's name :type facility_name: str :param extra_inputs: Command line argument required by the executable script [name: cwl type] :type extra_inputs: MutableMapping[str, str] .. py:method:: get_available_position() -> int