Add rendering performance example notebook#8
Merged
Conversation
Port the `speed_up_illustration` notebook from spatialdata-notebooks into the gallery as examples/performance.ipynb, adapted to repo conventions: - Uses the cached `squidpy` visium_hne_sdata loader (its multiscale `hne` image drives the image sections) instead of a manually-downloaded zarr. - Sections: automatic rasterization (single-scale images), automatic scale selection (multi-scale images), and the datashader backend for shapes/points. - Slims the synthetic-data helper to build only the benchmarked element, and adds an untimed warmup so numba JIT / datashader setup isn't measured. - Keeps the shape crossovers (~250 polygons/circles, ~225 multi-polygons) and shows that points are comparable across backends (no clean crossover). Points benchmark starts at n=10: a single point has zero extent and crashes the datashader backend (scverse/spatialdata-plot#724). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
📖 Docs preview: https://scverse.org/spatialdata-plot-notebooks/pr-8/gallery.html Built from 498f380; redeployed on every push. |
- Compute the datashader/matplotlib crossover from the measured medians
instead of hardcoding it, so the red line is correct after CI re-execution
on different hardware (the multi-polygon line was previously wrong). No line
is drawn for points, where datashader never pulls ahead.
- Move the plot legend inside (upper left) for a better thumbnail aspect ratio.
- Replace the multiscale scale="full" render with a verbal note (the dataset's
full image is small enough that the demo no longer makes its point).
- benchmark(): warm up once instead of per-count, and plt.close("all") each
iteration so figures don't accumulate (memory spike / silenced
max_open_warning on CI re-execution).
- Add a Dataset citation to the intro; drop the unsampled "~50k points" claim;
mention points in the gallery card.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add the 10,000,000-point step so the reversed inflection is obvious: for points datashader is faster for small sets but matplotlib wins at scale, crossing around 100k and staying ahead out to 10 million. - crossover() now detects the switch in either direction (so points get a marked line too) and rounds to 2 significant figures for a clean label. - Regenerate the gallery thumbnail at a ~1.1 aspect ratio to match the other cards (was a wide 7x4 benchmark figure). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
It teaches rendering performance end-to-end on a real dataset, so it fits Tutorials rather than the single-feature Examples gallery. Moves the gallery card and toctree entry accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dbf0d20 to
413b9c3
Compare
timtreis
added a commit
to scverse/spatialdata-plot
that referenced
this pull request
Jun 19, 2026
Adds the gallery card + thumbnail for the new rendering-performance tutorial and advances the docs/notebooks submodule to the commit that introduces it. Depends on scverse/spatialdata-plot-notebooks#8 — the submodule pointer here references that PR's head commit so the docs build/preview renders the new tutorial. Once #8 merges, the pointer should be advanced to notebooks `main`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
timtreis
added a commit
to scverse/spatialdata-plot
that referenced
this pull request
Jun 19, 2026
scverse/spatialdata-plot-notebooks#8 is merged, so the tutorial is on main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ports the
speed_up_illustrationnotebook fromspatialdata-notebooksinto the gallery asexamples/performance.ipynb, adapted to this repo's conventions.