From aaa0692e17168c72a8a3e3c8a45ddba55fb90b1b Mon Sep 17 00:00:00 2001 From: Jacob Kerstetter Date: Wed, 8 Oct 2025 16:14:05 -0400 Subject: [PATCH 1/6] removed _grpc_id from all classes remove EntityIdentifier from all except designs.py (needs small rework) abstract Int32Value object to _grpc layer for problem area id's --- .../core/_grpc/_services/v0/repair_tools.py | 21 ++++++++-------- src/ansys/geometry/core/designer/body.py | 16 +----------- src/ansys/geometry/core/designer/component.py | 6 ----- src/ansys/geometry/core/designer/edge.py | 6 ----- src/ansys/geometry/core/designer/face.py | 6 ----- .../geometry/core/tools/problem_areas.py | 25 ++++++++----------- 6 files changed, 22 insertions(+), 58 deletions(-) diff --git a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py index ab574432fe..decaa42ca0 100644 --- a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py +++ b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py @@ -26,6 +26,7 @@ geometry issues, such as split edges, extra edges, duplicate faces etc. """ +from google.protobuf.wrappers_pb2 import Int32Value import grpc from ansys.geometry.core.errors import protect_grpc @@ -542,7 +543,7 @@ def fix_duplicate_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixDuplicateFacesRequest( - duplicate_face_problem_area_id=kwargs["duplicate_face_problem_area_id"], + duplicate_face_problem_area_id=Int32Value(value=kwargs["duplicate_face_problem_area_id"]), ) # Call the gRPC service @@ -564,7 +565,7 @@ def fix_missing_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixMissingFacesRequest( - missing_face_problem_area_id=kwargs["missing_face_problem_area_id"], + missing_face_problem_area_id=Int32Value(value=kwargs["missing_face_problem_area_id"]), ) # Call the gRPC service @@ -586,7 +587,7 @@ def fix_inexact_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixInexactEdgesRequest( - inexact_edge_problem_area_id=kwargs["inexact_edge_problem_area_id"], + inexact_edge_problem_area_id=Int32Value(value=kwargs["inexact_edge_problem_area_id"]), ) # Call the gRPC service @@ -608,7 +609,7 @@ def fix_extra_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixExtraEdgesRequest( - extra_edge_problem_area_id=kwargs["extra_edge_problem_area_id"], + extra_edge_problem_area_id=Int32Value(value=kwargs["extra_edge_problem_area_id"]), ) # Call the gRPC service @@ -630,7 +631,7 @@ def fix_short_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixShortEdgesRequest( - short_edge_problem_area_id=kwargs["short_edge_problem_area_id"], + short_edge_problem_area_id=Int32Value(value=kwargs["short_edge_problem_area_id"]), ) # Call the gRPC service @@ -652,7 +653,7 @@ def fix_small_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixSmallFacesRequest( - small_face_problem_area_id=kwargs["small_face_problem_area_id"], + small_face_problem_area_id=Int32Value(value=kwargs["small_face_problem_area_id"]), ) # Call the gRPC service @@ -674,7 +675,7 @@ def fix_split_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixSplitEdgesRequest( - split_edge_problem_area_id=kwargs["split_edge_problem_area_id"], + split_edge_problem_area_id=Int32Value(value=kwargs["split_edge_problem_area_id"]), ) # Call the gRPC service @@ -696,7 +697,7 @@ def fix_stitch_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixStitchFacesRequest( - stitch_face_problem_area_id=kwargs["stitch_face_problem_area_id"], + stitch_face_problem_area_id=Int32Value(value=kwargs["stitch_face_problem_area_id"]), ) # Call the gRPC service @@ -718,7 +719,7 @@ def fix_unsimplified_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixAdjustSimplifyRequest( - adjust_simplify_problem_area_id=kwargs["adjust_simplify_problem_area_id"], + adjust_simplify_problem_area_id=Int32Value(value=kwargs["adjust_simplify_problem_area_id"]), ) # Call the gRPC service @@ -740,7 +741,7 @@ def fix_interference(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixInterferenceRequest( - interference_problem_area_id=kwargs["interference_problem_area_id"], + interference_problem_area_id=Int32Value(value=kwargs["interference_problem_area_id"]), ) # Call the gRPC service diff --git a/src/ansys/geometry/core/designer/body.py b/src/ansys/geometry/core/designer/body.py index 56b879c68a..7b8b64805a 100644 --- a/src/ansys/geometry/core/designer/body.py +++ b/src/ansys/geometry/core/designer/body.py @@ -24,10 +24,9 @@ from abc import ABC, abstractmethod from collections.abc import Iterable from enum import Enum, unique -from functools import cached_property, wraps +from functools import wraps from typing import TYPE_CHECKING, Union -from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier from beartype import beartype as check_input_types import matplotlib.colors as mcolors from pint import Quantity @@ -120,11 +119,6 @@ def id(self) -> str: """Get the ID of the body as a string.""" return - @abstractmethod - def _grpc_id(self) -> EntityIdentifier: - """Entity identifier of this body on the server side.""" - return - @abstractmethod def name(self) -> str: """Get the name of the body.""" @@ -890,10 +884,6 @@ def wrapper(self: "MasterBody", *args, **kwargs): def id(self) -> str: # noqa: D102 return self._id - @cached_property - def _grpc_id(self) -> EntityIdentifier: # noqa: D102 - return EntityIdentifier(id=self._id) - @property def name(self) -> str: # noqa: D102 return self._name @@ -1468,10 +1458,6 @@ def _reset_tessellation_cache(self): # noqa: N805 def id(self) -> str: # noqa: D102 return self._id - @cached_property - def _grpc_id(self) -> EntityIdentifier: # noqa: D102 - return EntityIdentifier(id=self._id) - @property def name(self) -> str: # noqa: D102 return self._template.name diff --git a/src/ansys/geometry/core/designer/component.py b/src/ansys/geometry/core/designer/component.py index d0d1aade63..710f832986 100644 --- a/src/ansys/geometry/core/designer/component.py +++ b/src/ansys/geometry/core/designer/component.py @@ -27,7 +27,6 @@ from typing import TYPE_CHECKING, Any, Optional, Union import uuid -from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier from beartype import beartype as check_input_types from pint import Quantity @@ -276,11 +275,6 @@ def id(self) -> str: """ID of the component.""" return self._id - @property - def _grpc_id(self) -> EntityIdentifier: - """ID of the component in gRPC format.""" - return EntityIdentifier(id=self.id) - @property def name(self) -> str: """Name of the component.""" diff --git a/src/ansys/geometry/core/designer/edge.py b/src/ansys/geometry/core/designer/edge.py index 93568c958f..11f8136c6b 100644 --- a/src/ansys/geometry/core/designer/edge.py +++ b/src/ansys/geometry/core/designer/edge.py @@ -24,7 +24,6 @@ from enum import Enum, unique from typing import TYPE_CHECKING -from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier from pint import Quantity from ansys.geometry.core.connection.client import GrpcClient @@ -93,11 +92,6 @@ def id(self) -> str: """ID of the edge.""" return self._id - @property - def _grpc_id(self) -> EntityIdentifier: - """Entity ID of this edge on the server side.""" - return EntityIdentifier(id=self._id) - @property def body(self) -> "Body": """Body of the edge.""" diff --git a/src/ansys/geometry/core/designer/face.py b/src/ansys/geometry/core/designer/face.py index 92c6fd7f10..71d30097bf 100644 --- a/src/ansys/geometry/core/designer/face.py +++ b/src/ansys/geometry/core/designer/face.py @@ -24,7 +24,6 @@ from enum import Enum, unique from typing import TYPE_CHECKING -from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier from beartype import beartype as check_input_types import matplotlib.colors as mcolors from pint import Quantity @@ -185,11 +184,6 @@ def id(self) -> str: """Face ID.""" return self._id - @property - def _grpc_id(self) -> EntityIdentifier: - """Entity ID of this face on the server side.""" - return EntityIdentifier(id=self._id) - @property def is_reversed(self) -> bool: """Flag indicating if the face is reversed.""" diff --git a/src/ansys/geometry/core/tools/problem_areas.py b/src/ansys/geometry/core/tools/problem_areas.py index 5223edfd0a..cf1b1a7a8d 100644 --- a/src/ansys/geometry/core/tools/problem_areas.py +++ b/src/ansys/geometry/core/tools/problem_areas.py @@ -24,9 +24,6 @@ from abc import abstractmethod from typing import TYPE_CHECKING -from ansys.api.geometry.v0.repairtools_pb2_grpc import RepairToolsStub -from google.protobuf.wrappers_pb2 import Int32Value - import ansys.geometry.core as pyansys_geom from ansys.geometry.core.connection import GrpcClient from ansys.geometry.core.misc.auxiliary import ( @@ -57,8 +54,6 @@ class ProblemArea: def __init__(self, id: str, grpc_client: GrpcClient): """Initialize a new instance of a problem area class.""" self._id = id - self._grpc_id = Int32Value(value=int(id)) - self._repair_stub = RepairToolsStub(grpc_client.channel) self._grpc_client = grpc_client @property @@ -138,7 +133,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_duplicate_faces( - duplicate_face_problem_area_id=self._grpc_id + duplicate_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -192,7 +187,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_missing_faces( - missing_face_problem_area_id=self._grpc_id + missing_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -247,7 +242,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_inexact_edges( - inexact_edge_problem_area_id=self._grpc_id + inexact_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -301,7 +296,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_extra_edges( - extra_edge_problem_area_id=self._grpc_id + extra_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -355,7 +350,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_short_edges( - short_edge_problem_area_id=self._grpc_id + short_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -409,7 +404,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_small_faces( - small_face_problem_area_id=self._grpc_id + small_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -463,7 +458,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_split_edges( - split_edge_problem_area_id=self._grpc_id + split_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -517,7 +512,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_body(self.bodies[0]) response = self._grpc_client.services.repair_tools.fix_stitch_faces( - stitch_face_problem_area_id=self._grpc_id + stitch_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -566,7 +561,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_unsimplified_faces( - adjust_simplify_problem_area_id=self._grpc_id + adjust_simplify_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -620,7 +615,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_body(self.bodies[0]) response = self._grpc_client.services.repair_tools.fix_interference( - interference_problem_area_id=self._grpc_id + interference_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: From aa903d4113bab75fc65b721e06f2c55bf84966a4 Mon Sep 17 00:00:00 2001 From: Jacob Kerstetter Date: Wed, 8 Oct 2025 16:31:01 -0400 Subject: [PATCH 2/6] fixing problem areas id conversion --- .../geometry/core/tools/problem_areas.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ansys/geometry/core/tools/problem_areas.py b/src/ansys/geometry/core/tools/problem_areas.py index cf1b1a7a8d..262f16eb94 100644 --- a/src/ansys/geometry/core/tools/problem_areas.py +++ b/src/ansys/geometry/core/tools/problem_areas.py @@ -133,7 +133,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_duplicate_faces( - duplicate_face_problem_area_id=self.id + duplicate_face_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -187,7 +187,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_missing_faces( - missing_face_problem_area_id=self.id + missing_face_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -242,7 +242,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_inexact_edges( - inexact_edge_problem_area_id=self.id + inexact_edge_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -296,7 +296,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_extra_edges( - extra_edge_problem_area_id=self.id + extra_edge_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -350,7 +350,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_short_edges( - short_edge_problem_area_id=self.id + short_edge_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -404,7 +404,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_small_faces( - small_face_problem_area_id=self.id + small_face_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -458,7 +458,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_split_edges( - split_edge_problem_area_id=self.id + split_edge_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -512,7 +512,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_body(self.bodies[0]) response = self._grpc_client.services.repair_tools.fix_stitch_faces( - stitch_face_problem_area_id=self.id + stitch_face_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -561,7 +561,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_unsimplified_faces( - adjust_simplify_problem_area_id=self.id + adjust_simplify_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -615,7 +615,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_body(self.bodies[0]) response = self._grpc_client.services.repair_tools.fix_interference( - interference_problem_area_id=self.id + interference_problem_area_id=int(self.id) ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: From a241581e7504b32f31231854dccdbe805a91c2b7 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 8 Oct 2025 20:34:26 +0000 Subject: [PATCH 3/6] chore: adding changelog file 2295.maintenance.md [dependabot-skip] --- doc/changelog.d/2295.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/2295.maintenance.md diff --git a/doc/changelog.d/2295.maintenance.md b/doc/changelog.d/2295.maintenance.md new file mode 100644 index 0000000000..79f3bca20a --- /dev/null +++ b/doc/changelog.d/2295.maintenance.md @@ -0,0 +1 @@ +Remove grpc ids From ca6e8a2b34a0638e560ca3d2ef6fde2beeb90b51 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 20:36:42 +0000 Subject: [PATCH 4/6] chore: auto fixes from pre-commit hooks --- .../geometry/core/_grpc/_services/v0/repair_tools.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py index decaa42ca0..f9f5d14dda 100644 --- a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py +++ b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py @@ -543,7 +543,9 @@ def fix_duplicate_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixDuplicateFacesRequest( - duplicate_face_problem_area_id=Int32Value(value=kwargs["duplicate_face_problem_area_id"]), + duplicate_face_problem_area_id=Int32Value( + value=kwargs["duplicate_face_problem_area_id"] + ), ) # Call the gRPC service @@ -719,7 +721,9 @@ def fix_unsimplified_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixAdjustSimplifyRequest( - adjust_simplify_problem_area_id=Int32Value(value=kwargs["adjust_simplify_problem_area_id"]), + adjust_simplify_problem_area_id=Int32Value( + value=kwargs["adjust_simplify_problem_area_id"] + ), ) # Call the gRPC service From 587ab84f277f19bd9d24a9a79ed0f173dc5dee84 Mon Sep 17 00:00:00 2001 From: Jacob Kerstetter Date: Thu, 9 Oct 2025 08:44:32 -0400 Subject: [PATCH 5/6] doing all conversion in grpc layer --- .../core/_grpc/_services/v0/repair_tools.py | 20 +++++++++---------- .../geometry/core/tools/problem_areas.py | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py index f9f5d14dda..a71e831418 100644 --- a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py +++ b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py @@ -544,7 +544,7 @@ def fix_duplicate_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixDuplicateFacesRequest( duplicate_face_problem_area_id=Int32Value( - value=kwargs["duplicate_face_problem_area_id"] + value=int(kwargs["duplicate_face_problem_area_id"]) ), ) @@ -567,7 +567,7 @@ def fix_missing_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixMissingFacesRequest( - missing_face_problem_area_id=Int32Value(value=kwargs["missing_face_problem_area_id"]), + missing_face_problem_area_id=Int32Value(value=int(kwargs["missing_face_problem_area_id"])), ) # Call the gRPC service @@ -589,7 +589,7 @@ def fix_inexact_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixInexactEdgesRequest( - inexact_edge_problem_area_id=Int32Value(value=kwargs["inexact_edge_problem_area_id"]), + inexact_edge_problem_area_id=Int32Value(value=int(kwargs["inexact_edge_problem_area_id"])), ) # Call the gRPC service @@ -611,7 +611,7 @@ def fix_extra_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixExtraEdgesRequest( - extra_edge_problem_area_id=Int32Value(value=kwargs["extra_edge_problem_area_id"]), + extra_edge_problem_area_id=Int32Value(value=int(kwargs["extra_edge_problem_area_id"])), ) # Call the gRPC service @@ -633,7 +633,7 @@ def fix_short_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixShortEdgesRequest( - short_edge_problem_area_id=Int32Value(value=kwargs["short_edge_problem_area_id"]), + short_edge_problem_area_id=Int32Value(value=int(kwargs["short_edge_problem_area_id"])), ) # Call the gRPC service @@ -655,7 +655,7 @@ def fix_small_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixSmallFacesRequest( - small_face_problem_area_id=Int32Value(value=kwargs["small_face_problem_area_id"]), + small_face_problem_area_id=Int32Value(value=int(kwargs["small_face_problem_area_id"])), ) # Call the gRPC service @@ -677,7 +677,7 @@ def fix_split_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixSplitEdgesRequest( - split_edge_problem_area_id=Int32Value(value=kwargs["split_edge_problem_area_id"]), + split_edge_problem_area_id=Int32Value(value=int(kwargs["split_edge_problem_area_id"])), ) # Call the gRPC service @@ -699,7 +699,7 @@ def fix_stitch_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixStitchFacesRequest( - stitch_face_problem_area_id=Int32Value(value=kwargs["stitch_face_problem_area_id"]), + stitch_face_problem_area_id=Int32Value(value=int(kwargs["stitch_face_problem_area_id"])), ) # Call the gRPC service @@ -722,7 +722,7 @@ def fix_unsimplified_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixAdjustSimplifyRequest( adjust_simplify_problem_area_id=Int32Value( - value=kwargs["adjust_simplify_problem_area_id"] + value=int(kwargs["adjust_simplify_problem_area_id"]) ), ) @@ -745,7 +745,7 @@ def fix_interference(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixInterferenceRequest( - interference_problem_area_id=Int32Value(value=kwargs["interference_problem_area_id"]), + interference_problem_area_id=Int32Value(value=int(kwargs["interference_problem_area_id"])), ) # Call the gRPC service diff --git a/src/ansys/geometry/core/tools/problem_areas.py b/src/ansys/geometry/core/tools/problem_areas.py index 262f16eb94..cf1b1a7a8d 100644 --- a/src/ansys/geometry/core/tools/problem_areas.py +++ b/src/ansys/geometry/core/tools/problem_areas.py @@ -133,7 +133,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_duplicate_faces( - duplicate_face_problem_area_id=int(self.id) + duplicate_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -187,7 +187,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_missing_faces( - missing_face_problem_area_id=int(self.id) + missing_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -242,7 +242,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_inexact_edges( - inexact_edge_problem_area_id=int(self.id) + inexact_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -296,7 +296,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_extra_edges( - extra_edge_problem_area_id=int(self.id) + extra_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -350,7 +350,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_short_edges( - short_edge_problem_area_id=int(self.id) + short_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -404,7 +404,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_small_faces( - small_face_problem_area_id=int(self.id) + small_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -458,7 +458,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_edge(self.edges[0]) response = self._grpc_client.services.repair_tools.fix_split_edges( - split_edge_problem_area_id=int(self.id) + split_edge_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -512,7 +512,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_body(self.bodies[0]) response = self._grpc_client.services.repair_tools.fix_stitch_faces( - stitch_face_problem_area_id=int(self.id) + stitch_face_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -561,7 +561,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_face(self.faces[0]) response = self._grpc_client.services.repair_tools.fix_unsimplified_faces( - adjust_simplify_problem_area_id=int(self.id) + adjust_simplify_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: @@ -615,7 +615,7 @@ def fix(self) -> RepairToolMessage: parent_design = get_design_from_body(self.bodies[0]) response = self._grpc_client.services.repair_tools.fix_interference( - interference_problem_area_id=int(self.id) + interference_problem_area_id=self.id ) if not pyansys_geom.USE_TRACKER_TO_UPDATE_DESIGN: From 25bd0d0d29e2a246745d517a7fed25d07d58de85 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 12:45:07 +0000 Subject: [PATCH 6/6] chore: auto fixes from pre-commit hooks --- .../core/_grpc/_services/v0/repair_tools.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py index a71e831418..25a4986d62 100644 --- a/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py +++ b/src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py @@ -567,7 +567,9 @@ def fix_missing_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixMissingFacesRequest( - missing_face_problem_area_id=Int32Value(value=int(kwargs["missing_face_problem_area_id"])), + missing_face_problem_area_id=Int32Value( + value=int(kwargs["missing_face_problem_area_id"]) + ), ) # Call the gRPC service @@ -589,7 +591,9 @@ def fix_inexact_edges(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixInexactEdgesRequest( - inexact_edge_problem_area_id=Int32Value(value=int(kwargs["inexact_edge_problem_area_id"])), + inexact_edge_problem_area_id=Int32Value( + value=int(kwargs["inexact_edge_problem_area_id"]) + ), ) # Call the gRPC service @@ -699,7 +703,9 @@ def fix_stitch_faces(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixStitchFacesRequest( - stitch_face_problem_area_id=Int32Value(value=int(kwargs["stitch_face_problem_area_id"])), + stitch_face_problem_area_id=Int32Value( + value=int(kwargs["stitch_face_problem_area_id"]) + ), ) # Call the gRPC service @@ -745,7 +751,9 @@ def fix_interference(self, **kwargs) -> dict: # noqa: D102 # Create the request - assumes all inputs are valid and of the proper type request = FixInterferenceRequest( - interference_problem_area_id=Int32Value(value=int(kwargs["interference_problem_area_id"])), + interference_problem_area_id=Int32Value( + value=int(kwargs["interference_problem_area_id"]) + ), ) # Call the gRPC service