Skip to content

Commit

Permalink
Merge branch 'v2' into Uparrow
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith authored Oct 9, 2024
2 parents 1ec90d8 + 19e3073 commit 4cb02ae
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 24 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ jobs:
matrix:
version:
- '1' # latest stable
- '1.9' # minimal declared julia compat in `Project.toml`
- '1.10' # minimal declared julia compat in `Project.toml`
experimental:
- false
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
arch: [x64]
include:
- os: ubuntu-latest
experimental: true
version: 'pre' # upcoming julia version (`alpha`, `beta` or `rc`)

- os: macOS-latest
arch: aarch64
version: '1'
experimental: false

steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Create Pull Request
if: ${{ failure() }}
id: cpr
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Format .jl files [skip ci]"
Expand Down
10 changes: 10 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,12 @@
"orcid": "0000-0002-1589-2916",
"type": "Other"
},
{
"affiliation": "Flatiron Institute",
"name": "Lukas Weber",
"orcid": "0000-0003-4949-5529",
"type": "Other"
},
{
"affiliation": "The Alan Turing Institute",
"name": "Penelope Yong",
Expand All @@ -779,6 +785,10 @@
{
"name": "Leon Becker",
"type": "Other"
},
{
"name": "Patrick Jaap",
"type": "Other"
}
],
"upload_type": "software"
Expand Down
2 changes: 1 addition & 1 deletion PlotsBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ UnicodePlots = "3"
UnitfulLatexify = "1"
Unzip = "0.1 - 0.2"
UUIDs = "1"
julia = "1.9"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
4 changes: 2 additions & 2 deletions PlotsBase/ext/GRExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ end

gr_inqtext(x, y, s) = gr_inqtext(x, y, string(s))
gr_inqtext(x, y, s::AbstractString) =
if (occursin('\\', s) || occursin("10^{", s)) &&
if (occursin('\\', s) || occursin(r"10\^{|2\^{|e\^{", s)) &&
match(r".*\$[^\$]+?\$.*", String(s)) nothing
GR.inqtextext(x, y, s)
else
Expand All @@ -441,7 +441,7 @@ gr_inqtext(x, y, s::AbstractString) =

gr_text(x, y, s) = gr_text(x, y, string(s))
gr_text(x, y, s::AbstractString) =
if (occursin('\\', s) || occursin("10^{", s)) &&
if (occursin('\\', s) || occursin(r"10\^{|2\^{|e\^{", s)) &&
match(r".*\$[^\$]+?\$.*", String(s)) nothing
GR.textext(x, y, s)
else
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
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
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
23 changes: 21 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,31 @@ 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"
julia = "1.9"
Unitful = "1"
julia = "1.10"

[extras]
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
Expand Down
2 changes: 1 addition & 1 deletion RecipesBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
PrecompileTools = "1"
julia = "1.6"
julia = "1.10"

[extras]
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Expand Down
2 changes: 1 addition & 1 deletion RecipesPipeline/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NaNMath = "0.3, 1"
PlotUtils = "0.6.5, 1"
RecipesBase = "1.3.1"
PrecompileTools = "1"
julia = "1.9"
julia = "1.10"

[extras]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand Down
2 changes: 1 addition & 1 deletion RecipesPipeline/src/group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ filter_data(v::AVec, idxfilter::AVec{Int}) = v[idxfilter]
filter_data(v, idxfilter) = v

function filter_data!(plotattributes::AKW, idxfilter)
for s in (:x, :y, :z)
for s in (:x, :y, :z, :xerror, :yerror, :zerror)
plotattributes[s] = filter_data(get(plotattributes, s, nothing), idxfilter)
end
end
Expand Down
12 changes: 12 additions & 0 deletions RecipesPipeline/test/test_group.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,16 @@ lp = map(i -> "xx" * "$(i % 599)", 1:2_000)
RecipesPipeline.GroupBy
@test RecipesPipeline._extract_group_attributes(Dict(:A => [1], :B => [2])) isa
RecipesPipeline.GroupBy

@testset "_filter_input_data!" begin
filtered_keys = [:x, :y, :z, :xerror, :yerror, :zerror]
orig_akw = Dict{Symbol,Any}(k => rand(10) for k in filtered_keys)
orig_akw[:idxfilter] = [1,4,10]

akw = deepcopy(orig_akw)
RecipesPipeline._filter_input_data!(akw)
for k in filtered_keys
@test akw[k] == orig_akw[k][orig_akw[:idxfilter]]
end
end
end

0 comments on commit 4cb02ae

Please sign in to comment.