Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
210a1af
feat: Update client side 'enhanced' meshing workflow to use server si…
prmukherj Nov 12, 2025
101d833
chore: adding changelog file 4600.added.md [dependabot-skip]
pyansys-ci-bot Nov 12, 2025
72bc722
Add test for renaming, deletion and insertion.
prmukherj Nov 12, 2025
fe3cc4a
Added the update workflow file.
prmukherj Nov 17, 2025
9a33809
Update Meshing workflow.
prmukherj Nov 21, 2025
74a5b01
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj Nov 26, 2025
00f9b29
Merge branch 'feat/update_enhanced_meshing_workflow_to_use_meshing_wo…
prmukherj Nov 26, 2025
dbca074
Update
prmukherj Nov 28, 2025
f4a922e
Updates.
prmukherj Nov 28, 2025
a02a71d
Updated behaviour.
prmukherj Dec 10, 2025
7f930a5
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj Dec 10, 2025
5774525
Monkey patch environment variable.
prmukherj Dec 10, 2025
efcfa19
Update generated task names.
prmukherj Dec 16, 2025
2729cfe
Merge branch 'main' into feat/update_enhanced_meshing_workflow_to_use…
prmukherj Dec 16, 2025
fff3e77
Added docstrings.
prmukherj Dec 16, 2025
dc05be2
Added docstrings.
prmukherj Dec 16, 2025
29780fb
Updates.
prmukherj Dec 16, 2025
4e876b0
Pass down meshing root from the top level.
prmukherj Dec 17, 2025
d96526f
Fixes.
prmukherj Dec 17, 2025
b787792
Remove unnecessary comments.
prmukherj Dec 17, 2025
1672f12
Minor updates.
prmukherj Dec 17, 2025
dcff47f
Minor updates.
prmukherj Dec 17, 2025
3935020
Minor updates.
prmukherj Dec 17, 2025
9919d07
Minor updates.
prmukherj Dec 17, 2025
5ae4d88
Refactor.
prmukherj Dec 17, 2025
51b7d6c
Have inline comments.
prmukherj Dec 17, 2025
bb9ece0
Rename _task_list.
prmukherj Dec 17, 2025
1a63519
Mark workflow tests as nightly.
prmukherj Dec 17, 2025
42eb0eb
Refactor and clean up.
prmukherj Dec 17, 2025
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
Prev Previous commit
Refactor and clean up.
  • Loading branch information
prmukherj committed Dec 17, 2025
commit 42eb0eba55fb09e431a5130abe154ec0b03ccd08
72 changes: 28 additions & 44 deletions src/ansys/fluent/core/workflow_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,10 @@ def __init__(

def _get_next_possible_tasks(self):
"""Get display names of tasks that can be inserted after this task."""
task_obj = super().__getattribute__("_task_object")
task_obj = self._task_object
ret_list = []
for item in task_obj.get_next_possible_tasks():
snake_case_name = command_name_to_task_name(
super().__getattribute__("_meshing_root"), item
)
snake_case_name = command_name_to_task_name(self._meshing_root, item)
if snake_case_name != item:
self._cache[snake_case_name] = item
ret_list.append(snake_case_name)
Expand All @@ -618,10 +616,9 @@ def _insert_next_task(self, task_name):
-----
Internal method. Users should use `insertable_tasks.<task>.insert()` instead.
"""
task_obj = super().__getattribute__("_task_object")
self.get_next_possible_tasks()
self._get_next_possible_tasks()
command_name = self._cache.get(task_name) or task_name
task_obj.insert_next_task(command_name=command_name)
self._task_object.insert_next_task(command_name=command_name)

@property
def insertable_tasks(self):
Expand Down Expand Up @@ -739,32 +736,30 @@ def __getattr__(self, item):
-----
Arguments take precedence over task object properties.
"""
task_obj = super().__getattribute__("_task_object")
task_obj = self._task_object
args = task_obj.arguments
if item in args():
return getattr(args, item)
return getattr(task_obj, item)

def __setattr__(self, key, value):
"""Enable attribute assignment to task arguments."""
task_obj = super().__getattribute__("_task_object")
args = task_obj.arguments
args = self._task_object.arguments
if hasattr(args, key):
setattr(args, key, value)
else:
super().__setattr__(key, value)

def __call__(self):
"""Execute the task when called as a function."""
task_obj = super().__getattribute__("_task_object")
return task_obj.execute()
return self._task_object.execute()

def __getitem__(self, key):
task_obj = super().__getattribute__("_task_object")
name = super().__getattribute__("_name")
workflow = super().__getattribute__("_workflow")
parent = super().__getattribute__("_parent")
meshing_root = super().__getattribute__("_meshing_root")
task_obj = self._task_object
name = self._name
workflow = self._workflow
parent = self._parent
meshing_root = self._meshing_root
name_1 = name
name_2 = re.sub(r"\s+\d+$", "", task_obj.name().strip()) + f" {key}"
try:
Expand Down Expand Up @@ -800,12 +795,9 @@ def __delitem__(self, key):

def _task_names(self):
"""Gets the display names of the child tasks of a task item."""
task_obj = super().__getattribute__("_task_object")
task_list = task_obj.task_list()
task_list = self._task_object.task_list()
if task_list:
return _convert_task_list_to_display_names(
super().__getattribute__("_workflow"), task_list
)
return _convert_task_list_to_display_names(self._workflow, task_list)
else:
return []

Expand All @@ -821,8 +813,7 @@ def children(self):
if not child_names:
return []

workflow = super().__getattribute__("_workflow")
meshing_root = super().__getattribute__("_meshing_root")
workflow = self._workflow

# Create reverse lookup: display name -> task type
name_to_type = {
Expand All @@ -842,7 +833,7 @@ def children(self):
task_type,
workflow,
self,
meshing_root,
self._meshing_root,
)
wrapped_children.append(wrapped)

Expand Down Expand Up @@ -878,7 +869,7 @@ def first_child(self):
first_name = task_list[0]
else:
return None
workflow = super().__getattribute__("_workflow")
workflow = self._workflow

type_to_name = {
item.split(":")[0]: item.split(":")[-1] for item in workflow.task_object()
Expand All @@ -890,7 +881,7 @@ def first_child(self):
key,
workflow,
self,
super().__getattribute__("_meshing_root"),
self._meshing_root,
)

def last_child(self):
Expand All @@ -913,7 +904,7 @@ def last_child(self):
last_name = task_list[-1]
else:
return None
workflow = super().__getattribute__("_workflow")
workflow = self._workflow

type_to_name = {
item.split(":")[0]: item.split(":")[-1] for item in workflow.task_object()
Expand All @@ -925,7 +916,7 @@ def last_child(self):
key,
workflow,
self,
super().__getattribute__("_meshing_root"),
self._meshing_root,
)

@staticmethod
Expand Down Expand Up @@ -1006,8 +997,7 @@ def parent(self):
- Workflow instance for top-level tasks
- TaskObject instance for nested child tasks
"""
parent = super().__getattribute__("_parent")
return parent
return self._parent

def has_next(self) -> bool:
"""Check if there is a next sibling task.
Expand All @@ -1020,8 +1010,7 @@ def has_next(self) -> bool:
bool
True if a next sibling exists, False if this is the last task.
"""
parent = super().__getattribute__("_parent")
task_dict = parent._ordered_tasks()
task_dict = self._parent._ordered_tasks()
try:
self._get_next_key(task_dict, self.name())
return True
Expand All @@ -1030,8 +1019,7 @@ def has_next(self) -> bool:

def next(self):
"""Returns the next sibling task item."""
parent = super().__getattribute__("_parent")
task_dict = parent._ordered_tasks()
task_dict = self._parent._ordered_tasks()
next_key = self._get_next_key(task_dict, self.name())
return task_dict[next_key]

Expand All @@ -1046,8 +1034,7 @@ def has_previous(self) -> bool:
bool
True if a previous sibling exists, False if this is the first task.
"""
parent = super().__getattribute__("_parent")
task_dict = parent._ordered_tasks()
task_dict = self._parent._ordered_tasks()
try:
self._get_previous_key(task_dict, self.name())
return True
Expand All @@ -1056,17 +1043,15 @@ def has_previous(self) -> bool:

def previous(self):
"""Returns the previous sibling task item."""
parent = super().__getattribute__("_parent")
task_dict = parent._ordered_tasks()
task_dict = self._parent._ordered_tasks()
previous_key = self._get_previous_key(task_dict, self.name())
return task_dict[previous_key]

def _ordered_tasks(self):
if not self._task_names():
return OrderedDict()

workflow = super().__getattribute__("_workflow")
meshing_root = super().__getattribute__("_meshing_root")
workflow = self._workflow

# Create lightweight lookup: task type -> display name
type_to_name = dict(item.split(":") for item in workflow.task_object())
Expand All @@ -1085,7 +1070,7 @@ def _ordered_tasks(self):
task_type,
workflow,
self,
meshing_root,
self._meshing_root,
)
sorted_dict[display_name] = wrapped
break
Expand All @@ -1094,8 +1079,7 @@ def _ordered_tasks(self):

def delete(self):
"""Deletes the task item on which it is called."""
workflow = super().__getattribute__("_workflow")
workflow.general.delete_tasks(list_of_tasks=[self.name()])
self._workflow.general.delete_tasks(list_of_tasks=[self.name()])

def __repr__(self):
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_server_meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ def test_watertight_workflow(
add_local_sizing.add_child = True
add_local_sizing.boi_face_label_list = ["cold-inlet", "hot-inlet"]
add_local_sizing.add_child_and_update()
assert add_local_sizing._task_list() == ["facesize_1"]
assert add_local_sizing._task_names() == ["facesize_1"]
assert watertight.add_local_sizing_wtm_child_1.name() == "facesize_1"
assert watertight.add_local_sizing_wtm["facesize_1"].name() == "facesize_1"

Expand Down