save/load not working?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
The stack trace points to src/persistence/lg.jl, especially _parse_header at line 62; start by reproducing the savegraph/loadgraph example with the listed Julia, Graphs, and MetaGraphs versions. Compare the generated .lg file with what loadlg expects, and consider the issue resolved when the example loads successfully without the BoundsError.
Written by the indexing model from the issue text.
Description
I thought this should work, but it doesn't:
using Graphs
using MetaGraphs
g = path_graph(5)
mg = MetaGraph(g, 3.0)
set_prop!(mg, :description, "This is a metagraph.")
savegraph("/tmp/test_graph.lg", mg)
mg1 = loadgraph("/tmp/test_graph.lg")
ERROR: LoadError: BoundsError: attempt to access 2-element Vector{SubString{String}} at index [3]
Stacktrace:
[1] getindex
@ ./array.jl:861 [inlined]
[2] indexed_iterate
@ ./tuple.jl:90 [inlined]
[3] _parse_header(s::SubString{String})
@ Graphs ~/.julia/packages/Graphs/zrMoC/src/persistence/lg.jl:62
[4] loadlg(io::IOStream, gname::String)
@ Graphs ~/.julia/packages/Graphs/zrMoC/src/persistence/lg.jl:104
[5] loadgraph
@ ~/.julia/packages/Graphs/zrMoC/src/persistence/lg.jl:147 [inlined]
[6] #120
@ ~/.julia/packages/Graphs/zrMoC/src/persistence/common.jl:15 [inlined]
[7] open(::Graphs.var"#120#121"{String, LGFormat}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:330
[8] open
@ ./io.jl:328 [inlined]
[9] loadgraph
@ ~/.julia/packages/Graphs/zrMoC/src/persistence/common.jl:14 [inlined]
[10] loadgraph(fn::String)
@ Graphs ~/.julia/packages/Graphs/zrMoC/src/persistence/common.jl:18
[11] top-level scope
@ untitled-55510ba3fa4677b8db7457446bdad39a:10
Is it something to do with the compressed format - savegraph(.. ... metagraph ... , compress=false) doesn't work either?
Using Graphs v1.7.0, MetaGraphs v0.7.1, Julia 1.7.
- Dominant language
- Julia
- Stars
- 71
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGraphs/MetaGraphs.jl
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
JuliaGraphs/MetaGraphs.jl#60 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
JuliaGraphs/MetaGraphs.jl#38 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
JuliaGraphs/MetaGraphs.jl#37 · 2 reactions ·
-
How to citeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
JuliaGraphs/MetaGraphs.jl#33 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
JuliaGraphs/MetaGraphs.jl#30 · 2 reactions ·
All issues in JuliaGraphs/MetaGraphs.jl
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
JuliaStats/LogExpFunctions.jl#134 · 2 comments ·
-
code bug PowerSystems 6.0
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Sienna-Platform/PowerSystems.jl#1849 ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FluxML/Metalhead.jl#407 ·
Maintainers usually reply within 1 day