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

Fix plot_complexes #1138

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Fix plot_complexes #1138

merged 5 commits into from
Nov 27, 2024

Conversation

vyudu
Copy link
Collaborator

@vyudu vyudu commented Nov 25, 2024

Fix for #1135. Should also resolve the documentation build issue in #1130.

Copy link
Member

@isaacsas isaacsas left a comment

Choose a reason for hiding this comment

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

Can you add some tests to cover the bug with respect to the ordering, including in the case of multiple edges?

ext/CatalystGraphMakieExtension.jl Outdated Show resolved Hide resolved
Comment on lines 68 to 72
for (i,e) in enumerate(edgelist)
fwd = findall(==(e), edgelist); rev = findall(==(reverse(e)), edgelist)
distances[i] != 0 && continue
distances[fwd] = collect(0:inc:inc*(length(fwd)-1))
distances[rev] = collect(inc:inc:inc*(length(rev)))
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a very inefficient way to do this? Maybe build a mapping from unique edges to vectors of their indices in edgelist as part of the MultiGraph?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrote a more efficient new way (that also correctly does the curves for multiple fwd/rev edges). One pass through the array and then one pass through the dict. Think it should be the same as storing the dict, since we construct a new MultiGraphWrap everytime we call plot_network and plot_complexes anyway

ext/CatalystGraphMakieExtension/rn_graph_plot.jl Outdated Show resolved Hide resolved
ext/CatalystGraphMakieExtension/rn_graph_plot.jl Outdated Show resolved Hide resolved
@vyudu vyudu mentioned this pull request Nov 26, 2024
Copy link
Member

@isaacsas isaacsas left a comment

Choose a reason for hiding this comment

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

@vyudu, feel free to merge if tests pass and the docs build.

@vyudu vyudu merged commit 19d9652 into SciML:master Nov 27, 2024
13 checks passed
@vyudu vyudu deleted the graph-fix branch November 27, 2024 16:02
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