Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
janvonrickenbach committed Sep 2, 2024
1 parent 464ce43 commit c20b5ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/ansys/dpf/post/result_workflows/_build_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ def _create_result_workflows(
create_operator_callable: _CreateOperatorCallable,
create_workflow_inputs: _CreateWorkflowInputs,
) -> ResultWorkflows:
"""Internal function to create the result workflows. Use _create_result_workflows instead."""
"""Creates all the sub-workflows needed to compute a result.
The resulting workflows are stored in a ResultWorkflows object.
"""
initial_result_wf = _create_initial_result_workflow(
name=create_workflow_inputs.base_name,
server=server,
Expand Down
13 changes: 11 additions & 2 deletions src/ansys/dpf/post/result_workflows/_connect_workflow_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ansys.dpf.post.selection import Selection, _WfNames


def _connect_cyclic_inputs(expand_cyclic, phase_angle_cyclic, result_wf):
def _connect_cyclic_inputs(expand_cyclic, phase_angle_cyclic, result_wf: Workflow):
if expand_cyclic is not False:
# If expand_cyclic is a list
if isinstance(expand_cyclic, list) and len(expand_cyclic) > 0:
Expand Down Expand Up @@ -80,6 +80,11 @@ def _connect_initial_results_inputs(
streams_provider: Any,
data_sources: Any,
):
"""Connects the inputs of the initial result workflow.
The initial result workflow is the first workflow in the result workflows chain, which
extracts the raw results from the data sources.
"""
initial_result_workflow.connect_with(
selection.spatial_selection._selection,
output_input_names={"scoping": "mesh_scoping"},
Expand Down Expand Up @@ -118,12 +123,16 @@ def _connect_initial_results_inputs(
def _connect_averaging_eqv_and_principal_workflows(
result_workflows: ResultWorkflows,
):
"""Connects the averaging, equivalent, and principal workflows.
The order of these workflows depends on result_workflows.compute_equivalent_before_average.
Only one of equivalent_workflow or principal_workflow can be active at the same time.
"""
averaging_wf_connections = {
_WfNames.output_data: _WfNames.input_data,
_WfNames.skin: _WfNames.skin,
_WfNames.skin_input_mesh: _WfNames.skin_input_mesh,
}
# Only one of equivalent_workflow or principal_workflow can be active at the same time.
assert not (
result_workflows.equivalent_workflow is not None
and result_workflows.principal_workflow is not None
Expand Down
2 changes: 2 additions & 0 deletions src/ansys/dpf/post/result_workflows/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class _CreateOperatorCallable(Protocol):
# Callable to create an operator with a given name.
# This usually corresponds to model.operator
def __call__(self, name: str) -> Operator:
...

Expand Down

0 comments on commit c20b5ba

Please sign in to comment.