diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..700707c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3fcbb60..c9bfda1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,10 +57,7 @@ jobs: julia --project=docs -e ' using Pkg Pkg.instantiate() - pkg"add https://github.com/jagot/Jagot.jl.git https://github.com/jagot/PyPlotRecipes.jl.git" - pkg"build PyPlot"' - env: - PYTHON: "" + pkg"add https://github.com/jagot/Jagot.jl.git"' - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 0f2ddc2..8224e8c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ ltximg /docs/src/figures /docs/src/assets/logo.svg Manifest.toml +.CondaPkg/ \ No newline at end of file diff --git a/Project.toml b/Project.toml index 4763971..1fabdbc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CompactBases" uuid = "2c0377a8-7469-4ebd-be0f-82e501f20078" authors = ["Stefanos Carlström "] -version = "0.3.13" +version = "0.3.14" [deps] BandedMatrices = "aae01518-5342-5314-be14-df237901396f" @@ -21,13 +21,13 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] ArnoldiMethod = "0.2" BandedMatrices = "0.16,0.17" -BlockBandedMatrices = "0.11" +BlockBandedMatrices = "0.11, 0.12" ContinuumArrays = "0.10, 0.11, 0.12" FastGaussQuadrature = "0.4, 0.5" -FillArrays = "0.12,0.13" +FillArrays = "0.12,0.13, 1" Formatting = "0.4" IntervalSets = "0.5.1,0.6,0.7" -LazyArrays = "0.22" +LazyArrays = "0.22, 1" OffsetArrays = "1.1" PrettyTables = "2" ProgressMeter = "1.5" diff --git a/docs/Project.toml b/docs/Project.toml index 7b0fc2b..9d86095 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -4,15 +4,15 @@ Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" -PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" +PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" +PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -Documenter = "0.27" ArnoldiMethod = "0.2" Colors = "0.12" +Documenter = "0.27" IntervalSets = "0.5.1,0.6,0.7" -PyCall = "1.94" -PyPlot = "2.11" +PythonCall = "0.9" +PythonPlot = "1" diff --git a/docs/bspline_plots.jl b/docs/bspline_plots.jl index 39ca658..8eb4a84 100644 --- a/docs/bspline_plots.jl +++ b/docs/bspline_plots.jl @@ -23,7 +23,7 @@ function bsplines_cardinal_splines() csubplot(5,1,k,nox=k<5) do for j = 1:size(χ,2) ϕ = view(χ, :, j) - l=plot(x, ϕ)[1] + l=first(plot(x, ϕ)) Bspline_text(x, ϕ, j, k, l.get_color()) end ylabel(latexstring("k = $k")) @@ -68,7 +68,7 @@ function bsplines_full_multiplicity_splines() csubplot(5,1,k,nox=k<5) do for j = 1:size(χ,2) ϕ = view(χ, :, j) - l=plot(x, ϕ)[1] + l=first(plot(x, ϕ)) Bspline_text(x, ϕ, j, k, l.get_color()) end ylabel(latexstring("k = $k")) @@ -101,7 +101,7 @@ function bsplines_spline1d() csubplot(312, nox=true) do for j = 1:size(χ,2) ϕ = view(χ, :, j) - l=plot(x, ϕ)[1] + l=first(plot(x, ϕ)) Bspline_text(x, ϕ, j, k, l.get_color()) end margins(0.1,0.1) @@ -223,15 +223,15 @@ function bsplines_restricted_basis_interpolation() yl = nothing cfigure("restricted basis interpolation", figsize=(7,9)) do csubplot(321, nox=true) do - l=plot(x, χ*c1)[1] + l=first(plot(x, χ*c1)) plot(x_avg, c1, "s:", color=l.get_color()) - l=plot(x, χ*c2)[1] + l=first(plot(x, χ*c2)) plot(x_avg, c2, "s:", color=l.get_color()) end csubplot(322, nox=true) do - l=plot(x, χ̃*c̃1)[1] + l=first(plot(x, χ̃*c̃1)) plot(x̃_avg, c̃1, "s:", color=l.get_color()) - l=plot(x, χ̃*c̃2)[1] + l=first(plot(x, χ̃*c̃2)) plot(x̃_avg, c̃2, "s:", color=l.get_color()) axes_labels_opposite(:y) end @@ -377,12 +377,12 @@ function bsplines_sine_derivative() cfigure("derivatives", figsize=(7,9)) do csubplot(411,nox=true) do - l=plot(x, χ*cf, label=L"\tilde{f}(x)")[1] + l=first(plot(x, χ*cf, label=L"\tilde{f}(x)")) plot(x, f.(x), ":", label=L"f(x)") legend(framealpha=0.75) end csubplot(412,nox=true) do - l=plot(x, (χ*cg), label=L"\tilde{g}(x)")[1] + l=first(plot(x, (χ*cg), label=L"\tilde{g}(x)")) plot(x, g.(x), ":", label=L"g(x)") legend(framealpha=0.75) end @@ -426,14 +426,14 @@ function bsplines_ode_hookes_law(xₘₐₓ, kspring, k, N) cfigure("Hooke's law",figsize=(7,9)) do csubplot(411,nox=true) do - l=plot(x, χ*cF, label=L"\tilde{F}(x)")[1] + l=first(plot(x, χ*cF, label=L"\tilde{F}(x)")) plot(-x, -χ*cF, "--", color=l.get_color()) plot(x_avg, cF, ".:", color=l.get_color(), label=L"c_F") plot(x, F.(x), ":", label=L"F(x)") legend(framealpha=0.75) end csubplot(412,nox=true) do - l=plot(x, χ*cV, label=L"\tilde{V}(x)")[1] + l=first(plot(x, χ*cV, label=L"\tilde{V}(x)")) plot(-x, χ*cV, "--", color=l.get_color()) plot(x_avg, cV, ".:", color=l.get_color(), label=L"c_V") plot(x, V.(x), ":", label=L"V(x)") @@ -441,13 +441,13 @@ function bsplines_ode_hookes_law(xₘₐₓ, kspring, k, N) end csubplot(413,nox=true) do plot(x, χ*cV - V.(x)) - xl = xlim() + xl = pyconvert(Tuple, xlim()) xlim(-xl[2],xl[2]) ylabel("Error") end csubplot(414) do plot(x, χ) - xl = xlim() + xl = pyconvert(Tuple, xlim()) xlim(-xl[2],xl[2]) xlabel(L"x") end diff --git a/docs/fd_plots.jl b/docs/fd_plots.jl index 6994da2..4fb1fdd 100644 --- a/docs/fd_plots.jl +++ b/docs/fd_plots.jl @@ -64,9 +64,9 @@ function fd_compare_staggered_non_uniform() cfigure("staggered non_uniform reconstruction") do csubplot(211,nox=true) do - l = plot(x1, c1, ".:", label="Uniform coeffs")[1] + l = first(plot(x1, c1, ".:", label="Uniform coeffs")) plot(ξ, f1, color=l.get_color(), label="Uniform reconstruction") - l = plot(x2, c2, ".:", label="Non-uniform coeffs")[1] + l = first(plot(x2, c2, ".:", label="Non-uniform coeffs")) plot(ξ, f2, "--", color=l.get_color(), label="Non-uniform reconstruction") plot(ξ, fe, ":", label="Exact") xscale("log") diff --git a/docs/plots.jl b/docs/plots.jl index fcf2de6..17fb026 100644 --- a/docs/plots.jl +++ b/docs/plots.jl @@ -1,8 +1,7 @@ -using PyPlot +using PythonPlot using Jagot.plotting plot_style("ggplot") -using PyPlotRecipes -using PyCall +using PythonCall PathEffects = pyimport("matplotlib.patheffects") using Statistics using Random @@ -20,6 +19,8 @@ function mean_color(color::String) mean([c.r,c.g,c.b]) end +mean_color(color::Py) = mean_color(pyconvert(String, color)) + lerp(a,b,t) = (1-t)*a + t*b mean_position(x, ϕ) = ϕ'*Diagonal(x)*ϕ/(ϕ'ϕ) @@ -30,7 +31,7 @@ function savedocfig(name,dir="figures") savefig(filename, transparent=true, facecolor=fig.get_facecolor()) - close(fig) + PythonPlot.close("all") if isfile(filename) println("Saved $(name) to $(filename)") else @@ -49,7 +50,7 @@ function logo() margins(0.1, 0.1) axis("off") end - savefig("docs/src/assets/logo.svg", transparent=true) + savedocfig("logo", "assets") end function simple_example() @@ -163,7 +164,7 @@ function densities() for ϕ in ϕ loglog(rr, abs.(ϕ-h.(rr))) end - yl = ylim() + yl = pyconvert(Tuple, ylim()) ylim(max(yl[1],1e-15), yl[2]) legend(["Finite-differences", "Log–linear finite-differences",