scverse / scverse/scverse-misc

Allow per-package configuration of `category`

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5
Forks
2
Avg merge
11h 10m
Merged PRs (30d)
13

Description

Description of feature

One idea I had: the default of FutureWarning across the board is good for our usual use case (=libraries that are usually used directly and not by other libraries), but it’s inconvenient to override, as you’d want to override it on a (toplevel import or distribution) package level.

I wonder if we could introduce a new default for the category args. If we at any point introduce a non-declarative API that raises a warning, we could also use that to set the default skip_file_prefixes.

E.g. directly in the body of the function, this would get the caller module name: inspect.getmodule(inspect.stack()[1].frame).__name__

The only issue would be if anyone wraps our decorator, as that would mean the call site is wherever the wrapper is defined.

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 decorator that accepts the category argument and review how warning defaults are currently selected. Investigate the proposed package-level configuration and the interaction with skip_file_prefixes, including wrapped decorators. Done means the configuration behavior and caller-resolution edge cases are specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.