Skip to content

Commit 97a42ed

Browse files
Merge pull request #1 from JuliaGraphs/transition-to-graphs.jl
Migrate from LightGraphs to Graphs.jl
2 parents c14d2e8 + 4e64abe commit 97a42ed

File tree

8 files changed

+21
-23
lines changed

8 files changed

+21
-23
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name = "MetaGraphs"
22
uuid = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
3-
version = "0.6.8"
3+
version = "0.7.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
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
99

1010
[compat]
11+
Graphs = "1.4"
1112
JLD2 = "0.1.11, 0.2, 0.3, 0.4"
12-
LightGraphs = "1.3.5"
1313
julia = "1"
1414

1515
[extras]

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
[![Codecov branch][codecov-img]][codecov-url]
55
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://juliagraphs.github.io/MetaGraphs.jl/latest)
66

7-
**Project Status:** As of 8 October 2021 MetaGraphs is no longer under active development. It will remain available on Github at [sbromberger/MetaGraphs.jl](https://github.com/sbromberger/MetaGraphs.jl). The JuliaGraphs organization will continue to maintain packages that use MetaGraphs and transition development over the long term.
8-
9-
[LightGraphs.jl](https://github.com/JuliaGraphs/LightGraphs.jl) graphs with arbitrary metadata.
7+
[MetaGraphs.jl](https://github.com/JuliaGraphs/MetaGraphs.jl) graphs with arbitrary metadata.
108

119
[build-img]: https://github.com/JuliaGraphs/Metagraphs.jl/workflows/CI/badge.svg?branch=master
1210
[build-url]: https://github.com/JuliaGraphs/Metagraphs.jl/actions?query=workflow%3ACI
@@ -25,7 +23,7 @@ add MetaGraphs
2523

2624
## Example Usage
2725
```julia
28-
julia> using LightGraphs, MetaGraphs
26+
julia> using Graphs, MetaGraphs
2927

3028
# create a standard simplegraph
3129
julia> g = path_graph(5)
@@ -87,7 +85,7 @@ Dict{Symbol,Any} with 0 entries
8785
julia> props(mg, 2)
8886
Dict{Symbol,Any} with 0 entries
8987

90-
# all LightGraphs analytics work
88+
# all Graphs.jl analytics work
9189
julia> betweenness_centrality(mg)
9290
5-element Array{Float64,1}:
9391
0.0

docs/oldmkdocsyml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
site_name: MetaGraphs.jl
22
repo_url: https://github.com/JuliaGraphs/MetaGraphs.jl
3-
site_description: Metadata for LightGraphs
3+
site_description: Metadata for Graphs.jl
44
site_author: Seth Bromberger
55

66
theme: readthedocs

src/MetaGraphs.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module MetaGraphs
2-
using LightGraphs
2+
using Graphs
33
using JLD2
44

55
import Base:
@@ -9,7 +9,7 @@ import Base:
99
import Random:
1010
randstring, seed!
1111

12-
import LightGraphs:
12+
import Graphs:
1313
AbstractGraph, src, dst, edgetype, nv,
1414
ne, vertices, edges, is_directed,
1515
add_vertex!, add_edge!, rem_vertex!, rem_edge!,
@@ -19,7 +19,7 @@ import LightGraphs:
1919
loadgraph, savegraph, AbstractGraphFormat,
2020
reverse
2121

22-
import LightGraphs.SimpleGraphs:
22+
import Graphs.SimpleGraphs:
2323
AbstractSimpleGraph, SimpleGraph, SimpleDiGraph,
2424
SimpleEdge, fadj, badj
2525

@@ -194,7 +194,7 @@ MetaWeights(g::AbstractMetaGraph) = MetaWeights{eltype(g),eltype(g.defaultweight
194194

195195
function getindex(w::MetaWeights{T,U}, u::Integer, v::Integer)::U where T <: Integer where U <: Real
196196
_e = Edge(u, v)
197-
e = !w.directed && !LightGraphs.is_ordered(_e) ? reverse(_e) : _e
197+
e = !w.directed && !Graphs.is_ordered(_e) ? reverse(_e) : _e
198198
!haskey(w.eprops, e) && return w.defaultweight
199199
return U(get(w.eprops[e], w.weightfield, w.defaultweight))
200200
end

src/metagraph.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ is_directed(g::MetaGraph) = false
5555

5656
weighttype(g::MetaGraph{T,U}) where T where U = U
5757
function props(g::MetaGraph, _e::SimpleEdge)
58-
e = LightGraphs.is_ordered(_e) ? _e : reverse(_e)
58+
e = Graphs.is_ordered(_e) ? _e : reverse(_e)
5959
get(PropDict, g.eprops, e)
6060
end
6161

6262
function set_props!(g::MetaGraph, _e::SimpleEdge, d::Dict)
63-
e = LightGraphs.is_ordered(_e) ? _e : reverse(_e)
63+
e = Graphs.is_ordered(_e) ? _e : reverse(_e)
6464
if has_edge(g, e)
6565
if !_hasdict(g, e)
6666
g.eprops[e] = d

test/dotformat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using MetaGraphs
22
using Test
3-
using LightGraphs
3+
using Graphs
44

55
property_set=[
66
(src="thirty",dst="inf",color="missing",penwidth="missing",style="missing",),

test/metagraphs.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using MetaGraphs
2-
import LightGraphs: SimpleGraphs
2+
import Graphs: SimpleGraphs
33
import Base64:
44
stringmime
55

@@ -32,8 +32,8 @@ import Base64:
3232
@test eltype(@inferred(MetaGraph{UInt8,Float16}(mg))) == UInt8
3333
@test weighttype(@inferred(MetaGraph{UInt8,Float16}(mg))) == Float16
3434

35-
@test @inferred(MetaGraphs.fadj(mg, 2)) == LightGraphs.SimpleGraphs.fadj(g, 2)
36-
@test @inferred(MetaGraphs.badj(mg, 2)) == LightGraphs.SimpleGraphs.badj(g, 2)
35+
@test @inferred(MetaGraphs.fadj(mg, 2)) == Graphs.SimpleGraphs.fadj(g, 2)
36+
@test @inferred(MetaGraphs.badj(mg, 2)) == Graphs.SimpleGraphs.badj(g, 2)
3737

3838
@test @inferred(edgetype(mg)) == edgetype(mg.graph)
3939

@@ -88,8 +88,8 @@ import Base64:
8888
@test eltype(@inferred(MetaDiGraph{UInt8,Float16}(mg))) == UInt8
8989
@test weighttype(@inferred(MetaDiGraph{UInt8,Float16}(mg))) == Float16
9090

91-
@test @inferred(MetaGraphs.fadj(mg, 2)) == LightGraphs.SimpleGraphs.fadj(g, 2)
92-
@test @inferred(MetaGraphs.badj(mg, 2)) == LightGraphs.SimpleGraphs.badj(g, 2)
91+
@test @inferred(MetaGraphs.fadj(mg, 2)) == Graphs.SimpleGraphs.fadj(g, 2)
92+
@test @inferred(MetaGraphs.badj(mg, 2)) == Graphs.SimpleGraphs.badj(g, 2)
9393

9494
@test @inferred(edgetype(mg)) == edgetype(mg.graph)
9595

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using LightGraphs
1+
using Graphs
22
using MetaGraphs
33
using Test
44

5-
import LightGraphs.SimpleGraphs: SimpleGraph, SimpleDiGraph
5+
import Graphs.SimpleGraphs: SimpleGraph, SimpleDiGraph
66

77
const testdir = @__DIR__
88

0 commit comments

Comments
 (0)