ArrayType serialization with 2D+ arrays
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- julia
调研方向
首先跟踪 ArrayType() 的序列化和 iterate(x::T) 的默认行为,然后审查提议的 construct(::Type{Matrix}, x::Vector) 反序列化路径。明确高维数组应如何保留维度,以及用户如何自定义序列化,同时清楚定义所选择的行为及其往返限制。
由索引模型根据 Issue 内容生成。
描述
Currently ArrayType() iterates element-wise over an array type using the default iterate(x::T) method when serializing. This has the effect of flattening higher dimensional arrays into vectors. Matrices, for instance, become vectors with no information about their original dimensions.
The JSON standard maintains array order, so it seems safe for me to serialize matrices as vectors of vectors. However, my only way to affect serialization is by overloading the iterate(x::T) function and doing so for the Matrix type seems likely to recompile large parts of Julia base (as well as break my own code.)
Then on deserialization, I would just construct(::Type{Matrix}, x::Vector) = hcat(x...)
It makes sense on some level that this would be natively unsupported because it makes the serialized representation of matrices and vectors of vectors indistinguishable (and thus deserialize(serialize(matrix)) != matrix without an additional construct definition), but that code doesn't work right now either and it seems like there should be some way to for users to enable support for it because matrices are so common. Perhaps there should be something analogous to construct() for serialization?
- 主要语言
- Julia
- 星标
- 86
- 派生
- 21
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaData/StructTypes.jl 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
JuliaData/StructTypes.jl#104 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
JuliaData/StructTypes.jl#102 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 35/100
JuliaData/StructTypes.jl#98 · 2 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 30/100
JuliaData/StructTypes.jl#96 · 1 条评论 ·
-
`StructTypes.x` is not defined可能已有人在做 @sunoru 于 1125 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
JuliaData/StructTypes.jl#92 · 3 条评论 ·
查看 JuliaData/StructTypes.jl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
CliMA/ClimaAtmos.jl#4891 · 1 条评论 ·
维护者通常 1 天内回复
-
tagbot-manual
难度 1/5 1 小时以内 新手友好度 75/100
tshort/StaticCompiler.jl#191 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
SciML/SciMLSensitivity.jl#1703 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
JuliaGPU/GPUCompiler.jl#1008 ·
维护者通常 1 天内回复
-
`biggs6` disagrees with CUTEst and is unbounded below可能已有人在做 @timholy 于 1 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100