ansys-fluent-core 0.30.dev2__py3-none-any.whl → 0.30.dev4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansys-fluent-core might be problematic. Click here for more details.
- ansys/fluent/core/__init__.py +14 -3
- ansys/fluent/core/codegen/datamodelgen.py +17 -3
- ansys/fluent/core/codegen/settingsgen.py +26 -4
- ansys/fluent/core/codegen/walk_api.py +11 -1
- ansys/fluent/core/exceptions.py +7 -4
- ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
- ansys/fluent/core/generated/datamodel_242/meshing_utilities.pyi +990 -0
- ansys/fluent/core/generated/datamodel_251/meshing_utilities.pyi +1002 -0
- ansys/fluent/core/generated/datamodel_252/meshing.py +7 -0
- ansys/fluent/core/generated/datamodel_252/meshing_utilities.pyi +1007 -0
- ansys/fluent/core/generated/datamodel_252/preferences.py +132 -3
- ansys/fluent/core/generated/fluent_version_252.py +3 -3
- ansys/fluent/core/generated/meshing/tui_252.py +111 -12
- ansys/fluent/core/generated/solver/settings_222.py +166 -170
- ansys/fluent/core/generated/solver/settings_222.pyi +10 -8
- ansys/fluent/core/generated/solver/settings_231.py +551 -598
- ansys/fluent/core/generated/solver/settings_231.pyi +40 -38
- ansys/fluent/core/generated/solver/settings_232.py +689 -736
- ansys/fluent/core/generated/solver/settings_232.pyi +39 -37
- ansys/fluent/core/generated/solver/settings_241.py +1365 -1439
- ansys/fluent/core/generated/solver/settings_241.pyi +1071 -1074
- ansys/fluent/core/generated/solver/settings_242.py +2852 -3098
- ansys/fluent/core/generated/solver/settings_242.pyi +2059 -2151
- ansys/fluent/core/generated/solver/settings_251.py +3656 -3914
- ansys/fluent/core/generated/solver/settings_251.pyi +2915 -3008
- ansys/fluent/core/generated/solver/settings_252.py +5894 -5707
- ansys/fluent/core/generated/solver/settings_252.pyi +4411 -4297
- ansys/fluent/core/generated/solver/tui_252.py +205 -25
- ansys/fluent/core/get_build_details.py +2 -2
- ansys/fluent/core/launcher/container_launcher.py +7 -1
- ansys/fluent/core/launcher/fluent_container.py +3 -2
- ansys/fluent/core/launcher/pim_launcher.py +7 -1
- ansys/fluent/core/launcher/slurm_launcher.py +7 -1
- ansys/fluent/core/launcher/standalone_launcher.py +7 -1
- ansys/fluent/core/services/datamodel_se.py +28 -23
- ansys/fluent/core/services/datamodel_tui.py +1 -1
- ansys/fluent/core/services/field_data.py +17 -5
- ansys/fluent/core/session_base_meshing.py +3 -3
- ansys/fluent/core/session_meshing.py +4 -4
- ansys/fluent/core/session_meshing.pyi +9 -9
- ansys/fluent/core/session_pure_meshing.pyi +9 -9
- ansys/fluent/core/session_solver.py +1 -1
- ansys/fluent/core/session_solver.pyi +5 -5
- ansys/fluent/core/solver/_docstrings.py +244 -0
- ansys/fluent/core/solver/error_message.py +7 -12
- ansys/fluent/core/solver/flobject.py +86 -27
- ansys/fluent/core/utils/fluent_version.py +2 -3
- ansys/fluent/core/utils/test_grpc_connection.py +139 -0
- ansys/fluent/core/workflow.py +1 -0
- {ansys_fluent_core-0.30.dev2.dist-info → ansys_fluent_core-0.30.dev4.dist-info}/METADATA +12 -12
- {ansys_fluent_core-0.30.dev2.dist-info → ansys_fluent_core-0.30.dev4.dist-info}/RECORD +77 -73
- ansys/fluent/core/_version.py +0 -40
- /ansys/fluent/core/generated/datamodel_222/{PartManagement.py → part_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_222/{PMFileManagement.py → pm_file_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_231/{PartManagement.py → part_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_231/{PMFileManagement.py → pm_file_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_231/{solverworkflow.py → solver_workflow.py} +0 -0
- /ansys/fluent/core/generated/datamodel_232/{PartManagement.py → part_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_232/{PMFileManagement.py → pm_file_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_232/{solverworkflow.py → solver_workflow.py} +0 -0
- /ansys/fluent/core/generated/datamodel_241/{PartManagement.py → part_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_241/{PMFileManagement.py → pm_file_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_241/{solverworkflow.py → solver_workflow.py} +0 -0
- /ansys/fluent/core/generated/datamodel_242/{MeshingUtilities.py → meshing_utilities.py} +0 -0
- /ansys/fluent/core/generated/datamodel_242/{PartManagement.py → part_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_242/{PMFileManagement.py → pm_file_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_242/{solverworkflow.py → solver_workflow.py} +0 -0
- /ansys/fluent/core/generated/datamodel_251/{MeshingUtilities.py → meshing_utilities.py} +0 -0
- /ansys/fluent/core/generated/datamodel_251/{PartManagement.py → part_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_251/{PMFileManagement.py → pm_file_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_251/{solverworkflow.py → solver_workflow.py} +0 -0
- /ansys/fluent/core/generated/datamodel_252/{MeshingUtilities.py → meshing_utilities.py} +0 -0
- /ansys/fluent/core/generated/datamodel_252/{PartManagement.py → part_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_252/{PMFileManagement.py → pm_file_management.py} +0 -0
- /ansys/fluent/core/generated/datamodel_252/{solverworkflow.py → solver_workflow.py} +0 -0
- /ansys/fluent/core/{systemcoupling.py → system_coupling.py} +0 -0
- {ansys_fluent_core-0.30.dev2.dist-info → ansys_fluent_core-0.30.dev4.dist-info}/LICENSE +0 -0
- {ansys_fluent_core-0.30.dev2.dist-info → ansys_fluent_core-0.30.dev4.dist-info}/WHEEL +0 -0
ansys/fluent/core/__init__.py
CHANGED
|
@@ -32,7 +32,6 @@ from ansys.fluent.core.logging import set_console_logging_level # noqa: F401
|
|
|
32
32
|
|
|
33
33
|
# isort: on
|
|
34
34
|
|
|
35
|
-
from ansys.fluent.core._version import __version__ # noqa: F401
|
|
36
35
|
from ansys.fluent.core.get_build_details import ( # noqa: F401
|
|
37
36
|
get_build_version,
|
|
38
37
|
get_build_version_string,
|
|
@@ -63,8 +62,13 @@ from ansys.fluent.core.utils import fldoc, get_examples_download_dir
|
|
|
63
62
|
from ansys.fluent.core.utils.fluent_version import FluentVersion # noqa: F401
|
|
64
63
|
from ansys.fluent.core.utils.setup_for_fluent import setup_for_fluent # noqa: F401
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
__version__ = "0.30.dev4"
|
|
66
|
+
|
|
67
|
+
_VERSION_INFO = "Build date: March 10, 2025 16:38 UTC ShaID: 58d9ae8"
|
|
68
|
+
"""
|
|
69
|
+
Global variable indicating the version info of the PyFluent package.
|
|
70
|
+
Build timestamp and commit hash are added to this variable during packaging.
|
|
71
|
+
"""
|
|
68
72
|
|
|
69
73
|
_THIS_DIRNAME = os.path.dirname(__file__)
|
|
70
74
|
_README_FILE = os.path.normpath(os.path.join(_THIS_DIRNAME, "docs", "README.rst"))
|
|
@@ -89,6 +93,13 @@ def version_info() -> str:
|
|
|
89
93
|
return _VERSION_INFO if _VERSION_INFO is not None else __version__
|
|
90
94
|
|
|
91
95
|
|
|
96
|
+
# Latest released Fluent version
|
|
97
|
+
FLUENT_RELEASE_VERSION = "25.1.0"
|
|
98
|
+
|
|
99
|
+
# Current dev Fluent version
|
|
100
|
+
FLUENT_DEV_VERSION = "25.2.0"
|
|
101
|
+
|
|
102
|
+
# Path to the example input/data files are downloaded
|
|
92
103
|
EXAMPLES_PATH = str(get_examples_download_dir())
|
|
93
104
|
|
|
94
105
|
# Host path which is mounted to the container
|
|
@@ -144,6 +144,18 @@ def _build_command_query_docstring(name: str, info: Any, indent: str, is_command
|
|
|
144
144
|
return doc
|
|
145
145
|
|
|
146
146
|
|
|
147
|
+
meshing_rule_file_names = {
|
|
148
|
+
"workflow": "workflow",
|
|
149
|
+
"meshing": "meshing",
|
|
150
|
+
"PartManagement": "part_management",
|
|
151
|
+
"PMFileManagement": "pm_file_management",
|
|
152
|
+
"preferences": "preferences",
|
|
153
|
+
"MeshingUtilities": "meshing_utilities",
|
|
154
|
+
"flicing": "flicing",
|
|
155
|
+
"solverworkflow": "solver_workflow",
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
147
159
|
class DataModelStaticInfo:
|
|
148
160
|
"""Stores datamodel static information."""
|
|
149
161
|
|
|
@@ -165,9 +177,11 @@ class DataModelStaticInfo:
|
|
|
165
177
|
rules_save_name = rules
|
|
166
178
|
datamodel_dir = (pyfluent.CODEGEN_OUTDIR / f"datamodel_{version}").resolve()
|
|
167
179
|
datamodel_dir.mkdir(exist_ok=True)
|
|
168
|
-
self.file_name = (
|
|
180
|
+
self.file_name = (
|
|
181
|
+
datamodel_dir / f"{meshing_rule_file_names[rules_save_name]}.py"
|
|
182
|
+
).resolve()
|
|
169
183
|
if rules == "MeshingUtilities":
|
|
170
|
-
self.stub_file = (datamodel_dir / "
|
|
184
|
+
self.stub_file = (datamodel_dir / "meshing_utilities.pyi").resolve()
|
|
171
185
|
if len(modes) > 1:
|
|
172
186
|
for mode in modes[1:]:
|
|
173
187
|
DataModelStaticInfo._noindices.append(f"{mode}.datamodel.{rules}")
|
|
@@ -372,7 +386,7 @@ class DataModelGenerator:
|
|
|
372
386
|
f.write(f'{indent} """\n')
|
|
373
387
|
f.write(f"{indent} pass\n\n")
|
|
374
388
|
api_tree[k] = "Parameter"
|
|
375
|
-
if "
|
|
389
|
+
if "meshing_utilities" in f.name:
|
|
376
390
|
stub_file = self._static_info["MeshingUtilities"].stub_file
|
|
377
391
|
stub_file.unlink(missing_ok=True)
|
|
378
392
|
with open(stub_file, "w", encoding="utf8") as file:
|
|
@@ -32,7 +32,8 @@ from typing import IO
|
|
|
32
32
|
|
|
33
33
|
import ansys.fluent.core as pyfluent
|
|
34
34
|
from ansys.fluent.core import launch_fluent
|
|
35
|
-
from ansys.fluent.core.codegen import StaticInfoType
|
|
35
|
+
from ansys.fluent.core.codegen import StaticInfoType, walk_api
|
|
36
|
+
from ansys.fluent.core.solver import _docstrings
|
|
36
37
|
from ansys.fluent.core.solver.flobject import (
|
|
37
38
|
ListObject,
|
|
38
39
|
NamedObject,
|
|
@@ -185,7 +186,7 @@ _arg_type_strings = {
|
|
|
185
186
|
"Filename": "str",
|
|
186
187
|
"BooleanList": "list[bool]",
|
|
187
188
|
"IntegerList": "list[int]",
|
|
188
|
-
"RealVector": "tuple[float | str, float | str, float | str",
|
|
189
|
+
"RealVector": "tuple[float | str, float | str, float | str]",
|
|
189
190
|
"RealList": "list[float | str]",
|
|
190
191
|
"StringList": "list[str]",
|
|
191
192
|
"FilenameList": "list[str]",
|
|
@@ -195,8 +196,9 @@ _arg_type_strings = {
|
|
|
195
196
|
def _write_function_stub(name, data, s_stub):
|
|
196
197
|
s_stub.write(f" def {name}(self")
|
|
197
198
|
for arg_name in data["argument_names"]:
|
|
198
|
-
arg_type =
|
|
199
|
-
|
|
199
|
+
arg_type = data["child_classes"][arg_name]["bases"][0]
|
|
200
|
+
py_arg_type = _arg_type_strings.get(arg_type, "Any")
|
|
201
|
+
s_stub.write(f", {arg_name}: {py_arg_type}")
|
|
200
202
|
s_stub.write("):\n")
|
|
201
203
|
# TODO: add return type
|
|
202
204
|
doc = data["doc"]
|
|
@@ -311,6 +313,24 @@ def _write_data(cls_name: str, python_name: str, data: dict, f: IO, f_stub: IO |
|
|
|
311
313
|
f_stub.write(s_stub.getvalue())
|
|
312
314
|
|
|
313
315
|
|
|
316
|
+
def _check_written_docstrings(version, output_file, verbose):
|
|
317
|
+
settings = pyfluent.utils.load_module(
|
|
318
|
+
f"settings_{version}",
|
|
319
|
+
output_file,
|
|
320
|
+
)
|
|
321
|
+
analysis = _docstrings._DocStringAnalysis()
|
|
322
|
+
walk_api.walk_api(getattr(settings, "root"), analysis.analyse, "")
|
|
323
|
+
dubious = analysis.dubious
|
|
324
|
+
if dubious:
|
|
325
|
+
print(
|
|
326
|
+
f"Some docstrings appear to be dubious in the solver settings generated classes: {dubious}."
|
|
327
|
+
)
|
|
328
|
+
elif verbose:
|
|
329
|
+
print(
|
|
330
|
+
"The solver settings generated classes contain no reported docstring issues."
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
|
|
314
334
|
def generate(version: str, static_infos: dict, verbose: bool = False) -> None:
|
|
315
335
|
"""Generate the classes corresponding to the Fluent settings API."""
|
|
316
336
|
start_time = time.time()
|
|
@@ -348,6 +368,7 @@ def generate(version: str, static_infos: dict, verbose: bool = False) -> None:
|
|
|
348
368
|
header.write(")\n\n")
|
|
349
369
|
f.write(header.getvalue())
|
|
350
370
|
f_stub.write(header.getvalue())
|
|
371
|
+
f_stub.write("from typing import Any\n\n")
|
|
351
372
|
f.write(f'SHASH = "{shash}"\n\n')
|
|
352
373
|
name = data["name"]
|
|
353
374
|
_NAME_BY_HASH[_gethash(data)] = name
|
|
@@ -359,6 +380,7 @@ def generate(version: str, static_infos: dict, verbose: bool = False) -> None:
|
|
|
359
380
|
)
|
|
360
381
|
print(f"{output_file.name} size: {file_size:.2f} MB")
|
|
361
382
|
print(f"{output_stub_file.name} size: {file_size_stub:.2f} MB")
|
|
383
|
+
_check_written_docstrings(version, output_file, verbose)
|
|
362
384
|
return {"<solver_session>": api_tree}
|
|
363
385
|
|
|
364
386
|
|
|
@@ -37,6 +37,8 @@ Example
|
|
|
37
37
|
from inspect import signature
|
|
38
38
|
from typing import List
|
|
39
39
|
|
|
40
|
+
import ansys.fluent.core.solver.flobject as flobject
|
|
41
|
+
|
|
40
42
|
|
|
41
43
|
def walk_api(
|
|
42
44
|
api_cls, on_each_path, current_path: str | List[str] = "", api_item_type: str = ""
|
|
@@ -53,7 +55,9 @@ def walk_api(
|
|
|
53
55
|
"""
|
|
54
56
|
# Skip the root path
|
|
55
57
|
if current_path:
|
|
56
|
-
if len(signature(on_each_path).parameters) ==
|
|
58
|
+
if len(signature(on_each_path).parameters) == 3:
|
|
59
|
+
on_each_path(current_path, api_item_type, api_cls)
|
|
60
|
+
elif len(signature(on_each_path).parameters) == 2:
|
|
57
61
|
on_each_path(current_path, api_item_type)
|
|
58
62
|
else:
|
|
59
63
|
on_each_path(current_path)
|
|
@@ -71,6 +75,12 @@ def walk_api(
|
|
|
71
75
|
f"{current_path}.{child_name}" if current_path else child_name
|
|
72
76
|
)
|
|
73
77
|
# Recursively walk the child
|
|
78
|
+
if not api_item_type:
|
|
79
|
+
api_item_type = (
|
|
80
|
+
"parameter"
|
|
81
|
+
if isinstance(child_cls, flobject.Property)
|
|
82
|
+
else "object"
|
|
83
|
+
)
|
|
74
84
|
walk_api(child_cls, on_each_path, new_path, api_item_type)
|
|
75
85
|
|
|
76
86
|
# Delegate directly to any child_object_type (relevant for named objects)
|
ansys/fluent/core/exceptions.py
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
"""Custom common higher level exceptions."""
|
|
24
24
|
|
|
25
|
-
from typing import Any
|
|
25
|
+
from typing import Any, Iterable
|
|
26
26
|
|
|
27
27
|
from ansys.fluent.core.solver.error_message import allowed_name_error_message
|
|
28
28
|
|
|
@@ -32,14 +32,17 @@ class DisallowedValuesError(ValueError):
|
|
|
32
32
|
|
|
33
33
|
def __init__(
|
|
34
34
|
self,
|
|
35
|
-
context:
|
|
35
|
+
context: str | None = None,
|
|
36
36
|
name: Any | None = None,
|
|
37
|
-
allowed_values: Any | None = None,
|
|
37
|
+
allowed_values: Iterable[Any] | None = None,
|
|
38
38
|
):
|
|
39
39
|
"""Initialize DisallowedValuesError."""
|
|
40
40
|
super().__init__(
|
|
41
41
|
allowed_name_error_message(
|
|
42
|
-
context=context,
|
|
42
|
+
context=context,
|
|
43
|
+
trial_name=name,
|
|
44
|
+
allowed_values=allowed_values,
|
|
45
|
+
message=f"{name} is not an allowed {context}",
|
|
43
46
|
)
|
|
44
47
|
)
|
|
45
48
|
|