Skip to content

Commit

Permalink
Fixed space/tabs in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Aug 14, 2019
1 parent 71a905c commit 9d2096b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
35 changes: 16 additions & 19 deletions html/hypno.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ <h1 class="title">Module <code>yasa.hypno</code></h1>
Parameters
----------
hypno : array_like
The sleep staging (hypnogram) 1D array.
The sleep staging (hypnogram) 1D array.
mapping_dict : dict
The mapping dictionnary. Note that this function is
essentially a wrapper around `pandas.Series.map`.
The mapping dictionnary. Note that this function is
essentially a wrapper around `pandas.Series.map`.

Returns
--------
hypno : array_like
The corresponding integer hypnogram.
The corresponding integer hypnogram.
&#34;&#34;&#34;
assert isinstance(hypno, (list, np.ndarray, pd.Series)), &#39;Not an array.&#39;
hypno = pd.Series(np.asarray(hypno, dtype=int))
Expand Down Expand Up @@ -265,7 +265,7 @@ <h1 class="title">Module <code>yasa.hypno</code></h1>
-------
hypno : array_like
The hypnogram, upsampled to ``sf_data`` and cropped/padded to
``data.size``.
``max(data.shape)``.
&#34;&#34;&#34;
if isinstance(data, mne.io.BaseRaw):
sf_data = data.info[&#39;sfreq&#39;]
Expand All @@ -291,19 +291,16 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<h2 id="parameters">Parameters</h2>
<dl>
<dt><strong><code>hypno</code></strong> :&ensp;<code>array_like</code></dt>
<dd>&nbsp;</dd>
<dt>The sleep staging (hypnogram) 1D array.</dt>
<dd>The sleep staging (hypnogram) 1D array.</dd>
<dt><strong><code>mapping_dict</code></strong> :&ensp;<code>dict</code></dt>
<dd>&nbsp;</dd>
<dd>The mapping dictionnary. Note that this function is
essentially a wrapper around <code>pandas.Series.map</code>.</dd>
</dl>
<p>The mapping dictionnary. Note that this function is
essentially a wrapper around <code>pandas.Series.map</code>.</p>
<h2 id="returns">Returns</h2>
<dl>
<dt><strong><code>hypno</code></strong> :&ensp;<code>array_like</code></dt>
<dd>&nbsp;</dd>
</dl>
<p>The corresponding integer hypnogram.</p></section>
<dd>The corresponding integer hypnogram.</dd>
</dl></section>
<details class="source">
<summary>Source code</summary>
<pre><code class="python">def hypno_int_to_str(hypno, mapping_dict={0: &#39;W&#39;, 1: &#39;N1&#39;, 2: &#39;N2&#39;, 3: &#39;N3&#39;,
Expand All @@ -315,15 +312,15 @@ <h2 id="returns">Returns</h2>
Parameters
----------
hypno : array_like
The sleep staging (hypnogram) 1D array.
The sleep staging (hypnogram) 1D array.
mapping_dict : dict
The mapping dictionnary. Note that this function is
essentially a wrapper around `pandas.Series.map`.
The mapping dictionnary. Note that this function is
essentially a wrapper around `pandas.Series.map`.

Returns
--------
hypno : array_like
The corresponding integer hypnogram.
The corresponding integer hypnogram.
&#34;&#34;&#34;
assert isinstance(hypno, (list, np.ndarray, pd.Series)), &#39;Not an array.&#39;
hypno = pd.Series(np.asarray(hypno, dtype=int))
Expand Down Expand Up @@ -403,7 +400,7 @@ <h2 id="returns">Returns</h2>
<dl>
<dt><strong><code>hypno</code></strong> :&ensp;<code>array_like</code></dt>
<dd>The hypnogram, upsampled to <code>sf_data</code> and cropped/padded to
<code>data.size</code>.</dd>
<code>max(data.shape)</code>.</dd>
</dl></section>
<details class="source">
<summary>Source code</summary>
Expand Down Expand Up @@ -431,7 +428,7 @@ <h2 id="returns">Returns</h2>
-------
hypno : array_like
The hypnogram, upsampled to ``sf_data`` and cropped/padded to
``data.size``.
``max(data.shape)``.
&#34;&#34;&#34;
if isinstance(data, mne.io.BaseRaw):
sf_data = data.info[&#39;sfreq&#39;]
Expand Down
10 changes: 5 additions & 5 deletions yasa/hypno.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ def hypno_int_to_str(hypno, mapping_dict={0: 'W', 1: 'N1', 2: 'N2', 3: 'N3',
Parameters
----------
hypno : array_like
The sleep staging (hypnogram) 1D array.
The sleep staging (hypnogram) 1D array.
mapping_dict : dict
The mapping dictionnary. Note that this function is
essentially a wrapper around `pandas.Series.map`.
The mapping dictionnary. Note that this function is
essentially a wrapper around `pandas.Series.map`.
Returns
--------
hypno : array_like
The corresponding integer hypnogram.
The corresponding integer hypnogram.
"""
assert isinstance(hypno, (list, np.ndarray, pd.Series)), 'Not an array.'
hypno = pd.Series(np.asarray(hypno, dtype=int))
Expand Down Expand Up @@ -202,7 +202,7 @@ def hypno_upsample_to_data(hypno, sf_hypno, data, sf_data=None):
-------
hypno : array_like
The hypnogram, upsampled to ``sf_data`` and cropped/padded to
``data.size``.
``max(data.shape)``.
"""
if isinstance(data, mne.io.BaseRaw):
sf_data = data.info['sfreq']
Expand Down

0 comments on commit 9d2096b

Please sign in to comment.