Skip to content

feat: Added MapCatiaSetsToGroups Import Option - #3031

Draft
Gonzi09 wants to merge 21 commits into
mainfrom
feat/add-map-cts-to-grps
Draft

Gonzi09 wants to merge 21 commits into
mainfrom
feat/add-map-cts-to-grps

Conversation

@Gonzi09

@Gonzi09 Gonzi09 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

As title mentions

Issue linked

Resolves #3008

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)

@Gonzi09 Gonzi09 self-assigned this Aug 12, 2026
@Gonzi09
Gonzi09 requested a review from a team as a code owner August 12, 2026 19:48
@github-actions github-actions Bot added the enhancement New features or code improvements label Aug 12, 2026
@codacy-production

codacy-production Bot commented Aug 12, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.62%. Comparing base (8f7dde1) to head (975cfcf).

❌ 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.
📢 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.

@Gonzi09
Gonzi09 marked this pull request as draft August 12, 2026 20:04
@github-actions github-actions Bot added documentation Improvements or additions to documentation maintenance Package and maintenance related testing Anything related to tests and removed documentation Improvements or additions to documentation maintenance Package and maintenance related labels Aug 13, 2026
@Gonzi09
Gonzi09 marked this pull request as ready for review August 13, 2026 15:22
Comment thread tests/integration/test_design_import.py
Comment thread src/ansys/geometry/core/misc/options.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 ImportOptions with map_catia_sets_to_groups and publications_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.

Comment thread src/ansys/geometry/core/misc/options.py
Comment thread tests/integration/test_design_import.py Outdated
@Gonzi09
Gonzi09 marked this pull request as draft August 14, 2026 06:05
@Gonzi09
Gonzi09 force-pushed the feat/add-map-cts-to-grps branch from 5e6dfff to 658a207 Compare August 17, 2026 13:36
@Gonzi09
Gonzi09 marked this pull request as ready for review August 17, 2026 19:41
Comment thread src/ansys/geometry/core/misc/options.py Outdated
Comment thread tests/integration/test_design_import.py
Comment on lines +67 to +75
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's remove this solo comment

Comment on lines +500 to +517
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +483 to +497
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Comment on lines +67 to +75
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

@Gonzi09
Gonzi09 marked this pull request as draft August 19, 2026 15:49
@Gonzi09
Gonzi09 marked this pull request as ready for review September 14, 2026 15:28
@Gonzi09
Gonzi09 marked this pull request as draft September 14, 2026 15:28
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 MapCatiaSetsToGroups Import Option

5 participants