Skip to content

Re-submission of gh-7087 with better file provenance - #7681

Merged
dschult merged 5 commits into
networkx:mainfrom
rossbar:animation-gallery-touchups-resub
Nov 11, 2024
Merged

dschult merged 5 commits into
networkx:mainfrom
rossbar:animation-gallery-touchups-resub

Conversation

@rossbar

@rossbar rossbar commented Oct 17, 2024

Copy link
Copy Markdown
Contributor

The state of the files in this PR (as of fd27267) are identical to 8452290 in #7087 . The main difference is I've re-applied the changes in a different way to better preserve attribution and make the changes more easily reviewable in github. See this comment for details.

Now, the big payoff of all this reorg is that the content changes are now diff-able in the GitHub UI by reviewing the diff for commit fd27267 .

@rossbar

rossbar commented Oct 17, 2024

Copy link
Copy Markdown
Contributor Author

As a reminder: the main motivation of this PR is to improve the animation performance, primarily to reduce doc CI burden. This PR does reduce the total time on the 3D animations by about 2x:

Both examples run in about 12.5 seconds with these changes (excerpted from the circleci build log for this PR):

    - ../examples/3d_drawing/plot_3d_animation_walk.py:                              6.29 sec   0.0 MB
    - ../examples/3d_drawing/plot_3d_animation_basic.py:                             6.17 sec   0.0 MB

vs. the current runtime for the example, which is about 25 seconds (excerpted from an arbitrary circleci build log):

    - ../examples/3d_drawing/plot_3d_rotation_animation.py:                         25.92 sec   0.0 MB

@lobpcg

lobpcg commented Oct 18, 2024

Copy link
Copy Markdown
Contributor

@rossbar maybe you could address my previous suggestions please: #7087 (comment)

A few suggestions:

  • keep both references in the basic example;
  • keep 3d spectral rather than spring in both examples - I would like to see it popularized.

Do you think that a frame redraw is never needed i.e. can always be avoided?

For a new follow up PR I would like to see a new hopefully similar example but which utilities
blit=True as in https://matplotlib.org/stable/api/animation_api.html

@rossbar

rossbar commented Oct 22, 2024 •

Copy link
Copy Markdown
Contributor Author

keep both references in the basic example;

The removal of the reference to sphinx-gallery was intentional - that's more of a tooling consideration that is more likely to be of interest to gallery authors rather than the typical reader of gallery examples.

The reference to matplotlib animations is still there in the original example - the external link has just been replaced with an intersphinx link for better maintainability.

keep 3d spectral rather than spring in both examples - I would like to see it popularized.

This was simply an aesthetic choice on my part. For whatever reason, the 3D spectral layout appears "compressed" in the depth dimension as opposed to the force-directed layout(s) which do a better job of recovering the "classic" dodecahedron.

In practice, this doesn't matter. I will switch back to the spectral layout to avoid bikeshedding.

Do you think that a frame redraw is never needed i.e. can always be avoided?

I'm no expert in the matplotlib animation API, but the resulting animation is consistent with the original example.

For a new follow up PR I would like to see a new hopefully similar example but which utilities blit=True

Agreed - let's leave it for a follow-up to hopefully get this one un-stuck!

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good.
I have a suggestion for the docs intro on the second example, but change it as you see fit.

And it's too bad to have to use global node to pass the node value into the anmiation function. But I don't see an easy way around it.

@dschult
dschult merged commit 8b845e9 into networkx:main Nov 11, 2024
@jarrodmillman jarrodmillman added this to the 3.5 milestone Nov 11, 2024
@rossbar
rossbar deleted the animation-gallery-touchups-resub branch November 11, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants