1919# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121# SOFTWARE.
22- """Module containing the repair tools service implementation for v0.
23-
24- This module defines an abstract base class for a gRPC-based repair tools service.
25- The class provides a set of abstract methods for identifying and repairing various
26- geometry issues, such as split edges, extra edges, duplicate faces etc.
27- """
22+ """Module containing the repair tools service implementation for v0."""
2823
2924from google .protobuf .wrappers_pb2 import Int32Value
3025import grpc
@@ -393,7 +388,7 @@ def find_and_fix_short_edges(self, **kwargs): # noqa: D102
393388 "repaired" : response .repaired ,
394389 "created_bodies_monikers" : [],
395390 "modified_bodies_monikers" : [],
396- "complete_command_response " : serialized_tracker_response ,
391+ "tracker_response " : serialized_tracker_response ,
397392 }
398393
399394 @protect_grpc
@@ -420,7 +415,7 @@ def find_and_fix_extra_edges(self, **kwargs) -> dict: # noqa: D102
420415 "repaired" : response .repaired ,
421416 "created_bodies_monikers" : response .created_bodies_monikers ,
422417 "modified_bodies_monikers" : response .modified_bodies_monikers ,
423- "complete_command_response " : serialized_tracker_response ,
418+ "tracker_response " : serialized_tracker_response ,
424419 }
425420
426421 @protect_grpc
@@ -449,7 +444,7 @@ def find_and_fix_split_edges(self, **kwargs) -> dict: # noqa: D102
449444 "repaired" : response .repaired ,
450445 "created_bodies_monikers" : [],
451446 "modified_bodies_monikers" : [],
452- "complete_command_response " : serialized_tracker_response ,
447+ "tracker_response " : serialized_tracker_response ,
453448 }
454449
455450 @protect_grpc
@@ -476,7 +471,7 @@ def find_and_fix_simplify(self, **kwargs) -> dict: # noqa: D102
476471 "repaired" : response .repaired ,
477472 "created_bodies_monikers" : [],
478473 "modified_bodies_monikers" : [],
479- "complete_command_response " : serialized_tracker_response ,
474+ "tracker_response " : serialized_tracker_response ,
480475 }
481476
482477 @protect_grpc
@@ -514,15 +509,15 @@ def find_and_fix_stitch_faces(self, **kwargs) -> dict: # noqa: D102
514509 "modified_bodies_monikers" : response .modified_bodies_monikers ,
515510 "found" : response .found ,
516511 "repaired" : response .repaired ,
517- "complete_command_response " : serialized_tracker_response ,
512+ "tracker_response " : serialized_tracker_response ,
518513 }
519514
520515 @protect_grpc
521516 def inspect_geometry (self , ** kwargs ) -> dict : # noqa: D102
522517 from ansys .api .geometry .v0 .repairtools_pb2 import InspectGeometryRequest
523518
524519 # Create the request - assumes all inputs are valid and of the proper type
525- request = InspectGeometryRequest (bodies = kwargs .get ("bodies" , [] ))
520+ request = InspectGeometryRequest (bodies = kwargs .get ("bodies" ))
526521
527522 # Call the gRPC service
528523 inspect_result_response = self .stub .InspectGeometry (request )
@@ -535,7 +530,7 @@ def repair_geometry(self, **kwargs) -> dict: # noqa: D102
535530 from ansys .api .geometry .v0 .repairtools_pb2 import RepairGeometryRequest
536531
537532 # Create the request - assumes all inputs are valid and of the proper type
538- request = RepairGeometryRequest (bodies = kwargs .get ("bodies" , [] ))
533+ request = RepairGeometryRequest (bodies = kwargs .get ("bodies" ))
539534
540535 # Call the gRPC service
541536 response = self .stub .RepairGeometry (request )
@@ -566,7 +561,9 @@ def fix_duplicate_faces(self, **kwargs) -> dict: # noqa: D102
566561 # Return the response - formatted as a dictionary
567562 return {
568563 "tracker_response" : serialized_tracker_response ,
569- "repair_tracker_response" : self .__serialize_message_response (response ),
564+ "success" : response .result .success ,
565+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
566+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
570567 }
571568
572569 @protect_grpc
@@ -590,7 +587,9 @@ def fix_missing_faces(self, **kwargs) -> dict: # noqa: D102
590587 # Return the response - formatted as a dictionary
591588 return {
592589 "tracker_response" : serialized_tracker_response ,
593- "repair_tracker_response" : self .__serialize_message_response (response ),
590+ "success" : response .result .success ,
591+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
592+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
594593 }
595594
596595 @protect_grpc
@@ -614,7 +613,9 @@ def fix_inexact_edges(self, **kwargs) -> dict: # noqa: D102
614613 # Return the response - formatted as a dictionary
615614 return {
616615 "tracker_response" : serialized_tracker_response ,
617- "repair_tracker_response" : self .__serialize_message_response (response ),
616+ "success" : response .result .success ,
617+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
618+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
618619 }
619620
620621 @protect_grpc
@@ -636,7 +637,9 @@ def fix_extra_edges(self, **kwargs) -> dict: # noqa: D102
636637 # Return the response - formatted as a dictionary
637638 return {
638639 "tracker_response" : serialized_tracker_response ,
639- "repair_tracker_response" : self .__serialize_message_response (response ),
640+ "success" : response .result .success ,
641+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
642+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
640643 }
641644
642645 @protect_grpc
@@ -658,7 +661,9 @@ def fix_short_edges(self, **kwargs) -> dict: # noqa: D102
658661 # Return the response - formatted as a dictionary
659662 return {
660663 "tracker_response" : serialized_tracker_response ,
661- "repair_tracker_response" : self .__serialize_message_response (response ),
664+ "success" : response .result .success ,
665+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
666+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
662667 }
663668
664669 @protect_grpc
@@ -680,7 +685,9 @@ def fix_small_faces(self, **kwargs) -> dict: # noqa: D102
680685 # Return the response - formatted as a dictionary
681686 return {
682687 "tracker_response" : serialized_tracker_response ,
683- "repair_tracker_response" : self .__serialize_message_response (response ),
688+ "success" : response .result .success ,
689+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
690+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
684691 }
685692
686693 @protect_grpc
@@ -702,7 +709,9 @@ def fix_split_edges(self, **kwargs) -> dict: # noqa: D102
702709 # Return the response - formatted as a dictionary
703710 return {
704711 "tracker_response" : serialized_tracker_response ,
705- "repair_tracker_response" : self .__serialize_message_response (response ),
712+ "success" : response .result .success ,
713+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
714+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
706715 }
707716
708717 @protect_grpc
@@ -726,7 +735,9 @@ def fix_stitch_faces(self, **kwargs) -> dict: # noqa: D102
726735 # Return the response - formatted as a dictionary
727736 return {
728737 "tracker_response" : serialized_tracker_response ,
729- "repair_tracker_response" : self .__serialize_message_response (response ),
738+ "success" : response .result .success ,
739+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
740+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
730741 }
731742
732743 @protect_grpc
@@ -750,7 +761,9 @@ def fix_unsimplified_faces(self, **kwargs) -> dict: # noqa: D102
750761 # Return the response - formatted as a dictionary
751762 return {
752763 "tracker_response" : serialized_tracker_response ,
753- "repair_tracker_response" : self .__serialize_message_response (response ),
764+ "success" : response .result .success ,
765+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
766+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
754767 }
755768
756769 @protect_grpc
@@ -774,7 +787,9 @@ def fix_interference(self, **kwargs) -> dict: # noqa: D102
774787 # Return the response - formatted as a dictionary
775788 return {
776789 "tracker_response" : serialized_tracker_response ,
777- "repair_tracker_response" : self .__serialize_message_response (response ),
790+ "success" : response .result .success ,
791+ "created_bodies_monikers" : response .result .created_bodies_monikers ,
792+ "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
778793 }
779794
780795 def __serialize_inspect_result_response (self , response ) -> dict : # noqa: D102
@@ -830,10 +845,3 @@ def serialize_issue(issue):
830845 for body_issues in response .issues_by_body
831846 ]
832847 }
833-
834- def __serialize_message_response (self , response ):
835- return {
836- "success" : response .result .success ,
837- "created_bodies_monikers" : response .result .created_bodies_monikers ,
838- "modified_bodies_monikers" : response .result .modified_bodies_monikers ,
839- }
0 commit comments