Skip to content

Commit

Permalink
Fixed import errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MicheleCeresoli committed Nov 29, 2023
1 parent aa58f93 commit 3df090a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/SMDGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import JSMDInterfaces.Graph:

import Graphs:
AbstractGraph,
SimpleEdge,
SimpleGraph,
SimpleDiGraph,
dijkstra_shortest_paths,
Expand Down
2 changes: 1 addition & 1 deletion src/graphs/MappedGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function has_edge(g::MappedNodeGraph, from::Int, to::Int)
end

function edges(g::MappedNodeGraph)
map(e->Graphs.SimpleEdge(get_outerid(g, e.src), get_outerid(g, e.dst)), edges(g.graph))
map(e->SimpleEdge(get_outerid(g, e.src), get_outerid(g, e.dst)), edges(g.graph))
end

edgetype(g::MappedNodeGraph) = edgetype(g.graph)
Expand Down
13 changes: 11 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using SMDGraphs
using Test

using Graphs: Graphs, SimpleEdge
using Graphs
using Graphs: SimpleEdge

import JSMDInterfaces.Errors: NotImplementedError
import JSMDInterfaces.Graph as jGraph
Expand Down Expand Up @@ -112,11 +113,19 @@ SMDGraphs.get_node_id(n::IntNode) = n.id
@test !SMDGraphs.has_edge(graph, 7, 1)

@test SMDGraphs.ne(graph) == 2
@test SMDGraphs.edges(graph) == [Graphs.Simpl]
@test SMDGraphs.edges(graph) == [
SimpleEdge(10, 7),
SimpleEdge(10, 1)
]

SMDGraphs.add_edge!(dgraph, 10, 7, 6)
SMDGraphs.add_edge!(dgraph, 7, 1, 3)

@test SMDGraphs.edges(dgraph) == [
SimpleEdge(10, 7),
SimpleEdge(7, 1)
]

@test isempty(SMDGraphs.inneighbors(dgraph, 10))
@test SMDGraphs.inneighbors(dgraph, 7) == [10]
@test SMDGraphs.outneighbors(dgraph, 10) == [7]
Expand Down

0 comments on commit 3df090a

Please sign in to comment.