scverse / scverse/napari-spatialdata
`add_elements` not adding elements using Interactive
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 90
- Forks
- 25
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Description
Hi,
I'm trying to use this package to show my sopa results but can't get my elements to be shown in napari through code.
Here is my code :
image_key = list(sdata.images.keys())[0]
points_key = list(sdata.points.keys())[0]
interactive = Interactive(sdata, headless=True)
interactive.add_element(image_key, "global", True)
interactive.add_element(points_key, "global", True)
interactive.add_element("cellpose_boundaries", "global", True)
interactive.run()
This loads the image but then nothing else.
The notebook shows
INFO: Please wait for the current operation to finish.
INFO: Please wait for the current operation to finish.
2025-05-13 15:56:57.577 | DEBUG | napari_spatialdata._view:_on_layer_update:569 - Updating layer.
2025-05-13 15:56:57.578 | DEBUG | napari_spatialdata._view:_on_layer_update:569 - Updating layer.
but it never finishes. Clicking on it through the GUI is super fast though. Any ideas why ?
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 the Interactive.add_element and Interactive.run entry points and reproduce the supplied Python snippet. Then inspect napari_spatialdata._view:_on_layer_update, which is named in the debug output, to determine why adding multiple elements does not finish. Done means the image, points, and cellpose_boundaries layers all load through code and the operation completes.
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
- Needs clarification
- Newbie friendliness
- 35/100