From ebf230e9fd022f7b4b89ef1991e54d7e50343fba Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Sat, 10 Sep 2022 14:05:57 +0200 Subject: [PATCH 1/4] remove Plots dep --- src/RobustAndOptimalControl.jl | 1 - src/lqg.jl | 6 ++++++ test/test_uncertainty.jl | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/RobustAndOptimalControl.jl b/src/RobustAndOptimalControl.jl index 00fc6b26..19b87c56 100644 --- a/src/RobustAndOptimalControl.jl +++ b/src/RobustAndOptimalControl.jl @@ -2,7 +2,6 @@ module RobustAndOptimalControl using ControlSystemsBase: issiso using LinearAlgebra, Statistics -using Plots using RecipesBase using ControlSystemsBase import ControlSystemsBase: ss, ssdata, ninputs, noutputs, nstates, isdiscrete, iscontinuous, to_matrix, timeevol, _string_mat_with_headers, common_timeevol, gangoffour, sensitivity, diff --git a/src/lqg.jl b/src/lqg.jl index b672a9c4..1ee00b84 100644 --- a/src/lqg.jl +++ b/src/lqg.jl @@ -492,6 +492,9 @@ function gangoffour(l::LQGProblem) end function ControlSystemsBase.gangoffourplot(l::LQGProblem, args...; sigma = true, kwargs...) + plots_id = Base.PkgId(UUID("91a5bcdd-55d7-5caf-9e0b-520d859cae80"), "Plots") + haskey(Base.loaded_modules, plots_id) || error("Call using Plots before calling this function") + Plots = Base.loaded_modules[plots_id] S,D,N,T = gangoffour(l) bp = (args...; kwargs...) -> sigma ? sigmaplot(args...; kwargs...) : bodeplot(args...; plotphase=false, kwargs...) f1 = bp(S, args...; show=false, title="S", kwargs...) @@ -515,6 +518,9 @@ function ControlSystemsBase.gangoffourplot(l::LQGProblem, args...; sigma = true, end function gangofsevenplot(P, C, F, args...; sigma = true, ylabel="", layout=4, kwargs...) + plots_id = Base.PkgId(UUID("91a5bcdd-55d7-5caf-9e0b-520d859cae80"), "Plots") + haskey(Base.loaded_modules, plots_id) || error("Call using Plots before calling this function") + Plots = Base.loaded_modules[plots_id] S,D,CS,T = gangoffour(P,C) RY = T*F RU = CS*F diff --git a/test/test_uncertainty.jl b/test/test_uncertainty.jl index ac32238c..61ba005a 100644 --- a/test/test_uncertainty.jl +++ b/test/test_uncertainty.jl @@ -340,6 +340,5 @@ w = exp10.(-1:0.01:4) bodeplot(P, exp10.(-1:0.001:3)) nyquistplot(P*C, w[1:10:end], points=true, xlims=(-3.5, 2.5), ylims=(-5, 1.5), Ms_circles=[1.5, 2], alpha=1) # Note, the nyquistplot with uncertain coefficients requires manual selection of plot limits -c2d(feedback(P, C), 0.001) # plot(step(feedback(P, C), 0:0.0001:0.05), lab="L = " .* string.(P.Tau[].particles'), title="Disturbance response") # This is not being run to avoid having to load ControlSystems From 0695f2c031b9c0a3e2de9a7825deb3e851b79b70 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Sun, 11 Sep 2022 16:48:56 +0200 Subject: [PATCH 2/4] rm plots from deps --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index e0e3fa0e..27dcba79 100644 --- a/Project.toml +++ b/Project.toml @@ -15,7 +15,6 @@ MatrixEquations = "99c1a7ee-ab34-5fd5-8076-27c950a045f4" MatrixPencils = "48965c70-4690-11ea-1f13-43a2532b2fa8" MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" Optim = "429524aa-4258-5aef-a3af-852621145aeb" -Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" From c6b72a7c64a9d1696bfb28e88081e5ff81c7d43a Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Mon, 12 Sep 2022 10:21:42 +0200 Subject: [PATCH 3/4] add UUIDs dep --- Project.toml | 1 + src/RobustAndOptimalControl.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/Project.toml b/Project.toml index 5a7564fd..96a84beb 100644 --- a/Project.toml +++ b/Project.toml @@ -19,6 +19,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" [compat] diff --git a/src/RobustAndOptimalControl.jl b/src/RobustAndOptimalControl.jl index 19b87c56..8a3b9604 100644 --- a/src/RobustAndOptimalControl.jl +++ b/src/RobustAndOptimalControl.jl @@ -3,6 +3,7 @@ module RobustAndOptimalControl using ControlSystemsBase: issiso using LinearAlgebra, Statistics using RecipesBase +using UUIDs # To check if Plots is loaded in gofplot using ControlSystemsBase import ControlSystemsBase: ss, ssdata, ninputs, noutputs, nstates, isdiscrete, iscontinuous, to_matrix, timeevol, _string_mat_with_headers, common_timeevol, gangoffour, sensitivity, input_sensitivity, From 8f288edd86cc0310c79d02ed9343467073580a12 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Mon, 12 Sep 2022 10:26:47 +0200 Subject: [PATCH 4/4] fix UUID for CSBase --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 050a2b87..8068d489 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,5 @@ [deps] -ControlSystemsBase = "a6e380b2-a6ca-5380-bf3e-84a91bcd477e" +ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"