-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OnsetFormulas, Sequences, and Component Functions - v0.4.0 #104
base: main
Are you sure you want to change the base?
Conversation
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@@ -62,7 +67,8 @@ function basis_shiftduration(evts, maxlength) | |||
end | |||
|
|||
# ## Simulate data with the new component type | |||
erp = UnfoldSim.simulate( | |||
erp = UnfoldSim.simulate_component( | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
@@ -40,7 +40,9 @@ design_single_shuffled = SingleSubjectDesign(; | |||
:stimulus_type => ["natural", "artificial"], | |||
:contrast_level => range(0, 1, length = 3), | |||
), | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
event_order_function = shuffle, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
@@ -46,11 +46,15 @@ makedocs(; | |||
"Overview: Noise types" => "./generated/reference/noisetypes.md", | |||
], | |||
"HowTo" => [ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
docs/make.jl
Outdated
"Get multiple trials with identical subject/item combinations" => "./generated/HowTo/repeatTrials.md", | ||
"Define a new component (with variable duration and shift)" => "./generated/HowTo/newComponent.md", | ||
"Generate multi channel data" => "./generated/HowTo/multichannel.md", | ||
"Use existing experimental designs & onsets in the simulation" => "./generated/HowTo/predefinedData.md", | ||
"Produce specific sequences of events" => "./generated/HowTo/sequence.md", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SequenceDesign{T}(d, s, sl) where {T<:AbstractDesign} = | ||
new(d, check_sequence(s), sl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
SequenceDesign{T}(d, s, sl) where {T<:AbstractDesign} = | |
new(d, check_sequence(s), sl) | |
SequenceDesign{T}(d, s, sl) where {T<:AbstractDesign} = new(d, check_sequence(s), sl) |
SequenceDesign(design, sequence) = | ||
SequenceDesign(design = design, sequence = sequence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
SequenceDesign(design, sequence) = | |
SequenceDesign(design = design, sequence = sequence) | |
SequenceDesign(design, sequence) = SequenceDesign(design = design, sequence = sequence) |
SequenceDesign(design, sequence) = | ||
SequenceDesign(design = design, sequence = sequence) | ||
|
||
generate_events(rng,design::SequenceDesign{MultiSubjectDesign}) = error("not yet implemented") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
generate_events(rng,design::SequenceDesign{MultiSubjectDesign}) = error("not yet implemented") | |
generate_events(rng, design::SequenceDesign{MultiSubjectDesign}) = | |
error("not yet implemented") |
function UnfoldSim.generate_events(rng::AbstractRNG, design::RepeatDesign) | ||
df = map(x -> generate_events(rng, design.design), 1:design.repeat) |> x -> vcat(x...) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
src/design.jl
Outdated
# No way to find out what size it is without actually generating first... | ||
Base.size( | ||
design::Union{<:SequenceDesign,<:SubselectDesign,<:RepeatDesign{<:SequenceDesign}}, | ||
) = size(generate_events(design), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
) = size(generate_events(design), 1) | |
) = size(generate_events(design), 1) |
Co-authored-by: Benedikt Ehinger <[email protected]>
Add EffectsDesign
New Features:
SequenceDesign
which allows for fixed sequences e.g. Stimulus - Decision - Response, or Stim - Fix - Fix - Fix etc.@jschepers I think I added unittests for all new features + docstrings + tutorials
commit list