Skip to content

Conversation

@smereu
Copy link
Contributor

@smereu smereu commented Dec 3, 2025

Description

V1 implementation of repair tools. Notes

  1. The return argument from the tracker were inconsistent between calls and were bringing outside in the service layer historical names (tracker_response vs complete_command_response) that is better to keep into v0. Some small changes were made to the v0 to eliminate the problem
  2. The return argument of functions (repair and others) that modify data in an unknown way needs to be made consistent but we can tackle that topic separately from v1 creation
  3. More stuff was put into conversions.py. Definitely needs a clean-up...

Issue linked

Please mention the issue number or describe the problem this pull request addresses.

Checklist

  • I have tested my changes locally.
  • I have added necessary documentation or updated existing documentation.
  • I have followed the coding style guidelines of this project.
  • I have added appropriate unit tests.
  • I have reviewed my changes before submitting this pull request.
  • I have linked the issue or issues that are solved to the PR if any.
  • I have assigned this PR to myself.
  • I have added the minimum version decorator to any new backend method implemented.
  • I have made sure that the title of my PR follows Conventional commits style (e.g. feat: extrude circle to cylinder)

pyansys-ci-bot and others added 26 commits February 17, 2025 14:31
V1 implementation of repair tools.  Notes
1) The return argument from the tracker were inconsistent between calls and were bringing outside in the service layer historical names (tracker_response vs complete_command_response) that is better to keep into v0. Some small changes were made to the v0 to eliminate the problem
2) The return argument of functions (repair and others) that modify data in an unknown way needs to be made consistent but we can tackle that topic separately from v1 creation
3) More stuff was put into conversions.py. Definitely needs a clean-up...
@smereu smereu self-assigned this Dec 3, 2025
@smereu smereu requested a review from a team as a code owner December 3, 2025 04:01
@github-actions github-actions bot added maintenance Package and maintenance related and removed maintenance Package and maintenance related labels Dec 3, 2025
@github-actions github-actions bot added maintenance Package and maintenance related and removed maintenance Package and maintenance related labels Dec 3, 2025
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 18.18182% with 144 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.64%. Comparing base (fa5a148) to head (659dc43).

Files with missing lines Patch % Lines
...s/geometry/core/_grpc/_services/v1/repair_tools.py 4.31% 133 Missing ⚠️
...ys/geometry/core/_grpc/_services/v1/conversions.py 50.00% 6 Missing ⚠️
src/ansys/geometry/core/tools/repair_tools.py 58.33% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2441      +/-   ##
==========================================
- Coverage   91.63%   90.64%   -0.99%     
==========================================
  Files         169      169              
  Lines       11841    12030     +189     
==========================================
+ Hits        10850    10905      +55     
- Misses        991     1125     +134     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added maintenance Package and maintenance related and removed maintenance Package and maintenance related labels Dec 3, 2025
@github-actions github-actions bot added maintenance Package and maintenance related and removed maintenance Package and maintenance related labels Dec 3, 2025
david-gorman
david-gorman previously approved these changes Dec 3, 2025
Copy link
Contributor

@jacobrkerstetter jacobrkerstetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you're testing by forcing to v1 for this stub - a lot of the request data doesn't align with the protos (EntityIdentifiers, BoolValue, etc.)

Other than that just small changes! 👍

return {
"problems": [
{
"id": res.id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the .id (EntityIdentifier) calls in this field will probably need another .id to extract the string. Run the tests forcing RepairTools to v1 to see if it's right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobrkerstetter Thx! I was not able to run the tests but I will try again with the latest

Comment on lines 24 to 26
This module defines an abstract base class for a gRPC-based repair tools service.
The class provides a set of abstract methods for identifying and repairing various
geometry issues, such as split edges, extra edges, duplicate faces etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably remove this from both v0/v1 files because it is not an abstract base class

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


# Create the request - assumes all inputs are valid and of the proper type
request = FindSplitEdgesRequest(
bodies_or_faces_ids=kwargs["bodies_or_faces"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anywhere in this stub that the service wants an id you will need to use build_grpc_id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobrkerstetter Sorry about that! Just FYI I started using co-pilot to make this changes but I gave the wrong instructions so it put it on other kwargs as well so I undid it and forgot to put it back properly

Comment on lines 149 to 158
if kwargs["angle"] is not None or kwargs["distance"] is not None:
# If the backend version is less than 26.1.0, set angle and distance to None
kwargs["angle"] = None
kwargs["distance"] = None

# Log a warning
LOG.warning(
"The backend version is less than 26.1.0, so angle and distance parameters will be"
"ignored. Please update the backend to use these parameters."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is assumed that v1 users are using 26.1 or newer versions so you can probably take this out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks!

Comment on lines +184 to +193
if kwargs["area"] is not None or kwargs["width"] is not None:
# If the backend version is less than 26.1.0, set area and width to None
kwargs["area"] = None
kwargs["width"] = None

# Log a warning
LOG.warning(
"The backend version is less than 26.1.0, so area and width parameters will be"
"ignored. Please update the backend to use these parameters."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for the versioning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks!

# Create the request - assumes all inputs are valid and of the proper type
request = FindInterferenceRequest(
bodY_ids=kwargs["bodies"],
cut_smaller_body=BoolValue(value=kwargs["cut_smaller_body"]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have removed these from the protos for v1

Comment on lines +335 to +337
allow_multiple_bodies=BoolValue(value=kwargs["allow_multiple_bodies"]),
maintain_components=BoolValue(value=kwargs["maintain_components"]),
check_for_coincidence=BoolValue(value=kwargs["check_for_coincidence"]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

from ansys.api.discovery.v1.operations.repair_pb2 import InspectGeometryRequest

# Create the request - assumes all inputs are valid and of the proper type
request = InspectGeometryRequest(body_ids=kwargs.get("bodies", []))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this match the other methods? ie. kwargs["bodies"] since we control what is passed in here we shouldn't have to have a default empty array

from ansys.api.discovery.v1.operations.repair_pb2 import RepairGeometryRequest

# Create the request - assumes all inputs are valid and of the proper type
request = RepairGeometryRequest(body_ids=kwargs.get("bodies", []))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. And if this is done in v0 we can also change it to align with the normal style

@github-actions github-actions bot added maintenance Package and maintenance related and removed maintenance Package and maintenance related labels Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Package and maintenance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants