From 649e98ff998e690247ca5d5e3cc838b26ab67e55 Mon Sep 17 00:00:00 2001 From: Umut Soysal Date: Fri, 21 Nov 2025 13:50:00 -0600 Subject: [PATCH 1/6] Update coordinate_systems.py --- .../_grpc/_services/v1/coordinate_systems.py | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py b/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py index 193de7c26e..22e387abb3 100644 --- a/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py +++ b/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py @@ -26,6 +26,7 @@ from ansys.geometry.core.errors import protect_grpc from ..base.coordinate_systems import GRPCCoordinateSystemService +from .conversions import from_frame_to_grpc_frame, from_grpc_frame_to_frame class GRPCCoordinateSystemServiceV1(GRPCCoordinateSystemService): # pragma: no cover @@ -43,10 +44,29 @@ class GRPCCoordinateSystemServiceV1(GRPCCoordinateSystemService): # pragma: no @protect_grpc def __init__(self, channel: grpc.Channel): # noqa: D102 - from ansys.api.geometry.v1.coordinatesystems_pb2_grpc import CoordinateSystemsStub + from ansys.api.discovery.v1.design.constructs.coordinatesystem_pb2_grpc import ( + CoordinateSystemStub, + ) - self.stub = CoordinateSystemsStub(channel) + self.stub = CoordinateSystemStub(channel) @protect_grpc def create(self, **kwargs) -> dict: # noqa: D102 - raise NotImplementedError + from ansys.api.discovery.v1.design.constructs.coordinatesystem_pb2 import CreateRequest + + # Create the request - assumes all inputs are valid and of the proper type + request = CreateRequest( + parent=kwargs["parent_id"], + name=kwargs["name"], + frame=from_frame_to_grpc_frame(kwargs["frame"]), + ) + + # Call the gRPC service + response = self.stub.Create(request=request) + + # Return the response - formatted as a dictionary + return { + "id": response.id, + "name": response.name, + "frame": from_grpc_frame_to_frame(response.frame), + } From 61fdee7cdd2da52dfcae6875b96128c0e22c7a21 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 21 Nov 2025 19:51:45 +0000 Subject: [PATCH 2/6] chore: adding changelog file 2402.added.md [dependabot-skip] --- doc/changelog.d/2402.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/2402.added.md diff --git a/doc/changelog.d/2402.added.md b/doc/changelog.d/2402.added.md new file mode 100644 index 0000000000..31376ca320 --- /dev/null +++ b/doc/changelog.d/2402.added.md @@ -0,0 +1 @@ +Coordinate_system implementation From ac0c828d9b5edb493a707e418ed3b79eac25c328 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 21 Nov 2025 20:06:34 +0000 Subject: [PATCH 3/6] chore: adding changelog file 2402.maintenance.md [dependabot-skip] --- doc/changelog.d/{2402.added.md => 2402.maintenance.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/changelog.d/{2402.added.md => 2402.maintenance.md} (100%) diff --git a/doc/changelog.d/2402.added.md b/doc/changelog.d/2402.maintenance.md similarity index 100% rename from doc/changelog.d/2402.added.md rename to doc/changelog.d/2402.maintenance.md From dfb3766b6e5c544a8a5199df4b2da335d8cfa785 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:25:18 +0000 Subject: [PATCH 4/6] chore: adding changelog file 2402.maintenance.md [dependabot-skip] --- doc/changelog.d/2402.maintenance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/2402.maintenance.md b/doc/changelog.d/2402.maintenance.md index 31376ca320..835718f835 100644 --- a/doc/changelog.d/2402.maintenance.md +++ b/doc/changelog.d/2402.maintenance.md @@ -1 +1 @@ -Coordinate_system implementation +V1 implementation of coordinate system stub From 2579feec1e178b0ecdc9e5cdd2cec41d274fd0df Mon Sep 17 00:00:00 2001 From: Umut Soysal Date: Mon, 24 Nov 2025 10:13:35 -0600 Subject: [PATCH 5/6] update for repeated request data --- .../_grpc/_services/v1/coordinate_systems.py | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py b/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py index 22e387abb3..fd1ab32d5b 100644 --- a/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py +++ b/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py @@ -52,21 +52,29 @@ def __init__(self, channel: grpc.Channel): # noqa: D102 @protect_grpc def create(self, **kwargs) -> dict: # noqa: D102 - from ansys.api.discovery.v1.design.constructs.coordinatesystem_pb2 import CreateRequest + from ansys.api.discovery.v1.design.constructs.coordinatesystem_pb2 import ( + CreateRequest, + CreateRequestData, + ) - # Create the request - assumes all inputs are valid and of the proper type - request = CreateRequest( - parent=kwargs["parent_id"], + # Create the request data - assumes all inputs are valid and of the proper type + request_data = CreateRequestData( + parent_id=kwargs["parent_id"], name=kwargs["name"], frame=from_frame_to_grpc_frame(kwargs["frame"]), ) + # Wrap in CreateRequest with repeated field + request = CreateRequest(request_data=[request_data]) + # Call the gRPC service response = self.stub.Create(request=request) # Return the response - formatted as a dictionary + # Note: response.coordinate_systems is a repeated field, we return the first one + coord_system = response.coordinate_systems[0] return { - "id": response.id, - "name": response.name, - "frame": from_grpc_frame_to_frame(response.frame), + "id": coord_system.id, + "name": coord_system.name, + "frame": from_grpc_frame_to_frame(coord_system.frame), } From 61ae1237a86c1ec2c55749b285984746ffc56995 Mon Sep 17 00:00:00 2001 From: Umut Soysal <97195410+umutsoysalansys@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:32:41 -0600 Subject: [PATCH 6/6] Update src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py Co-authored-by: Jacob Kerstetter <83893427+jacobrkerstetter@users.noreply.github.com> --- .../core/_grpc/_services/v1/coordinate_systems.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py b/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py index fd1ab32d5b..610e106950 100644 --- a/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py +++ b/src/ansys/geometry/core/_grpc/_services/v1/coordinate_systems.py @@ -58,15 +58,16 @@ def create(self, **kwargs) -> dict: # noqa: D102 ) # Create the request data - assumes all inputs are valid and of the proper type - request_data = CreateRequestData( - parent_id=kwargs["parent_id"], - name=kwargs["name"], - frame=from_frame_to_grpc_frame(kwargs["frame"]), + request = CreateRequest( + request_data=[ + CreateRequestData( + parent_id=kwargs["parent_id"], + name=kwargs["name"], + frame=from_frame_to_grpc_frame(kwargs["frame"]), + ) + ] ) - # Wrap in CreateRequest with repeated field - request = CreateRequest(request_data=[request_data]) - # Call the gRPC service response = self.stub.Create(request=request)