Skip to content

Commit cfc74ac

Browse files
committed
refactor: add typing for workflow record function
1 parent efb5170 commit cfc74ac

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/ansys/dpf/core/workflow.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
server_meet_version_and_raise,
4242
version_requires,
4343
)
44+
from ansys.dpf.core.server_types import BaseServer
4445
from ansys.dpf.gate import (
4546
data_processing_capi,
4647
data_processing_grpcapi,
@@ -624,13 +625,15 @@ def record(self, identifier="", transfer_ownership=True):
624625
return self._api.work_flow_record_instance(self, identifier, transfer_ownership)
625626

626627
@staticmethod
627-
def get_recorded_workflow(id, server=None):
628+
def get_recorded_workflow(id: int, server: BaseServer | None = None) -> Workflow:
628629
"""Retrieve a workflow registered (with workflow.record()).
629630
630631
Parameters
631632
----------
632633
id : int
633634
ID given by the method "record".
635+
server: server.BaseServer
636+
Server from which to get the recorded workflow.
634637
635638
Returns
636639
-------
@@ -659,12 +662,12 @@ def get_recorded_workflow(id, server=None):
659662
return wf
660663

661664
@property
662-
def info(self):
665+
def info(self) -> dict[str, list[str]]:
663666
"""Dictionary with the operator names and the exposed input and output names.
664667
665668
Returns
666669
-------
667-
info : dictionarry str->list str
670+
info : dictionary str->list str
668671
Dictionary with ``"operator_names"``, ``"input_names"``, and ``"output_names"`` key.
669672
"""
670673
return {
@@ -674,7 +677,7 @@ def info(self):
674677
}
675678

676679
@property
677-
def operator_names(self):
680+
def operator_names(self) -> list[str]:
678681
"""List of the names of operators added in the workflow.
679682
680683
Returns
@@ -688,7 +691,7 @@ def operator_names(self):
688691
return out
689692

690693
@property
691-
def input_names(self):
694+
def input_names(self) -> list[str]:
692695
"""List of the input names exposed in the workflow with set_input_name.
693696
694697
Returns
@@ -702,7 +705,7 @@ def input_names(self):
702705
return out
703706

704707
@property
705-
def output_names(self):
708+
def output_names(self) -> list[str]:
706709
"""List of the output names exposed in the workflow with set_output_name.
707710
708711
Returns

0 commit comments

Comments
 (0)