Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (89.62%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3031 +/- ##
==========================================
- Coverage 93.79% 89.62% -4.17%
==========================================
Files 195 185 -10
Lines 18171 16723 -1448
==========================================
- Hits 17043 14988 -2055
- Misses 1128 1735 +607 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds client-side support in PyAnsys Geometry for a CATIA import option that maps CATIA geometric sets/publications into PyGeometry named selection groups, aligning named selection behavior with SpaceClaim/GeometryService.
Changes:
- Extend
ImportOptionswithmap_catia_sets_to_groupsandpublications_only_to_groups. - Add integration tests covering CATIA named selections import and mapping behavior with the new options.
- Mark the new CATIA named-selection tests as incompatible on backend versions earlier than 26.1 and add a changelog entry.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/ansys/geometry/core/misc/options.py |
Adds new CATIA-related import flags to ImportOptions. |
tests/integration/test_design_import.py |
Adds integration coverage for CATIA named selections + mapping behavior. |
tests/_incompatible_tests.yml |
Skips the new CATIA named selection tests on backends older than 26.1. |
doc/changelog.d/3031.added.md |
Documents the newly added import option in the changelog. |
Suppressed comments (1)
tests/integration/test_design_import.py:484
- ImportOptions is already imported at module scope (from ansys.geometry.core.misc import ... ImportOptions). The additional local import is redundant and uses a different import path, which makes the test inconsistent and slightly harder to maintain.
def test_design_import_catia_named_selections_with_publications(modeler: Modeler):
"""Test importing a CATIA V5 file with publications as named selection groups."""
from ansys.geometry.core.misc.options import ImportOptions
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
5e6dfff to
658a207
Compare
| Warnings | ||
| -------- | ||
| map_catia_sets_to_groups and publications_only_to_groups are only available | ||
| starting in version 27R1. | ||
|
|
||
| Notes | ||
| ----- | ||
| import_as_lightweight and import_using_spaceclaim_colors are only available | ||
| starting in version 2027 R1. | ||
| starting in version 27R1. |
There was a problem hiding this comment.
Can we move these sections to both be part of the "notes"? I think that makes it a little more concise.
|
|
||
| - version: "26.1" | ||
| incompatible_tests: | ||
| # CATIA geometric-set mapping is not available in 26.1 |
There was a problem hiding this comment.
Let's remove this solo comment
| def test_design_import_cat5_2024_with_catia_named_selections(modeler: Modeler): | ||
| """Test importing a 2024 CATIA V5 file with geometric sets mapped to named selections.""" | ||
| options = ImportOptions(map_catia_sets_to_groups=True) | ||
| design = modeler.open_file( | ||
| Path(IMPORT_FILES_DIR, "CAT5/Bracket_Hole_2024.CATPart"), import_options=options | ||
| ) | ||
| assert len(design.bodies) == 1 | ||
| assert len(design.bodies[0].faces) == 24 | ||
|
|
||
|
|
||
| def test_design_import_cat5_2024_with_publications_to_groups(modeler: Modeler): | ||
| """Test importing a 2024 CATIA V5 file with publication groups enabled.""" | ||
| options = ImportOptions(map_catia_sets_to_groups=True, publications_only_to_groups=True) | ||
| design = modeler.open_file( | ||
| Path(IMPORT_FILES_DIR, "CAT5/Bracket_Hole_2024.CATPart"), import_options=options | ||
| ) | ||
| assert len(design.bodies) == 1 | ||
| assert len(design.bodies[0].faces) == 24 |
There was a problem hiding this comment.
These tests don't really show anything. The import options only really apply to models with NS and we aren't testing any NS here. I think we should remove them.
| def test_design_import_catia_named_selections_with_publications(modeler: Modeler): | ||
| """Test importing a CATIA V5 file with publications as named selection groups.""" | ||
| options = ImportOptions(map_catia_sets_to_groups=True, publications_only_to_groups=True) | ||
| design = modeler.open_file( | ||
| Path(IMPORT_FILES_DIR, "SelectionSets.CATPart"), import_options=options | ||
| ) | ||
| assert "GSMExtrude.1" in design._named_selections | ||
| assert len(design._named_selections["GSMExtrude.1"].bodies) == 1 | ||
| assert "GSMFill.1" in design._named_selections | ||
| assert len(design._named_selections["GSMFill.1"].bodies) == 1 | ||
| assert "Pad.1" in design._named_selections | ||
| assert len(design._named_selections["Pad.1"].bodies) == 1 | ||
| assert "Pad.2" in design._named_selections | ||
| assert len(design._named_selections["Pad.2"].bodies) == 1 | ||
| assert "Open_body.1" not in design._named_selections |
There was a problem hiding this comment.
This test is showing the same results as if you had none of the options set. @RyanJWard can you help us out here? What behavior is expected?
| Warnings | ||
| -------- | ||
| map_catia_sets_to_groups and publications_only_to_groups are only available | ||
| starting in version 27R1. | ||
|
|
||
| Notes | ||
| ----- | ||
| import_as_lightweight and import_using_spaceclaim_colors are only available | ||
| starting in version 2027 R1. | ||
| starting in version 27R1. |
There was a problem hiding this comment.
| Warnings | |
| -------- | |
| map_catia_sets_to_groups and publications_only_to_groups are only available | |
| starting in version 27R1. | |
| Notes | |
| ----- | |
| import_as_lightweight and import_using_spaceclaim_colors are only available | |
| starting in version 2027 R1. | |
| starting in version 27R1. | |
| Notes | |
| ----- | |
| import_as_lightweight, import_using_spaceclaim_colors, map_catia_sets_to_groups, and publications_only_to_groups are only available starting in version 2027 R1. |
I can't get the indentation correct but this is how it should look
Description
As title mentions
Issue linked
Resolves #3008
Checklist
feat: extrude circle to cylinder)