JuliaGraphs / GraphIO.jl

Graph IO functionality for various formats.
Other
61 stars 28 forks source link

ERROR: UndefVarError: GraphML not defined while saving a graph #33

Closed goryntsev closed 4 years ago

goryntsev commented 4 years ago

I am trying to save a graph in GraphML format and get an error:

julia> using LightGraphs, GraphIO

julia> g = SimpleGraph(5, 7)
{5, 7} undirected simple Int64 graph

julia> savegraph("graph", g, "simplegraph", GraphMLFormat())
ERROR: UndefVarError: GraphML not defined
Stacktrace:
 [1] GraphMLFormat() at C:\Users\alexa\.julia\packages\GraphIO\IgxnP\src\deprecations.jl:19
 [2] top-level scope at REPL[3]:1
 [3] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1088

Any ideas why? Other formats work fine.

goryntsev commented 4 years ago

Sorry, I got your "message" in the code:

function GraphMLFormat()
    depwarn("""
            `GraphIO.GraphMLFormat`  has been moved to submodule `GraphIO.GraphML` and needs `EzXML.jl` to be imported first. I.e. use
                using EzXML
                GraphIO.GraphML.GraphMLFormat()
            """, :GraphMLFormat)
    return GraphIO.GraphML.GraphMLFormat()
end

Anyway I think it should be more obvious.

diegozea commented 2 years ago

I can not see that message in Pluto:

image

etiennedeg commented 2 years ago

As stated above, you first need to import EzXML.jl

julia> savegraph("example.lg", graph, GraphIO.GraphMLFormat())
┌ Warning: `GraphIO.GraphMLFormat`  has been moved to submodule `GraphIO.GraphML` and needs `EzXML.jl` to be imported first. I.e. use
│     using EzXML
│     GraphIO.GraphML.GraphMLFormat()
│   caller = top-level scope at none:1
└ @ Core none:1
ERROR: UndefVarError: GraphML not defined
Stacktrace:
 [1] GraphMLFormat()
   @ GraphIO C:\Users\Dell\.julia\packages\GraphIO\x37Ru\src\deprecations.jl:19
 [2] top-level scope
   @ none:1

julia> using EzXML

julia> savegraph("example.lg", graph, GraphIO.GraphML.GraphMLFormat())
1

Weird that this package has no documentation, this is really not obvious.

diegozea commented 2 years ago

Yes, I just wanted to show that the warning is not visible using Pluto. That's a problem for new users using Pluto, as they will not know what is going on.