JuliaGraphs / JuliaGraphs/MetaGraphsNext.jl

MetaGraph to DOT seems buggy

Open
#73 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
93
Forks
24
PR merge metrics
No merged PRs in 30d

Description

MWE

julia> using MetaGraphsNext # v0.6.0

julia> struct Foo end

julia> g2 = MetaGraph(DiGraph(), label_type=Int, vertex_data_type=Foo)
Meta graph based on a SimpleDiGraph{Int64} with vertex labels of type Int64, vertex metadata of type Foo, edge metadata of type Nothing, graph metadata given by nothing, and default weight 1.0

julia> savegraph("data.dot", g2, DOTFormat())
ERROR: MethodError: no method matching length(::Foo)

Closest candidates are:
  length(::LibGit2.GitStatus)
   @ LibGit2 ~/.julia/juliaup/julia-1.10.0-rc1+0.x64.linux.gnu/share/julia/stdlib/v1.10/LibGit2/src/status.jl:21
  length(::Tables.DictRowTable)
   @ Tables ~/.julia/packages/Tables/NSGZI/src/dicts.jl:118
  length(::Base.MethodSpecializations)
   @ Base reflection.jl:1164
  ...

Stacktrace:
 [1] show_meta_list(io::IOStream, meta::Foo)
   @ MetaGraphsNext ~/.julia/packages/MetaGraphsNext/YvA1m/src/persistence.jl:31
 [2] savedot(io::IOStream, meta_graph::MetaGraph{…})
   @ MetaGraphsNext ~/.julia/packages/MetaGraphsNext/YvA1m/src/persistence.jl:76
 [3] #32
   @ ~/.julia/packages/MetaGraphsNext/YvA1m/src/persistence.jl:100 [inlined]
 [4] open(::MetaGraphsNext.var"#32#33"{MetaGraph{…}}, ::String, ::Vararg{String}; kwargs::@Kwargs{})
   @ Base ./io.jl:396
 [5] open
   @ Base ./io.jl:393 [inlined]
 [6] savegraph(file::String, meta_graph::MetaGraph{…}, ::DOTFormat)
   @ MetaGraphsNext ~/.julia/packages/MetaGraphsNext/YvA1m/src/persistence.jl:99
 [7] top-level scope
   @ REPL[13]:1
Some type information was truncated. Use `show(err)` to see complete types.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the MWE with MetaGraphsNext v0.6.0, then inspect persistence.jl at show_meta_list (line 31) and savedot (line 76). The fix should make savegraph("data.dot", g2, DOTFormat()) handle Foo metadata without the reported length(::Foo) error and produce the expected DOT output.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.