Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fantomg committed Sep 21, 2024
1 parent 228e952 commit a163c32
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 48 deletions.
Binary file modified docs/build/doctrees/eegunity.module_eeg_batch.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
101 changes: 71 additions & 30 deletions docs/build/html/_modules/eegunity/module_eeg_batch/eeg_batch.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ <h1>Source code for eegunity.module_eeg_parser.eeg_parser</h1><div class="highli
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;The provided &#39;datasets&#39; path is not a valid directory.&quot;</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_process_directory</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">datasets_path</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">_process_directory</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">datasets_path</span><span class="p">,</span> <span class="n">use_relative_path</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="n">files_info</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">datasets_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">datasets_path</span><span class="p">)</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">use_relative_path</span> <span class="k">else</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">relpath</span><span class="p">(</span><span class="n">datasets_path</span><span class="p">)</span>

<span class="k">for</span> <span class="n">filepath</span> <span class="ow">in</span> <span class="n">glob</span><span class="o">.</span><span class="n">glob</span><span class="p">(</span><span class="n">datasets_path</span> <span class="o">+</span> <span class="s1">&#39;/**/*&#39;</span><span class="p">,</span> <span class="n">recursive</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isfile</span><span class="p">(</span><span class="n">filepath</span><span class="p">):</span>
<span class="n">files_info</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">filepath</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_shared_attr</span><span class="p">()[</span><span class="s1">&#39;domain_tag&#39;</span><span class="p">],</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">])</span>
Expand Down
1 change: 1 addition & 0 deletions docs/build/html/eegunity.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ <h2>Subpackages<a class="headerlink" href="#subpackages" title="Link to this hea
<li class="toctree-l4"><a class="reference internal" href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.infer_units"><code class="docutils literal notranslate"><span class="pre">EEGBatch.infer_units()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.normalize"><code class="docutils literal notranslate"><span class="pre">EEGBatch.normalize()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.process_mean_std"><code class="docutils literal notranslate"><span class="pre">EEGBatch.process_mean_std()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.replace_paths"><code class="docutils literal notranslate"><span class="pre">EEGBatch.replace_paths()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.resample"><code class="docutils literal notranslate"><span class="pre">EEGBatch.resample()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.sample_filter"><code class="docutils literal notranslate"><span class="pre">EEGBatch.sample_filter()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.save_as_other"><code class="docutils literal notranslate"><span class="pre">EEGBatch.save_as_other()</span></code></a></li>
Expand Down
46 changes: 31 additions & 15 deletions docs/build/html/eegunity.module_eeg_batch.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,16 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi

<dl class="py method">
<dt class="sig sig-object py" id="eegunity.module_eeg_batch.eeg_batch.EEGBatch.epoch_by_event">
<span class="sig-name descname"><span class="pre">epoch_by_event</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seg_sec</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">resample</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude_bad</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">baseline</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">(0,</span> <span class="pre">0.2)</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">miss_bad_data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/eegunity/module_eeg_batch/eeg_batch.html#EEGBatch.epoch_by_event"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#eegunity.module_eeg_batch.eeg_batch.EEGBatch.epoch_by_event" title="Link to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">epoch_by_event</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">resample</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exclude_bad</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">miss_bad_data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">epoch_params</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/eegunity/module_eeg_batch/eeg_batch.html#EEGBatch.epoch_by_event"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#eegunity.module_eeg_batch.eeg_batch.EEGBatch.epoch_by_event" title="Link to this definition"></a></dt>
<dd><p>Batch process EEG data to create epochs based on events specified in event_id column.</p>
<p>Parameters:
df (pd.DataFrame): DataFrame containing paths to raw EEG data and event_id information.
output_path (str): Directory to save the processed epochs.
seg_sec (float): Length of each epoch in seconds.
resample (int): Resample rate for the raw data. If None, no resampling is performed.
overlap (float): Fraction of overlap between consecutive epochs. Range is 0 to 1.
exclude_bad (bool): Whether to exclude bad epochs. Uses simple heuristics to determine bad epochs.
baseline (tuple): Time interval to use for baseline correction. If (None, 0), uses the pre-stimulus interval.
miss_bad_data (bool): Whether to skip files with processing errors.</p>
miss_bad_data (bool): Whether to skip files with processing errors.
<a href="#id1"><span class="problematic" id="id2">**</span></a>epoch_params: Additional parameters for mne.Epochs, excluding raw_data, events, event_id.</p>
<p>Returns:
None</p>
</dd></dl>
Expand Down Expand Up @@ -234,6 +233,16 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
<span class="sig-name descname"><span class="pre">process_mean_std</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">domain_mean</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/eegunity/module_eeg_batch/eeg_batch.html#EEGBatch.process_mean_std"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#eegunity.module_eeg_batch.eeg_batch.EEGBatch.process_mean_std" title="Link to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="eegunity.module_eeg_batch.eeg_batch.EEGBatch.replace_paths">
<span class="sig-name descname"><span class="pre">replace_paths</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">old_prefix</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">new_prefix</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/eegunity/module_eeg_batch/eeg_batch.html#EEGBatch.replace_paths"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#eegunity.module_eeg_batch.eeg_batch.EEGBatch.replace_paths" title="Link to this definition"></a></dt>
<dd><p>Replace the prefix of file paths in the dataset according to the provided mapping.</p>
<p>Parameters:
- path_mapping (dict): A dictionary where the keys are the old path prefixes and the values are the new prefixes.</p>
<p>Returns:
- A new instance with updated file paths.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="eegunity.module_eeg_batch.eeg_batch.EEGBatch.resample">
<span class="sig-name descname"><span class="pre">resample</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">output_path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">new_sfreq</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">miss_bad_data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/eegunity/module_eeg_batch/eeg_batch.html#EEGBatch.resample"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#eegunity.module_eeg_batch.eeg_batch.EEGBatch.resample" title="Link to this definition"></a></dt>
Expand All @@ -249,21 +258,28 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
<dt class="sig sig-object py" id="eegunity.module_eeg_batch.eeg_batch.EEGBatch.sample_filter">
<span class="sig-name descname"><span class="pre">sample_filter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">channel_number</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sampling_rate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">duration</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">completeness_check</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domain_tag</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/eegunity/module_eeg_batch/eeg_batch.html#EEGBatch.sample_filter"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#eegunity.module_eeg_batch.eeg_batch.EEGBatch.sample_filter" title="Link to this definition"></a></dt>
<dd><p>Filters the ‘locator’ dataframe based on the given criteria.</p>
<p>Parameters:
channel_number (tuple/list/array-like, optional): A tuple or list with (min, max) values to filter the</p>
<blockquote>
<div><p>“Number of Channels” column. If None, this criterion is ignored. Default is None.</p>
</div></blockquote>
<dl class="simple">
<dt>sampling_rate (tuple/list/array-like, optional): A tuple or list with (min, max) values to filter the</dt><dd><p>“Sampling Rate” column. If None, this criterion is ignored. Default is None.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>channel_number</strong> (<em>(</em><em>tuple/list/array-like</em><em>, </em><em>optional</em><em>)</em>) – A tuple or list with (min, max) values to filter the
“Number of Channels” column. If None, this criterion is ignored. Default is None.</p>
</dd>
<dt>duration (tuple/list/array-like, optional): A tuple or list with (min, max) values to filter the</dt><dd><p>“Duration” column. If None, this criterion is ignored. Default is None.</p>
</dl>
<dl class="simple">
<dt>:param (tuple/list/array-like, optional) sampling_rate<span class="classifier">A tuple or list with (min, max) values to filter the</span></dt><dd><p>“Sampling Rate” column. If None, this criterion is ignored. Default is None.</p>
</dd>
<dt>completeness_check (str, optional): A string that can be ‘Completed’, ‘Unavailable’, or ‘Acceptable’ to filter the</dt><dd><p>“Completeness Check” column. The check is case-insensitive. If None, this criterion is ignored. Default is None.</p>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>duration</strong> (<em>(</em><em>tuple/list/array-like</em><em>, </em><em>optional</em><em>)</em>) – A tuple or list with (min, max) values to filter the
“Duration” column. If None, this criterion is ignored. Default is None.</p></li>
<li><p><strong>completeness_check</strong> (<em>(</em><em>str</em><em>, </em><em>optional</em><em>)</em>) – A string that can be ‘Completed’, ‘Unavailable’, or ‘Acceptable’ to filter the
“Completeness Check” column. The check is case-insensitive. If None, this criterion is ignored. Default is None.</p></li>
<li><p><strong>domain_tag</strong> (<em>(</em><em>str</em><em>, </em><em>optional</em><em>)</em>) – A string to filter the “Domain Tag” column. If None, this criterion is ignored. Default is None.</p></li>
<li><p><strong>file_type</strong> (<em>(</em><em>str</em><em>, </em><em>optional</em><em>)</em>) – A string to filter the “File Type” column. If None, this criterion is ignored. Default is None.</p></li>
</ul>
</dd>
</dl>
<p>domain_tag (str, optional): A string to filter the “Domain Tag” column. If None, this criterion is ignored. Default is None.
file_type (str, optional): A string to filter the “File Type” column. If None, this criterion is ignored. Default is None.</p>
<p>Returns:
None. The function updates the ‘locator’ dataframe in the shared attributes.</p>
</dd></dl>
Expand Down
4 changes: 3 additions & 1 deletion docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,12 @@ <h2 id="P">P</h2>
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="eegunity.module_eeg_correction.html#eegunity.module_eeg_correction.eeg_correction.EEGCorrection.report">report() (eegunity.module_eeg_correction.eeg_correction.EEGCorrection method)</a>
<li><a href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.replace_paths">replace_paths() (eegunity.module_eeg_batch.eeg_batch.EEGBatch method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="eegunity.module_eeg_correction.html#eegunity.module_eeg_correction.eeg_correction.EEGCorrection.report">report() (eegunity.module_eeg_correction.eeg_correction.EEGCorrection method)</a>
</li>
<li><a href="eegunity.module_eeg_batch.html#eegunity.module_eeg_batch.eeg_batch.EEGBatch.resample">resample() (eegunity.module_eeg_batch.eeg_batch.EEGBatch method)</a>
</li>
</ul></td>
Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

0 comments on commit a163c32

Please sign in to comment.