scverse / scverse/fast-array-utils

Maybe change `testing.fast_array_utils.Flags` design

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

Nobody has claimed this yet.

Dominant language
Python
Stars
15
Forks
5
Avg merge
10h 33m
Merged PRs (30d)
9

Description

Continued from https://github.com/scverse/fast-array-utils/pull/30#discussion_r1967609696 (cc @ilan-gold)

Currently we have Flags.Any, which is set for all ArrayTypes, in order to make sure that for each ArrayType “at”,

  1. at.flags & ~Flags(0) is truthy, and
  2. not (at.flags & Flags(0)) is true.

This isn’t trivially the case, since each flag represents an attribute, and its absence the inverse attribute, so there is always one group that has no flags set. With the current set of flags (sparse, gpu, dask, disk), this group contains numpy.ndarray)

Alternatives:

  1. don’t use Flags(0) as default for skip, but None instead (unintuitive, one would expect skip=Flags(0) to skip nothing)
  2. use a flag that is the inverse of another, e.g. Flags.Dense (there is no longer one obvious way to do things, e.g. shall we skip sparse or select dense?)
  3. switch the flags to NoDask and NoDisk, so that Flags(0) represents a combination that can never exist (might be elegant if there were were words to express these concepts without negation)

Contributor guide

No contributing guide indexed for this repository

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 the linked pull request discussion and inspect the current testing.fast_array_utils.Flags design, especially the handling of Flags.Any and Flags(0). Compare the three alternatives described in the issue and clarify the intended semantics with maintainers. Done means an agreed flag design and corresponding behavior for all ArrayTypes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.