Summation of ConstantArray of 0 with vector of 0's fails
还没有人认领这个 Issue。
评估
调研方向
从 DelayedArray::ConstantArray 和 HDF5Array::writeHDF5Array 入口点开始,重现零值情况,然后将其与报告中展示的可正常工作的组合进行比较。完成的标准是零值 ConstantArray 加上零向量可以成功写入,并且现有示例可作为回归检查。
由索引模型根据 Issue 内容生成。
描述
Hi,
I ran into a curious edge case, where summing a ConstantArray with a vector fails if both are zero and then writing it with HDF5Array::writeHDF5Array, but not in any other combination:
mat <- DelayedArray::ConstantArray(c(2, 4), value = 0)
res <- mat + rep(0, 2)
res
#> <2 x 4> sparse DelayedMatrix object of type "double":
#> [,1] [,2] [,3] [,4]
#> [1,] 0 0 0 0
#> [2,] 0 0 0 0
HDF5Array::writeHDF5Array(res)
#> Error in .Arith_SVT1_v2(.Generic, e1, e2): "+" is not supported between a SparseArray object and a numeric vector
#> (result wouldn't be sparse in general)
# All other combination seems to work
mat <- DelayedArray::ConstantArray(c(2, 4), value = 0)
res <- mat + rep(3, 2)
HDF5Array::writeHDF5Array(res)
#> <2 x 4> HDF5Matrix object of type "double":
#> [,1] [,2] [,3] [,4]
#> [1,] 3 3 3 3
#> [2,] 3 3 3 3
mat <- DelayedArray::ConstantArray(c(2, 4), value = 17)
res <- mat + rep(0, 2)
HDF5Array::writeHDF5Array(res)
#> <2 x 4> HDF5Matrix object of type "double":
#> [,1] [,2] [,3] [,4]
#> [1,] 17 17 17 17
#> [2,] 17 17 17 17
mat <- DelayedArray::ConstantArray(c(2, 4), value = 0)
res <- mat + 0
HDF5Array::writeHDF5Array(res)
#> <2 x 4> sparse HDF5Matrix object of type "double":
#> [,1] [,2] [,3] [,4]
#> [1,] 0 0 0 0
#> [2,] 0 0 0 0
Created on 2025-03-05 with reprex v2.1.1
I am not actually 100% this is an DelayedArray issue or if it might rather need to be moved to HDF5Array.
Best,
Constantin
- 主要语言
- R
- 星标
- 29
- 派生
- 12
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Bioconductor/DelayedArray 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 38/100
Bioconductor/DelayedArray#129 · 11 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
Bioconductor/DelayedArray#127 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
Bioconductor/DelayedArray#125 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
Bioconductor/DelayedArray#122 ·
-
`base::cbind()` 未关闭
难度 4/5 3-5 天 新手友好度 35/100
Bioconductor/DelayedArray#116 · 3 条评论 ·
查看 Bioconductor/DelayedArray 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
briandconnelly/airnow#9 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
OHDSI/CohortConstructor#774 ·
-
pre-review R TeX Track: 5 (DSAIS)
难度 1/5 1 小时以内 新手友好度 60/100
openjournals/joss-reviews#11330 · 7 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100