Skip to content

Add a feature tree #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add a feature tree #821

wants to merge 1 commit into from

Conversation

greschd
Copy link
Member

@greschd greschd commented Apr 17, 2025

Add helper functions to either print a tree of ACP objects, or
print it. In the documentation, show the tree structure, and
explain how it affects the access and creation of objects.

To implement the feature tree, record metadata when creating
mapping properties (value type, and read-only status), and use
a separate _exposed_grpc_property subclass to indicate it is
a mapping.

Other changes:

  • change the default look of the model printer, to include lines
    connecting the nodes

25R2 hardening item 11.

'P1__ModelingPly.1'
Analysis Plies
'P1L1__ModelingPly.1'
└── 'ACP Model'
Copy link
Member Author

@greschd greschd Apr 17, 2025

Choose a reason for hiding this comment

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

This is a change in behavior of the existing print_model method (added lines to the output).

We could avoid it by setting show_lines to False by default. However:

  • the change is relatively minor + easily reverted by passing show_lines=False
  • (to my eye) the version with lines looks easier to parse

What's your take on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fine with me. The lines help to read the data.

@greschd greschd force-pushed the feat/feature_tree branch 2 times, most recently from 6aac8e5 to 0ad99e2 Compare April 17, 2025 13:53
Copy link

codecov bot commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 95.74468% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.92%. Comparing base (5222628) to head (0ad99e2).

Files with missing lines Patch % Lines
src/ansys/acp/core/_model_printer.py 95.45% 1 Missing ⚠️
src/ansys/acp/core/extras/feature_tree.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #821      +/-   ##
==========================================
+ Coverage   94.91%   94.92%   +0.01%     
==========================================
  Files         109      110       +1     
  Lines        5737     5771      +34     
  Branches      328      333       +5     
==========================================
+ Hits         5445     5478      +33     
- Misses        291      292       +1     
  Partials        1        1              
Flag Coverage Δ
direct-launch 91.45% <95.74%> (+0.03%) ⬆️
minimum-deps 93.09% <95.74%> (+0.02%) ⬆️
python-3.10 94.14% <95.74%> (+0.01%) ⬆️
python-3.11 94.07% <95.74%> (+0.01%) ⬆️
python-3.12 94.28% <95.74%> (+0.01%) ⬆️
server-2024R2 90.66% <95.74%> (+0.03%) ⬆️
server-2025R1 94.02% <95.74%> (+0.01%) ⬆️
server-2025R2 94.07% <95.74%> (+0.01%) ⬆️
server-latest 94.71% <95.74%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@greschd greschd force-pushed the feat/feature_tree branch 2 times, most recently from e4284bc to b5e0642 Compare April 17, 2025 14:51
@greschd greschd marked this pull request as ready for review April 17, 2025 14:52
@greschd
Copy link
Member Author

greschd commented Apr 17, 2025

The check-vulnerabilities action is failing also on main; it appears to be a problem with the action itself.

@@ -1,11 +0,0 @@
Example helpers
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to extras.rst.

@greschd greschd force-pushed the feat/feature_tree branch from b5e0642 to 1897f3f Compare April 17, 2025 14:58
Add helper functions to either print a tree of ACP objects, or
print it. In the documentation, show the tree structure, and
explain how it affects the access and creation of objects.

To implement the feature tree, record metadata when creating
mapping properties (value type, and read-only status), and use
a separate _exposed_grpc_property subclass to indicate it is
a mapping.
@greschd greschd force-pushed the feat/feature_tree branch from 1897f3f to 023b59b Compare April 17, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants