Add feature to show names of layer dependencies in HLG JupyterLab repr#9081
Add feature to show names of layer dependencies in HLG JupyterLab repr#9081
Conversation
|
Can one of the admins verify this patch? |
|
@aomirolis Thank you for opening this! For future reference, you can push update commits to the branch you use for the PR, it helps consolidate all discussion and feedback in the same place. :) Some CI tests are failing with:
Since we added a new |
Co-authored-by: Pavithra Eswaramoorthy <pavithraes@outlook.com>
|
Thank you! I'll keep that in mind. |
|
@aomirolis Thanks for the updates! @gjoseph92 Could you please take a look at this when you get a chance? |
jsignell
left a comment
There was a problem hiding this comment.
This looks nice and clean but I don't actually see any dependency information in the output. Is it possible that that information isn't actually available until the graph is materialized @gjoseph92?
dask/highlevelgraph.py
Outdated
| return obj | ||
|
|
||
| def _repr_html_(self, layer_index="", highlevelgraph_key=""): | ||
| def _repr_html_(self, dependencies, layer_index="", highlevelgraph_key=""): |
There was a problem hiding this comment.
| def _repr_html_(self, dependencies, layer_index="", highlevelgraph_key=""): | |
| def _repr_html_(self, layer_index="", highlevelgraph_key="", dependencies=()): |
This should be an optional argument. Then you can revert your changes to all those tests as well.
I would have expected this to break rendering a Layer instance (as opposed to an HLG instance) in an actual notebook?
There was a problem hiding this comment.
Thank you for the suggestion! May I ask why it should be this way? I will soon make the suggested changes.
There was a problem hiding this comment.
By adding dependencies as an optional kwarg at the end of the method, this PR is fully backwards compatible. So any existing code will continue to work even if dependencies is not passed.
There was a problem hiding this comment.
Makes sense, thank you!
|
@jsignell are you trying this out?
That's definitely not the case, that's just part of the HLG structure. If it't not showing up, then I think something else is wrong. |
|
Yeah I was trying it out with: import dask.array as da
arr1 = da.zeros(shape=(100,100), chunks=(5,10))
arr2 = arr1.T + 100
arr3 = arr1.dot(arr2)
arr3.dask |
|
So sorry for the noise @aomirolis my git branch checkout failed and I didn't notice. I see the intended behavior now just as in your screenshot. |
|
No problem!! |
jsignell
left a comment
There was a problem hiding this comment.
This looks great! Thanks @aomirolis for sticking with it!

This PR implements the enhancement proposed by @gjoseph92 on #8567.
I opened a new PR (closed previous #9061) with the corrections suggested by @jsignell and @gjoseph92, thank you a lot for your quick response and feedback!