Skip to content

Commit

Permalink
fix: updated Workflow.get_topology() to use derived classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo-Baussart-ANSYS committed Nov 21, 2024
1 parent e75cfbc commit 849d50f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/ansys/dpf/core/dpf_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ def _type_to_output_method(self):
collection_base,
any,
)
from ansys.dpf.core.workflow_topology import workflow_topology

out = [
(any.Any, self._api.operator_getoutput_as_any),
Expand Down Expand Up @@ -466,6 +467,11 @@ def _type_to_output_method(self):
self._api.operator_getoutput_as_any,
lambda obj, type: any.Any(server=self._server, any_dpf=obj).cast(type),
),
(
workflow_topology.WorkflowTopology,
None,
"WorkflowTopology",
),
]
if hasattr(self._api, "operator_getoutput_generic_data_container"):
out.append(
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ def get_topology(self):
workflow_to_workflow_topology_op.inputs.workflow.connect(self)
workflow_topology_container = workflow_to_workflow_topology_op.outputs.workflow_topology()

Check warning on line 960 in src/ansys/dpf/core/workflow.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/dpf/core/workflow.py#L958-L960

Added lines #L958 - L960 were not covered by tests

return WorkflowTopology(workflow_topology_container)
return workflow_topology_container

Check warning on line 962 in src/ansys/dpf/core/workflow.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/dpf/core/workflow.py#L962

Added line #L962 was not covered by tests

def __del__(self):
try:
Expand Down

0 comments on commit 849d50f

Please sign in to comment.