Skip to content

Add rendering performance example notebook#8

Merged
timtreis merged 4 commits into
mainfrom
example/performance-notebook
Jun 19, 2026
Merged

Add rendering performance example notebook#8
timtreis merged 4 commits into
mainfrom
example/performance-notebook

Conversation

@timtreis

@timtreis timtreis commented Jun 19, 2026

Copy link
Copy Markdown
Member

Ports the speed_up_illustration notebook from spatialdata-notebooks into the gallery as examples/performance.ipynb, adapted to this repo's conventions.

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>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

📖 Docs preview: https://scverse.org/spatialdata-plot-notebooks/pr-8/gallery.html

Built from 498f380; redeployed on every push.

github-actions Bot pushed a commit that referenced this pull request Jun 19, 2026
- 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>
github-actions Bot pushed a commit that referenced this pull request Jun 19, 2026
- 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>
github-actions Bot pushed a commit that referenced this pull request Jun 19, 2026
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>
@timtreis timtreis force-pushed the example/performance-notebook branch from dbf0d20 to 413b9c3 Compare June 19, 2026 19:26
github-actions Bot pushed a commit that referenced this pull request Jun 19, 2026
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 timtreis merged commit 5f48235 into main Jun 19, 2026
4 checks passed
@timtreis timtreis deleted the example/performance-notebook branch June 19, 2026 19:42
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>
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.

1 participant