Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
084fef8
feat: reimplement designs stub + refactor
RobPasMue May 14, 2025
07b6e27
fix: pre-commit
RobPasMue May 15, 2025
4aad650
Merge branch 'main' into feat/grpc-rearchitect
RobPasMue May 15, 2025
400d52c
feat: adding parts stub to grpc rearchitect
RobPasMue May 15, 2025
305c078
chore: adding changelog file 1988.added.md [dependabot-skip]
pyansys-ci-bot May 15, 2025
c943312
chore: no cover statements
RobPasMue May 16, 2025
f3f95bf
Merge branch 'feat/grpc-rearchitect' of https://github.com/ansys/pyan…
RobPasMue May 16, 2025
60db0c8
Merge branch 'main' into feat/grpc-rearchitect
RobPasMue May 16, 2025
a7a7ed3
feat: change materials stub
RobPasMue May 16, 2025
9e84a48
feat: add edges stub
RobPasMue May 18, 2025
ac28a10
fix: remove EdgesStub from edge class
RobPasMue May 18, 2025
58357b1
Merge branch 'main' into feat/grpc-rearchitect
RobPasMue May 18, 2025
f988d86
fix: missing imports
RobPasMue May 18, 2025
ee2e764
Merge branch 'feat/grpc-rearchitect' of https://github.com/ansys/pyan…
RobPasMue May 18, 2025
582a8c3
fix: typo
RobPasMue May 18, 2025
11348af
fix: import
RobPasMue May 18, 2025
23f9a6f
fix: relocate imports
RobPasMue May 18, 2025
d0bd397
fix: response arg in get_curve
RobPasMue May 18, 2025
b8cb2db
Merge branch 'main' into feat/grpc-rearchitect
RobPasMue May 21, 2025
2368641
feat: adding faces support in grpc
RobPasMue May 21, 2025
d9aafa8
fix: missing import
RobPasMue May 21, 2025
5d903c9
fix: method call
RobPasMue May 22, 2025
5f3a8a6
fix: typo
RobPasMue May 22, 2025
f787835
fix: typo
RobPasMue May 22, 2025
58aedd7
Merge branch 'main' into feat/grpc-rearchitect
RobPasMue May 22, 2025
94edaae
fix: failing get_loops
RobPasMue May 22, 2025
c740715
fix: unnecessary decorators + key issues
RobPasMue May 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.10
hooks:
- id: ruff
- id: ruff-check
- id: ruff-format

- repo: https://github.com/codespell-project/codespell
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1988.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grpc reachitecture - several modules
280 changes: 210 additions & 70 deletions src/ansys/geometry/core/_grpc/_services/_service.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/ansys/geometry/core/_grpc/_services/base/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import grpc


class GRPCAdminService(ABC):
class GRPCAdminService(ABC): # pragma: no cover
"""Admin service for gRPC communication with the Geometry server.

Parameters
Expand All @@ -37,19 +37,19 @@ class GRPCAdminService(ABC):

def __init__(self, channel: grpc.Channel):
"""Initialize the GRPCAdminService class."""
pass # pragma: no cover
pass

@abstractmethod
def get_backend(self, **kwargs) -> dict:
"""Get server information."""
pass # pragma: no cover
pass

@abstractmethod
def get_logs(self, **kwargs) -> dict:
"""Get server logs."""
pass # pragma: no cover
pass

@abstractmethod
def get_service_status(self, **kwargs) -> dict:
"""Get server status (i.e. healthy or not)."""
pass # pragma: no cover
pass
70 changes: 35 additions & 35 deletions src/ansys/geometry/core/_grpc/_services/base/bodies.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import grpc


class GRPCBodyService(ABC):
class GRPCBodyService(ABC): # pragma: no cover
"""Body service for gRPC communication with the Geometry server.

Parameters
Expand All @@ -37,169 +37,169 @@ class GRPCBodyService(ABC):

def __init__(self, channel: grpc.Channel):
"""Initialize the GRPCBodyService class."""
pass # pragma: no cover
pass

@abstractmethod
def create_sphere_body(self, **kwargs) -> dict:
"""Create a sphere body."""
pass # pragma: no cover
pass

@abstractmethod
def create_extruded_body(self, **kwargs) -> dict:
"""Create an extruded body."""
pass # pragma: no cover
pass

@abstractmethod
def create_sweeping_profile_body(self, **kwargs) -> dict:
"""Create a sweeping profile body."""
pass # pragma: no cover
pass

@abstractmethod
def create_sweeping_chain(self, **kwargs) -> dict:
"""Create a sweeping chain."""
pass # pragma: no cover
pass

@abstractmethod
def create_extruded_body_from_face_profile(self, **kwargs) -> dict:
"""Create an extruded body from a face profile."""
pass # pragma: no cover
pass

@abstractmethod
def create_extruded_body_from_loft_profiles(self, **kwargs) -> dict:
"""Create an extruded body from loft profiles."""
pass # pragma: no cover
pass

@abstractmethod
def create_planar_body(self, **kwargs) -> dict:
"""Create a planar body."""
pass # pragma: no cover
pass

@abstractmethod
def create_body_from_face(self, **kwargs) -> dict:
"""Create a body from a face."""
pass # pragma: no cover
pass

@abstractmethod
def create_surface_body(self, **kwargs) -> dict:
"""Create a surface body."""
pass # pragma: no cover
pass

@abstractmethod
def create_surface_body_from_trimmed_curves(self, **kwargs) -> dict:
"""Create a surface body from trimmed curves."""
pass # pragma: no cover
pass

@abstractmethod
def translate(self, **kwargs) -> dict:
"""Translate a body."""
pass # pragma: no cover
pass

@abstractmethod
def delete(self, **kwargs) -> dict:
"""Delete a body."""
pass # pragma: no cover
pass

@abstractmethod
def is_suppressed(self, **kwargs) -> dict:
"""Check if a body is suppressed."""
pass # pragma: no cover
pass

@abstractmethod
def get_color(self, **kwargs) -> dict:
"""Get the color of a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_faces(self, **kwargs) -> dict:
"""Get the faces of a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_edges(self, **kwargs) -> dict:
"""Get the edges of a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_volume(self, **kwargs) -> dict:
"""Get the volume of a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_bounding_box(self, **kwargs) -> dict:
"""Get the bounding box of a body."""
pass # pragma: no cover
pass

@abstractmethod
def set_assigned_material(self, **kwargs) -> dict:
"""Set the assigned material of a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_assigned_material(self, **kwargs) -> dict:
"""Get the assigned material of a body."""
pass # pragma: no cover
pass

@abstractmethod
def set_name(self, **kwargs) -> dict:
"""Set the name of a body."""
pass # pragma: no cover
pass

@abstractmethod
def set_fill_style(self, **kwargs) -> dict:
"""Set the fill style of a body."""
pass # pragma: no cover
pass

@abstractmethod
def set_suppressed(self, **kwargs) -> dict:
"""Set the suppressed state of a body."""
pass # pragma: no cover
pass

@abstractmethod
def set_color(self, **kwargs) -> dict:
"""Set the color of a body."""
pass # pragma: no cover
pass

@abstractmethod
def rotate(self, **kwargs) -> dict:
"""Rotate a body."""
pass # pragma: no cover
pass

@abstractmethod
def scale(self, **kwargs) -> dict:
"""Scale a body."""
pass # pragma: no cover
pass

@abstractmethod
def mirror(self, **kwargs) -> dict:
"""Mirror a body."""
pass # pragma: no cover
pass

@abstractmethod
def map(self, **kwargs) -> dict:
"""Map a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_collision(self, **kwargs) -> dict:
"""Get the collision of a body."""
pass # pragma: no cover
pass

@abstractmethod
def copy(self, **kwargs) -> dict:
"""Copy a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_tesellation(self, **kwargs) -> dict:
"""Get the tessellation of a body."""
pass # pragma: no cover
pass

@abstractmethod
def get_tesellation_with_options(self, **kwargs) -> dict:
"""Get the tessellation of a body with options."""
pass # pragma: no cover
pass

@abstractmethod
def boolean(self, **kwargs) -> dict:
"""Boolean operation."""
pass # pragma: no cover
pass
23 changes: 23 additions & 0 deletions src/ansys/geometry/core/_grpc/_services/base/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# SOFTWARE.
"""Module containing server-version agnostic conversions."""

from pint import Quantity

from ansys.geometry.core.misc.measurements import DEFAULT_UNITS, Distance, Measurement


Expand Down Expand Up @@ -75,3 +77,24 @@ def to_distance(value: float | int) -> Distance:
The value should represent a length in the server's unit system.
"""
return Distance(value, DEFAULT_UNITS.SERVER_LENGTH)


def to_area(value: float | int) -> Quantity:
"""Convert a server value to an area object.

Parameters
----------
value : float | int
Value to convert.

Returns
-------
Quantity
Converted area.

Notes
-----
The value is converted to a Quantity object using the default server area unit.
The value should represent an area in the server's unit system.
"""
return Quantity(value, DEFAULT_UNITS.SERVER_AREA)
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import grpc


class GRPCCoordinateSystemService(ABC):
class GRPCCoordinateSystemService(ABC): # pragma: no cover
"""Coordinate systems service for gRPC communication with the Geometry server.

Parameters
Expand All @@ -37,9 +37,9 @@ class GRPCCoordinateSystemService(ABC):

def __init__(self, channel: grpc.Channel):
"""Initialize the GRPCCoordinateSystemService class."""
pass # pragma: no cover
pass

@abstractmethod
def create(self, **kwargs) -> dict:
"""Create a coordinate system."""
pass # pragma: no cover
pass
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import grpc


class GRPCDbuApplicationService(ABC):
class GRPCDbuApplicationService(ABC): # pragma: no cover
"""DBU Application service for gRPC communication with the Geometry server.

Parameters
Expand All @@ -37,9 +37,9 @@ class GRPCDbuApplicationService(ABC):

def __init__(self, channel: grpc.Channel):
"""Initialize the GRPCDbuApplicationService class."""
pass # pragma: no cover
pass

@abstractmethod
def run_script(self, **kwargs) -> dict:
"""Run a Scripting API script."""
pass # pragma: no cover
pass
Loading
Loading