Skip to content

Commit

Permalink
Merge branch 'v2' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith authored Oct 2, 2024
2 parents e16ad85 + 5a611ce commit 894d8eb
Show file tree
Hide file tree
Showing 81 changed files with 6,526 additions and 30 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CompatHelper

on:
workflow_dispatch:
schedule:
- cron: '00 00 * * *'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: benchmarks

on:
workflow_dispatch:
pull_request:

concurrency:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: ci

on:
workflow_dispatch:
pull_request:
push:
branches: [master, v2]
Expand Down Expand Up @@ -37,10 +38,7 @@ jobs:
include:
- os: ubuntu-latest
experimental: true
version: '~1.11.0-0' # upcoming julia version (`alpha`, `beta` or `rc`)
- os: ubuntu-latest
experimental: true
version: 'nightly'
version: 'pre' # upcoming julia version (`alpha`, `beta` or `rc`)

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ name: docs
on:
workflow_dispatch:
push:
branches: [master]
branches: [v2]
tags: '*'

jobs:
Build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: JuliaPlots/PlotDocs.jl
- uses: julia-actions/setup-julia@latest
- name: Cache artifacts
uses: actions/cache@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: format

on:
workflow_dispatch:
pull_request:
push:
branches: [master, v2]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/format_pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: format

on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/invalidations.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: invalidations
on:
workflow_dispatch:
pull_request:
push:
branches: [master]
branches: [v2]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ test/tmpplotsave.hdf5
/benchmark/*.json
.vscode/
.CondaPkg/

# docs
**/generated/
docs/build/
docs/work/
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,11 @@
"name": "Lukas Weber",
"orcid": "0000-0003-4949-5529",
"type": "Other"
},
{
"affiliation": "The Alan Turing Institute",
"name": "Penelope Yong",
"type": "Other"
}
],
"upload_type": "software"
Expand Down
13 changes: 7 additions & 6 deletions PlotsBase/src/Commons/layouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,18 @@ function GridLayout(
kw...,
)
# Check the values for heights and widths if values are provided
all_between_one(xs) = all(x -> 0 < x < 1, xs)
if heights nothing
sum(heights) == 1 || error("The sum of heights must be 1 !")
all(x -> 0 < x < 1, heights) ||
error("Values for heights must be in the range (0, 1) !")
sum(heights) 1 || error("The heights provided ($(heights)) must sum to 1.")
all_between_one(heights) ||
error("The heights provided ($(heights)) must be in the range (0, 1).")
else
heights = zeros(dims[1])
end
if widths nothing
sum(widths) == 1 || error("The sum of widths must be 1 !")
all(x -> 0 < x < 1, widths) ||
error("Values for widths must be in the range (0, 1) !")
sum(widths) 1 || error("The widths provided ($(widths)) must sum to 1.")
all_between_one(widths) ||
error("The widths provided ($(widths)) must be in the range (0, 1).")
else
widths = zeros(dims[2])
end
Expand Down
8 changes: 5 additions & 3 deletions PlotsBase/src/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1258,12 +1258,10 @@ _animation_examples = [02, 31]
_backend_skips = Dict(
:none => Int[],
:pythonplot => Int[],
:gr => [25, 30], # TODO: add back when StatsPlots is available
:gr => Int[],
:plotlyjs => [
21,
24,
25,
30,
49,
50,
51,
Expand Down Expand Up @@ -1314,6 +1312,10 @@ _backend_skips = Dict(
],
)
_backend_skips[:plotly] = _backend_skips[:plotlyjs]
# 25 and 30 require StatsPlots, which doesn't support Plots v2 yet
for backend in keys(_backend_skips)
append!(_backend_skips[backend], [25, 30])
end

# ---------------------------------------------------------------------------------
# replace `f(args...)` with `f(rng, args...)` for `f ∈ (rand, randn)`
Expand Down
4 changes: 2 additions & 2 deletions PlotsBase/src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ function Base.show(io::IO, plt::Plot)
end
do_show = true
for (i, ekwargs) enumerate(sp_ekwargs)
for (key, value) ekwargs
for (key, value) pairs(ekwargs)
do_show && println(io, " SubplotPlot{$i}:")
println(io, " "^4, key, ": ", value)
do_show = false
end
do_show = true
end
for (i, ekwargs) enumerate(s_ekwargs)
for (key, value) ekwargs
for (key, value) pairs(ekwargs)
do_show && println(io, " Series{$i}:")
println(io, " "^4, key, ": ", value)
do_show = false
Expand Down
8 changes: 2 additions & 6 deletions PlotsBase/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ is_ci() || @eval using Gtk # see JuliaPlots/VisualRegressionTests.jl/issues/30

ref_name(i) = "ref" * lpad(i, 3, '0')

const blacklist = if VERSION.major == 1 && VERSION.minor 9
[
25,
30, # FIXME: remove, when StatsPlots supports Plots v2
41,
] # FIXME: github.com/JuliaLang/julia/issues/47261
const broken_examples = if Sys.isapple()
[50] # FIXME: https://github.com/jheinen/GR.jl/issues/550
else
[]
end
Expand Down
2 changes: 1 addition & 1 deletion PlotsBase/test/test_backends.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ is_pkgeval() || @testset "Backends" begin
@test filesize(fn) > 1_000
end
Sys.islinux() && for be TEST_BACKENDS
skip = vcat(PlotsBase._backend_skips[be], blacklist)
skip = vcat(PlotsBase._backend_skips[be], broken_examples)
PlotsBase.test_examples(be; skip, callback, disp = is_ci(), strict = true) # `ci` display for coverage
closeall()
end
Expand Down
11 changes: 11 additions & 0 deletions PlotsBase/test/test_layouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ end
@test_throws ErrorException plot(map(_ -> plot(1:2), 1:5)...; layout = grid(2, 2))
end

@testset "Allowed grid widths/heights" begin
@test_nowarn grid(2, 1, heights = [0.5, 0.5])
@test_nowarn grid(4, 1, heights = [0.3, 0.3, 0.3, 0.1])
@test_nowarn grid(1, 2, widths = [0.5, 0.5])
@test_nowarn grid(1, 4, widths = [0.3, 0.3, 0.3, 0.1])
@test_throws ErrorException grid(2, 1, heights = [0.5, 0.4])
@test_throws ErrorException grid(4, 1, heights = [1.5, -0.5])
@test_throws ErrorException grid(1, 2, widths = [0.5, 0.4])
@test_throws ErrorException grid(1, 4, widths = [1.5, -0.5])
end

@testset "Invalid viewport" begin
# github.com/JuliaPlots/Plots.jl/issues/2804
pl = plot(1, layout = (10, 2))
Expand Down
2 changes: 1 addition & 1 deletion PlotsBase/test/test_pgfplotsx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ with(:pgfplotsx) do
@test PlotsBase.pgfx_sanitize_string("A string, with 2 punctuation chars.") ==
"A string, with 2 punctuation chars."
@test PlotsBase.pgfx_sanitize_string("Interpolação polinomial") ==
raw"Interpola$\textnormal{\c{c}}$$\textnormal{\~{a}}$o polinomial"
raw"Interpola$\textnormal{\c{c}}$$\tilde{a}$o polinomial"
@test PlotsBase.pgfx_sanitize_string("∫∞ ∂x") == raw"$\int$$\infty$ $\partial$x"

# special LaTeX characters
Expand Down
10 changes: 8 additions & 2 deletions PlotsBase/test/test_reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,19 @@ end
function image_comparison_facts(
pkg::Symbol;
skip = [], # skip these examples (int index)
broken = [], # known broken examples (int index)
only = nothing, # limit to these examples (int index)
debug = false, # print debug information ?
sigma = [1, 1], # number of pixels to "blur"
tol = 1e-2, # acceptable error (percent)
)
for i setdiff(1:length(PlotsBase._examples), skip)
if only nothing || i in only
@test success(image_comparison_tests(pkg, i; debug, sigma, tol))
if i broken
@test_broken success(image_comparison_tests(pkg, i; debug, sigma, tol))
else
@test success(image_comparison_tests(pkg, i; debug, sigma, tol))
end
end
end
end
Expand Down Expand Up @@ -141,7 +146,8 @@ end
image_comparison_facts(
:gr,
tol = PLOTS_IMG_TOL,
skip = vcat(PlotsBase._backend_skips[:gr], blacklist),
skip = vcat(PlotsBase._backend_skips[:gr]),
broken = broken_examples,
)
end
end
21 changes: 20 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,30 @@ PlotsBase = "c52230a3-c5da-43a3-9e85-260fcdfdc737"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[weakdeps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[extensions]
FileIOExt = "FileIO"
GeometryBasicsExt = "GeometryBasics"
IJuliaExt = "IJulia"
ImageInTerminalExt = "ImageInTerminal"
UnitfulExt = "Unitful"

[compat]
GR = "0, 1"
FileIO = "1"
GR = "0.73, 1"
ImageInTerminal = "0.5"
GeometryBasics = "0.4"
IJulia = "1"
PlotsBase = "0.1"
PrecompileTools = "1"
Reexport = "1"
Unitful = "1"
julia = "1.9"

[extras]
Expand Down
43 changes: 43 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DemoCards = "311a05b2-6137-4a5a-b473-18580a3d38b5"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FreeType = "b38be410-82b0-50bf-ab77-7b57e271db43"
Gaston = "4b11ee91-296f-5714-9832-002c20994614"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
GraphRecipes = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925"
PlotThemes = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
PlotlyKaleido = "f2990250-8cf9-495f-b13a-cce12b45703c"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
RecipesPipeline = "01d81517-befc-4cb6-b9ec-a95719d0359c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
Loading

0 comments on commit 894d8eb

Please sign in to comment.