ansys-fluent-core 0.33.dev0__py3-none-any.whl → 0.34.dev0__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 +11 -4
- ansys/fluent/core/codegen/builtin_settingsgen.py +17 -9
- ansys/fluent/core/codegen/datamodelgen.py +2 -2
- ansys/fluent/core/codegen/print_fluent_version.py +4 -4
- ansys/fluent/core/codegen/settingsgen.py +1 -2
- ansys/fluent/core/exceptions.py +0 -1
- ansys/fluent/core/file_session.py +9 -9
- ansys/fluent/core/filereader/case_file.py +2 -2
- ansys/fluent/core/fluent_connection.py +5 -5
- ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
- ansys/fluent/core/generated/datamodel_231/flicing.py +40 -40
- ansys/fluent/core/generated/datamodel_231/meshing.py +202 -202
- ansys/fluent/core/generated/datamodel_232/flicing.py +55 -55
- ansys/fluent/core/generated/datamodel_232/meshing.py +159 -159
- ansys/fluent/core/generated/datamodel_241/flicing.py +35 -35
- ansys/fluent/core/generated/datamodel_241/meshing.py +294 -294
- ansys/fluent/core/generated/datamodel_242/flicing.py +35 -35
- ansys/fluent/core/generated/datamodel_242/meshing.py +305 -305
- ansys/fluent/core/generated/datamodel_242/part_management.py +9 -9
- ansys/fluent/core/generated/datamodel_251/flicing.py +50 -50
- ansys/fluent/core/generated/datamodel_251/meshing.py +337 -337
- ansys/fluent/core/generated/datamodel_251/part_management.py +6 -6
- ansys/fluent/core/generated/datamodel_252/flicing.py +35 -35
- ansys/fluent/core/generated/datamodel_252/meshing.py +399 -399
- ansys/fluent/core/generated/datamodel_252/part_management.py +5 -5
- ansys/fluent/core/generated/datamodel_261/flicing.py +45 -45
- ansys/fluent/core/generated/datamodel_261/meshing.py +412 -406
- ansys/fluent/core/generated/datamodel_261/part_management.py +5 -5
- ansys/fluent/core/generated/datamodel_261/solver_workflow.py +7 -0
- ansys/fluent/core/generated/fluent_version_261.py +3 -3
- ansys/fluent/core/generated/solver/settings_252.py +55 -55
- ansys/fluent/core/generated/solver/settings_261.py +2483 -3943
- ansys/fluent/core/generated/solver/settings_261.pyi +3530 -6130
- ansys/fluent/core/generated/solver/settings_builtin.py +57 -1
- ansys/fluent/core/generated/solver/settings_builtin.pyi +79 -0
- ansys/fluent/core/generated/solver/tui_261.py +185 -345
- ansys/fluent/core/launcher/container_launcher.py +7 -9
- ansys/fluent/core/launcher/fluent_container.py +106 -75
- ansys/fluent/core/launcher/launch_options.py +22 -1
- ansys/fluent/core/launcher/launcher.py +5 -4
- ansys/fluent/core/pyfluent_warnings.py +13 -0
- ansys/fluent/core/search.py +170 -83
- ansys/fluent/core/services/app_utilities.py +52 -32
- ansys/fluent/core/services/datamodel_se.py +6 -3
- ansys/fluent/core/services/scheme_eval.py +2 -0
- ansys/fluent/core/services/solution_variables.py +64 -49
- ansys/fluent/core/session.py +36 -30
- ansys/fluent/core/session_base_meshing.py +2 -24
- ansys/fluent/core/session_shared.py +5 -2
- ansys/fluent/core/session_solver.py +15 -9
- ansys/fluent/core/solver/__init__.py +1 -1
- ansys/fluent/core/solver/flobject.py +62 -64
- ansys/fluent/core/solver/settings_builtin_bases.py +14 -7
- ansys/fluent/core/solver/settings_builtin_data.py +121 -540
- ansys/fluent/core/utils/context_managers.py +0 -17
- ansys/fluent/core/utils/fluent_version.py +173 -0
- {ansys_fluent_core-0.33.dev0.dist-info → ansys_fluent_core-0.34.dev0.dist-info}/METADATA +8 -8
- {ansys_fluent_core-0.33.dev0.dist-info → ansys_fluent_core-0.34.dev0.dist-info}/RECORD +60 -78
- {ansys_fluent_core-0.33.dev0.dist-info → ansys_fluent_core-0.34.dev0.dist-info}/WHEEL +1 -1
- ansys/fluent/core/generated/datamodel_222/meshing.py +0 -6332
- ansys/fluent/core/generated/datamodel_222/part_management.py +0 -2072
- ansys/fluent/core/generated/datamodel_222/pm_file_management.py +0 -290
- ansys/fluent/core/generated/datamodel_222/preferences.py +0 -2449
- ansys/fluent/core/generated/datamodel_222/workflow.py +0 -651
- ansys/fluent/core/generated/fluent_version_222.py +0 -5
- ansys/fluent/core/generated/meshing/tui_222.py +0 -9649
- ansys/fluent/core/generated/solver/settings_222.py +0 -29473
- ansys/fluent/core/generated/solver/settings_222.pyi +0 -19590
- ansys/fluent/core/generated/solver/tui_222.py +0 -43451
- ansys/fluent/core/post_objects/__init__.py +0 -21
- ansys/fluent/core/post_objects/check_in_notebook.py +0 -35
- ansys/fluent/core/post_objects/meta.py +0 -926
- ansys/fluent/core/post_objects/post_helper.py +0 -178
- ansys/fluent/core/post_objects/post_object_definitions.py +0 -693
- ansys/fluent/core/post_objects/post_objects_container.py +0 -248
- ansys/fluent/core/post_objects/singleton_meta.py +0 -42
- ansys/fluent/core/post_objects/timing_decorator.py +0 -38
- {ansys_fluent_core-0.33.dev0.dist-info → ansys_fluent_core-0.34.dev0.dist-info/licenses}/LICENSE +0 -0
|
@@ -80,6 +80,7 @@ from ansys.fluent.core.variable_strategies import (
|
|
|
80
80
|
import ansys.units
|
|
81
81
|
|
|
82
82
|
from . import _docstrings
|
|
83
|
+
from ..pyfluent_warnings import warning_for_fluent_dev_version
|
|
83
84
|
from .error_message import allowed_name_error_message, allowed_values_error
|
|
84
85
|
from .flunits import UnhandledQuantity, get_si_unit_for_fluent_quantity
|
|
85
86
|
from .settings_external import expand_api_file_argument
|
|
@@ -97,7 +98,6 @@ class InactiveObjectError(RuntimeError):
|
|
|
97
98
|
|
|
98
99
|
class _InlineConstants:
|
|
99
100
|
is_active = "active?"
|
|
100
|
-
is_stable = "webui-release-active?"
|
|
101
101
|
is_read_only = "read-only?"
|
|
102
102
|
default_value = "default"
|
|
103
103
|
min = "min"
|
|
@@ -195,7 +195,7 @@ _to_field_name_str = naming_strategy().to_string
|
|
|
195
195
|
def _get_python_path_comps(obj):
|
|
196
196
|
"""Get python path components for traversing class hierarchy."""
|
|
197
197
|
comps = []
|
|
198
|
-
while obj:
|
|
198
|
+
while obj is not None:
|
|
199
199
|
python_name = obj.python_name
|
|
200
200
|
obj = obj._parent
|
|
201
201
|
if isinstance(obj, (NamedObject, ListObject)):
|
|
@@ -224,6 +224,24 @@ def _get_class_from_paths(root_cls, some_path: list[str], other_path: list[str])
|
|
|
224
224
|
return cls, full_path
|
|
225
225
|
|
|
226
226
|
|
|
227
|
+
def _is_deprecated(obj) -> bool | None:
|
|
228
|
+
"""Whether the object is deprecated in a specific Fluent version."""
|
|
229
|
+
if FluentVersion(obj._version) >= FluentVersion.v252:
|
|
230
|
+
# "_deprecated_version" is part of generated data since 25R2
|
|
231
|
+
deprecated_version = getattr(obj, "_deprecated_version", None)
|
|
232
|
+
else:
|
|
233
|
+
deprecated_version = obj.get_attrs(["deprecated-version"])
|
|
234
|
+
if deprecated_version:
|
|
235
|
+
deprecated_version = deprecated_version.get("attrs", deprecated_version)
|
|
236
|
+
deprecated_version = (
|
|
237
|
+
deprecated_version.get("deprecated-version") if deprecated_version else None
|
|
238
|
+
)
|
|
239
|
+
return deprecated_version and (
|
|
240
|
+
FluentVersion(float(deprecated_version)) <= FluentVersion.v222
|
|
241
|
+
or FluentVersion(obj._version) >= FluentVersion(deprecated_version)
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
|
|
227
245
|
class Base:
|
|
228
246
|
"""Provides the base class for settings and command objects.
|
|
229
247
|
|
|
@@ -286,12 +304,10 @@ class Base:
|
|
|
286
304
|
|
|
287
305
|
Supports file upload and download.
|
|
288
306
|
"""
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
elif self._parent:
|
|
294
|
-
return self._parent._file_transfer_handler
|
|
307
|
+
if self._file_transfer_service:
|
|
308
|
+
return self._file_transfer_service
|
|
309
|
+
elif self._parent:
|
|
310
|
+
return self._parent._file_transfer_handler
|
|
295
311
|
|
|
296
312
|
_name = None
|
|
297
313
|
fluent_name = None
|
|
@@ -403,38 +419,11 @@ class Base:
|
|
|
403
419
|
return None
|
|
404
420
|
return val
|
|
405
421
|
|
|
406
|
-
def _is_deprecated(self) -> bool:
|
|
407
|
-
"""Whether the object is deprecated in a specific Fluent version.'"""
|
|
408
|
-
deprecated_version = self.get_attrs(["deprecated-version"])
|
|
409
|
-
if deprecated_version:
|
|
410
|
-
deprecated_version = deprecated_version.get("attrs", deprecated_version)
|
|
411
|
-
deprecated_version = (
|
|
412
|
-
deprecated_version.get("deprecated-version") if deprecated_version else None
|
|
413
|
-
)
|
|
414
|
-
return deprecated_version and (
|
|
415
|
-
float(deprecated_version) <= 22.2
|
|
416
|
-
or FluentVersion(self._version) >= FluentVersion(deprecated_version)
|
|
417
|
-
)
|
|
418
|
-
|
|
419
422
|
def is_active(self) -> bool:
|
|
420
423
|
"""Whether the object is active."""
|
|
421
424
|
attr = self.get_attr(_InlineConstants.is_active)
|
|
422
425
|
return False if attr is False else True
|
|
423
426
|
|
|
424
|
-
def _check_stable(self) -> None:
|
|
425
|
-
"""Whether the object is stable."""
|
|
426
|
-
if not self.is_active():
|
|
427
|
-
return
|
|
428
|
-
attr = self.get_attr(_InlineConstants.is_stable)
|
|
429
|
-
attr = True if attr is None else attr
|
|
430
|
-
if not attr:
|
|
431
|
-
warnings.warn(
|
|
432
|
-
f"The API feature at '{self.path}' is not stable. "
|
|
433
|
-
f"It is not guaranteed that it is fully validated and "
|
|
434
|
-
f"there is no commitment to its backwards compatibility.",
|
|
435
|
-
UnstableSettingWarning,
|
|
436
|
-
)
|
|
437
|
-
|
|
438
427
|
def is_read_only(self) -> bool:
|
|
439
428
|
"""Whether the object is read-only."""
|
|
440
429
|
attr = self.get_attr(_InlineConstants.is_read_only)
|
|
@@ -639,6 +628,7 @@ class DeprecatedSettingWarning(PyFluentDeprecationWarning):
|
|
|
639
628
|
pass
|
|
640
629
|
|
|
641
630
|
|
|
631
|
+
# TODO: Delete this after updating PyConsole code when next PyFluent version is pushed.
|
|
642
632
|
class UnstableSettingWarning(PyFluentUserWarning):
|
|
643
633
|
"""Provides unstable settings warning."""
|
|
644
634
|
|
|
@@ -965,7 +955,7 @@ def _command_query_name_filter(
|
|
|
965
955
|
for name in names:
|
|
966
956
|
if name not in excluded and name.startswith(prefix):
|
|
967
957
|
child = getattr(parent, name)
|
|
968
|
-
if child.is_active() and not
|
|
958
|
+
if child.is_active() and not _is_deprecated(child):
|
|
969
959
|
ret.append([name, child.__class__.__bases__[0].__name__, child.__doc__])
|
|
970
960
|
return ret
|
|
971
961
|
|
|
@@ -1079,7 +1069,7 @@ class Group(SettingsBase[DictStateType]):
|
|
|
1079
1069
|
ret = []
|
|
1080
1070
|
for child_name in self.child_names:
|
|
1081
1071
|
child = getattr(self, child_name)
|
|
1082
|
-
if child.is_active() and not
|
|
1072
|
+
if child.is_active() and not _is_deprecated(child):
|
|
1083
1073
|
ret.append(child_name)
|
|
1084
1074
|
return ret
|
|
1085
1075
|
|
|
@@ -1088,7 +1078,7 @@ class Group(SettingsBase[DictStateType]):
|
|
|
1088
1078
|
ret = []
|
|
1089
1079
|
for command_name in self.command_names:
|
|
1090
1080
|
command = getattr(self, command_name)
|
|
1091
|
-
if command.is_active() and not
|
|
1081
|
+
if command.is_active() and not _is_deprecated(command):
|
|
1092
1082
|
ret.append(command_name)
|
|
1093
1083
|
return ret
|
|
1094
1084
|
|
|
@@ -1097,7 +1087,7 @@ class Group(SettingsBase[DictStateType]):
|
|
|
1097
1087
|
ret = []
|
|
1098
1088
|
for query_name in self.query_names:
|
|
1099
1089
|
query = getattr(self, query_name)
|
|
1100
|
-
if query.is_active() and not
|
|
1090
|
+
if query.is_active() and not _is_deprecated(query):
|
|
1101
1091
|
ret.append(query_name)
|
|
1102
1092
|
return ret
|
|
1103
1093
|
|
|
@@ -1107,7 +1097,8 @@ class Group(SettingsBase[DictStateType]):
|
|
|
1107
1097
|
[
|
|
1108
1098
|
child
|
|
1109
1099
|
for child in self.child_names + self.command_names + self.query_names
|
|
1110
|
-
if getattr(self, child).
|
|
1100
|
+
if getattr(self, child).is_active()
|
|
1101
|
+
and _is_deprecated(getattr(self, child))
|
|
1111
1102
|
]
|
|
1112
1103
|
)
|
|
1113
1104
|
|
|
@@ -1124,7 +1115,7 @@ class Group(SettingsBase[DictStateType]):
|
|
|
1124
1115
|
for child_name in self.child_names:
|
|
1125
1116
|
if child_name not in excluded and child_name.startswith(prefix):
|
|
1126
1117
|
child = getattr(self, child_name)
|
|
1127
|
-
if child.is_active() and not
|
|
1118
|
+
if child.is_active() and not _is_deprecated(child):
|
|
1128
1119
|
ret.append(
|
|
1129
1120
|
[
|
|
1130
1121
|
child_name,
|
|
@@ -1141,25 +1132,24 @@ class Group(SettingsBase[DictStateType]):
|
|
|
1141
1132
|
return ret
|
|
1142
1133
|
|
|
1143
1134
|
def __getattribute__(self, name):
|
|
1144
|
-
if
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
alias = alias[0]
|
|
1150
|
-
alias_obj = self._child_alias_objs.get(name)
|
|
1151
|
-
if alias_obj is None:
|
|
1152
|
-
obj = self.find_object(alias)
|
|
1153
|
-
alias_obj = self._child_alias_objs[name] = _create_child(
|
|
1154
|
-
obj.__class__, None, obj.parent, alias
|
|
1155
|
-
)
|
|
1156
|
-
return alias_obj
|
|
1135
|
+
if (
|
|
1136
|
+
name in super().__getattribute__("child_names")
|
|
1137
|
+
and self.is_active() is False
|
|
1138
|
+
):
|
|
1139
|
+
raise InactiveObjectError(self.python_path)
|
|
1157
1140
|
try:
|
|
1158
|
-
|
|
1159
|
-
if name in super().__getattribute__("_child_classes"):
|
|
1160
|
-
attr._check_stable()
|
|
1161
|
-
return attr
|
|
1141
|
+
return super().__getattribute__(name)
|
|
1162
1142
|
except AttributeError as ex:
|
|
1143
|
+
alias = self._child_aliases.get(name)
|
|
1144
|
+
if alias is not None:
|
|
1145
|
+
alias = alias[0]
|
|
1146
|
+
alias_obj = self._child_alias_objs.get(name)
|
|
1147
|
+
if alias_obj is None:
|
|
1148
|
+
obj = self.find_object(alias)
|
|
1149
|
+
alias_obj = self._child_alias_objs[name] = _create_child(
|
|
1150
|
+
obj.__class__, None, obj.parent, alias
|
|
1151
|
+
)
|
|
1152
|
+
return alias_obj
|
|
1163
1153
|
error_msg = allowed_name_error_message(
|
|
1164
1154
|
trial_name=name,
|
|
1165
1155
|
message=ex.args[0],
|
|
@@ -1667,7 +1657,8 @@ class Action(Base):
|
|
|
1667
1657
|
[
|
|
1668
1658
|
child
|
|
1669
1659
|
for child in self.argument_names
|
|
1670
|
-
if getattr(self, child).
|
|
1660
|
+
if getattr(self, child).is_active()
|
|
1661
|
+
and _is_deprecated(getattr(self, child))
|
|
1671
1662
|
]
|
|
1672
1663
|
)
|
|
1673
1664
|
|
|
@@ -1684,7 +1675,7 @@ class Action(Base):
|
|
|
1684
1675
|
for argument_name in self.argument_names:
|
|
1685
1676
|
if argument_name not in excluded and argument_name.startswith(prefix):
|
|
1686
1677
|
argument = getattr(self, argument_name)
|
|
1687
|
-
if argument.is_active() and not
|
|
1678
|
+
if argument.is_active() and not _is_deprecated(argument):
|
|
1688
1679
|
ret.append(
|
|
1689
1680
|
[
|
|
1690
1681
|
argument_name,
|
|
@@ -1791,10 +1782,16 @@ def _fix_parameter_list_return(val):
|
|
|
1791
1782
|
# Symbols are not stripped in the command return in PyConsole.
|
|
1792
1783
|
# Following code will work in both PyConsole and PyFluent.
|
|
1793
1784
|
unit = units[0].lstrip("'")
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1785
|
+
if unit != "*null*":
|
|
1786
|
+
try:
|
|
1787
|
+
unit_labels = _fix_parameter_list_return.scheme_eval(
|
|
1788
|
+
f"(units/inquire-available-label-strings-for-quantity '{unit})"
|
|
1789
|
+
)
|
|
1790
|
+
except RuntimeError:
|
|
1791
|
+
unit_labels = []
|
|
1792
|
+
unit_label = unit_labels[0] if len(unit_labels) > 0 else ""
|
|
1793
|
+
else:
|
|
1794
|
+
unit_label = ""
|
|
1798
1795
|
else:
|
|
1799
1796
|
unit_label = ""
|
|
1800
1797
|
new_val[name] = [value, unit_label]
|
|
@@ -2274,6 +2271,7 @@ def get_root(
|
|
|
2274
2271
|
CODEGEN_OUTDIR / "solver" / f"settings_{version}.py",
|
|
2275
2272
|
)
|
|
2276
2273
|
root_cls = settings.root
|
|
2274
|
+
warning_for_fluent_dev_version(version)
|
|
2277
2275
|
except FileNotFoundError:
|
|
2278
2276
|
obj_info = flproxy.get_static_info()
|
|
2279
2277
|
root_cls, _ = get_cls("", obj_info, version=version)
|
|
@@ -55,14 +55,18 @@ def _get_settings_obj(settings_root, builtin_settings_obj):
|
|
|
55
55
|
builtin_cls_name = builtin_settings_obj.__class__.__name__
|
|
56
56
|
obj = settings_root
|
|
57
57
|
path = DATA[builtin_cls_name][1]
|
|
58
|
+
found_path = None
|
|
58
59
|
if isinstance(path, dict):
|
|
59
60
|
version = FluentVersion(obj._version)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
for version_set, p in path.items():
|
|
62
|
+
if version in version_set:
|
|
63
|
+
found_path = p
|
|
64
|
+
break
|
|
65
|
+
if found_path is None:
|
|
66
|
+
raise RuntimeError(f"{builtin_cls_name} is not supported in {version}.")
|
|
67
|
+
elif isinstance(path, str):
|
|
68
|
+
found_path = path
|
|
69
|
+
comps = found_path.split(".")
|
|
66
70
|
for i, comp in enumerate(comps):
|
|
67
71
|
obj = SettingsBase.__getattribute__(obj, comp) # bypass InactiveObjectError
|
|
68
72
|
if i < len(comps) - 1 and isinstance(obj, NamedObject):
|
|
@@ -81,7 +85,7 @@ def _initialize_settings(instance, defaults: dict, settings_source=None, **kwarg
|
|
|
81
85
|
|
|
82
86
|
|
|
83
87
|
class _SingletonSetting:
|
|
84
|
-
# Covers
|
|
88
|
+
# Covers groups, named-object containers and commands.
|
|
85
89
|
def __init__(self, settings_source: SettingsBase | Solver | None = None, **kwargs):
|
|
86
90
|
_initialize_settings(self, {"settings_source": None}, settings_source, **kwargs)
|
|
87
91
|
|
|
@@ -152,3 +156,6 @@ class _CreatableNamedObjectSetting:
|
|
|
152
156
|
self.__dict__.update(obj.__dict__ | dict(settings_source=settings_root))
|
|
153
157
|
else:
|
|
154
158
|
super().__setattr__(name, value)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
_CommandSetting = _SingletonSetting
|