-
Notifications
You must be signed in to change notification settings - Fork 184
0.8 Milestone #561
Comments
Do we want to deprecate |
I'd like to move persistence out to LGE if we can, but it can wait until 1.1. |
According to the Semantic Versioning definition removing persistence would be a breaking change that would require a major version number bump, unless you think that telling people to import LGE to use persistence is not breaking. All the functions will stay the same right? The problem is that we put stuff in LGE that needs a lot of binary dependencies people will need that to have persistence working. |
I think in 1.1 we can On the other hand, LGE was originally supposed to be a stopgap measure for things that were too heavy-weight for LG. My long-term goal for that package was to break each bit of functionality out into its own separate package in the same organization (IIRC, this is why I registered JuliaGraphs). Perhaps we can start that process by making "LightGraphsPersistence.jl" the first completely separate (optional) package. Thoughts? |
On Mar 27, 2017, at 2:37 PM, Seth Bromberger ***@***.***> wrote:
I think in 1.1 we can @deprecate the functions we move into LGE. I understand this might be a semver violation but I'd really rather not hold up 1.0 for the persistence changes, especially since we've got such a huge change in the pipeline already with #541 <#541>.
LGE was originally supposed to be a stopgap measure for things that were too heavy-weight for LG. My long-term goal for that package was to break each bit of functionality out into its own separate package in the same organization (IIRC, this is why I registered JuliaGraphs).
That is what I recall
Perhaps we can start that process by making "LightGraphsPersistence.jl" the first completely separate (optional) package. Thoughts?
GraphPersistence.jl? Where it works for any graph type?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#561 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACoFzgKe1AssNX5E3sNcJlPLZSNbWmEKks5rqAH-gaJpZM4MmEz7>.
James Fairbanks
[email protected]
|
This is an important bikeshed, actually. When you say "any graph type" do you mean other graph packages? (How would we do that?) |
I think that packages that are data structure independent, that is provide functionality for any subtype of These packages would look like module GraphPersistence
using LightGraphs
function save(path::String, g::AbstractGraph)
open(path, "w") do
# write graph to file
end
end Then when you go to use them you do using LightGraphs.SimpleGraphs
using GraphPersistence
g = SimpleGraph()
# insert some edges
# yadayada
save("graph.gml", g) If you have a package that defines its own subtypes of AbstractGraph you would write: using DatabaseGraphs
using GraphPersistence
g = DatabaseGraph("postgress://user:[email protected]/dbname",
"SELECT src,dst FROM edgetable")
save("graph.gml", g) where DatabaseGraph <: AbstractGraph and the constructor takes a database connection string and a query and makes implements a graph interface on top of that. These data structure independent packages are using only the AbstractGraph interface from LightGraphs. |
@jpfairbanks saving works well since the arguments can be abstract, but what do we do about loading? |
Can we pass an empty graph of the given type and have the loading routines fill it in? These packages would look like module GraphPersistence
using LightGraphs
function load!(path::String, g::AbstractGraph)
open(path, "r") do file
for edge in edges(file)
add_edge!(g, edge)
end
end
return g
end Then when you go to use them you do using LightGraphs.SimpleGraphs
using GraphPersistence
g = SimpleGraph()
load!("graph.gml", g)
print(g) If you are writing a package that defines its own subtypes of AbstractGraph you would write: module DatabaseGraphs
using GraphPersistence
function add_edge!(g::DatabaseGraph, edge)
execute(g.connection, "insert ?,? into edgetable", src(edge), dst(edge))
end
g = DatabaseGraph("postgress://user:[email protected]/dbname")
load!("graph.gml", g)
print(g) |
That means we can't use The whole persistence functionality needs to be reworked. My preference is to get it out of core (per #557) and then figure out a good way of doing things. (My other preference is to keep the LightGraphs persistence functionality inside core since 1) it only depends on GZip and 2) it gives at least one way to load/save graphs without having to depend on other packages.) |
Based on the description here: https://github.com/JuliaIO/FileIO.jl#implementing-loaderssavers I tested the ideas here:
|
Yup, I guess that would do it, but man. Having |
Closing now that v0.8.0 has been tagged and released. |
We should plan to hit v0.8 soon.
What are the things we need to do to get there.
Graph
/DiGraph
/Edge
(moving to 0.8.1)The text was updated successfully, but these errors were encountered: