ansys-fluent-core 0.30.dev3__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.

@@ -364,7 +364,7 @@ class TUIMenu:
364
364
  ]
365
365
 
366
366
  def __getattribute__(self, name) -> Any:
367
- if name in ["exit", "switch_to_meshing_mode"] and not self._path:
367
+ if name in ["exit"] and not self._path:
368
368
  raise AttributeError(
369
369
  f"'{self.__class__.__name__}' object has no attribute '{name}'"
370
370
  )
@@ -200,10 +200,10 @@ def _get_python_path_comps(obj):
200
200
  """Get python path components for traversing class hierarchy."""
201
201
  comps = []
202
202
  while obj:
203
- python_name = obj._python_name
203
+ python_name = obj.python_name
204
204
  obj = obj._parent
205
205
  if isinstance(obj, (NamedObject, ListObject)):
206
- comps.append(obj._python_name)
206
+ comps.append(obj.python_name)
207
207
  obj = obj._parent
208
208
  else:
209
209
  comps.append(python_name)
@@ -407,9 +407,19 @@ class Base:
407
407
  return None
408
408
  return val
409
409
 
410
+ def _is_deprecated(self) -> bool:
411
+ """Whether the object is deprecated in a specific Fluent version.'"""
412
+ deprecated_version = self.get_attrs(["deprecated-version"])
413
+ deprecated_version = (
414
+ deprecated_version.get("deprecated-version") if deprecated_version else None
415
+ )
416
+ return deprecated_version and FluentVersion(self.version) >= FluentVersion(
417
+ deprecated_version
418
+ )
419
+
410
420
  def is_active(self) -> bool:
411
421
  """Whether the object is active."""
412
- attr = self.get_attr(_InlineConstants.is_active)
422
+ attr = self.get_attr(_InlineConstants.is_active) and not self._is_deprecated()
413
423
  return False if attr is False else True
414
424
 
415
425
  def _check_stable(self) -> None:
@@ -1078,6 +1088,16 @@ class Group(SettingsBase[DictStateType]):
1078
1088
  ret.append(query)
1079
1089
  return ret
1080
1090
 
1091
+ def __dir__(self):
1092
+ dir_list = set(list(self.__dict__.keys()) + dir(type(self)))
1093
+ return dir_list - set(
1094
+ [
1095
+ child
1096
+ for child in self.child_names + self.command_names + self.query_names
1097
+ if getattr(self, child)._is_deprecated()
1098
+ ]
1099
+ )
1100
+
1081
1101
  def get_completer_info(self, prefix="", excluded=None) -> List[List[str]]:
1082
1102
  """Get completer info of all children.
1083
1103
 
@@ -1407,7 +1427,7 @@ class NamedObject(SettingsBase[DictStateType], Generic[ChildTypeT]):
1407
1427
  )
1408
1428
  raise KeyError(
1409
1429
  allowed_name_error_message(
1410
- context=self.__class__._python_name,
1430
+ context=self.python_name,
1411
1431
  trial_name=name,
1412
1432
  allowed_values=self.get_object_names(),
1413
1433
  )
@@ -1624,6 +1644,16 @@ class Action(Base):
1624
1644
  cls = self.__class__._child_classes[argument]
1625
1645
  self._setattr(argument, _create_child(cls, None, self))
1626
1646
 
1647
+ def __dir__(self):
1648
+ dir_list = set(list(self.__dict__.keys()) + dir(type(self)))
1649
+ return dir_list - set(
1650
+ [
1651
+ child
1652
+ for child in self.argument_names
1653
+ if getattr(self, child)._is_deprecated()
1654
+ ]
1655
+ )
1656
+
1627
1657
  def get_completer_info(self, prefix="", excluded=None) -> List[List[str]]:
1628
1658
  """Get completer info of all arguments.
1629
1659
 
@@ -1960,7 +1990,7 @@ class _NonCreatableNamedObjectMixin(
1960
1990
  else:
1961
1991
  raise KeyError(
1962
1992
  allowed_name_error_message(
1963
- context=self.__class__._python_name,
1993
+ context=self.python_name,
1964
1994
  trial_name=name,
1965
1995
  allowed_values=self.get_object_names(),
1966
1996
  )
@@ -2214,15 +2244,19 @@ def get_root(
2214
2244
  """
2215
2245
  from ansys.fluent.core import CODEGEN_OUTDIR, utils
2216
2246
 
2217
- try:
2218
- settings = utils.load_module(
2219
- f"settings_{version}",
2220
- CODEGEN_OUTDIR / "solver" / f"settings_{version}.py",
2221
- )
2222
- root_cls = settings.root
2223
- except FileNotFoundError:
2247
+ if os.getenv("PYFLUENT_USE_RUNTIME_PYTHON_CLASSES") == "1":
2224
2248
  obj_info = flproxy.get_static_info()
2225
2249
  root_cls, _ = get_cls("", obj_info, version=version)
2250
+ else:
2251
+ try:
2252
+ settings = utils.load_module(
2253
+ f"settings_{version}",
2254
+ CODEGEN_OUTDIR / "solver" / f"settings_{version}.py",
2255
+ )
2256
+ root_cls = settings.root
2257
+ except FileNotFoundError:
2258
+ obj_info = flproxy.get_static_info()
2259
+ root_cls, _ = get_cls("", obj_info, version=version)
2226
2260
  root = root_cls()
2227
2261
  root.set_flproxy(flproxy)
2228
2262
  root._set_on_interrupt(interrupt)
@@ -0,0 +1,139 @@
1
+ # Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ """Script to test viability of gRPC connection in the current machine."""
24
+
25
+
26
+ from argparse import ArgumentParser
27
+ import socket
28
+
29
+ import grpc
30
+ from grpc_health.v1 import health_pb2, health_pb2_grpc
31
+
32
+ from ansys.fluent.core.utils.networking import _GrpcServer, get_free_port
33
+
34
+
35
+ def _test_connection_using_specified_ip(ip: str, port: int | None = None) -> bool:
36
+ if not port:
37
+ port = get_free_port()
38
+ address = f"{ip}:{port}"
39
+ try:
40
+ with _GrpcServer(address):
41
+ with grpc.insecure_channel(address) as channel:
42
+ stub = health_pb2_grpc.HealthStub(channel)
43
+ return (
44
+ stub.Check(
45
+ health_pb2.HealthCheckRequest(),
46
+ timeout=1,
47
+ ).status
48
+ == health_pb2.HealthCheckResponse.ServingStatus.SERVING
49
+ )
50
+ except Exception:
51
+ return False
52
+
53
+
54
+ def _test_connection_using_all_available_ips(port: int | None = None) -> list[str]:
55
+ successful_ips = []
56
+ for addrinfo in socket.getaddrinfo(
57
+ "localhost",
58
+ 0,
59
+ family=socket.AF_INET,
60
+ type=socket.SOCK_STREAM,
61
+ flags=socket.AI_PASSIVE,
62
+ ):
63
+ ip = addrinfo[-1][0]
64
+ if _test_connection_using_specified_ip(ip, port):
65
+ successful_ips.append(ip)
66
+ return successful_ips
67
+
68
+
69
+ def test_connection(ip: str | None = None, port: int | None = None):
70
+ """
71
+ Test viability of gRPC connection in the current machine.
72
+ Parameters
73
+ ----------
74
+ ip : str, optional
75
+ IP address to test connection with. If not provided, will test using all available ips.
76
+ port : int, optional
77
+ Port to test connection with. If not provided, will test using random port.
78
+ """
79
+
80
+ if ip is not None and port is not None:
81
+ print(f"Testing gRPC connection using ip={ip} and port={port}.")
82
+ if _test_connection_using_specified_ip(ip, port):
83
+ print(f"gRPC connection can be established using ip={ip} and port={port}.")
84
+ else:
85
+ print(
86
+ f"gRPC connection cannot be established using ip={ip} and port={port}. "
87
+ "Try with a different ip and/or port. You can run the script again without "
88
+ "providing any ip to print all viable ips where gRPC connection can be established."
89
+ )
90
+ elif ip is not None and port is None:
91
+ print(f"Testing gRPC connection using ip={ip} and random port.")
92
+ if _test_connection_using_specified_ip(ip):
93
+ print(f"gRPC connection can be established using ip={ip}.")
94
+ else:
95
+ print(
96
+ f"gRPC connection cannot be established using ip={ip}. "
97
+ "Try with a different ip. You can run the script again without "
98
+ "providing any ip to print all viable ips where gRPC connection can be established."
99
+ )
100
+ elif ip is None and port is not None:
101
+ print(f"Testing gRPC connection using all available ips and port={port}.")
102
+ successful_ips = _test_connection_using_all_available_ips(port)
103
+ if successful_ips:
104
+ for ip in successful_ips:
105
+ print(
106
+ f"gRPC connection can be established using ip={ip} and port={port}."
107
+ )
108
+ else:
109
+ print(
110
+ f"gRPC connection cannot be established using any ip and port={port}. "
111
+ "Try with a different port. You can run the script again without "
112
+ "providing any port to test using random port."
113
+ )
114
+ else:
115
+ print("Testing gRPC connection using all available ips and random port.")
116
+ successful_ips = _test_connection_using_all_available_ips()
117
+ if successful_ips:
118
+ for ip in successful_ips:
119
+ print(f"gRPC connection can be established using ip={ip}.")
120
+ else:
121
+ print("gRPC connection cannot be established using any ip.")
122
+
123
+
124
+ if __name__ == "__main__":
125
+ parser = ArgumentParser(
126
+ description="Script to test viability of gRPC connection in the current machine."
127
+ )
128
+ parser.add_argument(
129
+ "-i",
130
+ "--ip",
131
+ help="IP address to test connection with. If not provided, will test using all available ips.",
132
+ )
133
+ parser.add_argument(
134
+ "-p",
135
+ "--port",
136
+ help="Port to test connection with. If not provided, will test using random port.",
137
+ )
138
+ args = parser.parse_args()
139
+ test_connection(args.ip, args.port)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ansys-fluent-core
3
- Version: 0.30.dev3
3
+ Version: 0.30.dev4
4
4
  Summary: PyFluent provides Pythonic access to Ansys Fluent.
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
@@ -24,27 +24,27 @@ Requires-Dist: numpy>=1.14.0,<3.0.0
24
24
  Requires-Dist: pandas>=1.1.0,<2.3
25
25
  Requires-Dist: pyansys-tools-report>=0.8.1
26
26
  Requires-Dist: pyyaml>=6.0
27
- Requires-Dist: Sphinx==7.4.7 ; extra == "docs"
27
+ Requires-Dist: Sphinx==8.1.3 ; extra == "docs"
28
28
  Requires-Dist: jupyter_sphinx==0.5.3 ; extra == "docs"
29
29
  Requires-Dist: numpydoc==1.8.0 ; extra == "docs"
30
- Requires-Dist: matplotlib==3.10.0 ; extra == "docs"
31
- Requires-Dist: ansys-sphinx-theme==1.2.7 ; extra == "docs"
30
+ Requires-Dist: matplotlib==3.10.1 ; extra == "docs"
31
+ Requires-Dist: ansys-sphinx-theme==1.3.2 ; extra == "docs"
32
32
  Requires-Dist: pypandoc==1.15 ; extra == "docs"
33
33
  Requires-Dist: pytest-sphinx==0.6.3 ; extra == "docs"
34
34
  Requires-Dist: sphinx-autobuild==2024.10.3 ; extra == "docs"
35
- Requires-Dist: sphinx-autodoc-typehints==2.3.0 ; extra == "docs"
35
+ Requires-Dist: sphinx-autodoc-typehints==3.0.1 ; extra == "docs"
36
36
  Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "docs"
37
- Requires-Dist: sphinx-gallery==0.18.0 ; extra == "docs"
37
+ Requires-Dist: sphinx-gallery==0.19.0 ; extra == "docs"
38
38
  Requires-Dist: sphinx-notfound-page==1.1.0 ; extra == "docs"
39
39
  Requires-Dist: sphinxcontrib-websupport==2.0.0 ; extra == "docs"
40
40
  Requires-Dist: sphinxemoji==0.3.1 ; extra == "docs"
41
- Requires-Dist: sphinx-toggleprompt==0.5.2 ; extra == "docs"
41
+ Requires-Dist: sphinx-toggleprompt==0.6.0 ; extra == "docs"
42
42
  Requires-Dist: autodocsumm==0.2.14 ; extra == "docs"
43
- Requires-Dist: beautifulsoup4==4.13.1 ; extra == "docs"
43
+ Requires-Dist: beautifulsoup4==4.13.3 ; extra == "docs"
44
44
  Requires-Dist: openpyxl>=3.1.5 ; extra == "docs"
45
45
  Requires-Dist: plotly>=5.22.0 ; extra == "docs"
46
46
  Requires-Dist: python-pptx>=0.6.23 ; extra == "docs"
47
- Requires-Dist: quarto-cli==1.6.39 ; extra == "docs"
47
+ Requires-Dist: quarto-cli==1.6.42 ; extra == "docs"
48
48
  Requires-Dist: pdf2image==1.17.0 ; extra == "docs"
49
49
  Requires-Dist: seaborn>=0.13.2 ; extra == "docs"
50
50
  Requires-Dist: tensorflow>=2.17.0 ; extra == "docs"
@@ -1,4 +1,4 @@
1
- ansys/fluent/core/__init__.py,sha256=s7iEbWSkySb16JCC93oZr4CoZgMjfKPWC_2Gsc83NPI,5931
1
+ ansys/fluent/core/__init__.py,sha256=C5u0ePhI_RpyeZttXVzwOJsL8vQbX-cde1-VwnfcoOg,5928
2
2
  ansys/fluent/core/data_model_cache.py,sha256=MVnBuH7s5Yr_AI8f0F9kPw-gMExDopUKvW9a99MX2RE,16963
3
3
  ansys/fluent/core/exceptions.py,sha256=fNOlOANWh1UJE2qBqOFxBjLXYQFvKzszX3KDQbVdEIY,2006
4
4
  ansys/fluent/core/file_session.py,sha256=5Pvotahjxw796IeyFJxZIXRh2zdLjz_4abDxdOJTyX4,27850
@@ -56,7 +56,7 @@ ansys/fluent/core/generated/fluent_version_241.py,sha256=R60bDiS2y_VYuI49NMPWTYg
56
56
  ansys/fluent/core/generated/fluent_version_242.py,sha256=098i_ge1V5f_MZxu9hIjNAF_nYL5RTEzsGNkrgVIn0A,167
57
57
  ansys/fluent/core/generated/fluent_version_251.py,sha256=HB2VZqVDg8DbP2kDE1v2rCxCgUrXwnWdiLGaTOdNnF0,167
58
58
  ansys/fluent/core/generated/fluent_version_252.py,sha256=JuvZqvIkHRaTAnR4tVTtF0Zz9addO5ZXYE6-gRTj52c,151
59
- ansys/fluent/core/generated/api_tree/api_objects.json,sha256=fPYdV7I9Gd8qDi3T00IhJKnk3conS5lK2mOy_zR83rA,13464044
59
+ ansys/fluent/core/generated/api_tree/api_objects.json,sha256=6Ps-DeoEEFGShYlILSh6Mibx7YCSxYeX2cMHcYCXhXA,13464044
60
60
  ansys/fluent/core/generated/datamodel_222/meshing.py,sha256=w815twyOdeNBQjuyWGCWektjM4oDaWq2MBoSiZXiYoI,49964
61
61
  ansys/fluent/core/generated/datamodel_222/part_management.py,sha256=Lvq9BtPFQK_26m0K-pHIeN2QaMr_8xu2pGGW-07avPA,40605
62
62
  ansys/fluent/core/generated/datamodel_222/pm_file_management.py,sha256=LhCYSB_swkVZ8iPqGus-miHD65LqZB_x3C6y0B_Bl34,7270
@@ -172,7 +172,7 @@ ansys/fluent/core/services/api_upgrade.py,sha256=ebesQI1X9418qFBRV8wpYV59btVyrFJ
172
172
  ansys/fluent/core/services/app_utilities.py,sha256=OStE35HzCpGG3RB17Ln_Tuuyp5RM1zoFfU08oM-gYVk,18623
173
173
  ansys/fluent/core/services/batch_ops.py,sha256=NmTqERVZ5quMInEFM-DofPwrWOYRprz93GjePBR-gjQ,8606
174
174
  ansys/fluent/core/services/datamodel_se.py,sha256=0MVx9GAIzj28h_L6UnTzAj_hdX197hcc6c2LrhOCOVs,79145
175
- ansys/fluent/core/services/datamodel_tui.py,sha256=ltq3XXa6m3wRQ2Q29c_531oqDR9nTtr6ZOoj1xb0dSQ,15301
175
+ ansys/fluent/core/services/datamodel_tui.py,sha256=IZTtfdS-bJlX863yu0kb7D3kB82xNjOn4BY-uMpiKOI,15275
176
176
  ansys/fluent/core/services/deprecated_field_data.py,sha256=3aOiwPiTP_1BhDoIN796LVH0DTLpFOEN7WZMnto4_gk,26000
177
177
  ansys/fluent/core/services/events.py,sha256=mWDilZ3LCNYJw4bhCNTHikgmtfd3x_ZQq-mOX9mYOnw,1746
178
178
  ansys/fluent/core/services/field_data.py,sha256=3DzYvkaQXyGnpF2c524YR9EILSH9KVjeUEt6W8ZrybA,55568
@@ -188,7 +188,7 @@ ansys/fluent/core/services/transcript.py,sha256=AQAtJt6OFDHwkxOTYXoZuVK5RucBH09q
188
188
  ansys/fluent/core/solver/__init__.py,sha256=ZasBiwk-6qye3jeNE0zKBXdOQYW-ZyR8wAApC-OhzSg,1389
189
189
  ansys/fluent/core/solver/_docstrings.py,sha256=_-NiOvAPr3CGu4G7bLpkUw2yfnvFpq7RCox77IMEX3M,8505
190
190
  ansys/fluent/core/solver/error_message.py,sha256=pPzVh2ZwlXOYfcdWEgPHu90UkpW-jD239DxJOcweU5U,2729
191
- ansys/fluent/core/solver/flobject.py,sha256=f41TYiZ-EuIEyZhDsoNNkf-8faQv-3MZH4i70U2iLng,74058
191
+ ansys/fluent/core/solver/flobject.py,sha256=yh4UBmoEkYT6L0TZ3BRc4fqLIhKYhfFw4bEtzQ4YkrQ,75337
192
192
  ansys/fluent/core/solver/flunits.py,sha256=RSMq_8dPxRTmLCUk5V0K9vmIXkVfYoYy42VNAsVAr-k,10505
193
193
  ansys/fluent/core/solver/settings_builtin_bases.py,sha256=G8fa-2zN1p1GGKleVWRrnq7IFyVp26n4WbdzecdFubA,5551
194
194
  ansys/fluent/core/solver/settings_builtin_data.py,sha256=571yvaoDFvXna4ccX11wq2uvQiDPlpKJShJXteLMjfE,44068
@@ -216,7 +216,8 @@ ansys/fluent/core/utils/fldoc.py,sha256=q0qmq_RDfxUqP5EuSnE3yRNgyEavsOdGYBaIrZ0i
216
216
  ansys/fluent/core/utils/fluent_version.py,sha256=QgHlyjAQKKlHy-NX3Os4PrsZ-FGZtSW4blYRecfMEOw,5270
217
217
  ansys/fluent/core/utils/networking.py,sha256=hrZi4WgUSKGwV3iJBAK3tOaS4XLs4Nfs63fOwWvwM6I,4428
218
218
  ansys/fluent/core/utils/setup_for_fluent.py,sha256=kgRIB40Fs0tx6Nup5LGhVIu63lX9CYzGx6TkgmJfZBw,2031
219
- ansys_fluent_core-0.30.dev3.dist-info/LICENSE,sha256=5w5etzTlBx3bnQfaa3IXMnV4n9cHCJn4bD5XbiUfCbY,1097
220
- ansys_fluent_core-0.30.dev3.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
221
- ansys_fluent_core-0.30.dev3.dist-info/METADATA,sha256=r5hea7HfJ_yFCiXE_SBsuykhiOFh2PaRYK7AUq9iUvc,9491
222
- ansys_fluent_core-0.30.dev3.dist-info/RECORD,,
219
+ ansys/fluent/core/utils/test_grpc_connection.py,sha256=_7HyGZn9huR12D9WvR-8rDZ7ni1DHxzQii2YL7vRp98,5649
220
+ ansys_fluent_core-0.30.dev4.dist-info/LICENSE,sha256=5w5etzTlBx3bnQfaa3IXMnV4n9cHCJn4bD5XbiUfCbY,1097
221
+ ansys_fluent_core-0.30.dev4.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
222
+ ansys_fluent_core-0.30.dev4.dist-info/METADATA,sha256=oXMNAl-S3BBa_cBPUEHR6mT1Ja4BhRdFQ-QqQc1zVVQ,9491
223
+ ansys_fluent_core-0.30.dev4.dist-info/RECORD,,