scverse / scverse/squidpy

[doc improvment] inconsistent usage of img_key and img_res_key in code base

Open
#884 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

doc
Dominant language
Python
Stars
598
Forks
121
Avg merge
3d 11h
Merged PRs (30d)
3

Description

I encountered a problem today using sq.pl.spatial_scatter, I have to use lowres image in my object, so I see the docstring said - Use ``img_key`` to display the image in the background.
https://github.com/scverse/squidpy/blob/e6b5b0ccd2739aa50b55c7628e685a6750249d8f/src/squidpy/pl/_spatial.py#L392
but when I specified img_key in sq.pl.spatial_scatter, I encountered error saying that it is not a valid parameter.
So I looked into the source code, and found sq.pl.spatial_scatter calls _spatial_plot
https://github.com/scverse/squidpy/blob/e6b5b0ccd2739aa50b55c7628e685a6750249d8f/src/squidpy/pl/_spatial.py#L47

in which the real parameter is named img_res_key
https://github.com/scverse/squidpy/blob/e6b5b0ccd2739aa50b55c7628e685a6750249d8f/src/squidpy/pl/_spatial.py#L57
but the docstring of _spatial_plot says img_key as well
https://github.com/scverse/squidpy/blob/e6b5b0ccd2739aa50b55c7628e685a6750249d8f/src/squidpy/pl/_spatial.py#L143

I wanted to submit a pr because this seems a simple fix, just fix the docstring would be good, but when I grep the code base I found
image
image

There seem to be a major name inconsistency, and I don't know what is the intended name in opinion of your team, so I gave up and file an issue.

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 reading src/squidpy/pl/_spatial.py, especially the spatial_scatter entry point, _spatial_plot, and their docstrings. Trace the related img_key and img_res_key references across the codebase and confirm the intended name with maintainers. Done means the parameter and documentation references use one agreed name consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.