Skip to content

Commit

Permalink
Merge pull request #5 from s-ccs/docum
Browse files Browse the repository at this point in the history
Docum

Adding basic scripts for docs and tests
  • Loading branch information
vladdez authored Dec 20, 2024
2 parents 3813bb6 + cbc0a0d commit 6c5acdb
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using ERPExplorer
DocMeta.setdocmeta!(ERPExplorer, :DocTestSetup, :(using ERPExplorer); recursive=true)
doctest(ERPExplorer)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
15 changes: 15 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
8 changes: 8 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Format suggestions
on:
pull_request:
jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/[email protected]
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TopoPlots = "2bdbdf9c-dbd8-403f-947b-1a4e0dd41a7a"
Unfold = "181c99d8-e21b-4ff3-b70b-c233eddec679"
UnfoldMakie = "69a5ce3b-64fb-4f22-ae69-36dd4416af2a"
UnfoldSim = "ed8ae6d2-84d3-44c6-ab46-0baf21700804"
WGLMakie = "276b4fcb-3e11-5398-bf8b-a0c2d153d008"

[compat]
Test = "1.11.0"
10 changes: 10 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
ERPExplorer = "a0936657-5da6-42c1-a2f2-44cfa89f194c"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Unfold = "181c99d8-e21b-4ff3-b70b-c233eddec679"
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ERPExplorer Highlights

# ERPExplorer.jl allows interactive exploration of regression-ERPs.
# You can switch on and off formula terms, term values, row and column faceting, line colours and style, marker style.
48 changes: 48 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using ERPExplorer
using Documenter
using DocStringExtensions

# preload once

using CairoMakie
const Makie = CairoMakie # - for references
using Unfold
using DataFrames
using DataFramesMeta
using Literate
using Glob

GENERATED = joinpath(@__DIR__, "src", "generated")
SOURCE = joinpath(@__DIR__, "literate")
for subfolder ["intro"] #["how_to", "intro", "tutorials", "explanations"]
local SOURCE_FILES = Glob.glob(subfolder * "/*.jl", SOURCE)
foreach(fn -> Literate.markdown(fn, GENERATED * "/" * subfolder), SOURCE_FILES)
end

DocMeta.setdocmeta!(ERPExplorer, :DocTestSetup, :(using ERPExplorer); recursive = true)

makedocs(;
modules = [ERPExplorer],
authors = "Vladimir Mikheev, Simon Danisch, Benedikt Ehinger",
repo = Documenter.Remotes.GitHub("s-ccs", "ERPExplorer.jl"),
sitename = "ERPExplorer.jl",
warnonly = :cross_references,
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://s-css.github.io/ERPExplorer.jl",
assets = String[],
),
pages = [
"ERPExplorer highlights" => "index.md",
#"Plotting" => "generated/intro/toposeries.md",
#"Diagnostics" => "generated/intro/gnostics.md",
"API / DocStrings" => "api.md",
],
)

deploydocs(;
repo = "github.com/s-ccs/ERPExplorer.jl",
devbranch = "main",
versions = "v#.#",
push_preview = true,
)
7 changes: 7 additions & 0 deletions docs/run_liveserver.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using LiveServer
servedocs(
skip_dir = joinpath("src", "generated"),
literate_dir = joinpath("literate"),
literate = joinpath("literate"),
foldername = ".",
)
6 changes: 6 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```@autodocs
Modules = [ERPExplorer]
Order = [:function]
```

Internally, we use a `PlotConfig` struct to keep track of common plotting options, so that all functions have a similar API.
4 changes: 4 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ERPExplorer Highlights

# ERPExplorer.jl allows interactive exploration of regression-ERPs.
# You can switch on and off formula terms, term values, row and column faceting, line colours and style, marker style.
2 changes: 2 additions & 0 deletions src/formula_extractor.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const BSplineTerm = Base.get_extension(Unfold, :UnfoldBSplineKitExt).BSplineTerm


get_sym(t::InterceptTerm) = ""
get_sym(t::AbstractTerm) = t.sym
get_sym(t::BSplineTerm) = t.term.sym
Expand Down
9 changes: 9 additions & 0 deletions test/basic.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dataS, evts, pos2d = gen_data()
formulaS = @formula(0 ~ 1 + luminance + fruit + animal)
times = range(0, length = size(dataS, 2), step = 1 ./ 100)
model = Unfold.fit(UnfoldModel, formulaS, evts, dataS, times)
_, positions = TopoPlots.example_data()

@testset "basic test" begin
explore(model; positions = positions)
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("setup.jl")
5 changes: 5 additions & 0 deletions test/setup.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using ERPExplorer
using Test

path = dirname(Base.current_project())
include(path * "/docs/gen_data.jl")

0 comments on commit 6c5acdb

Please sign in to comment.