Skip to content

Adding visualization to uarray expressions#75

Merged
saulshanabrook merged 1 commit intoQuansight-Labs:masterfrom
costrouc:visualize-matchpy-expressions
Dec 8, 2018
Merged

Adding visualization to uarray expressions#75
saulshanabrook merged 1 commit intoQuansight-Labs:masterfrom
costrouc:visualize-matchpy-expressions

Conversation

@costrouc
Copy link
Copy Markdown
Contributor

@costrouc costrouc commented Dec 6, 2018

Looks like matchpy does not want to upstream visualization which is understandable. HPAC/matchpy#48

For now this PR adds a function visualize_expression which will return a graphviz object that will easily render in jupyter notebooks. This PR will require additional work in that we would like to add a notebook demonstrating the visualizations.

Action is needed on which Symbols/Objects in uarray to give the _repr_gviz_node_ to which will allow for gviz visualization. For now it has a default representation for Symbols/Operations.

Closes #40

@costrouc costrouc force-pushed the visualize-matchpy-expressions branch from 7226586 to 630676a Compare December 6, 2018 22:34
@costrouc
Copy link
Copy Markdown
Contributor Author

costrouc commented Dec 6, 2018

Need to add a notebook to demonstrate visualization.

@costrouc costrouc force-pushed the visualize-matchpy-expressions branch from 630676a to c819133 Compare December 6, 2018 22:45
Copy link
Copy Markdown
Contributor

@saulshanabrook saulshanabrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Yep having a notebook would be nice, I am excited to see how this looks for real expressions!

@costrouc costrouc force-pushed the visualize-matchpy-expressions branch from c819133 to 7d58088 Compare December 7, 2018 21:22
@costrouc
Copy link
Copy Markdown
Contributor Author

costrouc commented Dec 7, 2018

Notebook now exists to demonstrate. Here is a screenshot of visualizing (A^< 4 5 > + B) * (<1 2> phi C)

screenshot-localhost-8888-2018 12 07-16-25-39

visualize_expression(moa_expr, with_uarray=False)

screenshot-localhost-8888-2018 12 07-16-28-22

So both views are possible. I think that the first is more helpful for viewing reductions.

@saulshanabrook if this is good with you I will merge. I know that I can merge anytime but for now I would like to ask for approval first.

Notebook `Uarray Visualization.ipynb` included to demonstrate with
expressions.
@costrouc costrouc force-pushed the visualize-matchpy-expressions branch from 7d58088 to e126dfe Compare December 7, 2018 21:33
@saulshanabrook saulshanabrook merged commit 6c60090 into Quansight-Labs:master Dec 8, 2018
@saulshanabrook
Copy link
Copy Markdown
Contributor

Looks great!

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.

2 participants