ansys-speos-core 0.6.2__py3-none-any.whl → 0.7.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.
ansys/speos/core/bsdf.py CHANGED
@@ -30,16 +30,16 @@ from pathlib import Path
30
30
  from typing import Union
31
31
  import warnings
32
32
 
33
- from google.protobuf.empty_pb2 import Empty
34
- import grpc
35
- import numpy as np
36
-
37
33
  import ansys.api.speos.bsdf.v1.anisotropic_bsdf_pb2 as anisotropic_bsdf__v1__pb2
38
34
  import ansys.api.speos.bsdf.v1.anisotropic_bsdf_pb2_grpc as anisotropic_bsdf__v1__pb2_grpc
39
35
  import ansys.api.speos.bsdf.v1.bsdf_creation_pb2 as bsdf_creation__v1__pb2
40
36
  import ansys.api.speos.bsdf.v1.bsdf_creation_pb2_grpc as bsdf_creation__v1__pb2_grpc
41
37
  import ansys.api.speos.bsdf.v1.spectral_bsdf_pb2 as spectral_bsdf__v1__pb2
42
38
  import ansys.api.speos.bsdf.v1.spectral_bsdf_pb2_grpc as spectral_bsdf__v1__pb2_grpc
39
+ from google.protobuf.empty_pb2 import Empty
40
+ import grpc
41
+ import numpy as np
42
+
43
43
  import ansys.speos.core
44
44
  from ansys.speos.core.speos import Speos
45
45
 
@@ -34,10 +34,10 @@ from pathlib import Path
34
34
  from typing import List, Optional, Union, cast
35
35
  import warnings
36
36
 
37
+ from ansys.tools.common.path import get_available_ansys_installations
37
38
  import numpy as np
38
39
 
39
40
  from ansys.speos.core.generic.constants import DEFAULT_VERSION
40
- from ansys.tools.path import get_available_ansys_installations
41
41
 
42
42
  _GRAPHICS_AVAILABLE = None
43
43
 
@@ -90,9 +90,8 @@ def run_if_graphics_required(warning=False):
90
90
  global _GRAPHICS_AVAILABLE
91
91
  if _GRAPHICS_AVAILABLE is None:
92
92
  try:
93
- import pyvista as pv # noqa: F401
94
-
95
93
  from ansys.tools.visualization_interface import Plotter # noqa: F401
94
+ import pyvista as pv # noqa: F401
96
95
 
97
96
  _GRAPHICS_AVAILABLE = True
98
97
  except ImportError: # pragma: no cover
@@ -179,11 +178,8 @@ def error_no_install(install_path: Union[Path, str], version: Union[int, str]):
179
178
  version : Union[int, str]
180
179
  Version
181
180
  """
182
- install_loc_msg = ""
183
- if install_path:
184
- install_loc_msg = f"at {Path(install_path).parent}"
185
181
  raise FileNotFoundError(
186
- f"Ansys Speos RPC server installation not found{install_loc_msg}. "
182
+ f"Ansys Speos RPC server installation not found at {install_path}. "
187
183
  f"Please define AWP_ROOT{version} environment variable"
188
184
  )
189
185
 
@@ -28,6 +28,7 @@ from ansys.api.speos.part.v1 import (
28
28
  body_pb2 as messages,
29
29
  body_pb2_grpc as service,
30
30
  )
31
+
31
32
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
32
33
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
33
34
 
@@ -94,7 +95,7 @@ class BodyStub(CrudStub):
94
95
  Like in the following example:
95
96
 
96
97
  >>> from ansys.speos.core.speos import Speos
97
- >>> speos = Speos(host="localhost", port=50098)
98
+ >>> speos = Speos()
98
99
  >>> body_db = speos.client.bodies()
99
100
 
100
101
  """
@@ -25,14 +25,15 @@
25
25
  import logging
26
26
  import os
27
27
  from pathlib import Path
28
- import subprocess
28
+ import subprocess # nosec
29
+ import tempfile
29
30
  import time
30
31
  from typing import TYPE_CHECKING, List, Optional, Union
31
32
 
33
+ from ansys.api.speos.part.v1 import body_pb2, face_pb2, part_pb2
32
34
  import grpc
33
35
  from grpc._channel import _InactiveRpcError
34
36
 
35
- from ansys.api.speos.part.v1 import body_pb2, face_pb2, part_pb2
36
37
  from ansys.speos.core.generic.constants import (
37
38
  DEFAULT_HOST,
38
39
  DEFAULT_PORT,
@@ -42,6 +43,13 @@ from ansys.speos.core.generic.constants import (
42
43
  from ansys.speos.core.generic.general_methods import retrieve_speos_install_dir
43
44
  from ansys.speos.core.kernel.body import BodyLink, BodyStub
44
45
  from ansys.speos.core.kernel.face import FaceLink, FaceStub
46
+ from ansys.speos.core.kernel.grpc.transport_options import (
47
+ InsecureOptions,
48
+ TransportMode,
49
+ TransportOptions,
50
+ UDSOptions,
51
+ WNUAOptions,
52
+ )
45
53
  from ansys.speos.core.kernel.intensity_template import (
46
54
  IntensityTemplateLink,
47
55
  IntensityTemplateStub,
@@ -82,7 +90,7 @@ def wait_until_healthy(channel: grpc.Channel, timeout: float):
82
90
 
83
91
  Parameters
84
92
  ----------
85
- channel : ~grpc.Channel
93
+ channel : grpc.Channel
86
94
  Channel to wait until established and healthy.
87
95
  timeout : float
88
96
  Timeout in seconds. One attempt will be made each 100 milliseconds
@@ -107,24 +115,45 @@ def wait_until_healthy(channel: grpc.Channel, timeout: float):
107
115
  )
108
116
 
109
117
 
118
+ def default_docker_channel(
119
+ host: Optional[str] = DEFAULT_HOST,
120
+ port: Union[str, int] = DEFAULT_PORT,
121
+ message_size: int = MAX_CLIENT_MESSAGE_SIZE,
122
+ ) -> grpc.Channel:
123
+ """Create default transport options for docker on CI."""
124
+ return TransportOptions(
125
+ mode=TransportMode.INSECURE,
126
+ options=InsecureOptions(host=host, port=port, allow_remote_host=True),
127
+ ).create_channel(grpc_options=[("grpc.max_receive_message_length", message_size)])
128
+
129
+
130
+ def default_local_channel(
131
+ port: Union[str, int] = DEFAULT_PORT, message_size: int = MAX_CLIENT_MESSAGE_SIZE
132
+ ) -> grpc.Channel:
133
+ """Create default transport options, WNUA on Windows, UDS on Linux."""
134
+ if os.name == "nt":
135
+ transport = TransportOptions(
136
+ mode=TransportMode.WNUA, options=WNUAOptions(host=DEFAULT_HOST, port=port)
137
+ )
138
+ else:
139
+ sock_file = Path(tempfile.gettempdir()) / f"speosrpc_sock_{port}"
140
+ transport = TransportOptions(
141
+ mode=TransportMode.UDS, options=UDSOptions(uds_fullpath=str(sock_file))
142
+ )
143
+ return transport.create_channel(
144
+ grpc_options=[("grpc.max_receive_message_length", message_size)]
145
+ )
146
+
147
+
110
148
  class SpeosClient:
111
149
  """
112
150
  Wraps a speos gRPC connection.
113
151
 
114
152
  Parameters
115
153
  ----------
116
- host : str, optional
117
- Host where the server is running.
118
- By default, ``DEFAULT_HOST``.
119
- port : Union[str, int], optional
120
- Port number where the server is running.
121
- By default, ``DEFAULT_PORT``.
122
- channel : ~grpc.Channel, optional
154
+ channel : grpc.Channel, optional
123
155
  gRPC channel for server communication.
124
156
  By default, ``None``.
125
- message_size: int
126
- Maximum Message size of a newly generated channel
127
- By default, ``MAX_CLIENT_MESSAGE_SIZE``.
128
157
  remote_instance : ansys.platform.instancemanagement.Instance
129
158
  The corresponding remote instance when the Speos Service
130
159
  is launched through PyPIM. This instance will be deleted when calling
@@ -143,11 +172,8 @@ class SpeosClient:
143
172
 
144
173
  def __init__(
145
174
  self,
146
- host: Optional[str] = DEFAULT_HOST,
147
- port: Union[str, int] = DEFAULT_PORT,
148
175
  version: str = DEFAULT_VERSION,
149
176
  channel: Optional[grpc.Channel] = None,
150
- message_size: int = MAX_CLIENT_MESSAGE_SIZE,
151
177
  remote_instance: Optional["Instance"] = None,
152
178
  timeout: Optional[int] = 60,
153
179
  logging_level: Optional[int] = logging.INFO,
@@ -170,23 +196,17 @@ class SpeosClient:
170
196
  else:
171
197
  self._version = version
172
198
  if channel:
173
- # Used for PyPIM when directly providing a channel
199
+ # grpc channel is provided by caller, used by PyPIM or Docker server
174
200
  self._channel = channel
175
- self._target = str(channel)
176
201
  else:
177
- self._host = host
178
- self._port = port
179
- self._target = f"{host}:{port}"
180
- self._channel = grpc.insecure_channel(
181
- self._target,
182
- options=[("grpc.max_receive_message_length", message_size)],
183
- )
202
+ self._channel = default_local_channel()
203
+
184
204
  # do not finish initialization until channel is healthy
185
205
  wait_until_healthy(self._channel, timeout)
186
206
 
187
207
  # once connection with the client is established, create a logger
188
208
  self._log = LOGGER.add_instance_logger(
189
- name=self._target, client_instance=self, level=logging_level
209
+ name=self.target(), client_instance=self, level=logging_level
190
210
  )
191
211
  if logging_file:
192
212
  if isinstance(logging_file, Path):
@@ -492,7 +512,7 @@ List[ansys.speos.core.kernel.face.FaceLink]]
492
512
  """Represent the client as a string."""
493
513
  lines = []
494
514
  lines.append(f"Ansys Speos client ({hex(id(self))})")
495
- lines.append(f" Target: {self._target}")
515
+ lines.append(f" Target: {self.target()}")
496
516
  if self._closed:
497
517
  lines.append(" Connection: Closed")
498
518
  elif self.healthy:
@@ -504,6 +524,11 @@ List[ansys.speos.core.kernel.face.FaceLink]]
504
524
  def close(self):
505
525
  """Close the channel.
506
526
 
527
+ .. warning::
528
+
529
+ Do not execute this function with untrusted environment variables.
530
+ See the :ref:`security guide<ref_security_consideration>` for details.
531
+
507
532
  Returns
508
533
  -------
509
534
  bool
@@ -517,7 +542,7 @@ List[ansys.speos.core.kernel.face.FaceLink]]
517
542
  wait_time = 0
518
543
  if self._remote_instance:
519
544
  self._remote_instance.delete()
520
- elif self._host in ["localhost", "0.0.0.0", "127.0.0.1"] and self.__speos_exec:
545
+ elif self.__speos_exec:
521
546
  self.__close_local_speos_rpc_server()
522
547
  while self.healthy and wait_time < 15:
523
548
  time.sleep(1)
@@ -543,5 +568,30 @@ List[ansys.speos.core.kernel.face.FaceLink]]
543
568
  return self._closed
544
569
 
545
570
  def __close_local_speos_rpc_server(self):
546
- command = [self.__speos_exec, "-s{}".format(self._port)]
547
- subprocess.run(command, check=True)
571
+ """Close a locally started Speos RPC server.
572
+
573
+ .. warning::
574
+ Do not execute this function after modifying protected or private
575
+ attributes of the SpeosClient class or in a context with untrusted
576
+ environment variables.
577
+ See the :ref:`security guide<ref_security_consideration>` for details.
578
+
579
+ """
580
+ try:
581
+ # Extract port number at end of target string
582
+ target = self.target()
583
+ if ":" in target:
584
+ port = target.split(":")[-1]
585
+ else:
586
+ port = target.split("_")[-1]
587
+ int(port)
588
+ except ValueError:
589
+ raise RuntimeError("The port of the local server is not a valid integer.")
590
+ if (
591
+ not Path(self.__speos_exec).is_file()
592
+ or Path(self.__speos_exec).stem != "SpeosRPC_Server"
593
+ ):
594
+ raise RuntimeError("Unexpected executable path for Speos rpc executable.")
595
+
596
+ command = [self.__speos_exec, f"-s{port}"]
597
+ subprocess.run(command, check=True) # nosec
@@ -24,12 +24,12 @@
24
24
 
25
25
  from typing import Iterator, List
26
26
 
27
- from grpc import RpcError
28
-
29
27
  from ansys.api.speos.part.v1 import (
30
28
  face_pb2 as messages,
31
29
  face_pb2_grpc as service,
32
30
  )
31
+ from grpc import RpcError
32
+
33
33
  from ansys.speos.core.generic.general_methods import min_speos_version
34
34
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
35
35
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
@@ -97,7 +97,7 @@ class FaceStub(CrudStub):
97
97
  Like in the following example:
98
98
 
99
99
  >>> from ansys.speos.core.speos import Speos
100
- >>> speos = Speos(host="localhost", port=50098)
100
+ >>> speos = Speos()
101
101
  >>> face_db = speos.client.faces()
102
102
 
103
103
  """
@@ -0,0 +1,171 @@
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
+ """Define supported transport options for the FileTransfer Tool client.
24
+
25
+ This module provides classes and enumerations to configure and manage
26
+ different transport modes (UDS, mTLS, Insecure) for the FileTransfer Tool.
27
+ """
28
+
29
+ from dataclasses import dataclass
30
+ import enum
31
+ from pathlib import Path
32
+
33
+ from ansys.tools.common.cyberchannel import create_channel
34
+
35
+
36
+ class TransportMode(enum.Enum):
37
+ """Enumeration of transport modes supported by the FileTransfer Tool."""
38
+
39
+ UDS = "uds"
40
+ MTLS = "mtls"
41
+ INSECURE = "insecure"
42
+ WNUA = "wnua"
43
+
44
+
45
+ @dataclass(kw_only=True)
46
+ class UDSOptions:
47
+ """Options for UDS transport mode."""
48
+
49
+ uds_service: str | None = None
50
+ uds_dir: str | Path | None = None
51
+ uds_id: str | None = None
52
+ uds_fullpath: str | Path | None = None
53
+
54
+ def _to_cyberchannel_kwargs(self):
55
+ return {
56
+ "uds_service": self.uds_service,
57
+ "uds_dir": self.uds_dir,
58
+ "uds_id": self.uds_id,
59
+ "uds_fullpath": self.uds_fullpath,
60
+ }
61
+
62
+
63
+ @dataclass(kw_only=True)
64
+ class MTLSOptions:
65
+ """Options for mTLS transport mode."""
66
+
67
+ certs_dir: str | Path | None = None
68
+ host: str = "localhost"
69
+ port: int
70
+ allow_remote_host: bool = False
71
+
72
+ def _to_cyberchannel_kwargs(self):
73
+ if not self.allow_remote_host:
74
+ if self.host not in ("localhost", "127.0.0.1"):
75
+ raise ValueError(
76
+ f"Remote host '{self.host}' is not allowed when "
77
+ "'allow_remote_host' is set to False."
78
+ )
79
+ return {
80
+ "certs_dir": self.certs_dir,
81
+ "host": self.host,
82
+ "port": self.port,
83
+ }
84
+
85
+
86
+ @dataclass(kw_only=True)
87
+ class InsecureOptions:
88
+ """Options for insecure transport mode."""
89
+
90
+ host: str = "localhost"
91
+ port: int
92
+ allow_remote_host: bool = False
93
+
94
+ def _to_cyberchannel_kwargs(self):
95
+ if not self.allow_remote_host:
96
+ if self.host not in ("localhost", "127.0.0.1"):
97
+ raise ValueError(
98
+ f"Remote host '{self.host}' is not allowed when "
99
+ "'allow_remote_host' is set to False."
100
+ )
101
+ return {
102
+ "host": self.host,
103
+ "port": self.port,
104
+ }
105
+
106
+
107
+ @dataclass(kw_only=True)
108
+ class WNUAOptions:
109
+ """Options for Windows Named User Authentication transport mode."""
110
+
111
+ host: str = "localhost"
112
+ port: int
113
+
114
+ def _to_cyberchannel_kwargs(self):
115
+ return {
116
+ "host": self.host,
117
+ "port": self.port,
118
+ }
119
+
120
+
121
+ @dataclass(kw_only=True)
122
+ class TransportOptions:
123
+ """Transport options for the FileTransfer Tool client."""
124
+
125
+ mode: TransportMode
126
+ options: UDSOptions | MTLSOptions | InsecureOptions | WNUAOptions
127
+
128
+ def __init__(
129
+ self,
130
+ mode: TransportMode | str = "uds",
131
+ options: UDSOptions | MTLSOptions | InsecureOptions | WNUAOptions | None = None,
132
+ ):
133
+ if isinstance(mode, str):
134
+ mode = TransportMode(mode)
135
+ if options is None:
136
+ if mode != TransportMode.UDS:
137
+ raise RuntimeError("TransportOptions must be provided for modes other than UDS.")
138
+ # The default cannot be set in the constructor signature
139
+ # since '_get_uds_dir_default' may raise.
140
+ options = UDSOptions()
141
+
142
+ if mode == TransportMode.UDS:
143
+ if not isinstance(options, UDSOptions):
144
+ raise TypeError("For UDS transport mode, options must be of type UDSOptions.")
145
+ elif mode == TransportMode.MTLS:
146
+ if not isinstance(options, MTLSOptions):
147
+ raise TypeError("For mTLS transport mode, options must be of type MTLSOptions.")
148
+ elif mode == TransportMode.INSECURE:
149
+ if not isinstance(options, InsecureOptions):
150
+ raise TypeError(
151
+ "For Insecure transport mode, options must be of type InsecureOptions."
152
+ )
153
+ elif mode == TransportMode.WNUA:
154
+ if not isinstance(options, WNUAOptions):
155
+ raise TypeError("For WNUA transport mode, options must be of type WNUAOptions.")
156
+ else:
157
+ raise ValueError(f"Unsupported transport mode: {mode}")
158
+
159
+ self.mode = mode
160
+ self.options = options
161
+
162
+ def _to_cyberchannel_kwargs(self):
163
+ """Convert transport options to cyberchannel kwargs."""
164
+ return {
165
+ "transport_mode": self.mode.value,
166
+ **self.options._to_cyberchannel_kwargs(),
167
+ }
168
+
169
+ def create_channel(self, grpc_options):
170
+ """Create a gRPC channel based on the transport options."""
171
+ return create_channel(**self._to_cyberchannel_kwargs(), grpc_options=grpc_options)
@@ -28,6 +28,7 @@ from ansys.api.speos.intensity.v1 import (
28
28
  intensity_pb2 as messages,
29
29
  intensity_pb2_grpc as service,
30
30
  )
31
+
31
32
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
32
33
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
33
34
 
@@ -55,7 +56,7 @@ class IntensityTemplateLink(CrudItem):
55
56
  >>> from ansys.speos.core.kernel.intensity_template import (
56
57
  ... ProtoIntensityTemplate,
57
58
  ... )
58
- >>> speos = Speos(host="localhost", port=50098)
59
+ >>> speos = Speos()
59
60
  >>> int_t_db = speos.client.intensity_templates()
60
61
  >>> int_t_message = ProtoIntensityTemplate(name="Cos_3_170")
61
62
  >>> int_t_message.cos.N = 3.0
@@ -126,7 +127,7 @@ class IntensityTemplateStub(CrudStub):
126
127
  intensity_templates() method. Like in the following example:
127
128
 
128
129
  >>> from ansys.speos.core.speos import Speos
129
- >>> speos = Speos(host="localhost", port=50098)
130
+ >>> speos = Speos()
130
131
  >>> int_t_db = speos.client.intensity_templates()
131
132
 
132
133
  """
@@ -22,10 +22,14 @@
22
22
 
23
23
  """Provides a wrapped abstraction of the gRPC proto API definition and stubs."""
24
24
 
25
+ from pathlib import Path
26
+ import tempfile
27
+ import time
25
28
  from typing import Iterator, List
26
29
 
27
30
  from ansys.api.speos.job.v2 import job_pb2 as messages, job_pb2_grpc as service
28
31
  from ansys.api.speos.results.v1.ray_path_pb2 import RayPath
32
+
29
33
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
30
34
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
31
35
 
@@ -34,6 +38,24 @@ ProtoJob = messages.Job
34
38
  ProtoJob.__str__ = lambda self: protobuf_message_to_str(self)
35
39
 
36
40
 
41
+ def _is_uds_channel(channel):
42
+ target = channel._channel.target().decode()
43
+ return target.startswith("unix:")
44
+
45
+
46
+ def _list_files_newer_than(folder, timestamp):
47
+ """
48
+ Return files in `folder` newer than the given timestamp.
49
+
50
+ :param folder: Path to the folder
51
+ :param timestamp: Reference timestamp (seconds since epoch)
52
+ :return: List of file names newer than timestamp
53
+ """
54
+ files = [f for f in folder.iterdir() if f.is_file() and f.stat().st_mtime > timestamp]
55
+
56
+ return files
57
+
58
+
37
59
  class JobLink(CrudItem):
38
60
  """Link object for job in database.
39
61
 
@@ -48,6 +70,8 @@ class JobLink(CrudItem):
48
70
  def __init__(self, db, key: str):
49
71
  super().__init__(db, key)
50
72
  self._actions_stub = db._actions_stub
73
+ self._is_uds = db._is_uds
74
+ self._timestamp_start = None
51
75
 
52
76
  def __str__(self) -> str:
53
77
  """Return the string representation of the Job."""
@@ -91,6 +115,7 @@ class JobLink(CrudItem):
91
115
 
92
116
  def start(self) -> None:
93
117
  """Start the job."""
118
+ self._timestamp_start = time.time()
94
119
  self._actions_stub.Start(messages.Start_Request(guid=self.key))
95
120
 
96
121
  def stop(self) -> None:
@@ -117,7 +142,18 @@ class JobLink(CrudItem):
117
142
  ansys.api.speos.job.v2.job_pb2.GetResults_Response
118
143
  Results of the job.
119
144
  """
120
- return self._actions_stub.GetResults(messages.GetResults_Request(guid=self.key))
145
+ if self._is_uds and self._timestamp_start is not None:
146
+ # Get results manually due to bug in uds GetResults implementation
147
+ results_folder = Path(tempfile.gettempdir()).joinpath("jobs", self.key)
148
+ files = _list_files_newer_than(results_folder, self._timestamp_start)
149
+ results = []
150
+ for f in files:
151
+ r = messages.Result(path=str(f))
152
+ results.append(r)
153
+
154
+ return messages.GetResults_Response(results=results)
155
+ else:
156
+ return self._actions_stub.GetResults(messages.GetResults_Request(guid=self.key))
121
157
 
122
158
  def get_progress_status(self) -> messages.GetProgressStatus_Response:
123
159
  """
@@ -161,7 +197,7 @@ class JobStub(CrudStub):
161
197
  Like in the following example:
162
198
 
163
199
  >>> from ansys.speos.core.speos import Speos
164
- >>> speos = Speos(host="localhost", port=50098)
200
+ >>> speos = Speos()
165
201
  >>> job_db = speos.client.jobs()
166
202
 
167
203
  """
@@ -169,6 +205,7 @@ class JobStub(CrudStub):
169
205
  def __init__(self, channel):
170
206
  super().__init__(stub=service.JobsManagerStub(channel=channel))
171
207
  self._actions_stub = service.JobActionsStub(channel=channel)
208
+ self._is_uds = _is_uds_channel(channel)
172
209
 
173
210
  def create(self, message: ProtoJob) -> JobLink:
174
211
  """Create a new entry.
@@ -28,6 +28,7 @@ from ansys.api.speos.part.v1 import (
28
28
  part_pb2 as messages,
29
29
  part_pb2_grpc as service,
30
30
  )
31
+
31
32
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
32
33
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
33
34
 
@@ -94,7 +95,7 @@ class PartStub(CrudStub):
94
95
  Like in the following example:
95
96
 
96
97
  >>> from ansys.speos.core.speos import Speos
97
- >>> speos = Speos(host="localhost", port=50098)
98
+ >>> speos = Speos()
98
99
  >>> part_db = speos.client.parts()
99
100
 
100
101
  """
@@ -29,6 +29,7 @@ from ansys.api.speos.scene.v2 import (
29
29
  scene_pb2 as messages,
30
30
  scene_pb2_grpc as service,
31
31
  )
32
+
32
33
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
33
34
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
34
35
  from ansys.speos.core.kernel.sop_template import ProtoSOPTemplate, SOPTemplateStub
@@ -58,7 +59,7 @@ class SceneLink(CrudItem):
58
59
  --------
59
60
  >>> from ansys.speos.core.speos import Speos
60
61
  >>> from ansys.speos.core.kernel.scene import ProtoScene
61
- >>> speos = Speos(host="localhost", port=50098)
62
+ >>> speos = Speos()
62
63
  >>> sce_db = speos.client.scenes()
63
64
  >>> sce_link = sce_db.create(message=ProtoScene(name="Empty_Scene"))
64
65
 
@@ -164,7 +165,7 @@ class SceneStub(CrudStub):
164
165
  Like in the following example:
165
166
 
166
167
  >>> from ansys.speos.core.speos import Speos
167
- >>> speos = Speos(host="localhost", port=50098)
168
+ >>> speos = Speos()
168
169
  >>> sce_db = speos.client.scenes()
169
170
 
170
171
  """
@@ -28,6 +28,7 @@ from ansys.api.speos.sensor.v1 import (
28
28
  sensor_pb2 as messages,
29
29
  sensor_pb2_grpc as service,
30
30
  )
31
+
31
32
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
32
33
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
33
34
 
@@ -51,7 +52,7 @@ class SensorTemplateLink(CrudItem):
51
52
  --------
52
53
  >>> from ansys.speos.core.speos import Speos
53
54
  >>> from ansys.speos.core.kernel.sensor_template import ProtoSensorTemplate
54
- >>> speos = Speos(host="localhost", port=50098)
55
+ >>> speos = Speos()
55
56
  >>> ssr_t_db = speos.client.sensor_templates()
56
57
  >>> ssr_t_message = ProtoSensorTemplate(name="Irradiance")
57
58
  >>> ssr_t_message.irradiance_sensor_template.sensor_type_photometric.SetInParent()
@@ -113,7 +114,7 @@ class SensorTemplateStub(CrudStub):
113
114
  sensor_templates() method. Like in the following example:
114
115
 
115
116
  >>> from ansys.speos.core.speos import Speos
116
- >>> speos = Speos(host="localhost", port=50098)
117
+ >>> speos = Speos()
117
118
  >>> ssr_t_db = speos.client.sensor_templates()
118
119
 
119
120
  """
@@ -28,6 +28,7 @@ from ansys.api.speos.simulation.v1 import (
28
28
  simulation_template_pb2 as messages,
29
29
  simulation_template_pb2_grpc as service,
30
30
  )
31
+
31
32
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
32
33
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
33
34
 
@@ -57,7 +58,7 @@ class SimulationTemplateLink(CrudItem):
57
58
  >>> from ansys.speos.core.kernel.simulation_template import (
58
59
  ... ProtoSimulationTemplate,
59
60
  ... )
60
- >>> speos = Speos(host="localhost", port=50098)
61
+ >>> speos = Speos()
61
62
  >>> sim_t_db = speos.client.simulation_templates()
62
63
  >>> sim_t_message = ProtoSimulationTemplate(name="Direct")
63
64
  >>> sim_t_message.direct_mc_simulation_template.geom_distance_tolerance = 0.01
@@ -118,7 +119,7 @@ class SimulationTemplateStub(CrudStub):
118
119
  simulation_templates() method. Like in the following example:
119
120
 
120
121
  >>> from ansys.speos.core.speos import Speos
121
- >>> speos = Speos(host="localhost", port=50098)
122
+ >>> speos = Speos()
122
123
  >>> sim_t_db = speos.client.simulation_templates()
123
124
 
124
125
  """
@@ -25,6 +25,7 @@
25
25
  from typing import List
26
26
 
27
27
  from ansys.api.speos.sop.v1 import sop_pb2 as messages, sop_pb2_grpc as service
28
+
28
29
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
29
30
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
30
31
 
@@ -48,7 +49,7 @@ class SOPTemplateLink(CrudItem):
48
49
  --------
49
50
  >>> from ansys.speos.core.speos import Speos
50
51
  >>> from ansys.speos.core.kernel.sop_template import ProtoSOPTemplate
51
- >>> speos = Speos(host="localhost", port=50098)
52
+ >>> speos = Speos()
52
53
  >>> sop_t_db = speos.client.sop_templates()
53
54
  >>> sop_t_message = ProtoSOPTemplate(name="Mirror_50")
54
55
  >>> sop_t_message.mirror.reflectance = 50
@@ -103,7 +104,7 @@ class SOPTemplateStub(CrudStub):
103
104
  method. Like in the following example:
104
105
 
105
106
  >>> from ansys.speos.core.speos import Speos
106
- >>> speos = Speos(host="localhost", port=50098)
107
+ >>> speos = Speos()
107
108
  >>> sop_t_db = speos.client.sop_templates()
108
109
 
109
110
  """
@@ -28,6 +28,7 @@ from ansys.api.speos.source.v1 import (
28
28
  source_pb2 as messages,
29
29
  source_pb2_grpc as service,
30
30
  )
31
+
31
32
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
32
33
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
33
34
 
@@ -107,7 +108,7 @@ class SourceTemplateStub(CrudStub):
107
108
  source_templates() method. Like in the following example:
108
109
 
109
110
  >>> from ansys.speos.core.speos import Speos
110
- >>> speos = Speos(host="localhost", port=50098)
111
+ >>> speos = Speos()
111
112
  >>> src_t_db = speos.client.source_templates()
112
113
 
113
114
  """
@@ -28,6 +28,7 @@ from ansys.api.speos.spectrum.v1 import (
28
28
  spectrum_pb2 as messages,
29
29
  spectrum_pb2_grpc as service,
30
30
  )
31
+
31
32
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
32
33
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
33
34
 
@@ -51,7 +52,7 @@ class SpectrumLink(CrudItem):
51
52
  --------
52
53
  >>> from ansys.speos.core.speos import Speos
53
54
  >>> from ansys.speos.core.kernel.spectrum import ProtoSpectrum
54
- >>> speos = Speos(host="localhost", port=50098)
55
+ >>> speos = Speos()
55
56
  >>> spe_db = speos.client.spectrums()
56
57
  >>> spe_message = ProtoSpectrum(name="Monochromatic_600")
57
58
  >>> spe_message.monochromatic.wavelength = 600
@@ -106,7 +107,7 @@ class SpectrumStub(CrudStub):
106
107
  Like in the following example:
107
108
 
108
109
  >>> from ansys.speos.core.speos import Speos
109
- >>> speos = Speos(host="localhost", port=50098)
110
+ >>> speos = Speos()
110
111
  >>> spe_db = speos.client.spectrums()
111
112
 
112
113
  """
@@ -25,6 +25,7 @@
25
25
  from typing import List
26
26
 
27
27
  from ansys.api.speos.vop.v1 import vop_pb2 as messages, vop_pb2_grpc as service
28
+
28
29
  from ansys.speos.core.kernel.crud import CrudItem, CrudStub
29
30
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
30
31
 
@@ -48,7 +49,7 @@ class VOPTemplateLink(CrudItem):
48
49
  --------
49
50
  >>> from ansys.speos.core.speos import Speos
50
51
  >>> from ansys.speos.core.kernel.vop_template import ProtoVOPTemplate
51
- >>> speos = Speos(host="localhost", port=50098)
52
+ >>> speos = Speos()
52
53
  >>> vop_t_db = speos.client.vop_templates()
53
54
  >>> vop_t_message = ProtoVOPTemplate(name="Opaque")
54
55
  >>> vop_t_message.opaque.SetInParent()
@@ -103,7 +104,7 @@ class VOPTemplateStub(CrudStub):
103
104
  method. Like in the following example:
104
105
 
105
106
  >>> from ansys.speos.core.speos import Speos
106
- >>> speos = Speos(host="localhost", port=50098)
107
+ >>> speos = Speos()
107
108
  >>> vop_t_db = speos.client.vop_templates()
108
109
 
109
110
  """
@@ -24,7 +24,7 @@
24
24
 
25
25
  import os
26
26
  from pathlib import Path
27
- import subprocess
27
+ import subprocess # nosec B404
28
28
  import tempfile
29
29
  from typing import Optional, Union
30
30
 
@@ -36,6 +36,7 @@ from ansys.speos.core.generic.constants import (
36
36
  MAX_SERVER_MESSAGE_LENGTH,
37
37
  )
38
38
  from ansys.speos.core.generic.general_methods import retrieve_speos_install_dir
39
+ from ansys.speos.core.kernel.client import default_local_channel
39
40
  from ansys.speos.core.speos import Speos
40
41
 
41
42
  try:
@@ -105,18 +106,27 @@ def launch_remote_speos(
105
106
 
106
107
 
107
108
  def launch_local_speos_rpc_server(
108
- version: str = DEFAULT_VERSION,
109
+ version: Union[str, int] = DEFAULT_VERSION,
109
110
  port: Union[str, int] = DEFAULT_PORT,
110
111
  server_message_size: int = MAX_SERVER_MESSAGE_LENGTH,
111
112
  client_message_size: int = MAX_CLIENT_MESSAGE_SIZE,
112
113
  logfile_loc: str = None,
113
114
  log_level: int = 20,
114
115
  speos_rpc_path: Optional[Union[Path, str]] = None,
116
+ use_insecure: bool = False,
115
117
  ) -> Speos:
116
118
  """Launch Speos RPC server locally.
117
119
 
120
+ This method only work for SpeosRPC server supporting UDS or WNUA transport.
121
+ For release 251, minimal requirement is 2025.1.4.
122
+ For release 252, minimal requirement is 2025.2.4.
123
+ From release 261, grpc transport is always supported.
124
+
118
125
  .. warning::
119
- Do not execute this function with untrusted input parameters.
126
+
127
+ Do not execute this function with untrusted function argument or environment
128
+ variables.
129
+ See the :ref:`security guide<ref_security_consideration>` for details.
120
130
 
121
131
  Parameters
122
132
  ----------
@@ -141,13 +151,29 @@ def launch_local_speos_rpc_server(
141
151
  By default, ``logging.WARNING`` = 20.
142
152
  speos_rpc_path : Optional[str, Path]
143
153
  location of Speos rpc executable
154
+ use_insecure: bool
155
+ Whether to use insecure transport mode for the Speos RPC server.
156
+ By default, ``False``.
144
157
 
145
158
  Returns
146
159
  -------
147
160
  ansys.speos.core.speos.Speos
148
161
  An instance of the Speos Service.
149
162
  """
150
- speos_rpc_path = retrieve_speos_install_dir(speos_rpc_path, version)
163
+ try:
164
+ int(version)
165
+ except ValueError:
166
+ raise ValueError("The version is not a valid integer.")
167
+ try:
168
+ int(port)
169
+ except ValueError:
170
+ raise ValueError("The port is not a valid integer.")
171
+ try:
172
+ int(server_message_size)
173
+ except ValueError:
174
+ raise ValueError("The server message size is not a valid integer.")
175
+
176
+ speos_rpc_path = retrieve_speos_install_dir(speos_rpc_path, str(version))
151
177
  if os.name == "nt":
152
178
  speos_exec = speos_rpc_path / "SpeosRPC_Server.exe"
153
179
  else:
@@ -164,20 +190,26 @@ def launch_local_speos_rpc_server(
164
190
  logfile = logfile_loc / "speos_rpc.log"
165
191
  if not logfile_loc.exists():
166
192
  logfile_loc.mkdir()
193
+
194
+ if use_insecure:
195
+ transport_option = "--transport_insecure"
196
+ elif os.name == "nt":
197
+ transport_option = "--transport_wnua"
198
+ else:
199
+ transport_option = "--transport_uds"
167
200
  command = [
168
201
  str(speos_exec),
169
- "-p{}".format(port),
170
- "-m{}".format(server_message_size),
171
- "-l{}".format(str(logfile)),
202
+ f"-p{port}",
203
+ f"-m{server_message_size}",
204
+ f"-l{str(logfile)}",
205
+ transport_option,
172
206
  ]
173
207
  out, stdout_file = tempfile.mkstemp(suffix="speos_out.txt", dir=logfile_loc)
174
208
  err, stderr_file = tempfile.mkstemp(suffix="speos_err.txt", dir=logfile_loc)
175
209
 
176
- subprocess.Popen(command, stdout=out, stderr=err)
210
+ subprocess.Popen(command, stdout=out, stderr=err) # nosec B603
177
211
  return Speos(
178
- host="localhost",
179
- port=port,
180
- message_size=client_message_size,
212
+ channel=default_local_channel(port=port, message_size=client_message_size),
181
213
  logging_level=log_level,
182
214
  logging_file=logfile,
183
215
  speos_install_path=speos_rpc_path,
ansys/speos/core/lxp.py CHANGED
@@ -33,6 +33,7 @@ from typing import TYPE_CHECKING, Optional, Union
33
33
 
34
34
  import ansys.api.speos.lpf.v2.lpf_file_reader_pb2 as lpf_file_reader__v2__pb2
35
35
  import ansys.api.speos.lpf.v2.lpf_file_reader_pb2_grpc as lpf_file_reader__v2__pb2_grpc
36
+
36
37
  from ansys.speos.core.generic.general_methods import graphics_required, wavelength_to_rgb
37
38
  from ansys.speos.core.project import Project, Speos
38
39
 
@@ -69,9 +69,8 @@ except ImportError as err: # pragma: no cover
69
69
  raise err
70
70
 
71
71
  if TYPE_CHECKING: # pragma: no cover
72
- import pyvista as pv
73
-
74
72
  from ansys.tools.visualization_interface import Plotter
73
+ import pyvista as pv
75
74
 
76
75
 
77
76
  class Project:
@@ -850,7 +849,8 @@ class Project:
850
849
  sensor_instance=ssr_inst,
851
850
  default_values=False,
852
851
  )
853
- self._features.append(ssr_feat)
852
+ if ssr_feat is not None:
853
+ self._features.append(ssr_feat)
854
854
 
855
855
  for sim_inst in scene_data.simulations:
856
856
  if sim_inst.name in [_._name for _ in self._features]:
@@ -878,7 +878,8 @@ class Project:
878
878
  simulation_instance=sim_inst,
879
879
  default_values=False,
880
880
  )
881
- self._features.append(sim_feat)
881
+ if sim_feat is not None:
882
+ self._features.append(sim_feat)
882
883
 
883
884
  def __extract_part_mesh_info(
884
885
  self,
@@ -1033,9 +1034,8 @@ class Project:
1033
1034
  - {'style': 'surface', 'color':'white'},
1034
1035
  - {'opacity': 0.7, 'color':'white', 'show_edges': False},
1035
1036
  """
1036
- import pyvista as pv
1037
-
1038
1037
  from ansys.tools.visualization_interface import Plotter
1038
+ import pyvista as pv
1039
1039
 
1040
1040
  def find_all_subparts(target_part):
1041
1041
  subparts = []
@@ -29,10 +29,10 @@ from typing import List, Mapping, Optional, Union
29
29
  import uuid
30
30
  import warnings
31
31
 
32
+ from ansys.api.speos.sensor.v1 import camera_sensor_pb2, common_pb2, sensor_pb2
32
33
  import grpc
33
34
  import numpy as np
34
35
 
35
- from ansys.api.speos.sensor.v1 import camera_sensor_pb2, common_pb2, sensor_pb2
36
36
  import ansys.speos.core as core
37
37
  import ansys.speos.core.generic.general_methods as general_methods
38
38
  from ansys.speos.core.generic.visualization_methods import _VisualData, local2absolute
@@ -35,6 +35,7 @@ from ansys.api.speos.job.v2 import job_pb2
35
35
  from ansys.api.speos.job.v2.job_pb2 import Result
36
36
  from ansys.api.speos.scene.v2 import scene_pb2 as messages
37
37
  from ansys.api.speos.simulation.v1 import simulation_template_pb2
38
+
38
39
  from ansys.speos.core.generic.general_methods import min_speos_version
39
40
  from ansys.speos.core.kernel.job import ProtoJob
40
41
  from ansys.speos.core.kernel.proto_message_utils import protobuf_message_to_str
@@ -29,9 +29,9 @@ from difflib import SequenceMatcher
29
29
  from typing import List, Mapping, Optional, Union
30
30
  import uuid
31
31
 
32
+ from ansys.api.speos.scene.v2 import scene_pb2
32
33
  import numpy as np
33
34
 
34
- from ansys.api.speos.scene.v2 import scene_pb2
35
35
  from ansys.speos.core import (
36
36
  project as project,
37
37
  proto_message_utils as proto_message_utils,
ansys/speos/core/speos.py CHANGED
@@ -29,10 +29,7 @@ from typing import TYPE_CHECKING, Optional, Union
29
29
  from grpc import Channel
30
30
 
31
31
  from ansys.speos.core.generic.constants import (
32
- DEFAULT_HOST,
33
- DEFAULT_PORT,
34
32
  DEFAULT_VERSION,
35
- MAX_CLIENT_MESSAGE_SIZE,
36
33
  )
37
34
  from ansys.speos.core.kernel.client import SpeosClient
38
35
 
@@ -45,22 +42,15 @@ class Speos:
45
42
 
46
43
  Parameters
47
44
  ----------
48
- host : str, optional
49
- Host where the server is running.
50
- By default, ``ansys.speos.core.kernel.client.DEFAULT_HOST``.
51
- port : Union[str, int], optional
52
- Port number where the server is running.
53
- By default, ``ansys.speos.core.kernel.client.DEFAULT_PORT``.
54
45
  version : str
55
46
  The Speos server version to run, in the 3 digits format, such as "242".
56
47
  If unspecified, the version will be chosen as
57
48
  ``ansys.speos.core.kernel.client.LATEST_VERSION``.
58
- channel : ~grpc.Channel, optional
49
+ channel : grpc.Channel, optional
59
50
  gRPC channel for server communication.
51
+ Can be created with ``ansys.speos.core.kernel.grpc.transport_options``
52
+ and ``ansys.speos.core.kernel.grpc.cyberchannel``
60
53
  By default, ``None``.
61
- message_size: int
62
- Maximum Message size of a newly generated channel
63
- By default, ``MAX_CLIENT_MESSAGE_SIZE``.
64
54
  remote_instance : ansys.platform.instancemanagement.Instance
65
55
  The corresponding remote instance when the Speos Service
66
56
  is launched through PyPIM. This instance will be deleted when calling
@@ -73,15 +63,37 @@ class Speos:
73
63
  By default, ``INFO``.
74
64
  logging_file : Optional[str, Path]
75
65
  The file to output the log, if requested. By default, ``None``.
66
+
67
+ Examples
68
+ --------
69
+ >>> # Create default channel (to use when server was started with `SpeosRPC_Server.exe`)
70
+ >>> speos = Speos()
71
+ >>> # which is also equivalent to:
72
+ >>> from ansys.speos.core.kernel.client import default_local_channel
73
+ >>> channel = default_local_channel()
74
+ >>> speos = Speos(channel=channel)
75
+ >>> # Create channel with custom port and message size:
76
+ >>> # use when server was started with `SpeosRPC_Server.exe --port 53123`
77
+ >>> speos = Speos(channel=default_local_channel(port=53123, message_size=20000000))
78
+ >>> # Create insecure channel, to use when server was started with:
79
+ >>> # `SpeosRPC_Server.exe --transport-insecure`
80
+ >>> from ansys.speos.core.kernel.grpc.transport_options import (
81
+ ... TransportOptions,
82
+ ... InsecureOptions,
83
+ ... TransportMode,
84
+ ... )
85
+ >>> transport = TransportOptions(
86
+ ... mode=TransportMode.INSECURE,
87
+ ... options=InsecureOptions(host=host, port=port, allow_remote_host=True),
88
+ ... )
89
+ >>> grpc_options = [("grpc.max_receive_message_length", message_size)]
90
+ >>> speos = Speos(channel=transport.create_channel(grpc_options))
76
91
  """
77
92
 
78
93
  def __init__(
79
94
  self,
80
- host: str = DEFAULT_HOST,
81
- port: Union[str, int] = DEFAULT_PORT,
82
95
  version: str = DEFAULT_VERSION,
83
96
  channel: Optional[Channel] = None,
84
- message_size: int = MAX_CLIENT_MESSAGE_SIZE,
85
97
  remote_instance: Optional["Instance"] = None,
86
98
  timeout: Optional[int] = 60,
87
99
  logging_level: Optional[int] = logging.INFO,
@@ -89,11 +101,8 @@ class Speos:
89
101
  speos_install_path: Optional[Union[Path, str]] = None,
90
102
  ):
91
103
  self._client = SpeosClient(
92
- host=host,
93
- port=port,
94
104
  version=version,
95
105
  channel=channel,
96
- message_size=message_size,
97
106
  remote_instance=remote_instance,
98
107
  timeout=timeout,
99
108
  logging_level=logging_level,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ansys-speos-core
3
- Version: 0.6.2
3
+ Version: 0.7.0
4
4
  Summary: A Python wrapper for Ansys Speos
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: "ANSYS, Inc." <pyansys.core@ansys.com>
@@ -21,28 +21,25 @@ Classifier: Topic :: Scientific/Engineering :: Physics
21
21
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
22
22
  License-File: LICENSE
23
23
  Requires-Dist: protobuf>=3.20,<7
24
- Requires-Dist: grpcio>=1.50.0,<1.75
24
+ Requires-Dist: grpcio>=1.50.0,<1.77
25
25
  Requires-Dist: grpcio-health-checking>=1.45.0,<1.68
26
26
  Requires-Dist: ansys-api-speos==0.15.3
27
- Requires-Dist: ansys-tools-path>=0.3.1
27
+ Requires-Dist: ansys-tools-common>=0.3.1
28
28
  Requires-Dist: numpy>=1.20.3,<3
29
29
  Requires-Dist: comtypes>=1.4,<1.5; platform_system=='Windows'
30
- Requires-Dist: ansys-sphinx-theme==1.6.0 ; extra == "doc"
31
- Requires-Dist: numpydoc==1.8.0 ; extra == "doc"
30
+ Requires-Dist: ansys-sphinx-theme[autoapi]==1.6.3 ; extra == "doc"
31
+ Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "doc"
32
+ Requires-Dist: numpydoc==1.10.0 ; extra == "doc"
32
33
  Requires-Dist: Sphinx==8.1.3 ; extra == "doc"
33
34
  Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "doc"
34
- Requires-Dist: sphinx-autoapi==3.6.0 ; extra == "doc"
35
- Requires-Dist: sphinx_design==0.6.1 ; extra == "doc"
36
- Requires-Dist: sphinx-jinja==2.0.2 ; extra == "doc"
37
- Requires-Dist: sphinxcontrib-mermaid==1.0.0 ; extra == "doc"
35
+ Requires-Dist: sphinxcontrib-mermaid==1.2.3 ; extra == "doc"
38
36
  Requires-Dist: myst-parser==4.0.1 ; extra == "doc"
39
- Requires-Dist: nbsphinx==0.9.7 ; extra == "doc"
40
- Requires-Dist: jupytext==1.17.3 ; extra == "doc"
41
- Requires-Dist: jupyterlab==4.4.7 ; extra == "doc"
37
+ Requires-Dist: nbsphinx==0.9.8 ; extra == "doc"
38
+ Requires-Dist: jupytext==1.18.1 ; extra == "doc"
39
+ Requires-Dist: jupyterlab==4.5.0 ; extra == "doc"
42
40
  Requires-Dist: jupyter-server==2.17.0 ; extra == "doc"
43
41
  Requires-Dist: nbconvert==7.16.6 ; extra == "doc"
44
42
  Requires-Dist: pyvista[jupyter]>=0.43,<0.47 ; extra == "doc"
45
- Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "doc"
46
43
  Requires-Dist: pyvista>=0.40.0,<0.47 ; extra == "graphics"
47
44
  Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "graphics"
48
45
  Requires-Dist: matplotlib ; extra == "jupyter"
@@ -50,13 +47,13 @@ Requires-Dist: jupyterlab>=3 ; extra == "jupyter"
50
47
  Requires-Dist: ipywidgets ; extra == "jupyter"
51
48
  Requires-Dist: pyvista[jupyter]>=0.43,<0.47 ; extra == "jupyter"
52
49
  Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "jupyter"
53
- Requires-Dist: notebook==7.4.5 ; extra == "jupyter"
54
- Requires-Dist: psutil==7.0.0 ; extra == "tests"
55
- Requires-Dist: pytest==8.4.2 ; extra == "tests"
50
+ Requires-Dist: notebook==7.5.0 ; extra == "jupyter"
51
+ Requires-Dist: psutil==7.1.3 ; extra == "tests"
52
+ Requires-Dist: pytest==9.0.1 ; extra == "tests"
56
53
  Requires-Dist: pyvista>=0.40.0,<0.47 ; extra == "tests"
57
54
  Requires-Dist: ansys-tools-visualization-interface>=0.8.3 ; extra == "tests"
58
55
  Requires-Dist: ansys-platform-instancemanagement>=1.0.3 ; extra == "tests"
59
- Requires-Dist: pytest-cov==6.3.0 ; extra == "tests"
56
+ Requires-Dist: pytest-cov==7.0.0 ; extra == "tests"
60
57
  Project-URL: Changelog, https://github.com/ansys/pyspeos/blob/main/doc/source/changelog.rst
61
58
  Project-URL: Discussions, https://github.com/ansys/pyspeos/discussions
62
59
  Project-URL: Documentation, https://speos.docs.pyansys.com/
@@ -143,7 +140,7 @@ All sources are located in `<src/>`_ folder.
143
140
 
144
141
  from ansys.speos.core.speos import Speos
145
142
 
146
- speos = Speos(host="localhost", port=50098)
143
+ speos = Speos()
147
144
 
148
145
  Documentation and issues
149
146
  ------------------------
@@ -213,11 +210,11 @@ Then, to launch SpeosRPC server with product version 2025.1, you can run:
213
210
 
214
211
  cat GH_TOKEN.txt | docker login ghcr.io -u "$GH_USERNAME" --password-stdin
215
212
  docker pull ghcr.io/ansys/speos-rpc:252
216
- docker run --detach --name speos-rpc -p 50098:50098 -e ANSYSLMD_LICENSE_FILE=$LICENSE_SERVER --entrypoint /app/SpeosRPC_Server.x ghcr.io/ansys/speos-rpc:252
213
+ docker run --detach --name speos-rpc -p 127.0.0.1:50098:50098 -e ANSYSLMD_LICENSE_FILE=$LICENSE_SERVER --entrypoint /app/SpeosRPC_Server.x ghcr.io/ansys/speos-rpc:252 --transport_insecure --host 0.0.0.0
217
214
 
218
215
  .. note::
219
216
 
220
- To use the latest image in development, you can use `ghcr.io/ansys/speos-rpc:252`.
217
+ To use the latest image in development, you can use `ghcr.io/ansys/speos-rpc:dev`.
221
218
 
222
219
  On the other hand, the SpeosRPC server can be started locally.
223
220
 
@@ -0,0 +1,46 @@
1
+ ansys/speos/core/__init__.py,sha256=IVbIofkDu5EBe1sOr5SYfISacoR4gkb8sm2S-hFbXmw,2173
2
+ ansys/speos/core/body.py,sha256=D3IYL6V4PJp03BEYN5FVkCIr4W1in18XWMGExStsJsA,9703
3
+ ansys/speos/core/bsdf.py,sha256=vCmxGqa7bDe7iGfhRD9vKtS8JN7DeE6aSU4Q95Hng8w,61522
4
+ ansys/speos/core/face.py,sha256=PaywEiEO-gt96PVzrm46rba4DrqPFPxyNajNwB4ZPn8,7234
5
+ ansys/speos/core/geo_ref.py,sha256=zBvCepLSslR_Kr8x51eDK2_ShVj0Tu1AZA2aOfPWqjY,2057
6
+ ansys/speos/core/intensity.py,sha256=DJ3lLQyQWQoFxD1_bl5K286nHnOcu5yh4bTiWR-BsVs,17638
7
+ ansys/speos/core/launcher.py,sha256=lSwAnPOzocWJ-ecaKpfInJTWJFQrixBlH0GLmDQWOi0,7820
8
+ ansys/speos/core/logger.py,sha256=_Ct2rn2u9ZcBdwDkJ_nnnxy9pi5qKmUVgspqDJjfF4Q,22663
9
+ ansys/speos/core/lxp.py,sha256=pqrbRCYPk6F3uFCZhCpM8cuvtHNAy3TGQbsHe4jhAP8,17120
10
+ ansys/speos/core/opt_prop.py,sha256=0u8uuE0hkcVvWmGetKUuExRnxispOUPctqoD8yMloR0,20259
11
+ ansys/speos/core/part.py,sha256=dcspF6WoqM2AhqCpS8dizZSvbfTlvcys0jHvo08IxAY,24038
12
+ ansys/speos/core/project.py,sha256=IJTL858hOtZehJOfbzt4fFtoztA10tEc-atU9OQG6_s,41911
13
+ ansys/speos/core/proto_message_utils.py,sha256=MSljeekBmSnMBGQ9hU6qhXLXu1JahXIlxkOYGQcYA2E,10479
14
+ ansys/speos/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ ansys/speos/core/sensor.py,sha256=b6ZhJKJxvxMfneTeyD1wMWaGvk1muFK0L9OHOqOlCdE,139902
16
+ ansys/speos/core/simulation.py,sha256=Hju8u71IQyuA4h-abu4KUXKYfci49xQoCN9qEsDiBZo,55429
17
+ ansys/speos/core/source.py,sha256=o9HnIMgBAqZz8EJ93Na04YkXiXkeJpGVyFtjeyk1WDo,63005
18
+ ansys/speos/core/spectrum.py,sha256=PZpHlZ7nVsYFzFeOg1D49aREkWxHI3Nei1CQ4TrTMKs,9509
19
+ ansys/speos/core/speos.py,sha256=h5c_DUB0rJOqfBPXPL-nwqtFgoHf8-dIeErUf0pXpF0,5154
20
+ ansys/speos/core/generic/constants.py,sha256=gpWpBXx3Jdovrp9TPyGmEsWdg8d-paOcY-4hGtMf2iw,1861
21
+ ansys/speos/core/generic/general_methods.py,sha256=m2zAVpwIXjjnNRfvc3Pm0_OPbAxb06WI8DxCJOMMzS4,10055
22
+ ansys/speos/core/generic/visualization_methods.py,sha256=q5JHIyAlocL5nYWTy7EaBg5JjQgSrVJRQvBpicpyFGU,11753
23
+ ansys/speos/core/kernel/__init__.py,sha256=sYt0hIYkslTIbIfEXsux4M5neIaDQV61a1crZGOpTRk,2439
24
+ ansys/speos/core/kernel/body.py,sha256=it0ZIRkS3E2_WFVgNYkMdecxNzeV80bJGQ8dKktNZBM,5327
25
+ ansys/speos/core/kernel/client.py,sha256=CyssTlm9SFSBGUFVfWT5WqbAjTl5hR1pPJb7-jbciGY,21508
26
+ ansys/speos/core/kernel/crud.py,sha256=dJagcerQhs3foOCZXuXN6xwf7krBdMrhyhDYGQtFZtQ,2618
27
+ ansys/speos/core/kernel/face.py,sha256=CIlafANmv0B5N9o7k2QPoU3EeV-fW8NqvH-DsnTlbzg,12223
28
+ ansys/speos/core/kernel/intensity_template.py,sha256=sg_QoVRe4P0FtxyzBltFFduEVNk1bKzHmtfpDZVt9p0,7192
29
+ ansys/speos/core/kernel/job.py,sha256=mN1uZOgRocfhMji0YKfkvhOF1Xk5m_U1DOLqN3vWB-0,8714
30
+ ansys/speos/core/kernel/part.py,sha256=OVFUBO9DSyK9M_5C_E9bHvIJ-2UHtp72RZOu3AJvWUE,5316
31
+ ansys/speos/core/kernel/proto_message_utils.py,sha256=3_6DyEe1o-6d4oKolexBOa5bEuFbqRLli2v5ZisYtuM,2935
32
+ ansys/speos/core/kernel/scene.py,sha256=tE0FSZES8CX6BUU5RMJEVgMPKz9EPa1CL7TKdqdSHbE,9279
33
+ ansys/speos/core/kernel/sensor_template.py,sha256=PvK1kTlmSR_dDDzM73BfYBEVJJbtC-YaoIzpr7X6wB4,6896
34
+ ansys/speos/core/kernel/simulation_template.py,sha256=3O6ing3T5PmJQrv78tp3tXmnd6IdkzuDa8rqEG4QKE8,7147
35
+ ansys/speos/core/kernel/sop_template.py,sha256=qvnD7q50j0x-2sFqEzLWsPeZajxI5q-CqWx6G9XNw8U,6155
36
+ ansys/speos/core/kernel/source_template.py,sha256=28YzugjfvauD0hq_DtAHri_jUAAISizyDi0TRe_3nkY,6468
37
+ ansys/speos/core/kernel/spectrum.py,sha256=9xrEoF2jbjzwf_tBX-Y67ejPDdIUkBnvwxGpYK-h1l0,5945
38
+ ansys/speos/core/kernel/vop_template.py,sha256=YUhsFYWaETKSGc3TBEEsp15PAC7mwv9koTpp-jKLTpA,6153
39
+ ansys/speos/core/kernel/grpc/transport_options.py,sha256=M0N4Dr2KpS7iPDvtt-w3VaFHO8yJ7bdLGgpC1-qWY5Y,5863
40
+ ansys/speos/core/workflow/__init__.py,sha256=zaZ2dEvMudGZ98MdVZY0Ej-KHtU6qSULFviE-PuIuGM,1512
41
+ ansys/speos/core/workflow/combine_speos.py,sha256=0TVYYudBy4a6H7ZcDLnKRhPQ3Lv1_0X7TKHxkB2ZMdU,6435
42
+ ansys/speos/core/workflow/open_result.py,sha256=hxTpo8BAxt8oEWKX210_kMp04ywBwOAvGh8cCbuFooY,15160
43
+ ansys_speos_core-0.7.0.dist-info/licenses/LICENSE,sha256=IhvStQBsZm7tV9bx9yvmmBXxrigDLUeCP8h8TevNE7k,1098
44
+ ansys_speos_core-0.7.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
45
+ ansys_speos_core-0.7.0.dist-info/METADATA,sha256=r0wRv8xAGqAgy8Yc5pziN-CW5Oa3n-O0adIpX5g24lA,11522
46
+ ansys_speos_core-0.7.0.dist-info/RECORD,,
@@ -1,45 +0,0 @@
1
- ansys/speos/core/__init__.py,sha256=IVbIofkDu5EBe1sOr5SYfISacoR4gkb8sm2S-hFbXmw,2173
2
- ansys/speos/core/body.py,sha256=D3IYL6V4PJp03BEYN5FVkCIr4W1in18XWMGExStsJsA,9703
3
- ansys/speos/core/bsdf.py,sha256=h-33-00sKXTXdWvtcexqEL4i4S4gtMDHzF-AR1_i7HU,61522
4
- ansys/speos/core/face.py,sha256=PaywEiEO-gt96PVzrm46rba4DrqPFPxyNajNwB4ZPn8,7234
5
- ansys/speos/core/geo_ref.py,sha256=zBvCepLSslR_Kr8x51eDK2_ShVj0Tu1AZA2aOfPWqjY,2057
6
- ansys/speos/core/intensity.py,sha256=DJ3lLQyQWQoFxD1_bl5K286nHnOcu5yh4bTiWR-BsVs,17638
7
- ansys/speos/core/launcher.py,sha256=wfNGgC7bMju31q9W7QU_e93WvCctO9sooF8KVmGTINI,6622
8
- ansys/speos/core/logger.py,sha256=_Ct2rn2u9ZcBdwDkJ_nnnxy9pi5qKmUVgspqDJjfF4Q,22663
9
- ansys/speos/core/lxp.py,sha256=B3O3N0rfxES3IXU06hKHdxYRNlNpHZ9OcVBPbzwHysA,17119
10
- ansys/speos/core/opt_prop.py,sha256=0u8uuE0hkcVvWmGetKUuExRnxispOUPctqoD8yMloR0,20259
11
- ansys/speos/core/part.py,sha256=dcspF6WoqM2AhqCpS8dizZSvbfTlvcys0jHvo08IxAY,24038
12
- ansys/speos/core/project.py,sha256=byE8BbbYyf2d-z8V0bUWDo4C4i_co3rpshhI5GXs2tA,41831
13
- ansys/speos/core/proto_message_utils.py,sha256=MSljeekBmSnMBGQ9hU6qhXLXu1JahXIlxkOYGQcYA2E,10479
14
- ansys/speos/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- ansys/speos/core/sensor.py,sha256=FIk9pye74Vz0DXtiL1K0Ca7qtOf3sPYH5XLTkO466iA,139902
16
- ansys/speos/core/simulation.py,sha256=k70xqR9uzlIbS3ADTznQaRtp9zddig-7h_lOwzL302M,55428
17
- ansys/speos/core/source.py,sha256=LumElFnO-jQn5rxIKHCKbxymIYViT7UDAl8USKwHI9A,63005
18
- ansys/speos/core/spectrum.py,sha256=PZpHlZ7nVsYFzFeOg1D49aREkWxHI3Nei1CQ4TrTMKs,9509
19
- ansys/speos/core/speos.py,sha256=jVPr-59fEdVH1nulWmnTlvXQODx4xhNF0aK9YFBthU8,4551
20
- ansys/speos/core/generic/constants.py,sha256=gpWpBXx3Jdovrp9TPyGmEsWdg8d-paOcY-4hGtMf2iw,1861
21
- ansys/speos/core/generic/general_methods.py,sha256=dy8BQobJAxELNf8WUDMj_corAhgom1hUCY4FM7KRdh8,10154
22
- ansys/speos/core/generic/visualization_methods.py,sha256=q5JHIyAlocL5nYWTy7EaBg5JjQgSrVJRQvBpicpyFGU,11753
23
- ansys/speos/core/kernel/__init__.py,sha256=sYt0hIYkslTIbIfEXsux4M5neIaDQV61a1crZGOpTRk,2439
24
- ansys/speos/core/kernel/body.py,sha256=VyLJAS83ZM1R8hLH5teiAKuWyTmfP1GNNhjgtX0Uk0E,5354
25
- ansys/speos/core/kernel/client.py,sha256=tdn8Z-Xi2tWycQFHZq621ljCd-IvB8HCXvETMdG06ME,19804
26
- ansys/speos/core/kernel/crud.py,sha256=dJagcerQhs3foOCZXuXN6xwf7krBdMrhyhDYGQtFZtQ,2618
27
- ansys/speos/core/kernel/face.py,sha256=lnAHH9os9sR8aJivb61hZwnxsj2SlzusiNq8W4bYWfw,12251
28
- ansys/speos/core/kernel/intensity_template.py,sha256=fmF0Oi74P29dULBI4uw6rLVoCgLwLWU5wV2ZwyNizaI,7247
29
- ansys/speos/core/kernel/job.py,sha256=TY8PCNVQDs0ETu3kZDeN9AWJSpMmgkO43kxN2p29UZ0,7488
30
- ansys/speos/core/kernel/part.py,sha256=WFQ0nRR5IFlZ5O2TyugtUco_lIqcbn_672j4QhvoOGA,5343
31
- ansys/speos/core/kernel/proto_message_utils.py,sha256=3_6DyEe1o-6d4oKolexBOa5bEuFbqRLli2v5ZisYtuM,2935
32
- ansys/speos/core/kernel/scene.py,sha256=whA21jc-H1t7KEhLp9apSEuD_UCI92x9AhLqGnjMJOk,9334
33
- ansys/speos/core/kernel/sensor_template.py,sha256=8bXRfbYBSFbsGsiX1JwiBR6mwyxV0lvFsE9cfAtYres,6951
34
- ansys/speos/core/kernel/simulation_template.py,sha256=CoBkheCNzAe29JdddnU8yTgGoufP9Fr7DPODkOIpZuA,7202
35
- ansys/speos/core/kernel/sop_template.py,sha256=CRJKXFqDh4S04zbbc3sYmhD1QnDkRmTD-_8JzMp9kaI,6210
36
- ansys/speos/core/kernel/source_template.py,sha256=_MG1JwmTDGkcK1ZNyxQinVYxE2j2Rp70sDWNiYgiWo4,6495
37
- ansys/speos/core/kernel/spectrum.py,sha256=Ij3IlQtSnclxmllqNbHYckm5Zro6tjgoX1dTQeHWzsA,6000
38
- ansys/speos/core/kernel/vop_template.py,sha256=w6p3B-BnKU4k_6KufMUQ4WToxw0SNOVXyl-xb0m4iZo,6208
39
- ansys/speos/core/workflow/__init__.py,sha256=zaZ2dEvMudGZ98MdVZY0Ej-KHtU6qSULFviE-PuIuGM,1512
40
- ansys/speos/core/workflow/combine_speos.py,sha256=0TVYYudBy4a6H7ZcDLnKRhPQ3Lv1_0X7TKHxkB2ZMdU,6435
41
- ansys/speos/core/workflow/open_result.py,sha256=hxTpo8BAxt8oEWKX210_kMp04ywBwOAvGh8cCbuFooY,15160
42
- ansys_speos_core-0.6.2.dist-info/licenses/LICENSE,sha256=IhvStQBsZm7tV9bx9yvmmBXxrigDLUeCP8h8TevNE7k,1098
43
- ansys_speos_core-0.6.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
44
- ansys_speos_core-0.6.2.dist-info/METADATA,sha256=oDLI_8Wxe4SV8kAJK4oGVj5NER1tEs39pMoxcJgDZrk,11651
45
- ansys_speos_core-0.6.2.dist-info/RECORD,,