Skip to content

Conversation

@greschd
Copy link
Member

@greschd greschd commented Nov 18, 2024

Change the implementation of 'get_model_tree' to use the '_GRPC_PROPERTIES' class attribute, and thus include all newly-added object types in the representation.

The style of the tree has changed in some ways:

  • The root node now shows the model name, instead of always 'Model'
  • Objects (name or id) are distinguished from collections by wrapping the string in single quotes
  • The additional nesting level for 'Materials', 'Selection Rules', and other 'logical' groupings which are not part of the PyACP hierarchy has been removed

The new tree structure can be seen in the updated test cases, or in print_model.rst.

Partially addresses #348, interactive tree support in Jupyter notebooks is still missing.

@codecov
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.98%. Comparing base (2ff380a) to head (8a5cf8e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ansys/acp/core/_model_printer.py 88.46% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #679      +/-   ##
==========================================
- Coverage   95.04%   94.98%   -0.07%     
==========================================
  Files         109      109              
  Lines        5716     5685      -31     
  Branches      324      322       -2     
==========================================
- Hits         5433     5400      -33     
- Misses        282      284       +2     
  Partials        1        1              
Flag Coverage Δ
direct-launch 91.57% <88.46%> (-0.09%) ⬇️
minimum-deps 93.18% <88.46%> (-0.08%) ⬇️
python-3.10 94.24% <88.46%> (-0.07%) ⬇️
python-3.11 94.17% <88.46%> (-0.07%) ⬇️
python-3.12 94.37% <88.46%> (-0.07%) ⬇️
server-2024R2 90.80% <88.46%> (-0.09%) ⬇️
server-2025R1 94.17% <88.46%> (-0.07%) ⬇️
server-2025R2 94.17% <88.46%> (-0.07%) ⬇️
server-latest 94.79% <88.46%> (-0.07%) ⬇️

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.

@greschd greschd force-pushed the fix/tree_printer branch 2 times, most recently from 959ecd2 to 31c84a9 Compare November 18, 2024 16:15
Change the implementation of 'get_model_tree' to use the
'_GRPC_PROPERTIES' class attribute, and thus include all
newly-added object types in the representation.

The style of the tree has changed in some ways:
- The root node now shows the model name, instead of always 'Model'
- Objects (name or id) are distinguished from collections by
  wrapping the string in single quotes
- The additional nesting level for 'Materials', 'Selection Rules',
  and other 'logical' groupings which are not part of the PyACP
  hierarchy has been removed [1]

[1] This change might be debatable since the ACP GUI does show
this nesting level. Since the PyACP hierarchy does not include them,
it would be complicated to add them in a generic way, however.

To discuss: should the collection names be capitalized (as done
currently), or not (matching the PyACP attribute names)?

The new tree structure can be seen in the updated test cases.

Partially addresses #348, interactive tree support in Jupyter
notebooks is still missing.
@greschd greschd merged commit d440904 into main Nov 28, 2024
31 of 33 checks passed
@greschd greschd deleted the fix/tree_printer branch November 28, 2024 08:35
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.

3 participants