|
11 | 11 | "\n",
|
12 | 12 | "## Setup - Working Directory\n",
|
13 | 13 | "\n",
|
14 |
| - "To run the array ephys workflow, we need to properly set up the DataJoint configuration. The configuration will be saved in a file called `dj_local_conf.json` on each machine and this notebook walks you through the process.\n", |
| 14 | + "To run the array ephys workflow, we need to properly set up the DataJoint configuration. The configuration can be saved in a local directory as `dj_local_conf.json` or at your root directory as a hidden file. This notebook walks you through the setup process.\n", |
15 | 15 | "\n",
|
16 |
| - "**The configuration only needs to be set up once**, if you have gone through the configuration before, directly go to [02-workflow-structure](02-workflow-structure-optional.ipynb).\n", |
17 |
| - "\n", |
18 |
| - "As a convention, we set the configuration up in the root directory of the workflow package and always starts importing datajoint and pipeline modules from there." |
| 16 | + "**The configuration only needs to be set up once**, if you have gone through the configuration before, directly go to [02-workflow-structure](02-workflow-structure-optional.ipynb)." |
19 | 17 | ]
|
20 | 18 | },
|
21 | 19 | {
|
22 | 20 | "cell_type": "code",
|
23 |
| - "execution_count": null, |
| 21 | + "execution_count": 1, |
24 | 22 | "id": "dc2dc935",
|
25 | 23 | "metadata": {},
|
26 | 24 | "outputs": [],
|
27 | 25 | "source": [
|
28 |
| - "import os" |
29 |
| - ] |
30 |
| - }, |
31 |
| - { |
32 |
| - "cell_type": "code", |
33 |
| - "execution_count": null, |
34 |
| - "metadata": {}, |
35 |
| - "outputs": [], |
36 |
| - "source": [ |
37 |
| - "# change to the upper level folder\n", |
| 26 | + "import os\n", |
38 | 27 | "if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")\n",
|
39 | 28 | "import datajoint as dj"
|
40 | 29 | ]
|
|
119 | 108 | "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",
|
120 | 109 | "\n",
|
121 | 110 | "- 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", |
| 111 | + "- For CodeBook users, the root is `/home/inbox/0.1.0a4/`\n", |
123 | 112 | "\n",
|
124 | 113 | "```\n",
|
125 | 114 | "- subject6\n",
|
|
139 | 128 | "# If there is only one root path.\n",
|
140 | 129 | "dj.config[\"custom\"][\"ephys_root_data_dir\"] = \"/tmp/test_data\"\n",
|
141 | 130 | "# If there are multiple possible root paths:\n",
|
142 |
| - "dj.config[\"custom\"][\"ephys_root_data_dir\"] = [\"/tmp/test_data\", \"/home/inbox/\"]" |
| 131 | + "dj.config[\"custom\"][\"ephys_root_data_dir\"] = [\n", |
| 132 | + " \"/tmp/test_data/workflow_ephys_data1/\",\n", |
| 133 | + " \"/tmp/test_data/workflow_ephys_data2/\",\n", |
| 134 | + " \"/tmp/test_data/workflow_localization/\", \n", |
| 135 | + " \"/home/inbox/0.1.0a4/workflow_ephys_data1/\",\n", |
| 136 | + " \"/home/inbox/0.1.0a4/workflow_ephys_data2/\",\n", |
| 137 | + " \"/home/inbox/0.1.0a4/workflow_localization/\"\n", |
| 138 | + "]" |
143 | 139 | ]
|
144 | 140 | },
|
145 | 141 | {
|
|
188 | 184 | "source": [
|
189 | 185 | "## Save configuration\n",
|
190 | 186 | "\n",
|
191 |
| - "With the proper configurations, we could save this as a file, either as a local json file, or a global file." |
192 |
| - ] |
193 |
| - }, |
194 |
| - { |
195 |
| - "cell_type": "code", |
196 |
| - "execution_count": null, |
197 |
| - "id": "dcc8b17b", |
198 |
| - "metadata": {}, |
199 |
| - "outputs": [], |
200 |
| - "source": [ |
201 |
| - "dj.config.save_local()" |
202 |
| - ] |
203 |
| - }, |
204 |
| - { |
205 |
| - "cell_type": "code", |
206 |
| - "execution_count": null, |
207 |
| - "id": "9b95596f", |
208 |
| - "metadata": {}, |
209 |
| - "outputs": [], |
210 |
| - "source": [ |
211 |
| - "ls" |
212 |
| - ] |
213 |
| - }, |
214 |
| - { |
215 |
| - "cell_type": "markdown", |
216 |
| - "id": "d76904b4", |
217 |
| - "metadata": {}, |
218 |
| - "source": [ |
219 |
| - "Local configuration file is saved as `dj_local_conf.json` in the root directory of this package `workflow-array-ephys`. Next time if you change your directory to `workflow-array-ephys` before importing datajoint and the pipeline packages, the configurations will get properly loaded.\n", |
| 187 | + "With the proper configurations, we could save this as a file, either as a local json file, or a global file.\n", |
220 | 188 | "\n",
|
221 |
| - "If saved globally, there will be a hidden configuration file saved in your root directory. The configuration will be loaded no matter where the directory is." |
| 189 | + "Local configuration file is saved as `dj_local_conf.json` in current directory, which is great for project-specific settings.\n", |
| 190 | + "\n", |
| 191 | + "For first-time and CodeBook users, we recommend saving globally. This will create a hidden configuration file saved in your root directory, loaded whenever there is no local version to override it." |
222 | 192 | ]
|
223 | 193 | },
|
224 | 194 | {
|
225 | 195 | "cell_type": "code",
|
226 | 196 | "execution_count": null,
|
| 197 | + "id": "dcc8b17b", |
227 | 198 | "metadata": {},
|
228 | 199 | "outputs": [],
|
229 | 200 | "source": [
|
230 |
| - "# dj.config.save_global()" |
| 201 | + "# dj.config.save_local()\n", |
| 202 | + "dj.config.save_global()" |
231 | 203 | ]
|
232 | 204 | },
|
233 | 205 | {
|
|
250 | 222 | "formats": "ipynb,py_scripts//py"
|
251 | 223 | },
|
252 | 224 | "kernelspec": {
|
253 |
| - "display_name": "Python 3.9.12 ('ele')", |
| 225 | + "display_name": "Python 3.9.13 ('ele')", |
254 | 226 | "language": "python",
|
255 | 227 | "name": "python3"
|
256 | 228 | },
|
|
264 | 236 | "name": "python",
|
265 | 237 | "nbconvert_exporter": "python",
|
266 | 238 | "pygments_lexer": "ipython3",
|
267 |
| - "version": "3.9.12" |
| 239 | + "version": "3.9.13" |
268 | 240 | },
|
269 | 241 | "vscode": {
|
270 | 242 | "interpreter": {
|
271 |
| - "hash": "61456c693db5d9aa6731701ec9a9b08ab88a172bee0780139a3679beb166da16" |
| 243 | + "hash": "d00c4ad21a7027bf1726d6ae3a9a6ef39c8838928eca5a3d5f51f3eb68720410" |
272 | 244 | }
|
273 | 245 | }
|
274 | 246 | },
|
|
0 commit comments