Skip to content

Commit

Permalink
shift things around a little for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Mar 13, 2024
1 parent 68c5803 commit 39b2712
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1.6'
version: '1.10'
- uses: julia-actions/cache@v1
with:
cache-compiled: true
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Lighthouse = "ac2c24cd-07f0-4848-96b2-1b82c3ea0e59"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"

[compat]
Expand Down
1 change: 1 addition & 0 deletions docs/src/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Note that all curve plot types accepts these types:
Lighthouse.XYVector
Lighthouse.SeriesCurves
```

## Theming

All generic series and axis attributes can be themed via `SeriesPlot.Series` / `SeriesPlot.Axis`.
Expand Down
24 changes: 2 additions & 22 deletions ext/LighthouseMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ using Printf

using Lighthouse: has_value, evaluation_metrics

using Lighthouse: XYVector, SeriesCurves, NumberLike, NumberVector, NumberMatrix

# all the methods we're actually defining and which call each other
using Lighthouse: evaluation_metrics_plot, plot_confusion_matrix, plot_confusion_matrix!,
plot_reliability_calibration_curves, plot_reliability_calibration_curves!,
Expand All @@ -16,14 +18,6 @@ using Lighthouse: evaluation_metrics_plot, plot_confusion_matrix, plot_confusion

get_parent(x::Makie.GridPosition) = x.layout.parent

# We can't rely on inference to always give us fully typed
# Vector{<: Number} so we add `{T} where T` to the the mix
# This makes the number like type a bit absurd, but is still nice for
# documentation purposes!
const NumberLike = Union{Number,Missing,Nothing,T} where {T}
const NumberVector = AbstractVector{<:NumberLike}
const NumberMatrix = AbstractMatrix{<:NumberLike}

#####
##### Helpers for theming and color generation...May want to move them to Colors.jl / Makie.jl
#####
Expand Down Expand Up @@ -60,20 +54,6 @@ function high_contrast(background_color::Colorant, target_color::Colorant;
return RGBAf(color[1], Makie.Colors.alpha(target_color))
end

"""
Tuple{<:NumberVector, <: NumberVector}
Tuple of X, Y coordinates
"""
const XYVector = Tuple{<:NumberVector,<:NumberVector}

"""
Union{XYVector, AbstractVector{<: XYVector}}
A series of XYVectors, or a single xyvector.
"""
const SeriesCurves = Union{XYVector,AbstractVector{<:XYVector}}

function series_plot!(subfig::GridPosition, per_class_pr_curves::SeriesCurves,
class_labels::Union{Nothing,AbstractVector{String}}; legend=:lt,
title="No title",
Expand Down
22 changes: 22 additions & 0 deletions src/plotting.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# We can't rely on inference to always give us fully typed
# Vector{<: Number} so we add `{T} where T` to the the mix
# This makes the number like type a bit absurd, but is still nice for
# documentation purposes!
const NumberLike = Union{Number,Missing,Nothing,T} where {T}
const NumberVector = AbstractVector{<:NumberLike}
const NumberMatrix = AbstractMatrix{<:NumberLike}

"""
Tuple{<:NumberVector, <: NumberVector}
Tuple of X, Y coordinates
"""
const XYVector = Tuple{<:NumberVector,<:NumberVector}

"""
Union{XYVector, AbstractVector{<: XYVector}}
A series of XYVectors, or a single xyvector.
"""
const SeriesCurves = Union{XYVector,AbstractVector{<:XYVector}}

"""
evaluation_metrics_plot(data::Dict; size=(1000, 1000), fontsize=12)
evaluation_metrics_plot(row::EvaluationV1; kwargs...)
Expand Down

0 comments on commit 39b2712

Please sign in to comment.