scverse / scverse/fast-array-utils
Maybe change `testing.fast_array_utils.Flags` design
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”,
at.flags & ~Flags(0)is truthy, andnot (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:
- don’t use
Flags(0)as default forskip, butNoneinstead (unintuitive, one would expectskip=Flags(0)to skip nothing) - 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?) - switch the flags to
NoDaskandNoDisk, so thatFlags(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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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