Skip to content
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

Add interactive tree visualization #348

Open
janvonrickenbach opened this issue Jan 23, 2024 · 3 comments
Open

Add interactive tree visualization #348

janvonrickenbach opened this issue Jan 23, 2024 · 3 comments
Labels
feature New feature or request

Comments

@janvonrickenbach
Copy link
Contributor

Currently it is hard to get an overview over the model.

We could add a small visualization for the plies with ipytree [1].
We could add some print functionality to get an overview over the layup
Maybe add a helper function to export/print the layup as JSON (with configurable detail)
Document workflow for opening a pyACP model in ACP standalone
(maybe even with some "live" reload functionality)

[1]

from ipytree import Tree, Node
model.update()

tree = Tree(stripes=True)
tree

for modeling_group_name, modeling_group in model.modeling_groups.items():
group_node = Node(modeling_group_name)
tree.add_node(group_node)
for modeling_ply_name, modeling_ply in modeling_group.modeling_plies.items():
modeling_ply_node = Node(modeling_ply_name)
group_node.add_node(modeling_ply_node)
for production_ply_name, production_ply in modeling_ply.production_plies.items():
production_ply_node = Node(production_ply_name)
modeling_ply_node.add_node(production_ply_node)
for analysis_ply_name, analysis_ply in production_ply.analysis_plies.items():
analysis_ply_node = Node(analysis_ply_name)
production_ply_node.add_node(analysis_ply_node)

@janvonrickenbach janvonrickenbach self-assigned this Jan 23, 2024
@janvonrickenbach janvonrickenbach changed the title Add simple visualization for the model Add simple visualization for the tree Jan 23, 2024
@janvonrickenbach
Copy link
Contributor Author

Print tree as string is done in #350
Interactive tree in ipython notebook still todo.

@greschd
Copy link
Member

greschd commented Nov 6, 2024

The current model tree printer also needs updating to show the new object types. Maybe we can restructure it to make use of the tree built up for the recursive copy feature[1], to ensure it stays up-to-date.

[1] The order and / or labels of groups may need specific handling

@greschd greschd added this to the 2025R1 release milestone Nov 6, 2024
greschd added a commit that referenced this issue 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 [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 added a commit that referenced this issue Nov 27, 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 [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 added a commit that referenced this issue Nov 28, 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.
@greschd greschd added feature New feature or request and removed bug Something isn't working labels Nov 28, 2024
@greschd greschd changed the title Add simple visualization for the tree Add interactive tree visualization Nov 28, 2024
@greschd
Copy link
Member

greschd commented Nov 28, 2024

The tree printer has been fixed in #679; moving this to backlog since now only interactive (ipytree) component is missing.

@greschd greschd removed this from the 2025R1 release milestone Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants