Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Maybe change `testing.fast_array_utils.Flags` design

未关闭
#34 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
tooling

调研方向

从链接的 pull request 讨论开始,检查当前 testing.fast_array_utils.Flags 的设计,尤其是 Flags.Any 和 Flags(0) 的处理方式。比较 issue 中描述的三个替代方案,并与维护者澄清预期语义。对于所有 ArrayTypes,达成一致的 flag 设计并确定相应行为后,即视为完成。

由索引模型根据 Issue 内容生成。

描述

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)
主要语言
Python
星标
15
派生
5
平均合并
10 小时 33 分钟
30 天内合并 PR
9

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

scverse/fast-array-utils 的其他 Issue

查看 scverse/fast-array-utils 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。