ansys-fluent-core 0.32.2__py3-none-any.whl → 0.33.0__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.

Files changed (78) hide show
  1. ansys/fluent/core/__init__.py +11 -4
  2. ansys/fluent/core/codegen/builtin_settingsgen.py +16 -8
  3. ansys/fluent/core/codegen/datamodelgen.py +2 -2
  4. ansys/fluent/core/codegen/print_fluent_version.py +4 -4
  5. ansys/fluent/core/codegen/settingsgen.py +1 -2
  6. ansys/fluent/core/exceptions.py +0 -1
  7. ansys/fluent/core/file_session.py +9 -9
  8. ansys/fluent/core/filereader/case_file.py +2 -2
  9. ansys/fluent/core/fluent_connection.py +5 -5
  10. ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
  11. ansys/fluent/core/generated/datamodel_231/flicing.py +55 -55
  12. ansys/fluent/core/generated/datamodel_231/meshing.py +171 -171
  13. ansys/fluent/core/generated/datamodel_232/flicing.py +30 -30
  14. ansys/fluent/core/generated/datamodel_232/meshing.py +218 -218
  15. ansys/fluent/core/generated/datamodel_241/flicing.py +45 -45
  16. ansys/fluent/core/generated/datamodel_241/meshing.py +295 -295
  17. ansys/fluent/core/generated/datamodel_242/flicing.py +40 -40
  18. ansys/fluent/core/generated/datamodel_242/meshing.py +299 -299
  19. ansys/fluent/core/generated/datamodel_242/part_management.py +3 -3
  20. ansys/fluent/core/generated/datamodel_251/flicing.py +45 -45
  21. ansys/fluent/core/generated/datamodel_251/meshing.py +294 -294
  22. ansys/fluent/core/generated/datamodel_251/part_management.py +6 -6
  23. ansys/fluent/core/generated/datamodel_252/flicing.py +50 -50
  24. ansys/fluent/core/generated/datamodel_252/meshing.py +431 -431
  25. ansys/fluent/core/generated/datamodel_252/part_management.py +5 -5
  26. ansys/fluent/core/generated/datamodel_261/flicing.py +55 -55
  27. ansys/fluent/core/generated/datamodel_261/meshing.py +447 -441
  28. ansys/fluent/core/generated/datamodel_261/part_management.py +5 -5
  29. ansys/fluent/core/generated/datamodel_261/solver_workflow.py +7 -0
  30. ansys/fluent/core/generated/fluent_version_261.py +3 -3
  31. ansys/fluent/core/generated/solver/settings_252.py +55 -55
  32. ansys/fluent/core/generated/solver/settings_261.py +2134 -3644
  33. ansys/fluent/core/generated/solver/settings_261.pyi +3391 -6013
  34. ansys/fluent/core/generated/solver/settings_builtin.py +57 -1
  35. ansys/fluent/core/generated/solver/settings_builtin.pyi +79 -0
  36. ansys/fluent/core/generated/solver/tui_261.py +78 -228
  37. ansys/fluent/core/launcher/container_launcher.py +7 -9
  38. ansys/fluent/core/launcher/fluent_container.py +106 -75
  39. ansys/fluent/core/launcher/launch_options.py +22 -1
  40. ansys/fluent/core/launcher/launcher.py +5 -4
  41. ansys/fluent/core/pyfluent_warnings.py +13 -0
  42. ansys/fluent/core/search.py +170 -83
  43. ansys/fluent/core/services/app_utilities.py +52 -32
  44. ansys/fluent/core/services/datamodel_se.py +6 -3
  45. ansys/fluent/core/services/scheme_eval.py +2 -0
  46. ansys/fluent/core/services/solution_variables.py +64 -49
  47. ansys/fluent/core/session.py +36 -30
  48. ansys/fluent/core/session_base_meshing.py +2 -24
  49. ansys/fluent/core/session_shared.py +5 -2
  50. ansys/fluent/core/session_solver.py +15 -9
  51. ansys/fluent/core/solver/__init__.py +1 -1
  52. ansys/fluent/core/solver/flobject.py +55 -38
  53. ansys/fluent/core/solver/settings_builtin_bases.py +14 -7
  54. ansys/fluent/core/solver/settings_builtin_data.py +121 -540
  55. ansys/fluent/core/utils/context_managers.py +0 -17
  56. ansys/fluent/core/utils/fluent_version.py +173 -0
  57. {ansys_fluent_core-0.32.2.dist-info → ansys_fluent_core-0.33.0.dist-info}/METADATA +9 -9
  58. {ansys_fluent_core-0.32.2.dist-info → ansys_fluent_core-0.33.0.dist-info}/RECORD +60 -78
  59. {ansys_fluent_core-0.32.2.dist-info → ansys_fluent_core-0.33.0.dist-info}/WHEEL +1 -1
  60. ansys/fluent/core/generated/datamodel_222/meshing.py +0 -6332
  61. ansys/fluent/core/generated/datamodel_222/part_management.py +0 -2072
  62. ansys/fluent/core/generated/datamodel_222/pm_file_management.py +0 -290
  63. ansys/fluent/core/generated/datamodel_222/preferences.py +0 -2449
  64. ansys/fluent/core/generated/datamodel_222/workflow.py +0 -651
  65. ansys/fluent/core/generated/fluent_version_222.py +0 -5
  66. ansys/fluent/core/generated/meshing/tui_222.py +0 -9649
  67. ansys/fluent/core/generated/solver/settings_222.py +0 -29473
  68. ansys/fluent/core/generated/solver/settings_222.pyi +0 -19590
  69. ansys/fluent/core/generated/solver/tui_222.py +0 -43451
  70. ansys/fluent/core/post_objects/__init__.py +0 -21
  71. ansys/fluent/core/post_objects/check_in_notebook.py +0 -35
  72. ansys/fluent/core/post_objects/meta.py +0 -926
  73. ansys/fluent/core/post_objects/post_helper.py +0 -178
  74. ansys/fluent/core/post_objects/post_object_definitions.py +0 -693
  75. ansys/fluent/core/post_objects/post_objects_container.py +0 -248
  76. ansys/fluent/core/post_objects/singleton_meta.py +0 -42
  77. ansys/fluent/core/post_objects/timing_decorator.py +0 -38
  78. {ansys_fluent_core-0.32.2.dist-info → ansys_fluent_core-0.33.0.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
@@ -223,6 +224,24 @@ def _get_class_from_paths(root_cls, some_path: list[str], other_path: list[str])
223
224
  return cls, full_path
224
225
 
225
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
+
226
245
  class Base:
227
246
  """Provides the base class for settings and command objects.
228
247
 
@@ -400,19 +419,6 @@ class Base:
400
419
  return None
401
420
  return val
402
421
 
403
- def _is_deprecated(self) -> bool:
404
- """Whether the object is deprecated in a specific Fluent version.'"""
405
- deprecated_version = self.get_attrs(["deprecated-version"])
406
- if deprecated_version:
407
- deprecated_version = deprecated_version.get("attrs", deprecated_version)
408
- deprecated_version = (
409
- deprecated_version.get("deprecated-version") if deprecated_version else None
410
- )
411
- return deprecated_version and (
412
- float(deprecated_version) <= 22.2
413
- or FluentVersion(self._version) >= FluentVersion(deprecated_version)
414
- )
415
-
416
422
  def is_active(self) -> bool:
417
423
  """Whether the object is active."""
418
424
  attr = self.get_attr(_InlineConstants.is_active)
@@ -949,7 +955,7 @@ def _command_query_name_filter(
949
955
  for name in names:
950
956
  if name not in excluded and name.startswith(prefix):
951
957
  child = getattr(parent, name)
952
- if child.is_active() and not child._is_deprecated():
958
+ if child.is_active() and not _is_deprecated(child):
953
959
  ret.append([name, child.__class__.__bases__[0].__name__, child.__doc__])
954
960
  return ret
955
961
 
@@ -1063,7 +1069,7 @@ class Group(SettingsBase[DictStateType]):
1063
1069
  ret = []
1064
1070
  for child_name in self.child_names:
1065
1071
  child = getattr(self, child_name)
1066
- if child.is_active() and not child._is_deprecated():
1072
+ if child.is_active() and not _is_deprecated(child):
1067
1073
  ret.append(child_name)
1068
1074
  return ret
1069
1075
 
@@ -1072,7 +1078,7 @@ class Group(SettingsBase[DictStateType]):
1072
1078
  ret = []
1073
1079
  for command_name in self.command_names:
1074
1080
  command = getattr(self, command_name)
1075
- if command.is_active() and not command._is_deprecated():
1081
+ if command.is_active() and not _is_deprecated(command):
1076
1082
  ret.append(command_name)
1077
1083
  return ret
1078
1084
 
@@ -1081,7 +1087,7 @@ class Group(SettingsBase[DictStateType]):
1081
1087
  ret = []
1082
1088
  for query_name in self.query_names:
1083
1089
  query = getattr(self, query_name)
1084
- if query.is_active() and not query._is_deprecated():
1090
+ if query.is_active() and not _is_deprecated(query):
1085
1091
  ret.append(query_name)
1086
1092
  return ret
1087
1093
 
@@ -1091,7 +1097,8 @@ class Group(SettingsBase[DictStateType]):
1091
1097
  [
1092
1098
  child
1093
1099
  for child in self.child_names + self.command_names + self.query_names
1094
- if getattr(self, child)._is_deprecated()
1100
+ if getattr(self, child).is_active()
1101
+ and _is_deprecated(getattr(self, child))
1095
1102
  ]
1096
1103
  )
1097
1104
 
@@ -1108,7 +1115,7 @@ class Group(SettingsBase[DictStateType]):
1108
1115
  for child_name in self.child_names:
1109
1116
  if child_name not in excluded and child_name.startswith(prefix):
1110
1117
  child = getattr(self, child_name)
1111
- if child.is_active() and not child._is_deprecated():
1118
+ if child.is_active() and not _is_deprecated(child):
1112
1119
  ret.append(
1113
1120
  [
1114
1121
  child_name,
@@ -1125,22 +1132,24 @@ class Group(SettingsBase[DictStateType]):
1125
1132
  return ret
1126
1133
 
1127
1134
  def __getattribute__(self, name):
1128
- if name in super().__getattribute__("child_names"):
1129
- if self.is_active() is False:
1130
- raise InactiveObjectError(self.python_path)
1131
- alias = super().__getattribute__("_child_aliases").get(name)
1132
- if alias:
1133
- alias = alias[0]
1134
- alias_obj = self._child_alias_objs.get(name)
1135
- if alias_obj is None:
1136
- obj = self.find_object(alias)
1137
- alias_obj = self._child_alias_objs[name] = _create_child(
1138
- obj.__class__, None, obj.parent, alias
1139
- )
1140
- 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)
1141
1140
  try:
1142
1141
  return super().__getattribute__(name)
1143
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
1144
1153
  error_msg = allowed_name_error_message(
1145
1154
  trial_name=name,
1146
1155
  message=ex.args[0],
@@ -1648,7 +1657,8 @@ class Action(Base):
1648
1657
  [
1649
1658
  child
1650
1659
  for child in self.argument_names
1651
- if getattr(self, child)._is_deprecated()
1660
+ if getattr(self, child).is_active()
1661
+ and _is_deprecated(getattr(self, child))
1652
1662
  ]
1653
1663
  )
1654
1664
 
@@ -1665,7 +1675,7 @@ class Action(Base):
1665
1675
  for argument_name in self.argument_names:
1666
1676
  if argument_name not in excluded and argument_name.startswith(prefix):
1667
1677
  argument = getattr(self, argument_name)
1668
- if argument.is_active() and not argument._is_deprecated():
1678
+ if argument.is_active() and not _is_deprecated(argument):
1669
1679
  ret.append(
1670
1680
  [
1671
1681
  argument_name,
@@ -1772,10 +1782,16 @@ def _fix_parameter_list_return(val):
1772
1782
  # Symbols are not stripped in the command return in PyConsole.
1773
1783
  # Following code will work in both PyConsole and PyFluent.
1774
1784
  unit = units[0].lstrip("'")
1775
- unit_labels = _fix_parameter_list_return.scheme_eval(
1776
- f"(units/inquire-available-label-strings-for-quantity '{unit})"
1777
- )
1778
- unit_label = unit_labels[0] if len(unit_labels) > 0 else ""
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 = ""
1779
1795
  else:
1780
1796
  unit_label = ""
1781
1797
  new_val[name] = [value, unit_label]
@@ -2255,6 +2271,7 @@ def get_root(
2255
2271
  CODEGEN_OUTDIR / "solver" / f"settings_{version}.py",
2256
2272
  )
2257
2273
  root_cls = settings.root
2274
+ warning_for_fluent_dev_version(version)
2258
2275
  except FileNotFoundError:
2259
2276
  obj_info = flproxy.get_static_info()
2260
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
- path = path.get(version)
61
- if path is None:
62
- raise RuntimeError(
63
- f"{builtin_cls_name} is not supported in Fluent version {version}."
64
- )
65
- comps = path.split(".")
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 both groups and named-object containers
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