Skip to content

Commit

Permalink
first real test
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdez committed Dec 15, 2024
1 parent 0e2bf9a commit 93808a1
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Unfold = "181c99d8-e21b-4ff3-b70b-c233eddec679"
26 changes: 26 additions & 0 deletions docs/gen_data.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using UnfoldSim, DataFrames, Random
using GeometryBasics
function gen_data()
d1, evts = UnfoldSim.predef_eeg(n_repeats = 120, noiselevel = 25; return_epoched = true)
dataS = permutedims(repeat(d1, 1, 1, 64), (3, 1, 2))
dataS = dataS .+ rand(dataS)

evts = insertcols(
evts,
:saccade_amplitude => rand(nrow(evts)) .* 15,
:luminance => rand(nrow(evts)) .* 100,
:contrast => rand(nrow(evts)),
:string => shuffle(
repeat(
["stringsuperlong", "stringshort", "stringUPPERCASE", "stringEXCITED!!!!"],
outer = div(nrow(evts), 4),
),
),
:animal => shuffle(repeat(["cat", "dog"], outer = div(nrow(evts), 2))),
:fruit => shuffle(repeat(["orange", "banana"], outer = div(nrow(evts), 2))),
:color => shuffle(repeat(["black", "white"], outer = div(nrow(evts), 2))),
)

positions = rand(Point2f, size(dataS, 1))
return dataS, evts, positions
end
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ERPExplorer Highlights

# Hello World!
# 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.
10 changes: 10 additions & 0 deletions test/basic.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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

3 changes: 3 additions & 0 deletions test/setup.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using ERPExplorer
using Test

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

0 comments on commit 93808a1

Please sign in to comment.