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

Sphinx gallery #4

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e .[doc]
pip install pymatreader

- name: Build documentation
run: |
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,7 @@ dmypy.json
my_project_ll_config.yaml

# VSCode ignore
.vscode
.vscode

# sphinx gallery
docs/auto_examples/
8 changes: 8 additions & 0 deletions docs/API/io.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
File IO
=======

eog-learn provides some helper functions for reading data from open-access
EEG-eyetracking datasets.

.. automodule:: eoglearn.io.eegeyenet
:members:
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx_design",
"sphinx_gallery.gen_gallery",
"sphinxemoji.sphinxemoji",
]

Expand Down Expand Up @@ -83,3 +84,9 @@
"dtype",
"object",
}

# Sphinx Gallery configuration ------------------------------------------------
sphinx_gallery_conf = {
"examples_dirs": "../examples", # path to tutorial python scripts
"gallery_dirs": "auto_examples", # path to where to save gallery generated output
}
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Please see the contributing section or the Roadmap for details on how to get inv
installation
implementation
API/API_index
auto_examples/index.rst
contributing
5 changes: 5 additions & 0 deletions examples/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eog-learn Tutorials
===================

Here we list some (work in progress!) tutorials for using eog-learn with eeg-eyetracking
data. Mainly these will cover loading eeg-eyetracking data and training the model.
19 changes: 19 additions & 0 deletions examples/plot_eegeyenet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""

Load an example file from EEGEyeNet
===================================

This example shows how to load an example file from EEGEyeNet, an open-access
dataset of EEG and eyetracking data. We'll load one file from the "dots" task,
which presents a subject with a series of dots at fixed locations on the screen.
"""

# %%
# Import the necessary packages
from eoglearn.datasets import fetch_eegeyenet
from eoglearn.io import read_raw_eegeyenet

fpath = fetch_eegeyenet()
fname = fpath / "EP10_DOTS1_EEG.mat"
raw = read_raw_eegeyenet(fname)
raw.plot()
Loading