ansys-fluent-core 0.31.dev1__py3-none-any.whl → 0.31.1__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 (59) hide show
  1. ansys/fluent/core/__init__.py +11 -3
  2. ansys/fluent/core/codegen/settingsgen.py +6 -0
  3. ansys/fluent/core/codegen/tuigen.py +1 -2
  4. ansys/fluent/core/docker/docker_compose.py +243 -0
  5. ansys/fluent/core/field_data_interfaces.py +6 -0
  6. ansys/fluent/core/file_session.py +158 -128
  7. ansys/fluent/core/filereader/data_file.py +11 -0
  8. ansys/fluent/core/filereader/pre_processor.py +22 -0
  9. ansys/fluent/core/fluent_connection.py +48 -20
  10. ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
  11. ansys/fluent/core/generated/datamodel_231/flicing.py +35 -35
  12. ansys/fluent/core/generated/datamodel_231/meshing.py +189 -189
  13. ansys/fluent/core/generated/datamodel_232/flicing.py +35 -35
  14. ansys/fluent/core/generated/datamodel_232/meshing.py +237 -237
  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 +60 -60
  18. ansys/fluent/core/generated/datamodel_242/meshing.py +285 -285
  19. ansys/fluent/core/generated/datamodel_242/part_management.py +6 -6
  20. ansys/fluent/core/generated/datamodel_251/flicing.py +55 -55
  21. ansys/fluent/core/generated/datamodel_251/meshing.py +370 -370
  22. ansys/fluent/core/generated/datamodel_251/part_management.py +6 -6
  23. ansys/fluent/core/generated/datamodel_252/flicing.py +55 -55
  24. ansys/fluent/core/generated/datamodel_252/meshing.py +790 -428
  25. ansys/fluent/core/generated/datamodel_252/part_management.py +10 -10
  26. ansys/fluent/core/generated/datamodel_252/preferences.py +1 -1
  27. ansys/fluent/core/generated/fluent_version_252.py +4 -4
  28. ansys/fluent/core/generated/meshing/tui_252.py +1133 -1178
  29. ansys/fluent/core/generated/solver/settings_252.py +2241 -1649
  30. ansys/fluent/core/generated/solver/settings_252.pyi +1785 -1430
  31. ansys/fluent/core/generated/solver/settings_builtin.pyi +104 -0
  32. ansys/fluent/core/generated/solver/tui_252.py +2174 -2005
  33. ansys/fluent/core/launcher/container_launcher.py +39 -8
  34. ansys/fluent/core/launcher/fluent_container.py +61 -22
  35. ansys/fluent/core/launcher/launcher.py +24 -13
  36. ansys/fluent/core/launcher/launcher_utils.py +8 -0
  37. ansys/fluent/core/launcher/process_launch_string.py +2 -6
  38. ansys/fluent/core/launcher/slurm_launcher.py +1 -0
  39. ansys/fluent/core/report.py +2 -0
  40. ansys/fluent/core/services/deprecated_field_data.py +74 -46
  41. ansys/fluent/core/services/field_data.py +104 -69
  42. ansys/fluent/core/services/reduction.py +55 -66
  43. ansys/fluent/core/services/solution_variables.py +9 -1
  44. ansys/fluent/core/session.py +15 -12
  45. ansys/fluent/core/session_meshing.py +3 -0
  46. ansys/fluent/core/session_solver.py +20 -43
  47. ansys/fluent/core/session_utilities.py +429 -0
  48. ansys/fluent/core/solver/flobject.py +28 -0
  49. ansys/fluent/core/utils/deprecate.py +46 -0
  50. ansys/fluent/core/utils/file_transfer_service.py +19 -3
  51. ansys/fluent/core/utils/fluent_version.py +42 -11
  52. ansys/fluent/core/variable_strategies/__init__.py +29 -0
  53. ansys/fluent/core/variable_strategies/expr.py +186 -0
  54. ansys/fluent/core/variable_strategies/field.py +186 -0
  55. ansys/fluent/core/variable_strategies/svar.py +61 -0
  56. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.31.1.dist-info}/METADATA +9 -6
  57. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.31.1.dist-info}/RECORD +59 -53
  58. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.31.1.dist-info}/WHEEL +1 -1
  59. {ansys_fluent_core-0.31.dev1.dist-info → ansys_fluent_core-0.31.1.dist-info/licenses}/LICENSE +0 -0
@@ -38,6 +38,7 @@ Examples
38
38
  import inspect
39
39
  import logging
40
40
  import os
41
+ import time
41
42
  from typing import Any
42
43
 
43
44
  from ansys.fluent.core.fluent_connection import FluentConnection
@@ -45,6 +46,7 @@ from ansys.fluent.core.launcher.fluent_container import (
45
46
  configure_container_dict,
46
47
  start_fluent_container,
47
48
  )
49
+ from ansys.fluent.core.launcher.launcher_utils import is_compose
48
50
  from ansys.fluent.core.launcher.process_launch_string import (
49
51
  _build_fluent_launch_args_string,
50
52
  )
@@ -58,6 +60,7 @@ from ansys.fluent.core.launcher.pyfluent_enums import (
58
60
  _get_argvals_and_session,
59
61
  )
60
62
  import ansys.fluent.core.launcher.watchdog as watchdog
63
+ from ansys.fluent.core.session import _parse_server_info_file
61
64
  from ansys.fluent.core.utils.fluent_version import FluentVersion
62
65
 
63
66
  _THIS_DIR = os.path.dirname(__file__)
@@ -65,6 +68,21 @@ _OPTIONS_FILE = os.path.join(_THIS_DIR, "fluent_launcher_options.json")
65
68
  logger = logging.getLogger("pyfluent.launcher")
66
69
 
67
70
 
71
+ def _get_server_info_from_container(config_dict):
72
+ """Retrieve the server info from a specified file in a container."""
73
+
74
+ host_server_info_file = config_dict["host_server_info_file"]
75
+
76
+ time_limit = 0
77
+ while not host_server_info_file.exists():
78
+ time.sleep(2)
79
+ time_limit += 2
80
+ if time_limit > 60:
81
+ raise FileNotFoundError(f"{host_server_info_file} not found.")
82
+
83
+ return _parse_server_info_file(str(host_server_info_file))
84
+
85
+
68
86
  class DockerLauncher:
69
87
  """Instantiates Fluent session in container mode."""
70
88
 
@@ -198,9 +216,16 @@ class DockerLauncher:
198
216
  del config_dict_h
199
217
  return config_dict
200
218
 
201
- port, password, container = start_fluent_container(
202
- self._args, self.argvals["container_dict"]
203
- )
219
+ if is_compose():
220
+ port, config_dict, container = start_fluent_container(
221
+ self._args, self.argvals["container_dict"]
222
+ )
223
+
224
+ _, _, password = _get_server_info_from_container(config_dict=config_dict)
225
+ else:
226
+ port, password, container = start_fluent_container(
227
+ self._args, self.argvals["container_dict"]
228
+ )
204
229
 
205
230
  fluent_connection = FluentConnection(
206
231
  port=port,
@@ -209,6 +234,7 @@ class DockerLauncher:
209
234
  cleanup_on_exit=self.argvals["cleanup_on_exit"],
210
235
  slurm_job_id=self.argvals and self.argvals.get("slurm_job_id"),
211
236
  inside_container=True,
237
+ container=container,
212
238
  )
213
239
 
214
240
  session = self.new_session(
@@ -217,12 +243,17 @@ class DockerLauncher:
217
243
  file_transfer_service=self.file_transfer_service,
218
244
  start_transcript=self.argvals["start_transcript"],
219
245
  )
246
+
220
247
  session._container = container
221
248
 
222
- if self.argvals["start_watchdog"] is None and self.argvals["cleanup_on_exit"]:
223
- self.argvals["start_watchdog"] = True
224
- if self.argvals["start_watchdog"]:
225
- logger.debug("Launching Watchdog for Fluent container...")
226
- watchdog.launch(os.getpid(), port, password)
249
+ if not is_compose():
250
+ if (
251
+ self.argvals["start_watchdog"] is None
252
+ and self.argvals["cleanup_on_exit"]
253
+ ):
254
+ self.argvals["start_watchdog"] = True
255
+ if self.argvals["start_watchdog"]:
256
+ logger.debug("Launching Watchdog for Fluent container...")
257
+ watchdog.launch(os.getpid(), port, password)
227
258
 
228
259
  return session
@@ -78,8 +78,10 @@ import tempfile
78
78
  from typing import Any, List
79
79
 
80
80
  import ansys.fluent.core as pyfluent
81
+ from ansys.fluent.core.docker.docker_compose import ComposeBasedLauncher
82
+ from ansys.fluent.core.launcher.launcher_utils import is_compose
81
83
  from ansys.fluent.core.session import _parse_server_info_file
82
- from ansys.fluent.core.utils.deprecate import deprecate_argument
84
+ from ansys.fluent.core.utils.deprecate import all_deprecators
83
85
  from ansys.fluent.core.utils.execution import timeout_loop
84
86
  from ansys.fluent.core.utils.networking import get_free_port
85
87
 
@@ -116,8 +118,24 @@ class LicenseServerNotSpecified(KeyError):
116
118
  )
117
119
 
118
120
 
119
- @deprecate_argument("container_mount_path", "mount_target")
120
- @deprecate_argument("host_mount_path", "mount_source")
121
+ @all_deprecators(
122
+ deprecate_arg_mappings=[
123
+ {
124
+ "old_arg": "container_mount_path",
125
+ "new_arg": "mount_target",
126
+ "converter": lambda old_arg_val: old_arg_val,
127
+ },
128
+ {
129
+ "old_arg": "host_mount_path",
130
+ "new_arg": "mount_source",
131
+ "converter": lambda old_arg_val: old_arg_val,
132
+ },
133
+ ],
134
+ data_type_converter=None,
135
+ deprecated_version="v0.23.dev1",
136
+ deprecated_reason="'container_mount_path' and 'host_mount_path' are deprecated. Use 'mount_target' and 'mount_source' instead.",
137
+ warn_message="",
138
+ )
121
139
  def configure_container_dict(
122
140
  args: List[str],
123
141
  mount_source: str | Path | None = None,
@@ -288,6 +306,7 @@ def configure_container_dict(
288
306
  environment={
289
307
  "ANSYSLMD_LICENSE_FILE": license_server,
290
308
  "REMOTING_PORTS": f"{container_grpc_port}/portspan=2",
309
+ "FLUENT_ALLOW_REMOTE_GRPC_CONNECTION": "1",
291
310
  }
292
311
  )
293
312
 
@@ -381,6 +400,11 @@ def configure_container_dict(
381
400
 
382
401
  host_server_info_file = Path(mount_source) / container_server_info_file.name
383
402
 
403
+ if is_compose():
404
+ container_dict["host_server_info_file"] = host_server_info_file
405
+ container_dict["mount_source"] = mount_source
406
+ container_dict["mount_target"] = mount_target
407
+
384
408
  return (
385
409
  container_dict,
386
410
  timeout,
@@ -451,34 +475,49 @@ def start_fluent_container(
451
475
  del container_vars_tmp
452
476
 
453
477
  try:
454
- if not host_server_info_file.exists():
455
- host_server_info_file.parents[0].mkdir(exist_ok=True)
478
+ if is_compose():
479
+ config_dict["fluent_port"] = port
456
480
 
457
- host_server_info_file.touch(exist_ok=True)
458
- last_mtime = host_server_info_file.stat().st_mtime
481
+ compose_container = ComposeBasedLauncher(container_dict=config_dict)
459
482
 
460
- import docker
483
+ if not compose_container.check_image_exists():
484
+ logger.debug(
485
+ f"Fluent image {config_dict['fluent_image']} not found. Pulling image..."
486
+ )
487
+ compose_container.pull_image()
461
488
 
462
- docker_client = docker.from_env()
489
+ compose_container.start()
463
490
 
464
- logger.debug("Starting Fluent docker container...")
491
+ return port, config_dict, compose_container
492
+ else:
493
+ if not host_server_info_file.exists():
494
+ host_server_info_file.parents[0].mkdir(exist_ok=True)
465
495
 
466
- container = docker_client.containers.run(
467
- config_dict.pop("fluent_image"), **config_dict
468
- )
496
+ host_server_info_file.touch(exist_ok=True)
497
+ last_mtime = host_server_info_file.stat().st_mtime
469
498
 
470
- success = timeout_loop(
471
- lambda: host_server_info_file.stat().st_mtime > last_mtime, timeout
472
- )
499
+ import docker
500
+
501
+ docker_client = docker.from_env()
473
502
 
474
- if not success:
475
- raise TimeoutError(
476
- "Fluent container launch has timed out, stop container manually."
503
+ logger.debug("Starting Fluent docker container...")
504
+
505
+ container = docker_client.containers.run(
506
+ config_dict.pop("fluent_image"), **config_dict
477
507
  )
478
- else:
479
- _, _, password = _parse_server_info_file(str(host_server_info_file))
480
508
 
481
- return port, password, container
509
+ success = timeout_loop(
510
+ lambda: host_server_info_file.stat().st_mtime > last_mtime, timeout
511
+ )
512
+
513
+ if not success:
514
+ raise TimeoutError(
515
+ "Fluent container launch has timed out, stop container manually."
516
+ )
517
+ else:
518
+ _, _, password = _parse_server_info_file(str(host_server_info_file))
519
+
520
+ return port, password, container
482
521
  finally:
483
522
  if remove_server_info_file and host_server_info_file.exists():
484
523
  host_server_info_file.unlink()
@@ -54,12 +54,11 @@ from ansys.fluent.core.launcher.server_info import _get_server_info
54
54
  from ansys.fluent.core.launcher.slurm_launcher import SlurmFuture, SlurmLauncher
55
55
  from ansys.fluent.core.launcher.standalone_launcher import StandaloneLauncher
56
56
  import ansys.fluent.core.launcher.watchdog as watchdog
57
- from ansys.fluent.core.pyfluent_warnings import PyFluentDeprecationWarning
58
57
  from ansys.fluent.core.session_meshing import Meshing
59
58
  from ansys.fluent.core.session_pure_meshing import PureMeshing
60
59
  from ansys.fluent.core.session_solver import Solver
61
60
  from ansys.fluent.core.session_solver_icing import SolverIcing
62
- from ansys.fluent.core.utils.deprecate import deprecate_argument
61
+ from ansys.fluent.core.utils.deprecate import all_deprecators
63
62
  from ansys.fluent.core.utils.fluent_version import FluentVersion
64
63
 
65
64
  _THIS_DIR = os.path.dirname(__file__)
@@ -127,17 +126,23 @@ def _version_to_dimension(old_arg_val):
127
126
 
128
127
 
129
128
  # pylint: disable=unused-argument
130
- @deprecate_argument(
131
- old_arg="show_gui",
132
- new_arg="ui_mode",
133
- converter=_show_gui_to_ui_mode,
134
- warning_cls=PyFluentDeprecationWarning,
135
- )
136
- @deprecate_argument(
137
- old_arg="version",
138
- new_arg="dimension",
139
- converter=_version_to_dimension,
140
- warning_cls=PyFluentDeprecationWarning,
129
+ @all_deprecators(
130
+ deprecate_arg_mappings=[
131
+ {
132
+ "old_arg": "show_gui",
133
+ "new_arg": "ui_mode",
134
+ "converter": _show_gui_to_ui_mode,
135
+ },
136
+ {
137
+ "old_arg": "version",
138
+ "new_arg": "dimension",
139
+ "converter": _version_to_dimension,
140
+ },
141
+ ],
142
+ data_type_converter=None,
143
+ deprecated_version="v0.22.dev0",
144
+ deprecated_reason="'show_gui' and 'version' are deprecated. Use 'ui_mode' and 'dimension' instead.",
145
+ warn_message="",
141
146
  )
142
147
  def launch_fluent(
143
148
  product_version: FluentVersion | str | float | int | None = None,
@@ -179,6 +184,12 @@ def launch_fluent(
179
184
  Version of Ansys Fluent to launch. To use Fluent version 2025 R1, pass
180
185
  any of ``FluentVersion.v251``, ``"25.1.0"``, ``"25.1"``, ``25.1``or ``251``.
181
186
  The default is ``None``, in which case the newest installed version is used.
187
+ PyFluent uses the ``AWP_ROOT<ver>`` environment variable to locate the Fluent
188
+ installation, where ``<ver>`` is the Ansys release number such as ``251``.
189
+ The ``AWP_ROOT<ver>`` environment variable is automatically configured on Windows
190
+ system when Fluent is installed. On Linux systems, ``AWP_ROOT<ver>`` must be
191
+ configured to point to the absolute path of an Ansys installation such as
192
+ ``/apps/ansys_inc/v251``.
182
193
  dimension : Dimension or int, optional
183
194
  Geometric dimensionality of the Fluent simulation. The default is ``None``,
184
195
  in which case ``Dimension.THREE`` is used. Options are either the values of the
@@ -37,6 +37,14 @@ from ansys.fluent.core.utils.networking import find_remoting_ip
37
37
  logger = logging.getLogger("pyfluent.launcher")
38
38
 
39
39
 
40
+ def is_compose() -> bool:
41
+ """Check if the Fluent launch is through compose."""
42
+ return (
43
+ os.getenv("PYFLUENT_USE_DOCKER_COMPOSE") == "1"
44
+ or os.getenv("PYFLUENT_USE_PODMAN_COMPOSE") == "1"
45
+ )
46
+
47
+
40
48
  def is_windows():
41
49
  """Check if the current operating system is Windows."""
42
50
  return platform.system() == "Windows"
@@ -150,10 +150,6 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
150
150
  Fluent executable path
151
151
  """
152
152
 
153
- def get_fluent_root(version: FluentVersion) -> Path:
154
- awp_root = os.environ[version.awp_var]
155
- return Path(awp_root) / "fluent"
156
-
157
153
  def get_exe_path(fluent_root: Path) -> Path:
158
154
  if launcher_utils.is_windows():
159
155
  return fluent_root / "ntbin" / "win64" / "fluent.exe"
@@ -171,7 +167,7 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
171
167
  # 2. product_version parameter passed with launch_fluent
172
168
  product_version = launch_argvals.get("product_version")
173
169
  if product_version:
174
- return get_exe_path(get_fluent_root(FluentVersion(product_version)))
170
+ return FluentVersion(product_version).get_fluent_exe_path()
175
171
 
176
172
  # (DEV) "PYFLUENT_FLUENT_ROOT" environment variable
177
173
  fluent_root = os.getenv("PYFLUENT_FLUENT_ROOT")
@@ -179,4 +175,4 @@ def get_fluent_exe_path(**launch_argvals) -> Path:
179
175
  return get_exe_path(Path(fluent_root))
180
176
 
181
177
  # 3. the latest ANSYS version from AWP_ROOT environment variables
182
- return get_exe_path(get_fluent_root(FluentVersion.get_latest_installed()))
178
+ return FluentVersion.get_latest_installed().get_fluent_exe_path()
@@ -459,6 +459,7 @@ class SlurmLauncher:
459
459
  launch_cmd += _build_journal_argument(
460
460
  self._argvals["topy"], self._argvals["journal_file_names"]
461
461
  )
462
+ launch_cmd += ' -setenv="FLUENT_ALLOW_REMOTE_GRPC_CONNECTION=1"'
462
463
 
463
464
  logger.debug(f"Launching Fluent with command: {launch_cmd}")
464
465
  proc = subprocess.Popen(launch_cmd, **kwargs)
@@ -56,6 +56,8 @@ ANSYS_ENV_VARS = [
56
56
  "REMOTING_PORTS",
57
57
  "REMOTING_SERVER_ADDRESS",
58
58
  "SERVER_INFO_DIR",
59
+ "PYFLUENT_USE_DOCKER_COMPOSE",
60
+ "PYFLUENT_USE_PODMAN_COMPOSE",
59
61
  ]
60
62
 
61
63
 
@@ -42,7 +42,7 @@ from ansys.fluent.core.services.field_data import (
42
42
  get_fields_request,
43
43
  override_help_text,
44
44
  )
45
- from ansys.fluent.core.utils.deprecate import deprecate_argument
45
+ from ansys.fluent.core.utils.deprecate import all_deprecators
46
46
 
47
47
  DEPRECATION_MSG = "'field_data_old' is deprecated. Use 'field_data' instead."
48
48
 
@@ -297,15 +297,23 @@ class DeprecatedFieldData:
297
297
  self._allowed_vector_field_names,
298
298
  )
299
299
 
300
- @deprecate_argument(
301
- old_arg="surface_name",
302
- new_arg="surfaces",
303
- converter=lambda old_arg_val: [old_arg_val] if old_arg_val else [],
304
- )
305
- @deprecate_argument(
306
- old_arg="surface_ids",
307
- new_arg="surfaces",
308
- converter=lambda old_arg_val: old_arg_val or [],
300
+ @all_deprecators(
301
+ deprecate_arg_mappings=[
302
+ {
303
+ "old_arg": "surface_names",
304
+ "new_arg": "surfaces",
305
+ "converter": lambda old_arg_val: [old_arg_val] if old_arg_val else [],
306
+ },
307
+ {
308
+ "old_arg": "surface_ids",
309
+ "new_arg": "surfaces",
310
+ "converter": lambda old_arg_val: old_arg_val or [],
311
+ },
312
+ ],
313
+ data_type_converter=None,
314
+ deprecated_version="v0.27.0",
315
+ deprecated_reason="Old arguments 'surface_ids' and 'surface_names' are deprecated. Use 'surfaces' instead.",
316
+ warn_message=DEPRECATION_MSG,
309
317
  )
310
318
  def get_scalar_field_data(
311
319
  self,
@@ -336,7 +344,6 @@ class DeprecatedFieldData:
336
344
  IDs are provided as input, a dictionary containing a map of surface IDs to scalar
337
345
  field data.
338
346
  """
339
- warnings.warn(DEPRECATION_MSG, PyFluentDeprecationWarning)
340
347
  surface_ids = _get_surface_ids(
341
348
  field_info=self._field_info,
342
349
  allowed_surface_names=self._allowed_surface_names,
@@ -376,20 +383,28 @@ class DeprecatedFieldData:
376
383
  for surface_id in surface_ids
377
384
  }
378
385
 
379
- @deprecate_argument(
380
- old_arg="surface_name",
381
- new_arg="surfaces",
382
- converter=lambda old_arg_val: [old_arg_val] if old_arg_val else [],
383
- )
384
- @deprecate_argument(
385
- old_arg="surface_ids",
386
- new_arg="surfaces",
387
- converter=lambda old_arg_val: old_arg_val or [],
388
- )
389
- @deprecate_argument(
390
- old_arg="data_type",
391
- new_arg="data_types",
392
- converter=lambda old_arg_val: [old_arg_val] if old_arg_val else [],
386
+ @all_deprecators(
387
+ deprecate_arg_mappings=[
388
+ {
389
+ "old_arg": "surface_names",
390
+ "new_arg": "surfaces",
391
+ "converter": lambda old_arg_val: [old_arg_val] if old_arg_val else [],
392
+ },
393
+ {
394
+ "old_arg": "surface_ids",
395
+ "new_arg": "surfaces",
396
+ "converter": lambda old_arg_val: old_arg_val or [],
397
+ },
398
+ {
399
+ "old_arg": "data_type",
400
+ "new_arg": "data_types",
401
+ "converter": lambda old_arg_val: [old_arg_val] if old_arg_val else [],
402
+ },
403
+ ],
404
+ data_type_converter=None,
405
+ deprecated_version="v0.27.0",
406
+ deprecated_reason="Old arguments 'surface_names', 'surface_ids' and 'data_type' are deprecated. Use 'surfaces' and 'data_types' instead.",
407
+ warn_message=DEPRECATION_MSG,
393
408
  )
394
409
  def get_surface_data(
395
410
  self,
@@ -421,7 +436,6 @@ class DeprecatedFieldData:
421
436
  If surface IDs are provided as input, a dictionary containing a map of surface IDs to face
422
437
  vertices, connectivity data, and normal or centroid data is returned.
423
438
  """
424
- warnings.warn(DEPRECATION_MSG, PyFluentDeprecationWarning)
425
439
  surface_ids = _get_surface_ids(
426
440
  field_info=self._field_info,
427
441
  allowed_surface_names=self._allowed_surface_names,
@@ -509,15 +523,23 @@ class DeprecatedFieldData:
509
523
  for surface_id in surface_ids
510
524
  }
511
525
 
512
- @deprecate_argument(
513
- old_arg="surface_name",
514
- new_arg="surfaces",
515
- converter=lambda old_arg_val: [old_arg_val] if old_arg_val else [],
516
- )
517
- @deprecate_argument(
518
- old_arg="surface_ids",
519
- new_arg="surfaces",
520
- converter=lambda old_arg_val: old_arg_val or [],
526
+ @all_deprecators(
527
+ deprecate_arg_mappings=[
528
+ {
529
+ "old_arg": "surface_names",
530
+ "new_arg": "surfaces",
531
+ "converter": lambda old_arg_val: [old_arg_val] if old_arg_val else [],
532
+ },
533
+ {
534
+ "old_arg": "surface_ids",
535
+ "new_arg": "surfaces",
536
+ "converter": lambda old_arg_val: old_arg_val or [],
537
+ },
538
+ ],
539
+ data_type_converter=None,
540
+ deprecated_version="v0.27.0",
541
+ deprecated_reason="Old arguments 'surface_ids' and 'surface_names' are deprecated. Use 'surfaces' instead.",
542
+ warn_message=DEPRECATION_MSG,
521
543
  )
522
544
  def get_vector_field_data(
523
545
  self,
@@ -540,7 +562,6 @@ class DeprecatedFieldData:
540
562
  If surface IDs are provided as input, a dictionary containing a map of
541
563
  surface IDs to vector field data is returned.
542
564
  """
543
- warnings.warn(DEPRECATION_MSG, PyFluentDeprecationWarning)
544
565
  surface_ids = _get_surface_ids(
545
566
  field_info=self._field_info,
546
567
  allowed_surface_names=self._allowed_surface_names,
@@ -579,15 +600,23 @@ class DeprecatedFieldData:
579
600
  for surface_id in surface_ids
580
601
  }
581
602
 
582
- @deprecate_argument(
583
- old_arg="surface_name",
584
- new_arg="surfaces",
585
- converter=lambda old_arg_val: [old_arg_val] if old_arg_val else [],
586
- )
587
- @deprecate_argument(
588
- old_arg="surface_ids",
589
- new_arg="surfaces",
590
- converter=lambda old_arg_val: old_arg_val or [],
603
+ @all_deprecators(
604
+ deprecate_arg_mappings=[
605
+ {
606
+ "old_arg": "surface_names",
607
+ "new_arg": "surfaces",
608
+ "converter": lambda old_arg_val: [old_arg_val] if old_arg_val else [],
609
+ },
610
+ {
611
+ "old_arg": "surface_ids",
612
+ "new_arg": "surfaces",
613
+ "converter": lambda old_arg_val: old_arg_val or [],
614
+ },
615
+ ],
616
+ data_type_converter=None,
617
+ deprecated_version="v0.27.0",
618
+ deprecated_reason="Old arguments 'surface_ids' and 'surface_names' are deprecated. Use 'surfaces' instead.",
619
+ warn_message=DEPRECATION_MSG,
591
620
  )
592
621
  def get_pathlines_field_data(
593
622
  self,
@@ -648,7 +677,6 @@ class DeprecatedFieldData:
648
677
  """
649
678
  if zones is None:
650
679
  zones = []
651
- warnings.warn(DEPRECATION_MSG, PyFluentDeprecationWarning)
652
680
  surface_ids = _get_surface_ids(
653
681
  field_info=self._field_info,
654
682
  allowed_surface_names=self._allowed_surface_names,