Skip to content

Commit e829617

Browse files
a-cakiromusnbagherzadehkleinschmidt
authored
Upgrade to Legolas 0.5 (#97)
* Project file * update lighthouse eval * update lightouse observation * update lightouse class * update lightouse labeled metrics * update lightouse hardened metrics * update lightouse tradeoff metrics * formatting * comment for evaluation * comment for observation * upgrade comments * small changes based on huddle * export and legolas * Starting updating tests * Use Legolas v0.5 records * Prefer using term record to row * Fix `_values_or_missing` * Address MakieLayout deprecation * Fix mistake where rho was replace with p * Fix `test_evaluation_metrics_roundtrip` * Use `IOBuffer` for `roundtrip_row` * Documentation update * Documentation changes * Use modern Makie which deprecates MakieLayout * updates documentation failures updating Row to V1 * format * workflow * run format * un-mangle * Update docs/Project.toml * docstring format * deprecation (with error) * yasg demands return Co-authored-by: Curtis Vogt <curtis.vogt@gmail.com> Co-authored-by: Nader Bagherzadeh <nader.b@beacon.bio> Co-authored-by: Dave Kleinschmidt <dave.f.kleinschmidt@gmail.com>
1 parent a0bfb5b commit e829617

File tree

22 files changed

+771
-473
lines changed

22 files changed

+771
-473
lines changed

.github/workflows/format.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: YASG-enforcer
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
tags: '*'
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
# note: keep in sync with `format/run.jl`
10+
paths:
11+
- 'src/**'
12+
- 'test/**'
13+
- '.github/workflows/format.yml'
14+
- 'format/**'
15+
jobs:
16+
format-check:
17+
name: YASG Enforcement (Julia ${{ matrix.julia-version }} - ${{ github.event_name }})
18+
# Run on push's or non-draft PRs
19+
if: (github.event_name == 'push') || (github.event.pull_request.draft == false)
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
julia-version: [1.8]
24+
steps:
25+
- uses: julia-actions/setup-julia@latest
26+
with:
27+
version: ${{ matrix.julia-version }}
28+
- uses: actions/checkout@v1
29+
- name: Instantiate `format` environment and format
30+
run: |
31+
julia --project=format -e 'using Pkg; Pkg.instantiate()'
32+
julia --project=format 'format/run.jl'
33+
- uses: reviewdog/action-suggester@v1
34+
if: github.event_name == 'pull_request'
35+
with:
36+
tool_name: JuliaFormatter
37+
fail_on_error: true

Project.toml

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

66
[deps]
77
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
@@ -23,8 +23,8 @@ Arrow = "2.3"
2323
ArrowTypes = "1, 2"
2424
CairoMakie = "0.7, 0.8"
2525
DataFrames = "1.3"
26-
Legolas = "0.3"
27-
Makie = "0.16.5, 0.17, 0.18"
26+
Legolas = "0.5"
27+
Makie = "0.17.4, 0.18"
2828
StatsBase = "0.33"
2929
Tables = "1.7"
3030
TensorBoardLogger = "0.1"

docs/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
55

66
[compat]
7-
CairoMakie = "0.7.4"
87
Documenter = "0.25"

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ makedocs(; modules=[Lighthouse], sitename="Lighthouse",
77
"Plotting" => "plotting.md"],
88
# makes docs fail hard if there is any error building the examples,
99
# so we don't just miss a build failure!
10-
strict = true)
10+
strict=true)
1111

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

docs/src/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,23 @@ accuracy
6666
binary_statistics
6767
cohens_kappa
6868
calibration_curve
69-
EvaluationRow
70-
ObservationRow
69+
EvaluationV1
70+
ObservationV1
7171
Lighthouse.evaluation_metrics
72-
Lighthouse._evaluation_row_dict
73-
Lighthouse.evaluation_metrics_row
74-
Lighthouse.ClassRow
75-
TradeoffMetricsRow
72+
Lighthouse._evaluation_dict
73+
Lighthouse.evaluation_metrics_record
74+
Lighthouse.ClassV1
75+
TradeoffMetricsV1
7676
get_tradeoff_metrics
7777
get_tradeoff_metrics_binary_multirater
78-
HardenedMetricsRow
78+
HardenedMetricsV1
7979
get_hardened_metrics
8080
get_hardened_metrics_multirater
8181
get_hardened_metrics_multiclass
82-
LabelMetricsRow
82+
LabelMetricsV1
8383
get_label_metrics_multirater
8484
get_label_metrics_multirater_multiclass
85-
Lighthouse._evaluation_row
85+
Lighthouse._evaluation_record
8686
Lighthouse._calculate_ea_kappas
8787
Lighthouse._calculate_ira_kappas
8888
Lighthouse._calculate_spearman_correlation

docs/src/plotting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ data["optimal_threshold"] = missing
274274
evaluation_metrics_plot(data)
275275
```
276276

277-
Plots can also be generated directly from an `EvaluationRow`:
277+
Plots can also be generated directly from an `EvaluationV1`:
278278
```@example 1
279-
data_row = EvaluationRow(data)
279+
data_row = EvaluationV1(data)
280280
evaluation_metrics_plot(data_row)
281281
```

format/Manifest.toml

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
julia_version = "1.8.3"
4+
manifest_format = "2.0"
5+
project_hash = "30b405be1c677184b7703a9bfb3d2100029ccad0"
6+
7+
[[deps.ArgTools]]
8+
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
9+
version = "1.1.1"
10+
11+
[[deps.Artifacts]]
12+
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
13+
14+
[[deps.Base64]]
15+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
16+
17+
[[deps.CSTParser]]
18+
deps = ["Tokenize"]
19+
git-tree-sha1 = "3ddd48d200eb8ddf9cb3e0189fc059fd49b97c1f"
20+
uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
21+
version = "3.3.6"
22+
23+
[[deps.CommonMark]]
24+
deps = ["Crayons", "JSON", "URIs"]
25+
git-tree-sha1 = "86cce6fd164c26bad346cc51ca736e692c9f553c"
26+
uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6"
27+
version = "0.8.7"
28+
29+
[[deps.Compat]]
30+
deps = ["Dates", "LinearAlgebra", "UUIDs"]
31+
git-tree-sha1 = "00a2cccc7f098ff3b66806862d275ca3db9e6e5a"
32+
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
33+
version = "4.5.0"
34+
35+
[[deps.CompilerSupportLibraries_jll]]
36+
deps = ["Artifacts", "Libdl"]
37+
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
38+
version = "0.5.2+0"
39+
40+
[[deps.Crayons]]
41+
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
42+
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
43+
version = "4.1.1"
44+
45+
[[deps.DataStructures]]
46+
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
47+
git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0"
48+
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
49+
version = "0.18.13"
50+
51+
[[deps.Dates]]
52+
deps = ["Printf"]
53+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
54+
55+
[[deps.Downloads]]
56+
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
57+
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
58+
version = "1.6.0"
59+
60+
[[deps.FileWatching]]
61+
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
62+
63+
[[deps.Glob]]
64+
git-tree-sha1 = "4df9f7e06108728ebf00a0a11edee4b29a482bb2"
65+
uuid = "c27321d9-0574-5035-807b-f59d2c89b15c"
66+
version = "1.3.0"
67+
68+
[[deps.InteractiveUtils]]
69+
deps = ["Markdown"]
70+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
71+
72+
[[deps.JSON]]
73+
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
74+
git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
75+
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
76+
version = "0.21.3"
77+
78+
[[deps.JuliaFormatter]]
79+
deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "Tokenize"]
80+
git-tree-sha1 = "76ee67858b65133b2460b0eebf52e49950bb90a3"
81+
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
82+
version = "1.0.16"
83+
84+
[[deps.LibCURL]]
85+
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
86+
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
87+
version = "0.6.3"
88+
89+
[[deps.LibCURL_jll]]
90+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
91+
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
92+
version = "7.84.0+0"
93+
94+
[[deps.LibGit2]]
95+
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
96+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
97+
98+
[[deps.LibSSH2_jll]]
99+
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
100+
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
101+
version = "1.10.2+0"
102+
103+
[[deps.Libdl]]
104+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
105+
106+
[[deps.LinearAlgebra]]
107+
deps = ["Libdl", "libblastrampoline_jll"]
108+
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
109+
110+
[[deps.Logging]]
111+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
112+
113+
[[deps.Markdown]]
114+
deps = ["Base64"]
115+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
116+
117+
[[deps.MbedTLS_jll]]
118+
deps = ["Artifacts", "Libdl"]
119+
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
120+
version = "2.28.0+0"
121+
122+
[[deps.Mmap]]
123+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
124+
125+
[[deps.MozillaCACerts_jll]]
126+
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
127+
version = "2022.2.1"
128+
129+
[[deps.NetworkOptions]]
130+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
131+
version = "1.2.0"
132+
133+
[[deps.OpenBLAS_jll]]
134+
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
135+
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
136+
version = "0.3.20+0"
137+
138+
[[deps.OrderedCollections]]
139+
git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
140+
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
141+
version = "1.4.1"
142+
143+
[[deps.Parsers]]
144+
deps = ["Dates", "SnoopPrecompile"]
145+
git-tree-sha1 = "b64719e8b4504983c7fca6cc9db3ebc8acc2a4d6"
146+
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
147+
version = "2.5.1"
148+
149+
[[deps.Pkg]]
150+
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
151+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
152+
version = "1.8.0"
153+
154+
[[deps.Printf]]
155+
deps = ["Unicode"]
156+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
157+
158+
[[deps.REPL]]
159+
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
160+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
161+
162+
[[deps.Random]]
163+
deps = ["SHA", "Serialization"]
164+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
165+
166+
[[deps.SHA]]
167+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
168+
version = "0.7.0"
169+
170+
[[deps.Serialization]]
171+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
172+
173+
[[deps.SnoopPrecompile]]
174+
git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85"
175+
uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c"
176+
version = "1.0.1"
177+
178+
[[deps.Sockets]]
179+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
180+
181+
[[deps.TOML]]
182+
deps = ["Dates"]
183+
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
184+
version = "1.0.0"
185+
186+
[[deps.Tar]]
187+
deps = ["ArgTools", "SHA"]
188+
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
189+
version = "1.10.1"
190+
191+
[[deps.Tokenize]]
192+
git-tree-sha1 = "2b3af135d85d7e70b863540160208fa612e736b9"
193+
uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624"
194+
version = "0.5.24"
195+
196+
[[deps.URIs]]
197+
git-tree-sha1 = "ac00576f90d8a259f2c9d823e91d1de3fd44d348"
198+
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
199+
version = "1.4.1"
200+
201+
[[deps.UUIDs]]
202+
deps = ["Random", "SHA"]
203+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
204+
205+
[[deps.Unicode]]
206+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
207+
208+
[[deps.Zlib_jll]]
209+
deps = ["Libdl"]
210+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
211+
version = "1.2.12+3"
212+
213+
[[deps.libblastrampoline_jll]]
214+
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
215+
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
216+
version = "5.1.1+0"
217+
218+
[[deps.nghttp2_jll]]
219+
deps = ["Artifacts", "Libdl"]
220+
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
221+
version = "1.48.0+0"
222+
223+
[[deps.p7zip_jll]]
224+
deps = ["Artifacts", "Libdl"]
225+
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
226+
version = "17.4.0+0"

format/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
3+
4+
[compat]
5+
JuliaFormatter = "1"

format/run.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using JuliaFormatter
2+
3+
function main()
4+
perfect = format(joinpath(@__DIR__, ".."); style=YASStyle())
5+
if perfect
6+
@info "Linting complete - no files altered"
7+
else
8+
@info "Linting complete - files altered"
9+
run(`git status`)
10+
end
11+
return nothing
12+
end
13+
14+
main()

src/LearnLogger.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ function log_plot!(logger::LearnLogger, field::AbstractString, plot, plot_data)
4545
return plot
4646
end
4747

48-
function log_line_series!(logger::LearnLogger, field::AbstractString, curves, labels=1:length(curves))
49-
@warn "`log_line_series!` not implemented for `LearnLogger`" maxlog=1
48+
function log_line_series!(logger::LearnLogger, field::AbstractString, curves,
49+
labels=1:length(curves))
50+
@warn "`log_line_series!` not implemented for `LearnLogger`" maxlog = 1
5051
return nothing
5152
end
5253

0 commit comments

Comments
 (0)