From 2a267cc22db2ef6cedc852150ba57841e98fa343 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Thu, 29 Aug 2024 18:43:56 +0200 Subject: [PATCH 1/3] change default colors --- Project.toml | 2 +- src/PlotUtils.jl | 2 +- src/colorschemes.jl | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index c2ef6ce..61b1747 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "PlotUtils" uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" -version = "1.4.1" +version = "2.0.0" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" diff --git a/src/PlotUtils.jl b/src/PlotUtils.jl index e2b7161..a0ba58b 100644 --- a/src/PlotUtils.jl +++ b/src/PlotUtils.jl @@ -36,7 +36,7 @@ export optimize_ticks, optimize_datetime_ticks include("ticks.jl") -const _default_colorscheme = generate_colorscheme() +const _default_colorscheme = ColorSchemes.colorscheme(:seaborn_colorblind) if VERSION ≥ v"1.8.0" @compile_workload begin diff --git a/src/colorschemes.jl b/src/colorschemes.jl index 8a44379..7f80d18 100644 --- a/src/colorschemes.jl +++ b/src/colorschemes.jl @@ -237,7 +237,7 @@ function cgrad( end function cgrad(colors, args...; kwargs...) - colors ≡ :default && (colors = :inferno) + colors ≡ :default && (colors = DEFAULT_COLOR_GRADIENT[]) cgrad(get_colorscheme(colors), args...; kwargs...) end @@ -335,7 +335,7 @@ is_colorscheme(sym) = sym ∈ keys(COLORSCHEME_ALIASES) || sym ∈ keys(MISC_COLORSCHEMES) -const DEFAULT_COLOR_GRADIENT = Ref(cgrad(ColorSchemes.colorschemes[:inferno])) +const DEFAULT_COLOR_GRADIENT = Ref(cgrad(ColorSchemes.colorschemes[:haline])) ## Compat @@ -422,6 +422,7 @@ const TEST_COLORS = RGBA{Float64}[ ] const MISC_COLORSCHEMES = Dict{Symbol,ColorScheme}( + :default => generate_colorscheme(), :blues => ColorScheme(RGBA{Float64}[colorant"lightblue", colorant"darkblue"]), :reds => ColorScheme(RGBA{Float64}[colorant"lightpink", colorant"darkred"]), :greens => ColorScheme(RGBA{Float64}[colorant"lightgreen", colorant"darkgreen"]), From 93646cc24633648266e135fea125a70093387cdf Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Thu, 29 Aug 2024 18:50:17 +0200 Subject: [PATCH 2/3] rename old default --- src/colorschemes.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/colorschemes.jl b/src/colorschemes.jl index 7f80d18..b2c7703 100644 --- a/src/colorschemes.jl +++ b/src/colorschemes.jl @@ -422,7 +422,7 @@ const TEST_COLORS = RGBA{Float64}[ ] const MISC_COLORSCHEMES = Dict{Symbol,ColorScheme}( - :default => generate_colorscheme(), + :plots_v1 => generate_colorscheme(), :blues => ColorScheme(RGBA{Float64}[colorant"lightblue", colorant"darkblue"]), :reds => ColorScheme(RGBA{Float64}[colorant"lightpink", colorant"darkred"]), :greens => ColorScheme(RGBA{Float64}[colorant"lightgreen", colorant"darkgreen"]), From cdc9c3c3b0d9a858c11cd1ddf56c96513a8f51b1 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Thu, 29 Aug 2024 19:29:29 +0200 Subject: [PATCH 3/3] adapt ci --- .github/workflows/ci.yml | 1 + src/PlotUtils.jl | 2 +- test/downstream.jl | 39 +++++++++++++++++++++++++++++---------- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1128781..e22f721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: [master] pull_request: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/src/PlotUtils.jl b/src/PlotUtils.jl index a0ba58b..9c7c2a6 100644 --- a/src/PlotUtils.jl +++ b/src/PlotUtils.jl @@ -36,7 +36,7 @@ export optimize_ticks, optimize_datetime_ticks include("ticks.jl") -const _default_colorscheme = ColorSchemes.colorscheme(:seaborn_colorblind) +const _default_colorscheme = ColorSchemes.colorschemes[:seaborn_colorblind] if VERSION ≥ v"1.8.0" @compile_workload begin diff --git a/test/downstream.jl b/test/downstream.jl index 702eaf1..54c9ce3 100644 --- a/test/downstream.jl +++ b/test/downstream.jl @@ -3,7 +3,7 @@ using Pkg, PlotUtils, Test LibGit2 = Pkg.GitTools.LibGit2 TOML = Pkg.TOML -failsafe_clone_checkout(path, url) = begin +failsafe_clone_checkout(path, url; version = :stable) = begin local repo for i ∈ 1:6 try @@ -27,10 +27,13 @@ failsafe_clone_checkout(path, url) = begin end @assert isfile(versions) - stable = maximum(VersionNumber.(keys(TOML.parse(read(versions, String))))) - tag = LibGit2.GitObject(repo, "v$stable") - hash = string(LibGit2.target(tag)) - LibGit2.checkout!(repo, hash) + if version === :stable + stable = maximum(VersionNumber.(keys(TOML.parse(read(versions, String))))) + vrs = "v$stable" + tag = LibGit2.GitObject(repo, vrs) + hash = string(LibGit2.target(tag)) + LibGit2.checkout!(repo, hash) + end nothing end @@ -50,11 +53,27 @@ end develop_stable_Plots() = begin tmpd = mktempdir() Plots_jl = joinpath(tmpd, "Plots.jl") - - failsafe_clone_checkout(Plots_jl, "https://github.com/JuliaPlots/Plots.jl") - fake_supported_version!(Plots_jl) - - Pkg.develop(path = Plots_jl) + PlotThemes_jl = joinpath(tmpd, "PlotThemes.jl") + PlotsBase_jl = joinpath(Plots_jl, "PlotsBase") + RecipesPipeline_jl = joinpath(Plots_jl, "RecipesPipeline") + + failsafe_clone_checkout( + Plots_jl, + "https://github.com/JuliaPlots/Plots.jl", + version = :default, + ) + fake_supported_version!(RecipesPipeline_jl) + fake_supported_version!(PlotsBase_jl) + + failsafe_clone_checkout(PlotThemes_jl, "https://github.com/JuliaPlots/PlotThemes.jl") + fake_supported_version!(PlotThemes_jl) + + Pkg.develop([ + PackageSpec(path = Plots_jl), + PackageSpec(path = RecipesPipeline_jl), + PackageSpec(path = PlotsBase_jl), + PackageSpec(path = PlotThemes_jl), + ]) Pkg.status(["PlotUtils", "Plots"]) nothing end