Closed filchristou closed 1 year ago
And we should probably add a get_graph
function returning the underlying graph object (which may not be a Simple(Di)Graph
anymore thanks to #40)
As of right now these methods do not exist anymore
Building a Simple(Di)Graph
constructor for general graphs should be part of Graphs.jl, not MetaGraphsNext.jl specifically. Closing here
well, SimpleGraph(mg::MetaGraph) cannot be implemented in Graphs.jl . So if we want the user to be able to use this constructor it should be defined here.
It doesn't make much sense to me to have a constructor SimpleGraph(mg::MetaGraph)
, because in the end it would only use interface functions like vertices
and edges
. So what I had in mind was a SimpleGraph(g::AbstractGraph)
constructor, which does belong in Graphs.jl. What do you think?
I can live with that yes. Users will then have to do something like SimpleGraph(mg.graph)
. Do you think the users should access fields with dot-notation or should a getgraph
function be defined ?
I can live with that yes. Users will then have to do something like SimpleGraph(mg.graph). Do you think the users should access fields with dot-notation or should a getgraph function be defined ?
Actually no, that's the whole point: since a MetaGraph
is a wrapper around any graph object that extends the usual methods like vertices
and edges
, if SimpleGraph(::AbstractGraph)
is defined in the main package, all users have to do is call SimpleGraph(mg)
directly
This will be taken care of by https://github.com/JuliaGraphs/Graphs.jl/issues/98
according to conversation on #40 https://github.com/JuliaGraphs/MetaGraphsNext.jl/pull/40#issuecomment-1421208966 users would commonly expect
SimpleGraph(mg::MetaGraph)
andSimpleDiGraph(mg::MetaGraph)
to return a new instance (deep copy) which they can freely modify without repercussions onmg
.