Skip to content

Commit e15ade5

Browse files
authored
Merge pull request #30 from mmiller-max/mm/Switch-to-Graphs
Switch from LightGraphs to Graphs
2 parents 7d1fd84 + daf8b90 commit e15ade5

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name = "StaticGraphs"
22
uuid = "4c8beaf5-199b-59a0-a7f2-21d17de635b6"
3-
version = "0.2.1"
3+
version = "0.3.0"
44

55
[deps]
6+
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
67
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
7-
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
88
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
99

1010
[compat]
11-
LightGraphs = "1"
12-
julia = "1"
11+
Graphs = "1.4"
1312
JLD2 = "0.1 - 0.4"
13+
julia = "1"
1414

1515
[extras]
1616
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
[![codecov.io](http://codecov.io/github/JuliaGraphs/StaticGraphs.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaGraphs/StaticGraphs.jl?branch=master)
55

66
Memory-efficient, performant graph structures optimized for large networks.
7-
Uses [LightGraphs](https://github.com/JuliaGraphs/LightGraphs.jl).
7+
Uses [Graphs](https://github.com/JuliaGraphs/Graphs.jl).
88

99
Note: adding/removing edges and vertices is not supported with this graph type.

src/StaticGraphs.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
module StaticGraphs
22

3-
using LightGraphs
3+
using Graphs
44
using JLD2
55
using SparseArrays
66

77
import Base:
88
convert, eltype, show, ==, Pair, Tuple, in, copy, length, issubset, zero, one,
99
size, getindex, setindex!, length, IndexStyle
1010

11-
import LightGraphs:
11+
import Graphs:
1212
_NI, AbstractEdge, AbstractEdgeIter,
1313
src, dst, edgetype, nv, ne, vertices, edges, is_directed,
1414
has_vertex, has_edge, inneighbors, outneighbors,
1515
indegree, outdegree, degree, insorted, squash,
1616
AbstractGraphFormat, loadgraph, savegraph, reverse
1717

18-
import LightGraphs.SimpleGraphs:
18+
import Graphs.SimpleGraphs:
1919
AbstractSimpleGraph,
2020
fadj,
2121
badj,
@@ -103,7 +103,7 @@ include("persistence.jl")
103103
const SGraph = StaticGraph
104104
const SDiGraph = StaticDiGraph
105105

106-
const StaticEdgeIter{G} = LightGraphs.SimpleGraphs.SimpleEdgeIter{G}
106+
const StaticEdgeIter{G} = Graphs.SimpleGraphs.SimpleEdgeIter{G}
107107

108108
eltype(::Type{StaticEdgeIter{StaticGraph{T, U}}}) where T where U = StaticGraphEdge{T}
109109
eltype(::Type{StaticEdgeIter{StaticDiGraph{T, U}}}) where T where U = StaticDiGraphEdge{T}

src/overrides.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import LightGraphs.LinAlg: adjacency_matrix
2-
import LightGraphs: induced_subgraph
1+
import Graphs.LinAlg: adjacency_matrix
2+
import Graphs: induced_subgraph
33

44
adjacency_matrix(g::StaticGraph{I,U}, T::DataType; dir = :out!) where I<:Integer where U<:Integer =
55
SparseMatrixCSC{T,I}(nv(g), nv(g), g.f_ind, g.f_vec, ones(T, ne(g)*2))

src/staticdigraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function StaticDiGraph(nvtx::I, f_sd::Vector{Tuple{T, T}}, b_sd::Vector{Tuple{T,
5353
return StaticDiGraph(nvtx, f_ss, f_ds, b_ss, b_ds)
5454
end
5555

56-
function StaticDiGraph(g::LightGraphs.SimpleGraphs.SimpleDiGraph)
56+
function StaticDiGraph(g::Graphs.SimpleGraphs.SimpleDiGraph)
5757
ne(g) == 0 && return StaticDiGraph(nv(g), Array{Tuple{UInt8, UInt8},1}(), Array{Tuple{UInt8, UInt8},1}())
5858
f_sd = [Tuple(e) for e in edges(g)]
5959
b_sd = sort([Tuple(reverse(e)) for e in edges(g)])

src/staticgraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function StaticGraph(nvtx::I, sd::Vector{Tuple{T, T}}) where {T<:Integer, I<:Int
3535
return StaticGraph(nvtx, ss, ds)
3636
end
3737

38-
function StaticGraph(g::LightGraphs.SimpleGraphs.SimpleGraph)
38+
function StaticGraph(g::Graphs.SimpleGraphs.SimpleGraph)
3939
ne(g) == 0 && return StaticGraph(nv(g), Array{Tuple{UInt8, UInt8},1}())
4040
sd1 = [Tuple(e) for e in edges(g)]
4141
ds1 = [Tuple(reverse(e)) for e in edges(g)]

test/runtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using StaticGraphs
2-
using LightGraphs
3-
using LightGraphs.SimpleGraphs
2+
using Graphs
3+
using Graphs.SimpleGraphs
44
using Test
55

66
const testdir = dirname(@__FILE__)
@@ -67,10 +67,10 @@ const testdir = dirname(@__FILE__)
6767

6868
# empty constructors
6969
@test nv(gempty) === 0x00
70-
@test typeof(LightGraphs.nv(gempty)) == UInt8
71-
@test length(LightGraphs.edges(gempty)) === 0x00
70+
@test typeof(Graphs.nv(gempty)) == UInt8
71+
@test length(Graphs.edges(gempty)) === 0x00
7272
@test nv(gdempty) === 0x00
73-
@test length(LightGraphs.edges(gdempty)) === 0x00
73+
@test length(Graphs.edges(gdempty)) === 0x00
7474

7575
end # staticgraph
7676

0 commit comments

Comments
 (0)