Skip to content
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

componentfunction #91

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

componentfunction #91

wants to merge 15 commits into from

Conversation

behinger
Copy link
Member

Allows to specify a (function,maxlength) tuple instead of an Array for LinearModel & LinearMixedModel.

As the function gets the design as input, this makes modifying the shape of a response depending on the design trivially easy :)

  • add functionality

  • add tutorial

  • add docstring

  • add unit-test

  • FormulaOnsets

  • initial sequence tryout

  • fix bug in predef_eeg

  • forgot the end

  • half way through to success for sequence designs or something

  • everythinig except sequencelength seems to be working now

  • added string sequence tests

  • small doc update

  • added jitter to the '_' trial divisor

  • generalized LinearModelComponent to arbitrary functions instead of vectors

  • bugfix with endless loop due to multiple dispatch

  • function component for multi-subject

lines(data)
vlines!(evts.latency, color = (:gray, 0.5))
xlims!(0, 500)
current_figure()
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
current_figure()
current_figure()

axislegend(ax)
f

# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.`
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.`
# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.`

# 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)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
) = size(generate_events(design), 1)
) = size(generate_events(design), 1)

Comment on lines +181 to +182


Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

end
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,10}")) == 10
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,10}B")) == 11
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,20}")) >= 10
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,20}")) >= 10
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,20}")) >= 10

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

Attention: Patch coverage is 46.11399% with 104 lines in your changes are missing coverage. Please review.

Project coverage is 62.57%. Comparing base (75e86a1) to head (57a7f68).
Report is 1 commits behind head on main.

Files Patch % Lines
src/component.jl 46.15% 49 Missing ⚠️
src/onset.jl 12.00% 22 Missing ⚠️
src/design.jl 35.48% 20 Missing ⚠️
src/simulation.jl 53.33% 7 Missing ⚠️
src/sequence.jl 83.33% 5 Missing ⚠️
src/predefinedSimulations.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #91       +/-   ##
===========================================
- Coverage   72.70%   62.57%   -10.14%     
===========================================
  Files          10       11        +1     
  Lines         359      529      +170     
===========================================
+ Hits          261      331       +70     
- Misses         98      198      +100     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

lines(data)
vlines!(evts.latency, color = (:gray, 0.5))
xlims!(0, 500)
current_figure()
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
current_figure()
current_figure()

axislegend(ax)
f

# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.`
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.`
# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.`

# 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)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
) = size(generate_events(design), 1)
) = size(generate_events(design), 1)

Comment on lines +181 to +182


Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

end
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,10}")) == 10
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,10}B")) == 11
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,20}")) >= 10
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,20}")) >= 10
@test length(UnfoldSim.sequencestring(StableRNG(1), "A{10,20}")) >= 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant