Currently, it's not possible to save ShapedAsNT objects with JLD2.
Minimal example:
using ValueShapes
using JLD2
x = (a=1, b=2,)
vs = valshape(x)
x_shpd = ShapedAsNT(collect(x),vs)
jldsave("test.jld2", x = x_shpd)
This gives the following stacktrace.txt
@waldie11 and I tried solving that by implementing JLD2.writeas and Base.convert but didn't succeed.
We think the problem is somehow related to NamedTupleShape being deconstructed into its components in "JLD2/src/data/writing_datatypes.jl" finally resulting in the error in the function h5convert. This only happens if NamedTupleShape is ShapedAsNT.
Even though we tried for quite some time, we couldn't find a fix.
We noticed that the problem is the same when trying to store a type with unknown size like this:
T = NTuple{N, Int} where N
jldsave("test.jld2", a = T)
(for which we are not sure if something like that should even be possible)
Currently, it's not possible to save
ShapedAsNTobjects with JLD2.Minimal example:
This gives the following stacktrace.txt
@waldie11 and I tried solving that by implementing
JLD2.writeasandBase.convertbut didn't succeed.We think the problem is somehow related to
NamedTupleShapebeing deconstructed into its components in "JLD2/src/data/writing_datatypes.jl" finally resulting in the error in the functionh5convert. This only happens ifNamedTupleShapeisShapedAsNT.Even though we tried for quite some time, we couldn't find a fix.
We noticed that the problem is the same when trying to store a type with unknown size like this:
(for which we are not sure if something like that should even be possible)