You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Consider an empty vector of type Vector{Foo{Bar}}, i.e. the eltype of the vector itself has a type parameter. If I save this vector, and load it again (it does not matter if loading happens in the same session or a new one), it will be the empty vector of type Vector{Foo}.
In particular, running test_save_load_rountrip from https://github.com/oscar-system/Oscar.jl/blob/master/test/Serialization/setup_tests.jl with such a vector fails.
The same problem arises for 0x0 matrices and empty dicts instead of vectors
To Reproduce
Steps to reproduce the behavior, please provide a code snippet that triggers
the bug.
using Oscar, Test
x1 = Vector{Vector{Int}}() # empty vector
save("tmp.mrdi", x1)
x2 = load("tmp.mrdi")
@test x2 isa typeof(x1)
using JSONSchema
include("test/Serialization/setup_tests.jl")
mktempdir() do path
test_save_load_roundtrip(path, x1) do loaded
# nothing here
end
end
the same problem arises for e.g. x1 = Vector{MPolyRingElem{QQFieldElem}}() x1 = Dict{MPolyRingElem{QQFieldElem}, Int}() x1 = Dict{Int, MPolyRingElem{QQFieldElem}}()
For the following two empty containers, even trying to load raises a KeyError. x1 = Matrix{QQMatrix}(undef, 0, 0) (will no longer error but still have the problem once #3980 is merged) x1 = Dict{QQMatrix, Int}() x1 = Dict{Int, QQMatrix}()
Expected behavior
All of the above containers should remember its eltype when saving and loading, as they already do if they contain some elements.
System (please complete the following information):
julia> Oscar.versioninfo(full=true)
OSCAR version 1.2.0-DEV - #master, bfcfee360a -- 2024-07-28 10:10:11 +0000
combining:
AbstractAlgebra.jl v0.42.0
GAP.jl v0.10.4
Hecke.jl v0.33.0
Nemo.jl v0.46.0
Polymake.jl v0.11.19
Singular.jl v0.23.4
building on:
FLINT_jll v300.100.300+0
GAP_jll v400.1200.200+9
Singular_jll v404.0.301+0
libpolymake_julia_jll v0.12.0+0
libsingular_julia_jll v0.45.2+0
polymake_jll v400.1200.1+0
See `]st -m` for a full list of dependencies.
The text was updated successfully, but these errors were encountered:
Describe the bug
Consider an empty vector of type
Vector{Foo{Bar}}
, i.e. the eltype of the vector itself has a type parameter. If I save this vector, and load it again (it does not matter if loading happens in the same session or a new one), it will be the empty vector of typeVector{Foo}
.In particular, running
test_save_load_rountrip
from https://github.com/oscar-system/Oscar.jl/blob/master/test/Serialization/setup_tests.jl with such a vector fails.The same problem arises for 0x0 matrices and empty dicts instead of vectors
To Reproduce
Steps to reproduce the behavior, please provide a code snippet that triggers
the bug.
the same problem arises for e.g.
x1 = Vector{MPolyRingElem{QQFieldElem}}()
x1 = Dict{MPolyRingElem{QQFieldElem}, Int}()
x1 = Dict{Int, MPolyRingElem{QQFieldElem}}()
For the following two empty containers, even trying to load raises a
KeyError
.x1 = Matrix{QQMatrix}(undef, 0, 0)
(will no longer error but still have the problem once #3980 is merged)x1 = Dict{QQMatrix, Int}()
x1 = Dict{Int, QQMatrix}()
Expected behavior
All of the above containers should remember its eltype when saving and loading, as they already do if they contain some elements.
System (please complete the following information):
The text was updated successfully, but these errors were encountered: