From 1577f5f0b23861fe5341f428d693fe7e787d01ab Mon Sep 17 00:00:00 2001 From: Tim Wheeler Date: Sat, 4 Aug 2018 09:31:40 -0700 Subject: [PATCH 1/4] julia7 --- REQUIRE | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/REQUIRE b/REQUIRE index bed1d8d..352270d 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,3 @@ -julia 0.5 -TikzPictures 0.3.5 +julia 0.7-beta2 +TikzPictures 2.0.0 LightGraphs 0.6.0 -Compat 0.8.0 From 37a5c010b63bbf384100930f14e6124606be44e8 Mon Sep 17 00:00:00 2001 From: Tim Wheeler Date: Sat, 4 Aug 2018 09:34:31 -0700 Subject: [PATCH 2/4] femtocleaning --- src/TikzGraphs.jl | 16 ++++++++-------- test/runtests.jl | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/TikzGraphs.jl b/src/TikzGraphs.jl index 90c3716..180c2fb 100644 --- a/src/TikzGraphs.jl +++ b/src/TikzGraphs.jl @@ -8,7 +8,7 @@ import LightGraphs: DiGraph, Graph, vertices, edges, src, dst using Compat import Compat.String -preamble = readstring(joinpath(dirname(@__FILE__), "..", "src", "preamble.tex")) +preamble = read(joinpath(dirname(@__FILE__), "..", "src", "preamble.tex"), String) const AbstractGraph = Union{Graph, DiGraph} @@ -18,23 +18,23 @@ module Layouts using Compat export Layered, Spring, SimpleNecklace - @compat abstract type Layout end + abstract type Layout end - immutable Layered <: Layout end + struct Layered <: Layout end - immutable Spring <: Layout + struct Spring <: Layout randomSeed Spring(;randomSeed=42) = new(randomSeed) end - immutable SimpleNecklace <: Layout + struct SimpleNecklace <: Layout end end using .Layouts -plot{T<:AbstractString}(g, layout::Layouts.Layout, labels::Vector{T}=map(string, vertices(g)); args...) = plot(g; layout=layout, labels=labels, args...) -plot{T<:AbstractString}(g, labels::Vector{T}; args...) = plot(g; layout=Layered(), labels=labels, args...) +plot(g, layout::Layouts.Layout, labels::Vector{T}=map(string, vertices(g)); args...) where {T<:AbstractString} = plot(g; layout=layout, labels=labels, args...) +plot(g, labels::Vector{T}; args...) where {T<:AbstractString} = plot(g; layout=Layered(), labels=labels, args...) function edgeHelper(o::IOBuffer, a, b, edge_labels, edge_styles, edge_style) print(o, " [$(edge_style),") @@ -59,7 +59,7 @@ end edge_str(g::DiGraph) = "->" edge_str(g::Graph) = "--" -function plot{T<:AbstractString}(g::AbstractGraph; layout::Layouts.Layout = Layered(), labels::Vector{T}=map(string, vertices(g)), edge_labels::Dict = Dict(), node_styles::Dict = Dict(), node_style="", edge_styles::Dict = Dict(), edge_style="", options="") +function plot(g::AbstractGraph; layout::Layouts.Layout = Layered(), labels::Vector{T}=map(string, vertices(g)), edge_labels::Dict = Dict(), node_styles::Dict = Dict(), node_style="", edge_styles::Dict = Dict(), edge_style="", options="") where T<:AbstractString o = IOBuffer() println(o, "\\graph [$(layoutname(layout)), $(options_str(layout))] {") for v in vertices(g) diff --git a/test/runtests.jl b/test/runtests.jl index b54906c..aa0668e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ using TikzGraphs -using Base.Test +using Test @assert success(`lualatex -v`) using NBInclude From 11f240043f66f25fa8012fb8592f125b3967bdf5 Mon Sep 17 00:00:00 2001 From: Tim Wheeler Date: Sat, 4 Aug 2018 11:34:41 -0700 Subject: [PATCH 3/4] updates for 0.7-beta2 --- REQUIRE | 2 +- doc/TikzGraphs.ipynb | 1 + src/TikzGraphs.jl | 4 ---- test/runtests.jl | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/REQUIRE b/REQUIRE index 352270d..a0d0ab2 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,3 +1,3 @@ julia 0.7-beta2 TikzPictures 2.0.0 -LightGraphs 0.6.0 +LightGraphs 0.13.1 diff --git a/doc/TikzGraphs.ipynb b/doc/TikzGraphs.ipynb index 717004a..a0eb27c 100644 --- a/doc/TikzGraphs.ipynb +++ b/doc/TikzGraphs.ipynb @@ -27,6 +27,7 @@ "metadata": {}, "outputs": [], "source": [ + "using Pkg\n", "Pkg.add(\"TikzGraphs\")" ] }, diff --git a/src/TikzGraphs.jl b/src/TikzGraphs.jl index 180c2fb..579458e 100644 --- a/src/TikzGraphs.jl +++ b/src/TikzGraphs.jl @@ -5,9 +5,6 @@ module TikzGraphs export plot, Layouts import LightGraphs: DiGraph, Graph, vertices, edges, src, dst -using Compat -import Compat.String - preamble = read(joinpath(dirname(@__FILE__), "..", "src", "preamble.tex"), String) const AbstractGraph = Union{Graph, DiGraph} @@ -15,7 +12,6 @@ const AbstractGraph = Union{Graph, DiGraph} using TikzPictures module Layouts - using Compat export Layered, Spring, SimpleNecklace abstract type Layout end diff --git a/test/runtests.jl b/test/runtests.jl index aa0668e..91875da 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,4 +3,4 @@ using Test @assert success(`lualatex -v`) using NBInclude -nbinclude(joinpath(dirname(@__FILE__), "..", "doc", "TikzGraphs.ipynb")) +@nbinclude joinpath(dirname(@__FILE__), "..", "doc", "TikzGraphs.ipynb") From fc4f4431c5ee2b62da85b376cd50ba23118ac6fa Mon Sep 17 00:00:00 2001 From: Tim Wheeler Date: Sat, 4 Aug 2018 11:36:46 -0700 Subject: [PATCH 4/4] test on 0.7 --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7438b63..2fa87fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: julia sudo: required dist: trusty julia: - - 0.5 - - 0.6 + - 0.7 - nightly matrix: allow_failures: