Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph saved using JLD2 cannot be loaded on same machine #145

Closed
sbromberger opened this issue Aug 6, 2019 · 3 comments
Closed

graph saved using JLD2 cannot be loaded on same machine #145

sbromberger opened this issue Aug 6, 2019 · 3 comments

Comments

@sbromberger
Copy link
Contributor

I get warnings and then an error:

julia> g = loadgraph("mgtest1.mg", MGFormat())
┌ Warning: type SimpleGraphs.SimpleGraphs.SimpleEdge{Int64} does not exist in workspace; reconstructing
└ @ JLD2 ~/.julia/packages/JLD2/KjBIK/src/data.jl:1153
┌ Warning: type SimpleGraphs.SimpleGraphs.SimpleGraph{Int64} does not exist in workspace; reconstructing
└ @ JLD2 ~/.julia/packages/JLD2/KjBIK/src/data.jl:1153
ERROR: MethodError: Cannot `convert` an object of type getfield(JLD2.ReconstructedTypes, Symbol("##SimpleGraphs.SimpleGraphs.SimpleGraph{Int64}#400")) to an object of type SimpleGraph{Int64}

(This used to work a while ago; I can't point to when things broke.)

The savegraph code is simply

function savemg(fn::AbstractString, g::AbstractMetaGraph)
    @save fn g
    return 1
end

and the loadgraph code is

function loadmg(fn::AbstractString)
    @load fn g
    return g
end
@sbromberger
Copy link
Contributor Author

The file in question is available at https://www.dropbox.com/s/1dvjqqz3he2e1m1/mgtest1.mg?dl=0.

@sbromberger
Copy link
Contributor Author

Also: there's no such thing as SimpleGraphs.SimpleGraphs.SimpleEdge - it's SimpleGraphs.SimpleEdge.

@sbromberger
Copy link
Contributor Author

Closing. This requires using LightGraphs.SimpleGraphs to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant