Skip to content

Commit cac6186

Browse files
committed
fix
1 parent 2fa23b5 commit cac6186

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/MetaGraphs.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ export
3535
DOTFormat,
3636
reverse
3737

38-
39-
abstract type AbstractMetaGraph{Vertex, InnerGraph, AtVertex, AtEdge, GraphMeta, WeightFunction, Weight} <: AbstractGraph{Vertex} end
38+
abstract type AbstractMetaGraph{Vertex <: Integer, InnerGraph <: AbstractGraph, AtVertex, AtEdge, GraphMeta, WeightFunction, Weight <: Real} <: AbstractGraph{Vertex} end
4039

4140
function show(io::IO, meta::AbstractMetaGraph{<: Any, <: Any, AtVertex, AtEdge, GraphMeta, <: Any, Weight}) where {AtVertex, AtEdge, GraphMeta, Weight}
4241
print(io, "Meta graph based on a $(meta.inner_graph) with $AtVertex(s) at vertices, $AtEdge(s) at edges, $GraphMeta metadata, $Weight weights, and default weight $(meta.default_weight)")
@@ -83,7 +82,7 @@ end
8382

8483
add_vertex!(meta::AbstractMetaGraph) = add_vertex!(meta.inner_graph)
8584
function push!(meta::AbstractMetaGraph, value)
86-
add_vertex!(meta) || return false
85+
add_vertex!(meta)
8786
last_vertex = nv(meta)
8887
meta[last_vertex] = value
8988
return last_vertex
@@ -130,7 +129,6 @@ function delete!(meta::AbstractMetaGraph, deleted_vertex::Integer)
130129
rem_vertex!(meta.inner_graph, deleted_vertex)
131130
return result
132131
end
133-
134132
rem_vertex!(meta::AbstractMetaGraph, vertex) = delete!(meta, vertex)
135133

136134
struct MetaWeights{Weight <: Real, InnerAbstractMetaGraph} <: AbstractMatrix{Weight}
@@ -140,7 +138,8 @@ end
140138
show(io::IO, weights::MetaWeights) = print(io, "metaweights")
141139
show(io::IO, ::MIME"text/plain", weights::MetaWeights) = show(io, weights)
142140

143-
MetaWeights(meta::AbstractMetaGraph) = MetaWeights{weight_type(meta), typeof(meta)}(meta)
141+
MetaWeights(meta::AbstractMetaGraph) =
142+
MetaWeights{weight_type(meta), typeof(meta)}(meta)
144143

145144
function getindex(weights::MetaWeights{Weight}, in_vertex::Integer, out_vertex::Integer)::Weight where {Weight}
146145
edge = Edge(in_vertex, out_vertex)
@@ -165,8 +164,10 @@ weight_type(meta::AbstractMetaGraph{<: Any, <: Any, <: Any, <: Any, <: Any, <: A
165164
getindex(meta::AbstractMetaGraph, vertex::Integer) = meta.vertex_meta[vertex]
166165
getindex(meta::AbstractMetaGraph, edge::AbstractEdge) = meta.edge_meta[edge]
167166

168-
haskey(meta::AbstractMetaGraph, vertex::Integer) = haskey(meta.vertex_meta, vertex)
169-
haskey(meta::AbstractMetaGraph, edge::AbstractEdge) = haskey(meta.edge_meta, edge)
167+
haskey(meta::AbstractMetaGraph, vertex::Integer) =
168+
haskey(meta.vertex_meta, vertex)
169+
haskey(meta::AbstractMetaGraph, edge::AbstractEdge) =
170+
haskey(meta.edge_meta, edge)
170171

171172
function setindex!(meta::AbstractMetaGraph, value, vertex::Integer)
172173
meta.vertex_meta[vertex] = value
@@ -176,7 +177,7 @@ end
176177
"""
177178
weight_function(meta)
178179
179-
Return the weight function for meta graph `meta`.
180+
Return the weight function for metagraph `meta`.
180181
181182
```jldoctest
182183
julia> using MetaGraphs
@@ -192,7 +193,7 @@ weight_function(meta::AbstractMetaGraph) = meta.weight_function
192193
"""
193194
default_weight(meta)
194195
195-
Return the default weight for meta graph `meta`.
196+
Return the default weight for metagraph `meta`.
196197
197198
```jldoctest
198199
julia> using MetaGraphs

src/metadigraph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
struct MetaDiGraph{Vertex <: Integer, InnerGraph, AtVertex, AtEdge, GraphMeta, WeightFunction, Weight <: Real} <: AbstractMetaGraph{Vertex, InnerGraph, AtVertex, AtEdge, GraphMeta, WeightFunction, Weight}
1+
struct MetaDiGraph{Vertex, InnerGraph, AtVertex, AtEdge, GraphMeta, WeightFunction, Weight} <: AbstractMetaGraph{Vertex, InnerGraph, AtVertex, AtEdge, GraphMeta, WeightFunction, Weight}
22
inner_graph::InnerGraph
33
vertex_meta::Dict{Vertex, AtVertex}
44
edge_meta::Dict{Edge{Vertex}, AtEdge}

src/persistence.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ true
2020
```
2121
"""
2222
struct MGFormat <: AbstractGraphFormat end
23-
export MGFormat
2423

2524
"""
2625
struct DOTFormat <: AbstractGraphFormat end
@@ -56,7 +55,6 @@ digraph {
5655
```
5756
"""
5857
struct DOTFormat <: AbstractGraphFormat end
59-
export DOTFormat
6058

6159
function loadgraph(filename::AbstractString, ::String, ::MGFormat)
6260
@load filename meta

0 commit comments

Comments
 (0)