Skip to content

Commit bd3b65d

Browse files
RobPasMuepyansys-ci-botumutsoysalansysjacobrkerstetterJacob Kerstetter
authored
feat: blitz (2nd round) (#1853)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Umut Soysal <[email protected]> Co-authored-by: Jacob Kerstetter <[email protected]> Co-authored-by: Jacob Kerstetter <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Matteo Bini <[email protected]> Co-authored-by: Jonah Boling <[email protected]> Co-authored-by: Mike Kaplan <[email protected]> Co-authored-by: smereu <[email protected]>
1 parent 8bb7af7 commit bd3b65d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1403
-170
lines changed

doc/changelog.d/1779.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Streaming upload support

doc/changelog.d/1806.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
matrix helper methods

doc/changelog.d/1808.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
translating sketch issues when using a custom default unit

doc/changelog.d/1816.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
edge start and end were not being mapped correctly

doc/changelog.d/1820.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
component name setting

doc/changelog.d/1821.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enable runscript for CoreService

doc/changelog.d/1828.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enhanced beam implementation

doc/changelog.d/1834.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
update api geometry dependency

doc/changelog.d/1840.dependencies.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ansys api geometry 0.4.49

doc/changelog.d/1842.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
revolve faces and revolve faces by helix options

doc/changelog.d/1850.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tessellation options were not extended to component/face methods

doc/changelog.d/1851.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove rounds

doc/changelog.d/1853.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blitz (2nd round)

doc/changelog.d/1854.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
named selection import test

doc/changelog.d/1855.maintenance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cleanup blitz PR

src/ansys/geometry/core/connection/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@
3838
trimmed_curve_to_grpc_trimmed_curve,
3939
unit_vector_to_grpc_direction,
4040
)
41-
from ansys.geometry.core.connection.defaults import (
42-
DEFAULT_HOST,
43-
DEFAULT_PORT,
44-
GEOMETRY_SERVICE_DOCKER_IMAGE,
45-
)
41+
import ansys.geometry.core.connection.defaults as defaults
4642
from ansys.geometry.core.connection.docker_instance import (
4743
GeometryContainers,
4844
LocalDockerInstance,

src/ansys/geometry/core/connection/backend.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,27 @@ def is_core_service(backend_type: "BackendType") -> bool:
5757
BackendType.CORE_LINUX,
5858
)
5959

60+
@staticmethod
61+
def is_headless_service(backend_type: "BackendType") -> bool:
62+
"""Determine whether the backend is a headless service or not.
63+
64+
Parameters
65+
----------
66+
backend_type : BackendType
67+
The backend type to check whether or not it's a headless service.
68+
69+
Returns
70+
-------
71+
bool
72+
True if the backend is a headless service, False otherwise.
73+
"""
74+
return backend_type in (
75+
BackendType.WINDOWS_SERVICE,
76+
BackendType.LINUX_SERVICE,
77+
BackendType.CORE_WINDOWS,
78+
BackendType.CORE_LINUX,
79+
)
80+
6081
@staticmethod
6182
def is_linux_service(backend_type: "BackendType") -> bool:
6283
"""Determine whether the backend is a Linux service or not.

src/ansys/geometry/core/connection/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
)
5555
from ansys.api.dbu.v0.admin_pb2_grpc import AdminStub
5656
from ansys.geometry.core.connection.backend import BackendType
57-
from ansys.geometry.core.connection.defaults import DEFAULT_HOST, DEFAULT_PORT, MAX_MESSAGE_LENGTH
57+
import ansys.geometry.core.connection.defaults as pygeom_defaults
5858
from ansys.geometry.core.connection.docker_instance import LocalDockerInstance
5959
from ansys.geometry.core.connection.product_instance import ProductInstance
6060
from ansys.geometry.core.logger import LOG, PyGeometryCustomAdapter
@@ -158,8 +158,8 @@ class GrpcClient:
158158
@check_input_types
159159
def __init__(
160160
self,
161-
host: str = DEFAULT_HOST,
162-
port: str | int = DEFAULT_PORT,
161+
host: str = pygeom_defaults.DEFAULT_HOST,
162+
port: str | int = pygeom_defaults.DEFAULT_PORT,
163163
channel: grpc.Channel | None = None,
164164
remote_instance: Optional["Instance"] = None,
165165
docker_instance: LocalDockerInstance | None = None,
@@ -183,8 +183,8 @@ def __init__(
183183
self._channel = grpc.insecure_channel(
184184
self._target,
185185
options=[
186-
("grpc.max_receive_message_length", MAX_MESSAGE_LENGTH),
187-
("grpc.max_send_message_length", MAX_MESSAGE_LENGTH),
186+
("grpc.max_receive_message_length", pygeom_defaults.MAX_MESSAGE_LENGTH),
187+
("grpc.max_send_message_length", pygeom_defaults.MAX_MESSAGE_LENGTH),
188188
],
189189
)
190190

src/ansys/geometry/core/connection/docker_instance.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
except ModuleNotFoundError: # pragma: no cover
3838
_HAS_DOCKER = False
3939

40-
from ansys.geometry.core.connection.defaults import DEFAULT_PORT, GEOMETRY_SERVICE_DOCKER_IMAGE
40+
import ansys.geometry.core.connection.defaults as pygeom_defaults
4141
from ansys.geometry.core.logger import LOG
4242

4343

@@ -157,7 +157,7 @@ def is_docker_installed() -> bool:
157157
@_docker_python_available
158158
def __init__(
159159
self,
160-
port: int = DEFAULT_PORT,
160+
port: int = pygeom_defaults.DEFAULT_PORT,
161161
connect_to_existing_service: bool = True,
162162
restart_if_existing_service: bool = False,
163163
name: str | None = None,
@@ -234,7 +234,10 @@ def _is_cont_geom_service(self, cont: "Container") -> bool:
234234
# If one of the tags matches a Geometry service tag --> Return True
235235
for tag in cont.image.tags:
236236
for geom_services in GeometryContainers:
237-
if tag == f"{GEOMETRY_SERVICE_DOCKER_IMAGE}:{geom_services.value[2]}":
237+
if (
238+
tag
239+
== f"{pygeom_defaults.GEOMETRY_SERVICE_DOCKER_IMAGE}:{geom_services.value[2]}"
240+
):
238241
return True
239242

240243
# If you have reached this point, the image is not a Geometry service
@@ -290,7 +293,7 @@ def _deploy_container(self, port: int, name: str | None, image: GeometryContaine
290293
# Try to deploy it
291294
try:
292295
container: Container = self.docker_client().containers.run(
293-
image=f"{GEOMETRY_SERVICE_DOCKER_IMAGE}:{image.value[2]}",
296+
image=f"{pygeom_defaults.GEOMETRY_SERVICE_DOCKER_IMAGE}:{image.value[2]}",
294297
detach=True,
295298
auto_remove=True,
296299
name=name,
@@ -350,7 +353,7 @@ def get_geometry_container_type(instance: LocalDockerInstance) -> GeometryContai
350353
"""
351354
for tag in instance.container.image.tags:
352355
for geom_services in GeometryContainers:
353-
if tag == f"{GEOMETRY_SERVICE_DOCKER_IMAGE}:{geom_services.value[2]}":
356+
if tag == f"{pygeom_defaults.GEOMETRY_SERVICE_DOCKER_IMAGE}:{geom_services.value[2]}":
354357
return geom_services
355358

356359
return None

src/ansys/geometry/core/connection/launcher.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
from typing import TYPE_CHECKING
2828

2929
from ansys.geometry.core.connection.backend import ApiVersions, BackendType
30-
from ansys.geometry.core.connection.client import MAX_MESSAGE_LENGTH
31-
from ansys.geometry.core.connection.defaults import DEFAULT_PIM_CONFIG, DEFAULT_PORT
30+
import ansys.geometry.core.connection.defaults as pygeom_defaults
3231
from ansys.geometry.core.connection.docker_instance import (
3332
_HAS_DOCKER,
3433
GeometryContainers,
@@ -290,7 +289,7 @@ def launch_remote_modeler(
290289

291290

292291
def launch_docker_modeler(
293-
port: int = DEFAULT_PORT,
292+
port: int = pygeom_defaults.DEFAULT_PORT,
294293
connect_to_existing_service: bool = True,
295294
restart_if_existing_service: bool = False,
296295
name: str | None = None,
@@ -958,7 +957,7 @@ def _launch_pim_instance(
958957

959958
# If PIM Light is being used and PyPIM configuration is not defined... use defaults.
960959
if is_pim_light and not os.environ.get("ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG", None):
961-
os.environ["ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG"] = DEFAULT_PIM_CONFIG
960+
os.environ["ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIG"] = pygeom_defaults.DEFAULT_PIM_CONFIG
962961
pop_out = True
963962
else:
964963
pop_out = False
@@ -969,7 +968,7 @@ def _launch_pim_instance(
969968
instance.wait_for_ready()
970969
channel = instance.build_grpc_channel(
971970
options=[
972-
("grpc.max_receive_message_length", MAX_MESSAGE_LENGTH),
971+
("grpc.max_receive_message_length", pygeom_defaults.MAX_MESSAGE_LENGTH),
973972
]
974973
)
975974

0 commit comments

Comments
 (0)