scverse / scverse/spatialdata

Add `resolution` parameter to `circles_to_polygons()`

Open
#300 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement ✨ method: aggregation 🔢
Dominant language
Python
Stars
394
Forks
95
Avg merge
4d 3h
Merged PRs (30d)
7

Description

Minor change.

circles_to_polygons() calls .buffer() with the default resolution parameter (16). When aggregating using an higher resolution makes the results more accurate. In the Xenium + Visium example using 16 instead of 128 gives an relative error in the aggregated results of something like 1%.

Todo:

  • add resolution to circles_to_polygons()
  • allow to pass resolution to aggregate when aggregating circles values, or by circles. Ignore the parameter otherwise and show a warning.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating circles_to_polygons() and the aggregate path used for circle-based values, then inspect the Xenium + Visium example for the accuracy difference described. Add support for passing resolution through aggregation when applicable, ignore it with a warning otherwise, and verify that higher-resolution aggregation produces the intended results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.