scverse / scverse/napari-spatialdata
Fix default size for points elements
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 90
- Forks
- 25
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Description
When points elements are being shown, an optimal size for the points is guessed based on a heuristic implemented in _calc_default_radii().
There are three fixes that we need to make here:
get_extent(), even when usingexact=False, is too slow when there is a large number of points. We should add a parameterfast: bool = Falsewhich computes a very rough approximation of the extent based on some "Montecarlo" sampling.- The value in unit we return is wrong when we are in a scaled coordinate system; I think that we need to divide by the average module of the eigenvalues of the affine transformation, as we do in
_adjust_radii_of_points_layer() - There is a strange bug in
get_extent()where the single-dispatch doesn't recognizeSpatialDataobjects. This is tracked here: https://github.com/scverse/spatialdata/issues/500
For the moment, I am disabling the use of _calc_default_radii() in https://github.com/scverse/napari-spatialdata/pull/215.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with _calc_default_radii() and get_extent(), then compare the unit handling in _adjust_radii_of_points_layer(). Check the linked SpatialData issue and napari-spatialdata PR 215 for context on the single-dispatch problem and the temporary disabling change. Done means the fast extent path, scaled-coordinate sizing, and SpatialData dispatch behavior are corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100