Add static auto-layout graph visualization#8
Conversation
926ccfa to
e6917ed
Compare
e6917ed to
276aead
Compare
| # getting the end_lineno for ast nodes is provided in 3.8+ | ||
| # __init__subclass__ is provided in 3.6+ | ||
| requires-python = ">=3.8" | ||
| requires-python = ">=3.11" |
There was a problem hiding this comment.
is there a way to make it so the python version isn't forced to be 3.11?
I think minimum we can get away with is 3.10. this is because gr00t requires 3.10
There was a problem hiding this comment.
this is tough. I added 3.11 because fast-sugiyama (the layout library) needs it. If we cannot use 3.10 then we have to write the layout library from scratch
There was a problem hiding this comment.
do you know if gr00t requiring 3.10 is actually true? I think the public github still says requires 3.10 but at the same time it seems like you were able to run a test. If 3.10 is true we can make graphing optional depending on the python version the user is running? like before import add a try except. we can probably make this condition reflect in the pyproject too.
Summary
<graph_name>.svgand<graph_name>.pngfromleapp.compile_graph(visualize=True).kindwhen available.leapp-visualizationpip package.leappnow depends onleapp-visualization==0.5.2, resolved locally by uv frompackages/leapp-visualizationduring development.fast-sugiyama,Pillow) intoleapp-visualization.Package layout
packages/leapp-visualization/src/leapp_visualization/: generic visual graph dataclasses, layout, geometry, SVG renderer, PNG renderer, andrender_graph(...).leapp/leapp_graph/visualization_adapter.py: LEAPP-specific adapter from LEAPP nodes/connections/tensor descriptors intoleapp_visualization.VisualGraph.leapp/leapp_graph/graph_gui.py: compatibility wrapper used bycompile_graph(visualize=True).Example artifacts
Generated on this branch by
leapp.compile_graph(visualize=True):GR00T Graph Example
Larger saved LEAPP export rendered with the same static auto-layout path:
Verification
uv run pytest tests/unit_tests/test_graph_visualization_*.py tests/functional_tests/test_annotate.py::TestAnnotateTensor::test_annotate_traced_tensors_diamond_with_feedback tests/test_examples/test_getting_started.py::TestGettingStarted::test_getting_started_execution tests/test_examples/test_feedback_example.py::TestFeedbackExample::test_feedback_example_execution -q-> 38 passed, 4 warningsuv build packages/leapp-visualization && uv build-> built both distributions successfully