feat: Enhance Pipeline.draw()
to show image directly in Jupyter notebook
#6961
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
Pipeline.draw()
in a notebook cell we should display the image directly #6802Proposed Changes:
Change
Pipeline.draw()
to embed image if run in Jupyter notebook.Now it can also be run without passing a
path
.A
path
must still be provided if not running in a notebook, we raise aValueError
if missing.How it appears on a Jupyter notebook ran in VS Code.
![Screenshot 2024-02-08 at 15 34 15](https://private-user-images.githubusercontent.com/3314350/303368659-bfef51b6-17e4-43af-b69f-df2b524245ff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0MDA4MDcsIm5iZiI6MTcxOTQwMDUwNywicGF0aCI6Ii8zMzE0MzUwLzMwMzM2ODY1OS1iZmVmNTFiNi0xN2U0LTQzYWYtYjY5Zi1kZjJiNTI0MjQ1ZmYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjZUMTExNTA3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjRjYWM2YjQ4MTlmNTBjNjAzMTgwMmYwNTEyYzg1Njc2MGM2YzAyOTAzM2M4ZTU3NzM0MzZiNTM1ZWM2NWFjNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.7genx1Uu-jXQpl0uMGV_4gsrEvH58eUyEeDxN2hh43A)
How did you test it?
I added some new unit tests and adapted the existing ones. I also tested it manually on a local Jupyter notebook.
Notes for the reviewer
In this PR I also changed the
Pipeline.draw()
API to remove the choice of a rendering engine and always use mermaid.Rendering with graphviz has been completely removed.
I also restructured a bit the
draw
package to avoid annoying repetitions in import paths.Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.