Skip to content

Maybe change testing.fast_array_utils.Flags design #34

Open
@flying-sheep

Description

@flying-sheep

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions