Skip to content

Commit

Permalink
add precompile workload (#37)
Browse files Browse the repository at this point in the history
* add precompilation workload

* compat

* version bump

* fix precompile

* add Aqua + stdlib compat

* woops

* bump min Julia compat to LTS

* compat for InteractiveUtils

* missing compat

* precompile view and matrix

* fix docs build
  • Loading branch information
palday authored Nov 24, 2023
1 parent 2f65520 commit cdfc8e9
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 7 deletions.
10 changes: 8 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TopoPlots"
uuid = "2bdbdf9c-dbd8-403f-947b-1a4e0dd41a7a"
authors = ["Benedikt Ehinger", "Simon Danisch", "Beacon Biosignals, Inc."]
version = "0.1.4"
version = "0.1.5"

[deps]
CloughTocher2DInterpolation = "b70b374f-000b-463f-88dc-37030f004bd0"
Expand All @@ -12,6 +12,7 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
ScatteredInterpolation = "3f865c0f-6dca-5f4d-999b-29fe1e7e3c92"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

Expand All @@ -20,10 +21,15 @@ CloughTocher2DInterpolation = "0.1"
Delaunator = "0.1"
Dierckx = "0.5"
GeometryBasics = "0.4"
InteractiveUtils = "1"
LinearAlgebra = "1"
Makie = "0.17.8, 0.18, 0.19"
Parameters = "0.12"
PrecompileTools = "1"
ScatteredInterpolation = "0.3.6"
julia = "1"
Statistics = "1"
Test = "1"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ScatteredInterpolation = "3f865c0f-6dca-5f4d-999b-29fe1e7e3c92"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
TopoPlots = "2bdbdf9c-dbd8-403f-947b-1a4e0dd41a7a"

[compat]
# other bits of compat are handled by TopoPlots compat
Documenter = "1"
2 changes: 0 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ DocMeta.setdocmeta!(TopoPlots, :DocTestSetup, :(using TopoPlots); recursive=true
makedocs(;
modules=[TopoPlots],
authors="Benedikt Ehinger, Simon Danisch, Beacon Biosignals",
repo="https://github.com/MakieOrg/TopoPlots.jl/blob/{commit}{path}#{line}",
sitename="TopoPlots.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
Expand All @@ -19,7 +18,6 @@ makedocs(;
"EEG" => "eeg.md",
"Function reference" => "functions.md"
],
strict=true
)

deploydocs(;
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ f = Figure(;resolution=(800,280))
topoplot(f[1,1],rand(20), rand(Point2f, 20))
topoplot(f[1,2],rand(20), rand(Point2f, 20); contours=(color=:white, linewidth=2),
label_scatter=true, bounding_geometry=Rect(0,0,1,1), colormap=:viridis)
eeg_topoplot(f[1,3],rand(20),1:20;positions=rand(Point2f, 20),colormap=:Oranges)
eeg_topoplot(f[1,3],rand(20),1:20;positions=rand(Point2f, 20), colormap=:Oranges)
f
```

Find more documentation for `topoplot` in [Recipe for General TopoPlots](@ref).
Expand Down
15 changes: 14 additions & 1 deletion src/TopoPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ using Statistics
using GeometryBasics
using GeometryBasics: origin, radius
using Parameters
using InteractiveUtils
using InteractiveUtils # needed for subtypes
using Dierckx
using ScatteredInterpolation
using PrecompileTools

using Delaunator # DelaunayMesh
using CloughTocher2DInterpolation # pure julia implementation
Expand All @@ -35,4 +36,16 @@ export CloughTocher, SplineInterpolator, DelaunayMesh, NullInterpolator, Scatter
# Extrapolators
export GeomExtrapolation, NullExtrapolation

@setup_workload begin
# Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the size of the
# precompile file and potentially make loading faster.
data, positions = TopoPlots.example_data()
@compile_workload begin
# all calls in this block will be precompiled, regardless of whether
# they belong to your package or not (on Julia 1.8 and higher)
eeg_topoplot(view(data, :, 340, 1); positions)
eeg_topoplot(data[:, 340, 1]; positions)
end
end

end
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Expand All @@ -14,4 +15,5 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8"
PyMNE = "0.2"
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Test
using Aqua
using PythonCall
using TopoPlots
using LinearAlgebra, Statistics, CairoMakie, FileIO
Expand All @@ -20,6 +21,10 @@ PythonPlot.pygui(false)

include("percy.jl")

@testset "Aqua" begin
Aqua.test_all(TopoPlots; ambiguities=false)
end

data, positions = TopoPlots.example_data()

function mne_topoplot(fig, data, positions)
Expand Down

2 comments on commit cdfc8e9

@palday
Copy link
Collaborator Author

@palday palday commented on cdfc8e9 Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95924

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.5 -m "<description of version>" cdfc8e9ae34ef814a42d1d261ac6b6f9568a78c2
git push origin v0.1.5

Please sign in to comment.