Skip to content

Commit

Permalink
build based on 2b9cd37
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Nov 20, 2023
1 parent 00dc7e9 commit 8e3189c
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 114 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-11-15T14:16:48","documenter_version":"1.1.2"}}
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-11-20T19:48:23","documenter_version":"1.1.2"}}
12 changes: 6 additions & 6 deletions dev/api/index.html

Large diffs are not rendered by default.

43 changes: 8 additions & 35 deletions dev/generated/HowTo/multichannel/index.html

Large diffs are not rendered by default.

Binary file removed dev/generated/HowTo/newComponent/08f54f01.png
Binary file not shown.
Binary file added dev/generated/HowTo/newComponent/faaca575.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 8 additions & 13 deletions dev/generated/HowTo/newComponent/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dev/generated/HowTo/newDesign/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>New Experimental Design · UnfoldSim.jl</title><meta name="title" content="New Experimental Design · UnfoldSim.jl"/><meta property="og:title" content="New Experimental Design · UnfoldSim.jl"/><meta property="twitter:title" content="New Experimental Design · UnfoldSim.jl"/><meta name="description" content="Documentation for UnfoldSim.jl."/><meta property="og:description" content="Documentation for UnfoldSim.jl."/><meta property="twitter:description" content="Documentation for UnfoldSim.jl."/><meta property="og:url" content="https://unfoldtoolbox.github.io/UnfoldSim.jl/generated/HowTo/newDesign/"/><meta property="twitter:url" content="https://unfoldtoolbox.github.io/UnfoldSim.jl/generated/HowTo/newDesign/"/><link rel="canonical" href="https://unfoldtoolbox.github.io/UnfoldSim.jl/generated/HowTo/newDesign/"/><script data-outdated-warner src="../../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../../assets/documenter.js"></script><script src="../../../search_index.js"></script><script src="../../../siteinfo.js"></script><script src="../../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../../">UnfoldSim.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../../">Home</a></li><li><span class="tocitem">Tutorials</span><ul><li><a class="tocitem" href="../../tutorials/quickstart/">Quickstart</a></li><li><a class="tocitem" href="../../tutorials/simulateERP/">Simulate ERPs</a></li><li><a class="tocitem" href="../../tutorials/poweranalysis/">Poweranalysis</a></li></ul></li><li><span class="tocitem">Reference</span><ul><li><a class="tocitem" href="../../reference/overview/">Toolbox Overview</a></li><li><a class="tocitem" href="../../reference/noisetypes/">NoiseTypes</a></li><li><a class="tocitem" href="../../reference/basistypes/">ComponentBasisTypes</a></li></ul></li><li><span class="tocitem">HowTo</span><ul><li class="is-active"><a class="tocitem" href>New Experimental Design</a><ul class="internal"><li><a class="tocitem" href="#Define-a-new-Design"><span>Define a new Design</span></a></li></ul></li><li><a class="tocitem" href="../repeatTrials/">Repeating Trials within a Design</a></li><li><a class="tocitem" href="../newComponent/">New Duration/Shift-dependent Component</a></li><li><a class="tocitem" href="../multichannel/">Multi Channel Data</a></li></ul></li><li><a class="tocitem" href="../../../api/">DocStrings</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">HowTo</a></li><li class="is-active"><a href>New Experimental Design</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>New Experimental Design</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/unfoldtoolbox/UnfoldSim.jl/blob/main/docs/literate/HowTo/newDesign.jl#" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><pre><code class="language-julia hljs">using UnfoldSim
using StableRNGs
using DataFrames
using Parameters</code></pre><h2 id="Define-a-new-Design"><a class="docs-heading-anchor" href="#Define-a-new-Design">Define a new Design</a><a id="Define-a-new-Design-1"></a><a class="docs-heading-anchor-permalink" href="#Define-a-new-Design" title="Permalink"></a></h2><p>A design specifies how much data is generated, and how the event-table(s) should be generated. Already implemented examples are <code>MultiSubjectDesign</code> and <code>SingleSubjectdesign</code></p><p>We need 3 things for a new design: a <code>struct&lt;:AbstractDesign</code>, a <code>size</code> and a <code>generate</code> function</p><h4 id=")-type"><a class="docs-heading-anchor" href="#)-type">1) <code>type</code></a><a id=")-type-1"></a><a class="docs-heading-anchor-permalink" href="#)-type" title="Permalink"></a></h4><p>We need a <code>ImbalanceSubjectDesign</code> struct. You are free to implement it as you wish, as long as the other two functions are implemented</p><pre><code class="language-julia hljs">@with_kw struct ImbalanceSubjectDesign &lt;: UnfoldSim.AbstractDesign
using Parameters</code></pre><h2 id="Define-a-new-Design"><a class="docs-heading-anchor" href="#Define-a-new-Design">Define a new Design</a><a id="Define-a-new-Design-1"></a><a class="docs-heading-anchor-permalink" href="#Define-a-new-Design" title="Permalink"></a></h2><p>A design specifies how much data is generated, and how the event-table(s) should be generated. Already implemented examples are <code>MultiSubjectDesign</code> and <code>SingleSubjectDesign</code></p><p>We need 3 things for a new design: a <code>struct&lt;:AbstractDesign</code>, a <code>size</code> and a <code>generate</code> function</p><h4 id=")-type"><a class="docs-heading-anchor" href="#)-type">1) <code>type</code></a><a id=")-type-1"></a><a class="docs-heading-anchor-permalink" href="#)-type" title="Permalink"></a></h4><p>We need a <code>ImbalanceSubjectDesign</code> struct. You are free to implement it as you wish, as long as the other two functions are implemented</p><pre><code class="language-julia hljs">@with_kw struct ImbalanceSubjectDesign &lt;: UnfoldSim.AbstractDesign
nTrials::Int
balance::Float64 = 0.5 # default balanced
end;</code></pre><h4 id=")-size"><a class="docs-heading-anchor" href="#)-size">2) <code>size</code></a><a id=")-size-1"></a><a class="docs-heading-anchor-permalink" href="#)-size" title="Permalink"></a></h4><p>we need a <code>size(design::ImbalanceSubjectDesign)</code> function to tell how many events we will have. This is used at different places, e.g. in the Default onset implementation</p><pre><code class="language-julia hljs"># note the trailling , to make it a Tuple
end;</code></pre><h4 id=")-size"><a class="docs-heading-anchor" href="#)-size">2) <code>size</code></a><a id=")-size-1"></a><a class="docs-heading-anchor-permalink" href="#)-size" title="Permalink"></a></h4><p>we need a <code>size(design::ImbalanceSubjectDesign)</code> function to tell how many events we will have. This is used at different places, e.g. in the Default onset implementation</p><pre><code class="language-julia hljs"># note the trailing , to make it a Tuple
size(design::ImbalanceSubjectDesign) = (design.nTrials,);</code></pre><h4 id=")-generate"><a class="docs-heading-anchor" href="#)-generate">3) <code>generate</code></a><a id=")-generate-1"></a><a class="docs-heading-anchor-permalink" href="#)-generate" title="Permalink"></a></h4><p>We need a type <code>generate(design::ImbalanceSubjectDesign)</code> function. This function should return the actual table as a <code>DataFrame</code></p><pre><code class="language-julia hljs">function generate(design::ImbalanceSubjectDesign)
nA = Int(round.(design.nTrials .* design.balance))
nB = Int(round.(design.nTrials .* (1-design.balance)))
@assert nA + nB ≈ design.nTrials
levels = vcat(repeat([&quot;levelA&quot;],nA),repeat([&quot;levelB&quot;],nB))
return DataFrame(Dict(:condition=&gt;levels))
end;</code></pre><p>Finally, we can test the function and see whether it returns a Design-DataFrame as we requested</p><pre><code class="language-julia hljs">design = ImbalanceSubjectDesign(;nTrials=6,balance=0.2)
generate(design)</code></pre><div><div style = "float: left;"><span>6×1 DataFrame</span></div><div style = "clear: both;"></div></div><div class = "data-frame" style = "overflow-x: scroll;"><table class = "data-frame" style = "margin-bottom: 6px;"><thead><tr class = "header"><th class = "rowNumber" style = "font-weight: bold; text-align: right;">Row</th><th style = "text-align: left;">condition</th></tr><tr class = "subheader headerLastRow"><th class = "rowNumber" style = "font-weight: bold; text-align: right;"></th><th title = "String" style = "text-align: left;">String</th></tr></thead><tbody><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">1</td><td style = "text-align: left;">levelA</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">2</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">3</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">4</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">5</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">6</td><td style = "text-align: left;">levelB</td></tr></tbody></table></div><div class="admonition is-category-important"><header class="admonition-header">Important</header><div class="admonition-body"><p>it is the users task to ensure that each run is reproducible. So if you have a random process (e.g. shuffling), be sure to safe a RNG object in your struct and use it in your generate function.</p></div></div><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../reference/basistypes/">« ComponentBasisTypes</a><a class="docs-footer-nextpage" href="../repeatTrials/">Repeating Trials within a Design »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Wednesday 15 November 2023 14:16">Wednesday 15 November 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
generate(design)</code></pre><div><div style = "float: left;"><span>6×1 DataFrame</span></div><div style = "clear: both;"></div></div><div class = "data-frame" style = "overflow-x: scroll;"><table class = "data-frame" style = "margin-bottom: 6px;"><thead><tr class = "header"><th class = "rowNumber" style = "font-weight: bold; text-align: right;">Row</th><th style = "text-align: left;">condition</th></tr><tr class = "subheader headerLastRow"><th class = "rowNumber" style = "font-weight: bold; text-align: right;"></th><th title = "String" style = "text-align: left;">String</th></tr></thead><tbody><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">1</td><td style = "text-align: left;">levelA</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">2</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">3</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">4</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">5</td><td style = "text-align: left;">levelB</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">6</td><td style = "text-align: left;">levelB</td></tr></tbody></table></div><div class="admonition is-warning"><header class="admonition-header">Important</header><div class="admonition-body"><p>It is the users task to ensure that each run is reproducible. So if you have a random process (e.g. shuffling), be sure to safe a RNG object in your struct and use it in your generate function.</p></div></div><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../reference/basistypes/">« ComponentBasisTypes</a><a class="docs-footer-nextpage" href="../repeatTrials/">Repeating Trials within a Design »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Monday 20 November 2023 19:48">Monday 20 November 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 8e3189c

Please sign in to comment.