scverse / scverse/napari-spatialdata

Remove `_models.py`

Open
#248 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
90
Forks
25
Avg merge
22m
Merged PRs (30d)
1

Description

As discussed during the VIB Ghent 2024 hackathon with @giovp and @melonora, removing the legacy _models.py from the codebase, and access the data directly form layer.metadata['sdata'] would improve the robustness of the code.

In particular we should rely on get_values() for fetching annotations instead of the currently used get_obs(), get_var() etc.

A positive implication of this refactoring is that the mismatch between the annotation indices shown by napari, and the indices used by SpatialData, would disappear, therefore fixing this bug: https://github.com/scverse/napari-spatialdata/issues/242.

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 the legacy _models.py and the code paths that access layer metadata or call get_obs(), get_var(), and related methods. Trace annotation reads through layer.metadata['sdata'] and get_values(); the refactor is done when _models.py is no longer needed and the annotation-index mismatch described in issue #242 is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.