Skip to content

Commit d42a230

Browse files
Merge pull request #1014 from DerAndereJohannes/fix-documentation-error-warnings
[Fix] All docs-build warnings and errors
2 parents b3b76ea + a235631 commit d42a230

File tree

15 files changed

+126
-106
lines changed

15 files changed

+126
-106
lines changed

.github/workflows/docs-check.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
pip install EMD-signal
3939
pip install cvxopt
4040
pip install ts2vg
41+
pip install pickleshare
4142
pip install https://github.com/neuropsychology/neurokit/zipball/dev
4243
4344
- name: Build documentation 📜

AUTHORS.rst

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Contributors
5252
* `Jannik Gut <https://github.com/rostro36>`_
5353
* `Nattapong Thammasan <https://github.com/Nattapong-OnePlanet>`_ *(OnePlanet, Netherlands)*
5454
* `Marek Sokol <https://github.com/sokolmarek>`_ *(Faculty of Biomedical Engineering of the CTU in Prague, Czech Republic)*
55+
* `Johannes Herforth <https://github.com/DerAndereJohannes>`_ *(University of Luxembourg, Luxembourg)*
5556

5657

5758
Thanks also to `Chuan-Peng Hu <https://github.com/hcp4715>`_, `@ucohen <https://github.com/ucohen>`_, `Anthony Gatti <https://github.com/gattia>`_, `Julien Lamour <https://github.com/lamourj>`_, `@renatosc <https://github.com/renatosc>`_, `Nicolas Beaudoin-Gagnon <https://github.com/Fegalf>`_ and `@rubinovitz <https://github.com/rubinovitz>`_ for their contribution in `NeuroKit 1 <https://github.com/neuropsychology/NeuroKit.py>`_.

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def find_version():
131131
"use_issues_button": True,
132132
"path_to_docs": "docs/",
133133
"use_edit_page_button": True,
134-
"logo_only": True,
134+
# "logo_only": True,
135135
"show_toc_level": 1,
136136
"navigation_with_keys": False,
137137
}
@@ -140,4 +140,4 @@ def find_version():
140140
# Add any paths that contain custom static files (such as style sheets) here,
141141
# relative to this directory. They are copied after the builtin static files,
142142
# so a file named "default.css" will overwrite the builtin "default.css".
143-
html_static_path = ["_static"]
143+
# html_static_path = ["_static"]

docs/examples/eeg_microstates/eeg_microstates.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@
589589
"cell_type": "markdown",
590590
"metadata": {},
591591
"source": [
592-
"Several different clustering algorithms can be used to segment your EEG recordings into microstates. These algorithms mainly differ in how they define cluster membership and the cost functionals to be optimized ([Xu & Tian, 2015](10.1007/s40745-015-0040-1)). The method to use hence depends on your data and the underlying assumptions of the methods (e.g., some methods ignore polarity). There is no one true method that gives the best results but you can refer to [Poulsen et al., 2018](https://www.researchgate.net/publication/331367421_Microstate_EEGlab_toolbox_An_introductory_guide#pf6) if you would like a more detailed review of the different clustering methods."
592+
"Several different clustering algorithms can be used to segment your EEG recordings into microstates. These algorithms mainly differ in how they define cluster membership and the cost functionals to be optimized ([Xu & Tian, 2015](https://doi.org/10.1007/s40745-015-0040-1)). The method to use hence depends on your data and the underlying assumptions of the methods (e.g., some methods ignore polarity). There is no one true method that gives the best results but you can refer to [Poulsen et al., 2018](https://www.researchgate.net/publication/331367421_Microstate_EEGlab_toolbox_An_introductory_guide#pf6) if you would like a more detailed review of the different clustering methods."
593593
]
594594
},
595595
{

docs/make.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ REM Command file for Sphinx documentation
77
@REM SPHINXBUILD="D:\Python3\Scripts\sphinx-build.exe"
88

99
if "%SPHINXBUILD%" == "" (
10-
set SPHINXBUILD==python -m sphinx
10+
set SPHINXBUILD=python -m sphinx
1111
)
1212
set SOURCEDIR="."
1313
set BUILDDIR="_build"
@@ -34,4 +34,4 @@ goto end
3434
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3535

3636
:end
37-
popd
37+
popd

neurokit2/eda/eda_intervalrelated.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def eda_intervalrelated(data, sampling_rate=1000, **kwargs):
1717
1818
Parameters
1919
----------
20+
2021
data : Union[dict, pd.DataFrame]
2122
A DataFrame containing the different processed signal(s) as different columns, typically
2223
generated by :func:`eda_process` or :func:`bio_process`. Can also take a dict containing
@@ -31,6 +32,7 @@ def eda_intervalrelated(data, sampling_rate=1000, **kwargs):
3132
DataFrame
3233
A dataframe containing the analyzed EDA features. The analyzed
3334
features consist of the following:
35+
3436
* ``"SCR_Peaks_N"``: the number of occurrences of Skin Conductance Response (SCR).
3537
* ``"SCR_Peaks_Amplitude_Mean"``: the mean amplitude of the SCR peak occurrences.
3638
* ``"EDA_Tonic_SD"``: the mean amplitude of the SCR peak occurrences.
@@ -44,22 +46,22 @@ def eda_intervalrelated(data, sampling_rate=1000, **kwargs):
4446
.bio_process, eda_eventrelated
4547
4648
Examples
47-
----------
49+
--------
4850
.. ipython:: python
4951
50-
import neurokit2 as nk
52+
import neurokit2 as nk
5153
52-
# Download data
53-
data = nk.data("bio_resting_8min_100hz")
54+
# Download data
55+
data = nk.data("bio_resting_8min_100hz")
5456
55-
# Process the data
56-
df, info = nk.eda_process(data["EDA"], sampling_rate=100)
57+
# Process the data
58+
df, info = nk.eda_process(data["EDA"], sampling_rate=100)
5759
58-
# Single dataframe is passed
59-
nk.eda_intervalrelated(df, sampling_rate=100)
60+
# Single dataframe is passed
61+
nk.eda_intervalrelated(df, sampling_rate=100)
6062
61-
epochs = nk.epochs_create(df, events=[0, 25300], sampling_rate=100, epochs_end=20)
62-
nk.eda_intervalrelated(epochs, sampling_rate=100)
63+
epochs = nk.epochs_create(df, events=[0, 25300], sampling_rate=100, epochs_end=20)
64+
nk.eda_intervalrelated(epochs, sampling_rate=100)
6365
6466
"""
6567

neurokit2/eeg/mne_to_df.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,26 @@ def mne_to_dict(eeg):
8383
8484
# Raw objects
8585
eeg = nk.mne_data("filt-0-40_raw")
86-
nk.mne_to_dict(eeg)
86+
eeg_dict = nk.mne_to_dict(eeg)
87+
88+
# Print function result summary
89+
eeg_dict_view = {k: f"Signal with length: {len(v)}" for k, v in eeg_dict.items()}
90+
eeg_dict_view
91+
8792
8893
# Epochs objects
8994
eeg = nk.mne_data("epochs")
90-
nk.mne_to_dict(eeg)
95+
eeg_epoch_dict = nk.mne_to_dict(eeg)
96+
97+
# Print function result summary
98+
list(eeg_epoch_dict.items())[:2]
9199
92100
# Evoked objects
93101
eeg = nk.mne_data("evoked")
94-
nk.mne_to_dict(eeg)
102+
eeg_evoked_dict = nk.mne_to_dict(eeg)
103+
104+
# Print function result summary
105+
eeg_evoked_dict
95106
96107
"""
97108
return _mne_convert(eeg, to_what="dict")

neurokit2/events/events_find.py

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def events_find(
137137
Convert the event condition results its human readable representation
138138
139139
.. ipython:: python
140+
140141
value_to_condition = {1: "Stimulus 1", 2: "Stimulus 2", 3: "Stimulus 3"}
141142
events["condition"] = [value_to_condition[id] for id in events["condition"]]
142143
events

neurokit2/misc/progress_bar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def progress_bar(it, prefix="", size=40, verbose=True):
1919
2020
Examples
2121
--------
22-
..ipython:: python
22+
.. ipython:: python
2323
2424
import neurokit2 as nk
2525

neurokit2/rsp/rsp_process.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def rsp_process(
6868
* ``"RSP_Phase"``: breathing phase, marked by "1" for inspiration and "0" for expiration.
6969
* ``"RSP_Phase_Completion"``: breathing phase completion, expressed in percentage (from 0 to
7070
1), representing the stage of the current respiratory phase.
71-
* ``"RSP_RVT"``: respiratory volume per time (RVT).
71+
* ``"RSP_RVT"``: respiratory volume per time (RVT).
72+
7273
info : dict
7374
A dictionary containing the samples at which inhalation peaks and exhalation troughs occur,
7475
accessible with the keys ``"RSP_Peaks"``, and ``"RSP_Troughs"`` respectively, as well as the

neurokit2/signal/signal_detrend.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ def signal_detrend(
1818
sampling_rate=1000,
1919
):
2020
"""**Signal Detrending**
21+
2122
Apply a baseline (order = 0), linear (order = 1), or polynomial (order > 1) detrending to the
2223
signal (i.e., removing a general trend). One can also use other methods, such as smoothness
2324
priors approach described by Tarvainen (2002) or LOESS regression, but these scale badly for
2425
long signals.
26+
2527
Parameters
2628
----------
2729
signal : Union[list, np.array, pd.Series]

neurokit2/signal/signal_interpolate.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ def signal_interpolate(
3232
method : str
3333
Method of interpolation. Can be ``"linear"``, ``"nearest"``, ``"zero"``, ``"slinear"``,
3434
``"quadratic"``, ``"cubic"``, ``"previous"``, ``"next"``, ``"monotone_cubic"``, or ``"akima"``.
35-
The methods ``"zero"``, ``"slinear"``,``"quadratic"`` and ``"cubic"`` refer to a spline
35+
The methods ``"zero"``, ``"slinear"``, ``"quadratic"`` and ``"cubic"`` refer to a spline
3636
interpolation of zeroth, first, second or third order; whereas ``"previous"`` and
3737
``"next"`` simply return the previous or next value of the point. An integer specifying the
3838
order of the spline interpolator to use.
39-
See `here <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
39+
See `monotone cubic method <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
4040
PchipInterpolator.html>`_ for details on the ``"monotone_cubic"`` method.
41-
See `here <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
41+
See `akima method <https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.
4242
Akima1DInterpolator.html>`_ for details on the ``"akima"`` method.
4343
fill_value : float or tuple or str
4444
If a ndarray (or float), this value will be used to fill in for
@@ -87,6 +87,7 @@ def signal_interpolate(
8787
plt.scatter(x_values, signal, label="original datapoints", zorder=3)
8888
@suppress
8989
plt.close()
90+
9091
"""
9192
# Sanity checks
9293
if x_values is None:

studies/complexity_eeg/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ data_delay <- read.csv("data_delay.csv") |>
7171
# facet_wrap(~Metric, scales = "free_y")
7272
```
7373

74-
#### Per Channel
74+
#### Per Channel Delay Optimization
7575

7676
``` r
7777
delay_perchannel <- function(data_delay, dataset="Lemon") {
@@ -247,7 +247,7 @@ data_dim <- read.csv("data_dimension.csv") |>
247247
Area = fct_relevel(Area, c("F", "C", "T", "P", "O")))
248248
```
249249

250-
#### Per Channel
250+
#### Per Channel Dimension Optimization
251251

252252
``` r
253253
dim_perchannel <- function(data_dim, dataset="Lemon") {

0 commit comments

Comments
 (0)