Skip to content

Maybe change testing.fast_array_utils.Flags design #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
flying-sheep opened this issue Feb 25, 2025 · 0 comments
Open

Maybe change testing.fast_array_utils.Flags design #34

flying-sheep opened this issue Feb 25, 2025 · 0 comments

Comments

@flying-sheep
Copy link
Member

Continued from #30 (comment) (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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant