ansys.fluent.core.workflow#
Workflow module that wraps and extends the core functionality.
Classes:
|
Wrapper for a single task argument. |
|
Wrapper for a dictionary of task arguments. |
|
Base class Task representation for wrapping a Workflow TaskObject instance, adding methods to discover more about the relationships between TaskObjects. |
|
Wraps a meshing workflow object. |
|
Intermediate base class task representation for wrapping a Workflow TaskObject instance, adding attributes related to commanding. |
|
Composite task representation for wrapping a Workflow TaskObject instance of TaskType Composite. |
|
Compound Child representation for wrapping a Workflow TaskObject instance of TaskType Compound Child. |
|
Compound task representation for wrapping a Workflow TaskObject instance of TaskType Compound. |
|
Conditional task representation for wrapping a Workflow TaskObject instance of TaskType Conditional. |
|
Removes set_state() to implement read-only behaviour. |
|
Simple task representation for wrapping a Workflow TaskObject instance of TaskType Simple. |
|
Wrap a workflow TaskObject container. |
|
Wraps a workflow object, adding methods to discover more about the relationships between task objects. |
Exceptions:
|
Raised when an attempt to create an instance of a task command fails. |
Functions:
|
Convert camel case input string to snake case output string. |
|
Populate the snake-case attribute map and return camel case of the passed attribute. |
- class ansys.fluent.core.workflow.ArgumentWrapper(task, arg)#
Bases:
PyCallableStateObject
Wrapper for a single task argument.
Methods:
__init__
(task, arg)Initialize ArgumentWrapper.
get_state
([explicit_only])Get the state of this argument.
set_state
(value)Set the state of the argument.
- __init__(task, arg)#
Initialize ArgumentWrapper.
- Parameters:
- task
BaseTask
The task holding these arguments.
- arg: str
Argument name.
- task
- get_state(explicit_only=False)#
Get the state of this argument.
- Parameters:
- explicit_onlybool
Whether to return the explicitly set value or the full derived value.
- set_state(value)#
Set the state of the argument.
- Parameters:
- value
Any
Value of the argument.
- value
- class ansys.fluent.core.workflow.ArgumentsWrapper(task)#
Bases:
PyCallableStateObject
Wrapper for a dictionary of task arguments.
Methods:
__init__
(task)Initialize ArgumentsWrapper.
get_state
([explicit_only])Get the state of the arguments.
set_state
(args)Overwrite arguments.
update_dict
(args)Merge with arguments.
- get_state(explicit_only=False)#
Get the state of the arguments.
- Parameters:
- explicit_onlybool
Whether to only include explicitly set values. Otherwise, all values are included.
- set_state(args)#
Overwrite arguments.
- Parameters:
- args
dict
State of the arguments.
- args
- Raises:
ValueError
If input is invalid.
- update_dict(args)#
Merge with arguments.
- Parameters:
- args
dict
State of the arguments.
- args
- Raises:
ValueError
If input is invalid.
- class ansys.fluent.core.workflow.BaseTask(command_source, task)#
Bases:
object
Base class Task representation for wrapping a Workflow TaskObject instance, adding methods to discover more about the relationships between TaskObjects.
Methods
get_direct_upstream_tasks()
get_direct_downstream_tasks()
tasks()
inactive_tasks()
get_id()
get_idx()
__getattr__(attr)
__setattr__(attr, value)
__dir__()
__call__()
Methods:
__init__
(command_source, task)Initialize BaseTask.
Add a child task.
delete
()Delete this task from the workflow.
Display name.
Get the list of tasks downstream of this one and directly connected by a data dependency.
Get the list of tasks upstream of this one and directly connected by a data dependency.
get_id
()Get the unique string identifier of this task, as it is in the application.
get_idx
()Get the unique integer index of this task, as it is in the application.
Get the inactive ordered child list.
Insert a compound child task.
Get the Pythonic name of this task from the underlying application.
rename
(new_name)Rename the current task to a given name.
Get the list of the Python names for the available tasks.
tasks
([recompute])Get the ordered task list held by this task.
update_child_tasks
(setup_type_changed)Update child tasks.
Attributes:
Tasks that can be inserted after the current task.
- __init__(command_source, task)#
Initialize BaseTask.
- Parameters:
- command_source
WorkflowWrapper
Set of workflow commands.
- task
str
Name of this task.
- command_source
- add_child_to_task()#
Add a child task.
- delete()#
Delete this task from the workflow.
- display_name()#
Display name.
- get_direct_downstream_tasks()#
Get the list of tasks downstream of this one and directly connected by a data dependency.
- Returns:
list
Downstream task list.
- get_direct_upstream_tasks()#
Get the list of tasks upstream of this one and directly connected by a data dependency.
- Returns:
list
Upstream task list.
- get_id()#
Get the unique string identifier of this task, as it is in the application.
- Returns:
str
The string identifier.
- get_idx()#
Get the unique integer index of this task, as it is in the application.
- Returns:
int
The integer index.
- insert_compound_child_task()#
Insert a compound child task.
- property insertable_tasks#
Tasks that can be inserted after the current task.
- python_name()#
Get the Pythonic name of this task from the underlying application.
- Returns:
str
Pythonic name of the task.
- rename(new_name)#
Rename the current task to a given name.
- task_names()#
Get the list of the Python names for the available tasks.
- tasks(recompute=True)#
Get the ordered task list held by this task.
This method sort tasks in terms of the workflow order and only includes this task’s top-level tasks. You can obtain other tasks by calling the
tasks()
method on a parent task.Given the workflow:
Workflow ├── A ├── B │ ├── C │ └── D └── E
C and D are the ordered children of task B.
- Returns:
list
Ordered children.
- update_child_tasks(setup_type_changed)#
Update child tasks.
- class ansys.fluent.core.workflow.ClassicWorkflow(workflow, command_source, fluent_version)#
Bases:
object
Wraps a meshing workflow object.
Methods
__getattr__(attr)
__dir__()
__call__()
Attributes:
Get a TaskObject container wrapper that 'holds' the underlying TaskObjects.
Methods:
__init__
(workflow, command_source, ...)Initialize ClassicWorkflow.
- property TaskObject: TaskContainer#
Get a TaskObject container wrapper that ‘holds’ the underlying TaskObjects.
The wrapper adds extra functionality.
- __init__(workflow, command_source, fluent_version)#
Initialize ClassicWorkflow.
- Parameters:
- workflow
PyMenuGeneric
The workflow object.
- command_source
PyMenuGeneric
The application root for commanding.
- workflow
- exception ansys.fluent.core.workflow.CommandInstanceCreationError(task_name)#
Bases:
RuntimeError
Raised when an attempt to create an instance of a task command fails.
- __init__(task_name)#
- class ansys.fluent.core.workflow.CommandTask(command_source, task)#
Bases:
BaseTask
Intermediate base class task representation for wrapping a Workflow TaskObject instance, adding attributes related to commanding.
Classes without these attributes cannot be commanded.
Methods:
__init__
(command_source, task)Initialize CommandTask.
Attributes:
Get the task's arguments.
Get the task's arguments in read-only form (deprecated).
- __init__(command_source, task)#
Initialize CommandTask.
- Parameters:
- command_source
WorkflowWrapper
The set of workflow commands.
- task
str
The name of this task.
- command_source
- property arguments: ArgumentsWrapper#
Get the task’s arguments.
- Returns:
ArgumentsWrapper
The task’s arguments.
- property command_arguments: ReadOnlyObject#
Get the task’s arguments in read-only form (deprecated).
- Returns:
ReadOnlyObject
The task’s arguments.
- class ansys.fluent.core.workflow.CompositeTask(command_source, task)#
Bases:
BaseTask
Composite task representation for wrapping a Workflow TaskObject instance of TaskType Composite.
Methods:
__init__
(command_source, task)Initialize CompositeTask.
insert_composite_child_task
(command_name)Insert a composite child task based on the Python name.
Attributes:
Get the task's arguments (empty for CompositeTask).
Get the task's arguments in read-only form (deprecated).
- __init__(command_source, task)#
Initialize CompositeTask.
- Parameters:
- command_source
WorkflowWrapper
The set of workflow commands.
- task
str
The name of this task.
- command_source
- property arguments: dict#
Get the task’s arguments (empty for CompositeTask).
- Returns:
dict
The task’s arguments (empty).
- property command_arguments: ReadOnlyObject#
Get the task’s arguments in read-only form (deprecated).
- Returns:
ReadOnlyObject
The task’s arguments.
- insert_composite_child_task(command_name)#
Insert a composite child task based on the Python name.
- class ansys.fluent.core.workflow.CompoundChild(command_source, task)#
Bases:
SimpleTask
Compound Child representation for wrapping a Workflow TaskObject instance of TaskType Compound Child.
Methods:
__init__
(command_source, task)Initialize CompoundChild.
- class ansys.fluent.core.workflow.CompoundTask(command_source, task)#
Bases:
CommandTask
Compound task representation for wrapping a Workflow TaskObject instance of TaskType Compound.
Methods:
__init__
(command_source, task)Initialize CompoundTask.
add_child_and_update
([state, defer_update])Add a child to this CompoundTask and update.
compound_child
(name)Get the compound child task of this CompoundTask by name.
Get the last child of this CompoundTask.
- __init__(command_source, task)#
Initialize CompoundTask.
- Parameters:
- command_source
WorkflowWrapper
The set of workflow commands.
- task
str
The name of this task.
- command_source
- add_child_and_update(state=None, defer_update=None)#
Add a child to this CompoundTask and update.
- compound_child(name)#
Get the compound child task of this CompoundTask by name.
- class ansys.fluent.core.workflow.ConditionalTask(command_source, task)#
Bases:
CommandTask
Conditional task representation for wrapping a Workflow TaskObject instance of TaskType Conditional.
Methods:
__init__
(command_source, task)Initialize ConditionalTask.
Get the inactive ordered task list held by this task.
- class ansys.fluent.core.workflow.ReadOnlyObject(cmd)#
Bases:
object
Removes set_state() to implement read-only behaviour.
Methods:
__init__
(cmd)Initialize this object.
Get the read-only status of this object.
- __init__(cmd)#
Initialize this object.
- is_read_only()#
Get the read-only status of this object.
- class ansys.fluent.core.workflow.SimpleTask(command_source, task)#
Bases:
CommandTask
Simple task representation for wrapping a Workflow TaskObject instance of TaskType Simple.
Methods:
__init__
(command_source, task)Initialize SimpleTask.
tasks
([recompute])Get the ordered task list held by the workflow.
- __init__(command_source, task)#
Initialize SimpleTask.
- Parameters:
- command_source
WorkflowWrapper
The set of workflow commands.
- task
str
The name of this task.
- command_source
- tasks(recompute=True)#
Get the ordered task list held by the workflow.
SimpleTasks have no TaskList.
- class ansys.fluent.core.workflow.TaskContainer(command_source)#
Bases:
PyCallableStateObject
Wrap a workflow TaskObject container.
Methods
__iter__()
__getitem__(attr)
__getattr__(attr)
__dir__()
Methods:
__init__
(command_source)Initialize TaskContainer.
Get state.
items
()Get state items.
- __init__(command_source)#
Initialize TaskContainer.
- Parameters:
- command_source
WorkflowWrapper
The set of workflow commands.
- command_source
- get_state()#
Get state.
- items()#
Get state items.
- class ansys.fluent.core.workflow.Workflow(workflow, command_source, fluent_version)#
Bases:
object
Wraps a workflow object, adding methods to discover more about the relationships between task objects.
Methods
tasks()
__getattr__(attr)
__dir__()
__call__()
Methods:
__init__
(workflow, command_source, ...)Initialize WorkflowWrapper.
delete_tasks
(list_of_tasks)Delete the provided list of tasks.
Get the inactive ordered task list held by this task.
load_state
(list_of_roots)Load the state of the workflow.
save_workflow
(file_path)Save the current workflow to the location provided.
task
(name)Get a TaskObject by name, in a
BaseTask
wrapper.Get the list of the Python names for the available tasks.
tasks
([recompute])Get the ordered task list held by the workflow.
Attributes:
Tasks that can be inserted on a blank workflow.
- __init__(workflow, command_source, fluent_version)#
Initialize WorkflowWrapper.
- Parameters:
- workflow
PyMenuGeneric
The workflow object.
- command_source
PyMenuGeneric
The application root for commanding.
- workflow
- delete_tasks(list_of_tasks)#
Delete the provided list of tasks.
- Parameters:
- list_of_tasks: list[str]
List of task items.
- Returns:
- Raises:
ValueError
If ‘task’ does not match a task name, no tasks are deleted.
- static inactive_tasks()#
Get the inactive ordered task list held by this task.
- Returns:
list
Inactive ordered children.
- property insertable_tasks#
Tasks that can be inserted on a blank workflow.
- load_state(list_of_roots)#
Load the state of the workflow.
- save_workflow(file_path)#
Save the current workflow to the location provided.
- task(name)#
Get a TaskObject by name, in a
BaseTask
wrapper.The wrapper adds extra functionality.
- Parameters:
- name
str
Task name - the display name, not the internal ID.
- Returns
- ——-
- BaseTask
wrapped task object.
- name
- task_names()#
Get the list of the Python names for the available tasks.
- tasks(recompute=True)#
Get the ordered task list held by the workflow.
This method sort tasks in terms of the workflow order and only includes this task’s top-level tasks. You can obtain other tasks by calling the
tasks()
method on a parent task.Consider the following workflow.
Given the workflow:
Workflow ├── A ├── B │ ├── C │ └── D └── E
The ordered children of the workflow are A, B, E, while B has ordered children C and D.
- ansys.fluent.core.workflow.camel_to_snake_case(camel_case_str)#
Convert camel case input string to snake case output string.
- ansys.fluent.core.workflow.snake_to_camel_case(snake_case_str, camel_case_strs)#
Populate the snake-case attribute map and return camel case of the passed attribute.