Skip to content

Commit 62ca792

Browse files
committed
2 parents 6a23076 + 5196f26 commit 62ca792

22 files changed

+1112
-69
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2323

2424
- name: Initialize CodeQL
25-
uses: github/codeql-action/init@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
25+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
2626
with:
2727
languages: 'python'
2828
config-file: ./.github/codeql-config.yml
2929

3030
- name: Autobuild
31-
uses: github/codeql-action/autobuild@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
31+
uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
3232

3333
# If the Autobuild fails above, remove it and uncomment the following three lines.
3434
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
@@ -38,6 +38,6 @@ jobs:
3838
# ./location_of_script_within_repo/buildscript.sh
3939

4040
- name: Perform CodeQL Analysis
41-
uses: github/codeql-action/analyze@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
41+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
4242
with:
4343
category: "/language:python"

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exclude: "tests/integration/files"
77
repos:
88

99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.12.1
10+
rev: v0.12.2
1111
hooks:
1212
- id: ruff-check
1313
- id: ruff-format
@@ -35,7 +35,7 @@ repos:
3535

3636
# this validates our github workflow files
3737
- repo: https://github.com/python-jsonschema/check-jsonschema
38-
rev: 0.33.1
38+
rev: 0.33.2
3939
hooks:
4040
- id: check-github-workflows
4141

doc/changelog.d/1922.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update with delta
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump github/codeql-action from 3.29.1 to 3.29.2 in the actions group

doc/changelog.d/2087.test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add more tests to expand coverage

doc/changelog.d/2088.test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add stride named selection import test
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pre-commit automatic update

doc/changelog.d/2092.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Internalize document after insert: update test

src/ansys/geometry/core/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@
7070

7171
DOCUMENTATION_BUILD: bool = os.environ.get("PYANSYS_GEOMETRY_DOC_BUILD", "false").lower() == "true"
7272
"""Global flag for the documentation to use the proper PyVista Jupyter backend."""
73+
74+
USE_TRACKER_TO_UPDATE_DESIGN: bool = False
75+
"""Global constant for checking whether to use the tracker to update designs."""

src/ansys/geometry/core/_grpc/_services/v0/repair_tools.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,18 @@ def find_and_fix_simplify(self, **kwargs) -> dict: # noqa: D102
344344
# Call the gRPC service
345345
response = self.stub.FindAndSimplify(request)
346346

347+
serialized_tracker_response = self._serialize_tracker_command_response(
348+
response.complete_command_response
349+
)
350+
347351
# Return the response - formatted as a dictionary
348352
return {
349353
"success": response.success,
350354
"found": response.found,
351355
"repaired": response.repaired,
352356
"created_bodies_monikers": [],
353357
"modified_bodies_monikers": [],
358+
"complete_command_response": serialized_tracker_response,
354359
}
355360

356361
@protect_grpc
@@ -378,13 +383,18 @@ def find_and_fix_stitch_faces(self, **kwargs) -> dict: # noqa: D102
378383
# Call the gRPC service
379384
response = self.stub.FindAndFixStitchFaces(request)
380385

386+
serialized_tracker_response = self._serialize_tracker_command_response(
387+
response.complete_command_response
388+
)
389+
381390
# Return the response - formatted as a dictionary
382391
return {
383392
"success": response.success,
384393
"created_bodies_monikers": response.created_bodies_monikers,
385394
"modified_bodies_monikers": response.modified_bodies_monikers,
386395
"found": response.found,
387396
"repaired": response.repaired,
397+
"complete_command_response": serialized_tracker_response,
388398
}
389399

390400
@protect_grpc
@@ -457,13 +467,18 @@ def find_and_fix_short_edges(self, **kwargs): # noqa: D102
457467
# Call the gRPC service
458468
response = self.stub.FindAndFixShortEdges(request)
459469

470+
serialized_tracker_response = self._serialize_tracker_command_response(
471+
response.complete_command_response
472+
)
473+
460474
# Return the response - formatted as a dictionary
461475
return {
462476
"success": response.success,
463477
"found": response.found,
464478
"repaired": response.repaired,
465479
"created_bodies_monikers": [],
466480
"modified_bodies_monikers": [],
481+
"complete_command_response": serialized_tracker_response,
467482
}
468483

469484
@protect_grpc
@@ -479,13 +494,18 @@ def find_and_fix_extra_edges(self, **kwargs) -> dict: # noqa: D102
479494
# Call the gRPC service
480495
response = self.stub.FindAndFixExtraEdges(request)
481496

497+
serialized_tracker_response = self._serialize_tracker_command_response(
498+
response.complete_command_response
499+
)
500+
482501
# Return the response - formatted as a dictionary
483502
return {
484503
"success": response.success,
485504
"found": response.found,
486505
"repaired": response.repaired,
487506
"created_bodies_monikers": response.created_bodies_monikers,
488507
"modified_bodies_monikers": response.modified_bodies_monikers,
508+
"complete_command_response": serialized_tracker_response,
489509
}
490510

491511
@protect_grpc
@@ -505,13 +525,18 @@ def find_and_fix_split_edges(self, **kwargs) -> dict: # noqa: D102
505525
# Call the gRPC service
506526
response = self.stub.FindAndFixSplitEdges(request)
507527

528+
serialized_tracker_response = self._serialize_tracker_command_response(
529+
response.complete_command_response
530+
)
531+
508532
# Return the response - formatted as a dictionary
509533
return {
510534
"success": response.success,
511535
"found": response.found,
512536
"repaired": response.repaired,
513537
"created_bodies_monikers": [],
514538
"modified_bodies_monikers": [],
539+
"complete_command_response": serialized_tracker_response,
515540
}
516541

517542
def __serialize_inspect_result_response(self, response) -> dict: # noqa: D102
@@ -567,3 +592,52 @@ def serialize_issue(issue):
567592
for body_issues in response.issues_by_body
568593
]
569594
}
595+
596+
def _serialize_tracker_command_response(self, response) -> dict:
597+
"""Serialize a TrackerCommandResponse object into a dictionary.
598+
599+
Parameters
600+
----------
601+
response : TrackerCommandResponse
602+
The gRPC TrackerCommandResponse object to serialize.
603+
604+
Returns
605+
-------
606+
dict
607+
A dictionary representation of the TrackerCommandResponse object.
608+
"""
609+
610+
def serialize_body(body):
611+
return {
612+
"id": body.id,
613+
"name": body.name,
614+
"can_suppress": body.can_suppress,
615+
"transform_to_master": {
616+
"m00": body.transform_to_master.m00,
617+
"m11": body.transform_to_master.m11,
618+
"m22": body.transform_to_master.m22,
619+
"m33": body.transform_to_master.m33,
620+
},
621+
"master_id": body.master_id,
622+
"parent_id": body.parent_id,
623+
}
624+
625+
def serialize_entity_identifier(entity):
626+
"""Serialize an EntityIdentifier object into a dictionary."""
627+
return {
628+
"id": entity.id,
629+
}
630+
631+
return {
632+
"success": response.success,
633+
"created_bodies": [
634+
serialize_body(body) for body in getattr(response, "created_bodies", [])
635+
],
636+
"modified_bodies": [
637+
serialize_body(body) for body in getattr(response, "modified_bodies", [])
638+
],
639+
"deleted_bodies": [
640+
serialize_entity_identifier(entity)
641+
for entity in getattr(response, "deleted_bodies", [])
642+
],
643+
}

0 commit comments

Comments
 (0)