Skip to content

Commit

Permalink
rename -> insertable_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
prmukherj committed Apr 20, 2024
1 parent e4487da commit 0a30191
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/session_base_meshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def create_workflow(self):

@property
def PartManagement(self):
"""Datamdoel root of PartManagement."""
"""Datamodel root of ``PartManagement``."""
if self._part_management is None:
try:
pm_module = importlib.import_module(
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/fluent/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def insert_next_task(self, task_name: str):
)

@property
def next_tasks(self):
def insertable_tasks(self):
"""Tasks that can be inserted after the current task."""
return self._NextTask(self)

Expand Down Expand Up @@ -1480,7 +1480,7 @@ def _create_workflow(self, dynamic_interface: bool = True):
self._activate_dynamic_interface(dynamic_interface=dynamic_interface)

@property
def first_tasks(self):
def insertable_tasks(self):
"""Tasks that can be inserted on a blank workflow."""
return self._FirstTask(self)

Expand Down
26 changes: 15 additions & 11 deletions tests/test_new_meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,9 @@ def test_duplicate_tasks_in_workflow(new_mesh_session):
def test_object_oriented_task_inserting_in_workflows(new_mesh_session):
meshing = new_mesh_session
watertight = meshing.watertight()
assert sorted([repr(x) for x in watertight.import_geometry.next_tasks()]) == sorted(
assert sorted(
[repr(x) for x in watertight.import_geometry.insertable_tasks()]
) == sorted(
[
"<Insertable 'import_boi_geometry' task>",
"<Insertable 'set_up_rotational_periodic_boundaries' task>",
Expand All @@ -1383,19 +1385,21 @@ def test_object_oriented_task_inserting_in_workflows(new_mesh_session):
"set_up_rotational_periodic_boundaries"
not in watertight.get_available_task_names()
)
watertight.import_geometry.next_tasks.set_up_rotational_periodic_boundaries.insert()
watertight.import_geometry.insertable_tasks.set_up_rotational_periodic_boundaries.insert()
assert (
"set_up_rotational_periodic_boundaries" in watertight.get_available_task_names()
)
assert sorted([repr(x) for x in watertight.import_geometry.next_tasks()]) == sorted(
assert sorted(
[repr(x) for x in watertight.import_geometry.insertable_tasks()]
) == sorted(
[
"<Insertable 'import_boi_geometry' task>",
"<Insertable 'create_local_refinement_regions' task>",
"<Insertable 'custom_journal_task' task>",
]
)
watertight.import_geometry.next_tasks.import_boi_geometry.insert()
watertight.import_geometry.next_tasks.import_boi_geometry.insert()
watertight.import_geometry.insertable_tasks.import_boi_geometry.insert()
watertight.import_geometry.insertable_tasks.import_boi_geometry.insert()
assert "import_boi_geometry" in watertight.get_available_task_names()
assert "import_boi_geometry_1" in watertight.get_available_task_names()
time.sleep(1)
Expand Down Expand Up @@ -1426,7 +1430,7 @@ def test_created_workflow(new_mesh_session):
meshing = new_mesh_session
created_workflow = meshing.create_workflow()

assert sorted([repr(x) for x in created_workflow.first_tasks()]) == sorted(
assert sorted([repr(x) for x in created_workflow.insertable_tasks()]) == sorted(
[
"<Insertable 'import_geometry' task>",
"<Insertable 'load_cad_geometry' task>",
Expand All @@ -1435,18 +1439,18 @@ def test_created_workflow(new_mesh_session):
]
)

created_workflow.first_tasks.import_geometry.insert()
created_workflow.insertable_tasks.import_geometry.insert()

assert created_workflow.first_tasks() == []
assert created_workflow.insertable_tasks() == []

time.sleep(2.5)

assert "<Insertable 'add_local_sizing' task>" in [
repr(x) for x in created_workflow.import_geometry.next_tasks()
repr(x) for x in created_workflow.import_geometry.insertable_tasks()
]
created_workflow.import_geometry.next_tasks.add_local_sizing.insert()
created_workflow.import_geometry.insertable_tasks.add_local_sizing.insert()
assert "<Insertable 'add_local_sizing' task>" not in [
repr(x) for x in created_workflow.import_geometry.next_tasks()
repr(x) for x in created_workflow.import_geometry.insertable_tasks()
]
assert sorted(created_workflow.get_available_task_names()) == sorted(
["import_geometry", "add_local_sizing"]
Expand Down

0 comments on commit 0a30191

Please sign in to comment.