Skip to content

Commit 698ab84

Browse files
authored
Makie compat bumps (#114)
1 parent c44a371 commit 698ab84

File tree

9 files changed

+142
-108
lines changed

9 files changed

+142
-108
lines changed

.github/workflows/CI.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,53 @@ on:
1010
concurrency:
1111
# Skip intermediate builds: always.
1212
# Cancel intermediate builds: only if it is a pull request build.
13-
group: ${{ github.workflow }}-${{ github.ref }}-TrialReportCI
13+
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1515
jobs:
1616
test:
17-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - Makie - ${{ matrix.makie }}
17+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - Makie v${{ matrix.makie }}
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
fail-fast: false
2121
matrix:
2222
version:
2323
- '1'
24-
- '1.9'
25-
- '1.6'
24+
- 'min'
2625
os:
2726
- ubuntu-latest
28-
arch:
29-
- x64
3027
makie:
31-
- '0.20'
32-
- '0.21'
28+
- '0.24'
29+
include:
30+
- makie: '0.23'
31+
version: 'min'
32+
os: ubuntu-latest
3333
steps:
3434
- uses: actions/checkout@v6
3535
- uses: julia-actions/setup-julia@v2
3636
with:
3737
version: ${{ matrix.version }}
38-
arch: ${{ matrix.arch }}
3938
- uses: julia-actions/cache@v2
4039
with:
4140
cache-compiled: true
4241
cache-name: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}-${{ matrix.makie }}
4342
- name: "Install Makie and instantiate project"
44-
shell: julia --color=yes --project {0}
43+
shell: julia --color=yes --project=. {0}
4544
run: |
4645
using Pkg
47-
Pkg.add(Pkg.PackageSpec(; name="Makie", version="${{ matrix.makie }}"))
4846
Pkg.instantiate()
47+
Pkg.add(Pkg.PackageSpec(; name="Makie", version="${{ matrix.makie }}"))
4948
- uses: julia-actions/julia-runtest@v1
5049
- name: Percy Upload
5150
uses: percy/exec-action@v0.3.1
52-
if: ${{ matrix.version == 1 && matrix.makie == 0.20 }}
51+
if: ${{ matrix.version == 1 && matrix.makie == 0.24 }}
5352
with:
5453
custom-command: "npx @percy/cli upload ./test/plot_results"
5554
env:
5655
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
5756
- uses: julia-actions/julia-processcoverage@v1
58-
- uses: codecov/codecov-action@v5
57+
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
5958
with:
60-
file: lcov.info
59+
files: lcov.info
6160
token: ${{ secrets.CODECOV_TOKEN }}
6261
docs:
6362
name: Documentation
@@ -71,12 +70,7 @@ jobs:
7170
with:
7271
cache-compiled: true
7372
cache-name: ${{ github.workflow }}-${{ github.job }}
74-
- run: |
75-
julia --project=docs -e '
76-
using Pkg
77-
Pkg.develop(PackageSpec(path=pwd()))
78-
Pkg.instantiate()'
79-
- run: julia --project=docs docs/make.jl
73+
- uses: julia-actions/julia-docdeploy@v1
8074
env:
75+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # when run by tagbot
8176
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/CompatHelper.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
jobs:
7+
CompatHelper:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Pkg.add("CompatHelper")
11+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12+
- name: CompatHelper.main()
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16+
run: julia -e 'using CompatHelper; CompatHelper.main()'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.jl.*.cov
33
*.jl.mem
44
Manifest.toml
5+
Manifest-v*.toml
56
docs/build/
67
docs/site/
78
.DS_Store

Project.toml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Lighthouse"
22
uuid = "ac2c24cd-07f0-4848-96b2-1b82c3ea0e59"
3+
version = "0.17.3"
34
authors = ["Beacon Biosignals, Inc."]
4-
version = "0.17.2"
55

66
[deps]
77
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
@@ -10,7 +10,6 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
1010
Legolas = "741b9549-f6ed-4911-9fbf-4a1c0c97f0cd"
1111
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1212
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
13-
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
1413
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1514
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1615
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
@@ -25,23 +24,33 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
2524
LighthouseMakieExt = ["Makie"]
2625

2726
[compat]
27+
Aqua = "0.8"
2828
Arrow = "2.3"
2929
ArrowTypes = "1, 2"
30-
CairoMakie = "0.11"
30+
CairoMakie = "0.14, 0.15"
3131
DataFrames = "1.3"
32+
Dates = "1"
3233
Legolas = "0.5"
33-
Makie = "0.20, 0.21"
34+
LinearAlgebra = "1"
35+
Logging = "1"
36+
Makie = "0.23, 0.24"
37+
Printf = "1"
38+
Random = "1"
39+
StableRNGs = "1"
40+
Statistics = "1"
3441
StatsBase = "0.33, 0.34"
3542
Tables = "1.7"
3643
TensorBoardLogger = "0.1"
37-
julia = "1.6"
44+
Test = "1"
45+
julia = "1.10"
3846

3947
[extras]
48+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
4049
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
4150
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
4251
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
4352
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
4453
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4554

4655
[targets]
47-
test = ["Test", "Arrow", "CairoMakie", "Makie", "StableRNGs"]
56+
test = ["Test", "Aqua", "Arrow", "CairoMakie", "Makie", "StableRNGs"]

docs/Project.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ Lighthouse = "ac2c24cd-07f0-4848-96b2-1b82c3ea0e59"
55
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
66

77
[compat]
8-
Documenter = "0.25"
8+
Documenter = "1.3"
9+
StableRNGs = "1"
10+
11+
[sources]
12+
Lighthouse = {path = ".."}

docs/make.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
using Lighthouse
22
using Documenter
33

4-
makedocs(; modules=[Lighthouse], sitename="Lighthouse",
4+
makedocs(; modules=[Lighthouse], sitename="Lighthouse.jl",
55
authors="Beacon Biosignals and other contributors",
6+
repo="https://github.com/beacon-biosignals/Lighthouse.jl/blob/{commit}{path}#{line}",
67
pages=["API Documentation" => "index.md",
78
"Plotting" => "plotting.md"],
8-
# makes docs fail hard if there is any error building the examples,
9-
# so we don't just miss a build failure!
10-
strict=true)
9+
format=Documenter.HTML(; prettyurls=get(ENV, "CI", "false") == "true",
10+
repolink="https://github.com/beacon-biosignals/Lighthouse.jl",
11+
canonical="https://beacon-biosignals.github.io/Lighthouse.jl/stable",
12+
assets=String[]))
1113

12-
deploydocs(; repo="github.com/beacon-biosignals/Lighthouse.jl.git",
13-
devbranch="main", push_preview=true)
14+
deploydocs(; repo="github.com/beacon-biosignals/Lighthouse.jl",
15+
devbranch="main",
16+
push_preview=true)

src/Lighthouse.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ include("metrics.jl")
2323
export confusion_matrix, accuracy, binary_statistics, cohens_kappa, calibration_curve,
2424
get_tradeoff_metrics, get_tradeoff_metrics_binary_multirater, get_hardened_metrics,
2525
get_hardened_metrics_multirater, get_hardened_metrics_multiclass,
26-
get_label_metrics_multirater, get_label_metrics_multirater_multiclass,
27-
harden_by_threshold
26+
get_label_metrics_multirater, get_label_metrics_multirater_multiclass
2827

2928
include("classifier.jl")
3029
export AbstractClassifier
@@ -39,9 +38,4 @@ export log_array!, log_arrays!
3938

4039
include("deprecations.jl")
4140

42-
@static if !isdefined(Base, :get_extension)
43-
include("../ext/LighthouseMakieExt.jl")
44-
using .LighthouseMakieExt
45-
end
46-
4741
end # module

test/runtests.jl

Lines changed: 6 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,10 @@
1-
using Test, LinearAlgebra, Statistics
2-
using StableRNGs
3-
using Lighthouse
4-
using Lighthouse: plot_reliability_calibration_curves, plot_pr_curves,
5-
plot_roc_curves, plot_kappas, plot_confusion_matrix,
6-
evaluation_metrics_plot, evaluation_metrics, binarize_by_threshold
7-
using Base.Threads
8-
using CairoMakie
9-
using Legolas, Tables
10-
using DataFrames
11-
using Arrow
1+
include("set_up_tests.jl")
122

13-
# Needs to be set for figures
14-
# returning true for showable("image/png", obj)
15-
# which TensorBoardLogger.jl uses to determine output
16-
CairoMakie.activate!(; type="png")
17-
plot_results = joinpath(@__DIR__, "plot_results")
18-
# Remove any old plots
19-
isdir(plot_results) && rm(plot_results; force=true, recursive=true)
20-
mkdir(plot_results)
21-
22-
macro testplot(fig_name)
23-
path = joinpath(plot_results, string(fig_name, ".png"))
24-
return quote
25-
fig = $(esc(fig_name))
26-
@test fig isa Makie.FigureLike
27-
save($(path), fig)
28-
end
29-
end
30-
31-
const EVALUATION_V1_KEYS = string.(fieldnames(EvaluationV1))
32-
33-
function test_evaluation_metrics_roundtrip(row_dict::Dict{String,S}) where {S}
34-
# Make sure all metrics keys are captured in our schema and are not thrown away
35-
keys_not_in_schema = setdiff(keys(row_dict), EVALUATION_V1_KEYS)
36-
@test isempty(keys_not_in_schema)
37-
38-
# Do the roundtripping (will fail if schema types do not validate after roundtrip)
39-
record = EvaluationV1(row_dict)
40-
rt_row = roundtrip_row(record)
41-
42-
# Make sure full row roundtrips correctly
43-
@test issetequal(keys(record), keys(rt_row))
44-
for (k, v) in pairs(record)
45-
if ismissing(v)
46-
@test ismissing(rt_row[k])
47-
else
48-
@test issetequal(v, rt_row[k])
49-
end
50-
end
51-
52-
# Make sure originating metrics dictionary roundtrips correctly
53-
rt_dict = Lighthouse._evaluation_dict(rt_row)
54-
for (k, v) in pairs(row_dict)
55-
if ismissing(v)
56-
@test ismissing(rt_dict[k])
57-
else
58-
@test issetequal(v, rt_dict[k])
59-
end
60-
end
61-
return nothing
62-
end
63-
64-
function roundtrip_row(row::EvaluationV1)
65-
io = IOBuffer()
66-
tbl = [row]
67-
Legolas.write(io, tbl, Lighthouse.EvaluationV1SchemaVersion())
68-
return EvaluationV1(only(Tables.rows(Legolas.read(seekstart(io)))))
3+
@testset "Aqua" begin
4+
# we ignore Makie because we do a manual install of a specific
5+
# version to test specific versions
6+
Aqua.test_all(Lighthouse;
7+
ambiguities=false, stale_deps=(; ignore=[:Makie]))
698
end
709

7110
include("plotting.jl")

test/set_up_tests.jl

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
using Aqua
3+
using Arrow
4+
using Base.Threads
5+
using CairoMakie
6+
using DataFrames
7+
using Legolas, Tables
8+
using Lighthouse
9+
using LinearAlgebra
10+
using StableRNGs
11+
using Statistics
12+
using Test
13+
14+
using Lighthouse: plot_reliability_calibration_curves, plot_pr_curves,
15+
plot_roc_curves, plot_kappas, plot_confusion_matrix,
16+
evaluation_metrics_plot, evaluation_metrics, binarize_by_threshold
17+
18+
# Needs to be set for figures
19+
# returning true for showable("image/png", obj)
20+
# which TensorBoardLogger.jl uses to determine output
21+
CairoMakie.activate!(; type="png")
22+
plot_results = joinpath(@__DIR__, "plot_results")
23+
# Remove any old plots
24+
isdir(plot_results) && rm(plot_results; force=true, recursive=true)
25+
mkdir(plot_results)
26+
27+
macro testplot(fig_name)
28+
path = joinpath(plot_results, string(fig_name, ".png"))
29+
return quote
30+
fig = $(esc(fig_name))
31+
@test fig isa Makie.FigureLike
32+
save($(path), fig)
33+
end
34+
end
35+
36+
const EVALUATION_V1_KEYS = string.(fieldnames(EvaluationV1))
37+
38+
function test_evaluation_metrics_roundtrip(row_dict::Dict{String,S}) where {S}
39+
# Make sure all metrics keys are captured in our schema and are not thrown away
40+
keys_not_in_schema = setdiff(keys(row_dict), EVALUATION_V1_KEYS)
41+
@test isempty(keys_not_in_schema)
42+
43+
# Do the roundtripping (will fail if schema types do not validate after roundtrip)
44+
record = EvaluationV1(row_dict)
45+
rt_row = roundtrip_row(record)
46+
47+
# Make sure full row roundtrips correctly
48+
@test issetequal(keys(record), keys(rt_row))
49+
for (k, v) in pairs(record)
50+
if ismissing(v)
51+
@test ismissing(rt_row[k])
52+
else
53+
@test issetequal(v, rt_row[k])
54+
end
55+
end
56+
57+
# Make sure originating metrics dictionary roundtrips correctly
58+
rt_dict = Lighthouse._evaluation_dict(rt_row)
59+
for (k, v) in pairs(row_dict)
60+
if ismissing(v)
61+
@test ismissing(rt_dict[k])
62+
else
63+
@test issetequal(v, rt_dict[k])
64+
end
65+
end
66+
return nothing
67+
end
68+
69+
function roundtrip_row(row::EvaluationV1)
70+
io = IOBuffer()
71+
tbl = [row]
72+
Legolas.write(io, tbl, Lighthouse.EvaluationV1SchemaVersion())
73+
return EvaluationV1(only(Tables.rows(Legolas.read(seekstart(io)))))
74+
end

0 commit comments

Comments
 (0)