Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update container level operations. #2336

Merged
merged 5 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ansys/fluent/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ def _tasks_with_matching_attributes(self, attr: str, other_attr: str) -> list:
matches.append(task)
return matches

def display_name(self):
return self._name_()


class TaskContainer(PyCallableStateObject):
"""Wrap a workflow TaskObject container.
Expand Down Expand Up @@ -381,6 +384,9 @@ def __dir__(self):
)
)

def items(self):
return self._task_container.get_state().items()
prmukherj marked this conversation as resolved.
Show resolved Hide resolved

def get_state(self):
return self._task_container.get_state()

Expand Down
32 changes: 32 additions & 0 deletions tests/test_meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,35 @@ def test_fault_tolerant_workflow(exhaust_system_geometry, new_mesh_session):
}
)
import_cad.Execute()


@pytest.mark.codegen_required
def test_modified_workflow(new_mesh_session):
meshing = new_mesh_session
meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")

task_object_display_names = {
"Import Geometry",
"Add Local Sizing",
"Generate the Surface Mesh",
"Describe Geometry",
"Apply Share Topology",
"Enclose Fluid Regions (Capping)",
"Update Boundaries",
"Create Regions",
"Update Regions",
"Add Boundary Layers",
"Generate the Volume Mesh",
}

task_display_names = []
for task in meshing.workflow.TaskObject:
task_display_names.append(task.display_name())

assert set(task_display_names) == task_object_display_names

task_display_names = []
for name, _ in meshing.workflow.TaskObject.items():
task_display_names.append(name)

assert set(task_display_names) == task_object_display_names