Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Commit d4be911

Browse files
authored
Merge pull request #76 from CBroz1/main
Fixes for codebook deployment
2 parents 374b016 + ade56a9 commit d4be911

25 files changed

+307
-3876
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
44
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
55

6+
## [0.2.1] - 2022-07-22
7+
+ Add - Mention CodeBook data directory in notebooks
8+
+ Update - Remove directory assertion in notebooks for CodeBook deployment
9+
+ Update - Move all export functions from `pipeline` to `export` script
10+
611
## [0.2.0] - 2022-07-08
712

813
+ Add - Adopt black formatting into code base

notebooks/00-data-download-optional.ipynb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"source": [
77
"# Download example data\n",
88
"\n",
9-
"This workflow will need Ephys data collected from either SpikeGLX or OpenEphys and the output from kilosort2. We provided an example dataset to be downloaded to run through the pipeline. This notebook walks you through the process to download the dataset."
9+
"This workflow will need Ephys data collected from either SpikeGLX or OpenEphys and the output from kilosort2. We provided an example dataset to be downloaded to run through the pipeline. This notebook walks you through the process to download the dataset.\n",
10+
"\n",
11+
"[CodeBook](codebook.datajoint.io) users can skip this step."
1012
]
1113
},
1214
{
@@ -173,7 +175,7 @@
173175
"formats": "ipynb,py"
174176
},
175177
"kernelspec": {
176-
"display_name": "Python 3.10.4 64-bit ('python3p10')",
178+
"display_name": "Python 3.9.12 ('ele')",
177179
"language": "python",
178180
"name": "python3"
179181
},
@@ -187,11 +189,11 @@
187189
"name": "python",
188190
"nbconvert_exporter": "python",
189191
"pygments_lexer": "ipython3",
190-
"version": "3.10.4"
192+
"version": "3.9.12"
191193
},
192194
"vscode": {
193195
"interpreter": {
194-
"hash": "ff52d424e56dd643d8b2ec122f40a2e279e94970100b4e6430cb9025a65ba4cf"
196+
"hash": "61456c693db5d9aa6731701ec9a9b08ab88a172bee0780139a3679beb166da16"
195197
}
196198
}
197199
},

notebooks/01-configure.ipynb

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@
3535
"outputs": [],
3636
"source": [
3737
"# change to the upper level folder\n",
38-
"if os.path.basename(os.getcwd()) == \"notebooks\":\n",
39-
" os.chdir(\"..\")\n",
40-
"assert os.path.basename(os.getcwd()) == \"workflow-array-ephys\", (\n",
41-
" \"Please move to the \" + \"workflow directory\"\n",
42-
")\n",
38+
"if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")\n",
4339
"import datajoint as dj"
4440
]
4541
},
@@ -55,20 +51,11 @@
5551
{
5652
"cell_type": "code",
5753
"execution_count": null,
58-
"id": "6820ef4c",
5954
"metadata": {},
6055
"outputs": [],
6156
"source": [
62-
"import getpass"
63-
]
64-
},
65-
{
66-
"cell_type": "code",
67-
"execution_count": null,
68-
"metadata": {},
69-
"outputs": [],
70-
"source": [
71-
"dj.config[\"database.host\"] = \"{YOUR_HOST}\"\n",
57+
"import getpass\n",
58+
"dj.config[\"database.host\"] = \"{YOUR_HOST}\" # CodeBook users should omit this\n",
7259
"dj.config[\"database.user\"] = \"{YOUR_USERNAME}\"\n",
7360
"dj.config[\"database.password\"] = getpass.getpass() # enter the password securily"
7461
]
@@ -106,7 +93,7 @@
10693
"\n",
10794
"Giving a prefix to schema could help on the configuration of privilege settings. For example, if we set prefix `neuro_`, every schema created with the current workflow will start with `neuro_`, e.g. `neuro_lab`, `neuro_subject`, `neuro_ephys` etc.\n",
10895
"\n",
109-
"The prefix could be configurated as follows in `dj.config`:"
96+
"The prefix could be configurated in `dj.config` as follows. CodeBook users should keep their username as the prefix for schema for declaration permissions."
11097
]
11198
},
11299
{
@@ -115,7 +102,8 @@
115102
"metadata": {},
116103
"outputs": [],
117104
"source": [
118-
"dj.config[\"custom\"] = {\"database.prefix\": \"neuro_\"}"
105+
"username_as_prefix = dj.config[\"database.user\"] + \"_\"\n",
106+
"dj.config[\"custom\"] = {\"database.prefix\": username_as_prefix}"
119107
]
120108
},
121109
{
@@ -130,10 +118,10 @@
130118
"\n",
131119
"The root path typically **do not** contain information of subjects or sessions, all data from subjects/sessions should be subdirectories in the root path.\n",
132120
"\n",
133-
"In the example dataset downloaded with [these instructions](00-data-download-optional.ipynb), `/tmp/test_data` will be the root\n",
121+
"- In the example dataset downloaded with [these instructions](00-data-download-optional.ipynb), `/tmp/test_data` will be the root. \n",
122+
"- For CodeBook users, the root is `/home/inbox/`\n",
134123
"\n",
135124
"```\n",
136-
"/tmp/test_data/\n",
137125
"- subject6\n",
138126
" - session1\n",
139127
" - towersTask_g0_imec0\n",
@@ -151,7 +139,7 @@
151139
"# If there is only one root path.\n",
152140
"dj.config[\"custom\"][\"ephys_root_data_dir\"] = \"/tmp/test_data\"\n",
153141
"# If there are multiple possible root paths:\n",
154-
"dj.config[\"custom\"][\"ephys_root_data_dir\"] = [\"/tmp/test_data1\", \"/tmp/test_data2\"]"
142+
"dj.config[\"custom\"][\"ephys_root_data_dir\"] = [\"/tmp/test_data\", \"/home/inbox/\"]"
155143
]
156144
},
157145
{
@@ -164,20 +152,13 @@
164152
]
165153
},
166154
{
167-
"cell_type": "code",
168-
"execution_count": null,
155+
"cell_type": "markdown",
169156
"id": "f7733450",
170157
"metadata": {},
171-
"outputs": [],
172158
"source": [
173-
"[markdown]\n",
174-
"# + In the database, every path for the ephys raw data is **relative to root path(s)**. The benefit is that the absolute path could be configured for each machine, and when data transfer happens, we just need to change the root directory in the config file.\n",
175-
"#\n",
176-
"# + The workflow supports **multiple root directories**. If there are multiple possible root directories, specify the `ephys_root_data_dir` as a list.\n",
177-
"#\n",
178-
"# + The root path(s) are **specific to each machine**, as the name of mounted drive could be different for different operating systems or machines.\n",
179-
"#\n",
180-
"# + In the context of the workflow, all the paths saved into the database or saved in the config file need to be in the **POSIX standards** (Unix/Linux), with `/`. The path conversion for machines of any operating system is taken care of inside the elements."
159+
"+ In the database, every path for the ephys raw data is **relative to root path(s)** to allow for the absolute path to be configured for **each machine**. When transferring data, we just need to change the root directory in the config file.\n",
160+
"\n",
161+
"+ DataJoint Elements use `pathlib.Path()` to maintain path information in **POSIX standards** (Unix/Linux), with `/`. The path conversion for machines of any operating system is taken care of inside the elements."
181162
]
182163
},
183164
{
@@ -269,7 +250,7 @@
269250
"formats": "ipynb,py_scripts//py"
270251
},
271252
"kernelspec": {
272-
"display_name": "Python 3.10.4 64-bit ('python3p10')",
253+
"display_name": "Python 3.9.12 ('ele')",
273254
"language": "python",
274255
"name": "python3"
275256
},
@@ -283,11 +264,11 @@
283264
"name": "python",
284265
"nbconvert_exporter": "python",
285266
"pygments_lexer": "ipython3",
286-
"version": "3.10.4"
267+
"version": "3.9.12"
287268
},
288269
"vscode": {
289270
"interpreter": {
290-
"hash": "ff52d424e56dd643d8b2ec122f40a2e279e94970100b4e6430cb9025a65ba4cf"
271+
"hash": "61456c693db5d9aa6731701ec9a9b08ab88a172bee0780139a3679beb166da16"
291272
}
292273
}
293274
},

notebooks/02-workflow-structure-optional.ipynb

Lines changed: 102 additions & 2699 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)