Skip to content
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
7 changes: 5 additions & 2 deletions src/ansys/fluent/core/filereader/case_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def __init__(self, raw_data: list) -> None:


class CaseVariable:
"""Provides access to variables defined in the case"""
"""Provides access to variables defined in the case."""

def __init__(self, variables: dict, path: Optional[str] = ""):
"""Initialize CaseVariable.
Expand Down Expand Up @@ -225,6 +225,7 @@ class Mesh:
"""

def __init__(self, file_handle):
"""Initialize the object."""
self._file_handle = file_handle

def get_surface_ids(self) -> list:
Expand Down Expand Up @@ -479,6 +480,7 @@ def config_var(self) -> CaseVariable:
return CaseVariable(self._config_vars)

def has_config_var(self, name):
"""Get whether the case has a given variable."""
return name in self._config_vars

def _named_expressions(self):
Expand Down Expand Up @@ -605,12 +607,13 @@ def __init__(
self._mesh = Mesh(_file)

def get_mesh(self):
"""Get the mesh data."""
return self._mesh


def _get_processed_string(input_string: bytes) -> str:
"""Processes the input string (binary) with help of an identifier to return
it in a format which can be parsed by lispy.parse()
it in a format which can be parsed by lispy.parse().

Parameters
----------
Expand Down
1 change: 1 addition & 0 deletions src/ansys/fluent/core/meshing/meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from typing import Optional

from ansys.fluent.core.services.datamodel_se import PyMenuGeneric
from ansys.fluent.core.workflow import WorkflowWrapper


Expand Down
2 changes: 2 additions & 0 deletions src/ansys/fluent/core/session_pure_meshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ def workflow(self):
return self._base_meshing.workflow

def watertight(self, dynamic_interface=True):
"""Get a new watertight workflow."""
self.workflow.watertight(dynamic_interface)
return self.workflow

def fault_tolerant(self, dynamic_interface=True):
"""Get a new fault-tolerant workflow."""
self.workflow.fault_tolerant(dynamic_interface)
return self.workflow

Expand Down
21 changes: 12 additions & 9 deletions src/ansys/fluent/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Any, Iterator, List, Optional, Tuple
import warnings

from ansys.fluent.core.services.datamodel_se import PyCallableStateObject
from ansys.fluent.core.services.datamodel_se import PyCallableStateObject, PyMenuGeneric

logger = logging.getLogger("pyfluent.datamodel")

Expand Down Expand Up @@ -77,6 +77,7 @@ def _refresh_task_accessors(obj):
class BaseTask:
"""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()
Expand Down Expand Up @@ -134,7 +135,7 @@ def get_direct_upstream_tasks(self) -> list:

Returns
-------
upstreams : list
list
Upstream task list.
"""
return self._tasks_with_matching_attributes(
Expand Down Expand Up @@ -200,7 +201,7 @@ def _task_by_id(task_id):
return self._ordered_children

def inactive_ordered_children(self) -> list:
"""Get the inactive ordered child list
"""Get the inactive ordered child list.

Returns
-------
Expand Down Expand Up @@ -424,7 +425,7 @@ def __setitem__(self, key, value):


class ArgumentWrapper(PyCallableStateObject):
"""Wrapper for a single task argument"""
"""Wrapper for a single task argument."""

def __init__(self, task: BaseTask, arg: str) -> None:
"""Initialize ArgumentWrapper.
Expand Down Expand Up @@ -551,7 +552,7 @@ def __init__(self, command_source: WorkflowWrapper, task: str) -> None:
super().__init__(command_source, task)

def ordered_children(self, recompute=True) -> list:
"""Get the ordered task list held by the workflow. SimpleTasks have no TaskList"""
"""Get the ordered task list held by the workflow. SimpleTasks have no TaskList."""
return []


Expand Down Expand Up @@ -651,7 +652,7 @@ def inactive_ordered_children(self) -> list:

Returns
-------
children : list
list
Inactive ordered children.
"""
return [
Expand Down Expand Up @@ -798,7 +799,7 @@ def task(self, name: str) -> BaseTask:

Returns
-------
task : BaseTask
BaseTask
wrapped task object.
"""
return _makeTask(self, name)
Expand Down Expand Up @@ -868,7 +869,7 @@ def inactive_ordered_children(self) -> list:

Returns
-------
children : list
list
Inactive ordered children.
"""
return []
Expand Down Expand Up @@ -963,14 +964,16 @@ def refresh_after_sleep(_):


class ReadOnlyObject:
"""Removes 'set_state()' attribute to implement read-only behaviour."""
"""Removes set_state() to implement read-only behaviour."""

_unwanted_attr = ["set_state", "setState"]

def __init__(self, cmd):
"""Initialize this object."""
self._cmd = cmd

def is_read_only(self):
"""Get the read-only status of this object."""
return True

def __getattr__(self, attr):
Expand Down