Skip to content

Commit 96bb6fa

Browse files
committed
Add tutorial notebook renders
1 parent 64e7dc6 commit 96bb6fa

File tree

9 files changed

+90
-21
lines changed

9 files changed

+90
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ ENV/
102102

103103
# mkdocs documentation
104104
docs/site
105+
docs/src/tutorials/*ipynb
105106

106107
# mypy
107108
.mypy_cache/

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"imrotbl",
6969
"imshow",
7070
"inlinehilite",
71+
"ipynb",
7172
"ipywidgets",
7273
"kcoords",
7374
"Klusta",

docs/.docker/pip_requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ mdx-truly-sane-lists
77
mkdocs-gen-files
88
mkdocs-literate-nav
99
mkdocs-exclude-search
10-
mkdocs-markdownextradata-plugin
10+
mkdocs-markdownextradata-plugin
11+
mkdocs-jupyter

docs/docker-compose.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ services:
2828
- |
2929
git config --global --add safe.directory /main
3030
set -e
31+
export ELEMENT_UNDERSCORE=$$(echo $${PACKAGE} | sed 's/element_//g')
32+
export ELEMENT_HYPHEN=$$(echo $${ELEMENT_UNDERSCORE} | sed 's/_/-/g')
3133
export PATCH_VERSION=$$(cat /main/$${PACKAGE}/version.py | grep -oE '\d+\.\d+\.[a-z0-9]+')
34+
git clone https://github.com/datajoint/workflow-$${ELEMENT_HYPHEN}.git /main/delete || true
35+
if [ -d /main/delete/ ]; then
36+
mv /main/delete/workflow_$${ELEMENT_UNDERSCORE} /main/
37+
mv /main/delete/notebooks/*ipynb /main/docs/src/tutorials/
38+
rm -fR /main/delete
39+
fi
3240
if echo "$${MODE}" | grep -i live &>/dev/null; then
33-
mkdocs serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80
41+
mkdocs serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80 2>&1 | tee docs/temp_mkdocs.log
3442
elif echo "$${MODE}" | grep -iE "qa|push" &>/dev/null; then
3543
echo "INFO::Delete gh-pages branch"
3644
git branch -D gh-pages || true

docs/mkdocs.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@ repo_name: datajoint/element-array-ephys
77
nav:
88
- Element Array Ephys: index.md
99
- Concepts: concepts.md
10-
- Tutorials: tutorials.md
10+
- Tutorials:
11+
- Overview: tutorials/index.md
12+
- Data Download: tutorials/00-data-download-optional.ipynb
13+
- Configure: tutorials/01-configure.ipynb
14+
- Workflow Structure: tutorials/02-workflow-structure-optional.ipynb
15+
- Process: tutorials/03-process.ipynb
16+
- Automate: tutorials/04-automate-optional.ipynb
17+
- Explore: tutorials/05-explore.ipynb
18+
- Drop: tutorials/06-drop-optional.ipynb
19+
- Downstream Analysis: tutorials/07-downstream-analysis.ipynb
20+
- Visualizations: tutorials/10-data_visualization.ipynb
21+
- Electrode Localization: tutorials/08-electrode-localization.ipynb
22+
- NWB Export: tutorials/09-NWB-export.ipynb
1123
- Citation: citation.md
1224
- API: api/ # defer to gen-files + literate-nav
1325
- Changelog: changelog.md
@@ -92,6 +104,12 @@ plugins:
92104
# "index.md": "getting_started.md"
93105
- mkdocstrings:
94106
default_handler: python
107+
handlers:
108+
python:
109+
options:
110+
members_order: source
111+
group_by_category: false
112+
line_length: 88
95113
- gen-files:
96114
scripts:
97115
- ./src/api/make_pages.py
@@ -100,6 +118,8 @@ plugins:
100118
- exclude-search:
101119
exclude:
102120
- "*/navigation.md"
121+
- mkdocs-jupyter:
122+
ignore_h1_titles: True
103123
markdown_extensions:
104124
- attr_list
105125
- toc:
@@ -120,6 +140,7 @@ markdown_extensions:
120140
linenums: true
121141
- pymdownx.inlinehilite
122142
- pymdownx.snippets
143+
- footnotes
123144

124145
extra:
125146
PATCH_VERSION: !ENV PATCH_VERSION

docs/src/api/make_pages.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,10 @@
77
import mkdocs_gen_files
88
from pathlib import Path
99
import os
10-
import subprocess
1110

1211
package = os.getenv("PACKAGE")
1312

1413
element = package.split("_", 1)[1]
15-
if not Path(f"workflow_{element}").is_dir():
16-
try:
17-
subprocess.run(
18-
f"git clone https://github.com/datajoint/workflow-{element.replace('_','-')}.git /main/delete".split(
19-
" "
20-
),
21-
check=True,
22-
timeout=5,
23-
)
24-
os.system(f"mv /main/delete/workflow_{element} /main/")
25-
os.system("rm -fR /main/delete")
26-
except subprocess.CalledProcessError:
27-
pass # no repo found
2814

2915
nav = mkdocs_gen_files.Nav()
3016
for path in sorted(Path(package).glob("**/*.py")) + sorted(

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ developed to handle various use cases of this pipeline and workflow:
2626

2727
Visit the [Concepts page](./concepts.md) for more information about the use cases of
2828
`ephys` schemas and an explanation of the tables. To get started with building your own
29-
data pipeline, visit the [Tutorials page](./tutorials.md).
29+
data pipeline, visit the [Tutorials page](./tutorials/index.md).

docs/src/tutorials.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/src/tutorials/index.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Tutorials
2+
3+
## Installation
4+
5+
Installation of the Element requires an integrated development environment and database.
6+
Instructions to setup each of the components can be found on the
7+
[User Instructions](https://datajoint.com/docs/elements/user-guide/) page. These
8+
instructions use the example
9+
[workflow for Element Array Ephys](https://github.com/datajoint/workflow-array-ephys),
10+
which can be modified for a user's specific experimental requirements. This example
11+
workflow uses several Elements (Lab, Animal, Session, Event, and Electrophysiology) to construct
12+
a complete pipeline, and is able to ingest experimental metadata and run model training
13+
and inference.
14+
15+
### Videos
16+
17+
The [Element Array Ephys tutorial](https://youtu.be/KQlGYOBq7ow?t=3658) gives an
18+
overview of the workflow files and notebooks as well as core concepts related to
19+
Electrophysiology.
20+
21+
[![YouTube tutorial](https://img.youtube.com/vi/KQlGYOBq7ow/0.jpg)](https://youtu.be/KQlGYOBq7ow?t=3658)
22+
23+
### Notebooks
24+
25+
Each of the notebooks in the workflow
26+
([download here](https://github.com/datajoint/workflow-array-ephys/tree/main/notebooks)
27+
steps through ways to interact with the Element itself. For convenience, these notebooks
28+
are also rendered as part of this site. To try out the Elements notebooks in an online
29+
Jupyter environment with access to example data, visit
30+
[CodeBook](https://codebook.datajoint.io/). (Electrophysiology notebooks coming soon!)
31+
32+
- [Data Download](./00-data-download-optional.ipynb) highlights how to use DataJoint
33+
tools to download a sample model for trying out the Element.
34+
- [Configure](./01-configure.ipynb) helps configure your local DataJoint installation to
35+
point to the correct database.
36+
- [Workflow Structure](./02-workflow-structure-optional.ipynb) demonstrates the table
37+
architecture of the Element and key DataJoint basics for interacting with these
38+
tables.
39+
- [Process](./03-process.ipynb) steps through adding data to these tables and launching
40+
key Electrophysiology features, like model training.
41+
- [Automate](./04-automate-optional.ipynb) highlights the same steps as above, but
42+
utilizing all built-in automation tools.
43+
- [Explore](./05-explore.ipynb) demonstrates how to fetch data from the Element.
44+
- [Drop schemas](./06-drop-optional.ipynb) provides the steps for dropping all the
45+
tables to start fresh.
46+
- [Downstream Analysis](./07-downstream-analysis.ipynb) highlights how to link
47+
this Element to Element Event for event-based analyses.
48+
- [Visualizations](./10-data_visualization.ipynb) highlights how to use a built-in module
49+
for visualizing units, probes and quality metrics.
50+
- [Electrode Localization](./08-electrode-localization.ipynb) demonstrates how to link
51+
this Element to
52+
[Element Electrode Localization](https://datajoint.com/docs/elements/element-electrode-localization/).
53+
- [NWB Export](./09-NWB-export.ipynb) highlights the export functionality available for the
54+
`no-curation` schema.

0 commit comments

Comments
 (0)