Skip to content

Commit 19761a2

Browse files
committed
Merge pull request #44 from JuliaControl/fastdocs
Fastdocs
2 parents 4ec3219 + a2583b4 commit 19761a2

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ script:
1010
after_success:
1111
- julia -e 'cd(Pkg.dir("ControlSystems")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
1212
- julia -e 'Pkg.clone("https://github.com/MichaelHatherly/Lapidary.jl")'
13-
- julia -e 'ENV["PYTHON"]=""; Pkg.add("PyPlot"); Pkg.build("PyCall")'
1413
- julia -e 'cd(Pkg.dir("ControlSystems")); include(joinpath("docs", "make.jl"))'

docs/make.jl

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
using Lapidary, ControlSystems, Plots
2+
include("src/makeplots.jl")
23

34
makedocs(modules=[ControlSystems])
45

5-
include("src/makeplots.jl")
6+
# If not running travis, generate the plots here, even if we are not deploying
7+
if get(ENV, "TRAVIS", "") == ""
8+
makePlots()
9+
end
10+
11+
# Only build plots in travis if we are deploying
12+
# And dont install the dependencies unless we are deploying
13+
function myDeps()
14+
if get(ENV, "TRAVIS", "") != ""
15+
println("Installing deploy dependencies")
16+
run(`pip install --user pygments mkdocs`)
17+
ENV["PYTHON"]=""
18+
Pkg.add("PyPlot")
19+
Pkg.build("PyCall")
20+
makePlots()
21+
end
22+
end
623

724
deploydocs(
825
repo = "github.com/JuliaControl/ControlSystems.jl.git",
926
latest = "master",
10-
julia = "0.4"
27+
julia = "0.4",
28+
deps = myDeps
1129
)

docs/src/makeplots.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function makePlots()
2+
3+
println("Generating plots")
4+
15
plotsDir = (pwd()[end-3:end] == "docs") ? "build/plots" : "docs/build/plots"
26
mkdir(plotsDir)
37
Plots.pyplot()
@@ -10,15 +14,15 @@ Plots.savefig(plotsDir*"/pidgofplot.svg")
1014

1115
ωp = 0.8
1216
kp,ki,C = loopshapingPI(P,ωp,phasemargin=60, doplot=false)
13-
gangoffourplot(P,C)
17+
gangoffourplot(P, [tf(1), C])
1418
Plots.savefig(plotsDir*"/pidgofplot2.svg")
1519
nyquistplot([P, P*C])
1620
Plots.savefig(plotsDir*"/pidnyquistplot.svg")
1721

1822

1923
ωp = 2
2024
kp,ki,C60 = loopshapingPI(P,ωp,rl=1,phasemargin=60, doplot=true)
21-
gangoffourplot(P,C60)
25+
gangoffourplot(P, [tf(1), C60])
2226
Plots.savefig(plotsDir*"/pidgofplot3.svg")
2327
nyquistplot([P, P*C60])
2428
Plots.savefig(plotsDir*"/pidnyquistplot2.svg")
@@ -88,3 +92,4 @@ Plots.savefig(plotsDir*"/pidplotsgof2.svg")
8892
#f2 = gangoffourplot(P, tf(-S,R))
8993
#Plots.savefig(f1, "$plotsDir/rstcstepplot.svg")
9094
#Plots.savefig(f2, "$plotsDir/rstcgofplot.svg")
95+
end

0 commit comments

Comments
 (0)