Skip to content

Conversation

@waltersma
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the bug Something isn't working label Dec 8, 2025
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

The documentation for this pull request will be available at https://prime.docs.pyansys.com/pull/1192. Please allow some time for the documentation to be deployed.

@subhnayak subhnayak requested a review from Copilot December 9, 2025 10:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the as_polydata method where duplicate entities were being generated. The fix changes nested list comprehensions to use indexed access instead of iterating over all results, ensuring each part's data is processed only once.

Key Changes:

  • Modified face polydata list comprehension to use indexed access (facet_result.face_connectivity_result_per_part[i]) instead of iterating over all face connectivity results
  • Applied the same fix to edge polydata list comprehension to prevent duplicate edge entities

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/ansys/meshing/prime/core/mesh.py Fixed nested list comprehensions to use indexed access, preventing duplicate face and edge polydata entities
doc/changelog.d/1192.miscellaneous.md Added changelog entry documenting the fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 522 to 529
face_polydata_list = [
self.get_face_polydata(part_id, face_fet_result, j)
for face_fet_result in facet_result.face_connectivity_result_per_part
for j in range(0, len(face_fet_result.face_zonelet_ids))
self.get_face_polydata(
part_id, facet_result.face_connectivity_result_per_part[i], j
)
for j in range(
0, len(facet_result.face_connectivity_result_per_part[i].face_zonelet_ids)
)
]
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The expression facet_result.face_connectivity_result_per_part[i] is accessed twice per iteration. Consider storing it in a variable before the list comprehension to avoid redundant indexing operations.

Copilot uses AI. Check for mistakes.
Comment on lines 531 to 538
edge_polydata_list = [
self.get_edge_polydata(part_id, edge_facet_result, j)
for edge_facet_result in facet_result.edge_connectivity_result_per_part
for j in range(0, len(edge_facet_result.edge_zonelet_ids))
self.get_edge_polydata(
part_id, facet_result.edge_connectivity_result_per_part[i], j
)
for j in range(
0, len(facet_result.edge_connectivity_result_per_part[i].edge_zonelet_ids)
)
]
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The expression facet_result.edge_connectivity_result_per_part[i] is accessed twice per iteration. Consider storing it in a variable before the list comprehension to avoid redundant indexing operations.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants