scverse / scverse/napari-spatialdata

why `len(unique) <= len(res) // 100`

Open
#346 1 comment 0 reactions 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

Hi, how should we distinguish between continuous and categorical variables? I don't understand the following line of code.

https://github.com/scverse/napari-spatialdata/blob/36fe3b96e829f45b39012238a5d1f4d8e1087eae/src/napari_spatialdata/utils/_utils.py#L72

In my case, len(unique) <= len(res) // 100, but the variable is 'total_counts per spot'

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 with src/napari_spatialdata/utils/_utils.py at line 72 and trace how unique and res are produced. Clarify how the <= len(res) // 100 condition distinguishes variable types, including whether total_counts per spot is classified as categorical or continuous, and document the intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.