Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix data paths in tests #23

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/parsing_graphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using FrameworkDemo

function main()
G = FrameworkDemo.parse_graphml(["./data/demo/sequencer/df.graphml"])
G = FrameworkDemo.parse_graphml("./data/demo/sequencer/df.graphml")
G_copy = deepcopy(G)
FrameworkDemo.show_graph(G_copy)
end
Expand Down
5 changes: 2 additions & 3 deletions src/parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ using Graphs
using MetaGraphs
include("../deps/GraphMLReader.jl/src/GraphMLReader.jl")

function parse_graphml(path)
file_path = joinpath(path...)
G = GraphMLReader.loadgraphml(file_path, "G")
function parse_graphml(filename::String)::MetaDiGraph
GraphMLReader.loadgraphml(filename, "G")
end

function show_graph(G)
Expand Down
2 changes: 1 addition & 1 deletion src/scheduling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function parse_graphs(graphs_map::Dict, output_graph_path::String, output_graph_
for (graph_name, graph_path) in graphs_map
parsed_graph_dot = timestamp_string("$output_graph_path$graph_name") * ".dot"
parsed_graph_image = timestamp_string("$output_graph_image_path$graph_name") * ".png"
G = parse_graphml([graph_path])
G = parse_graphml(graph_path)

open(parsed_graph_dot, "w") do f
MetaGraphs.savedot(f, G)
Expand Down
3 changes: 2 additions & 1 deletion test/parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ using Graphs
using MetaGraphs

@testset "Parsing" begin
graph = FrameworkDemo.parse_graphml(["../data/demo/sequencer/df.graphml"])
path = joinpath(pkgdir(FrameworkDemo), "data/demo/sequencer/df.graphml")
graph = FrameworkDemo.parse_graphml(path)
set_indexing_prop!(graph, :original_id)

# Test the general structure of the graph
Expand Down
3 changes: 2 additions & 1 deletion test/scheduling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ end


@testset verbose = true "Scheduling" begin
graph = FrameworkDemo.parse_graphml(["../data/demo/datadeps/df.graphml"])
path = joinpath(pkgdir(FrameworkDemo), "data/demo/datadeps/df.graphml")
graph = FrameworkDemo.parse_graphml(path)
ilength(x) = sum(_ -> 1, x) # no standard length for MetaGraphs.filter_vertices iterator
algorithms_count = ilength(MetaGraphs.filter_vertices(graph, :type, "Algorithm"))
set_indexing_prop!(graph, :node_id)
Expand Down