Skip to content

Conversation

@jacobrkerstetter
Copy link
Contributor

Description

  • added ability to find all named selections that a geometric entity belongs to
  • for bodies, faces, edges, beams, design points, components, and vertices

Issue linked

Closes #2326

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)

@jacobrkerstetter jacobrkerstetter self-assigned this Nov 4, 2025
@jacobrkerstetter jacobrkerstetter requested a review from a team as a code owner November 4, 2025 19:15
@github-actions github-actions bot added the enhancement New features or code improvements label Nov 4, 2025
@jacobrkerstetter jacobrkerstetter marked this pull request as draft November 4, 2025 20:34
@jacobrkerstetter jacobrkerstetter marked this pull request as ready for review November 11, 2025 16:29
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 92.95775% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.19%. Comparing base (1ef2779) to head (843cf03).

Files with missing lines Patch % Lines
src/ansys/geometry/core/designer/body.py 92.30% 1 Missing ⚠️
src/ansys/geometry/core/designer/designpoint.py 90.00% 1 Missing ⚠️
src/ansys/geometry/core/designer/edge.py 88.88% 1 Missing ⚠️
src/ansys/geometry/core/designer/face.py 87.50% 1 Missing ⚠️
src/ansys/geometry/core/designer/vertex.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2356      +/-   ##
==========================================
- Coverage   95.20%   95.19%   -0.02%     
==========================================
  Files         168      168              
  Lines       11103    11174      +71     
==========================================
+ Hits        10571    10637      +66     
- Misses        532      537       +5     

☔ 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 the testing Anything related to tests label Nov 11, 2025
Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

Some comments! Looks pretty good though :)

Comment on lines +1906 to +1908
@ensure_design_is_active
def get_named_selections(self) -> list["NamedSelection"]: # noqa: D102
return self._template.get_named_selections(self)
Copy link
Member

Choose a reason for hiding this comment

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

Question... should we do this at the master level or occurrence level? What gets added to named selections? Depending on the one affected, we will have to implement this in one or the other... right now it's implemented at the master level.

pinging @jonahrb @smereu for visibility on this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should probably be done at the body level. I will change this

Comment on lines +1296 to +1299
named_selections = get_design_from_body(body).named_selections

included_ns = []
for ns in named_selections:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
named_selections = get_design_from_body(body).named_selections
included_ns = []
for ns in named_selections:
included_ns = []
for ns in get_design_from_body(self).named_selections:

Comment on lines +91 to +93
if self.parent_component is None:
raise ValueError("Design point does not have a parent component.")

Copy link
Member

Choose a reason for hiding this comment

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

Is this even possible? Shouldn't it only be created from a modeling perspective? What's the case when a DesignPoint gets created without parent component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or code improvements testing Anything related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GetNamedSelections to geometric entities

4 participants