|
35 | 35 | "outputs": [],
|
36 | 36 | "source": [
|
37 | 37 | "# 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", |
43 | 39 | "import datajoint as dj"
|
44 | 40 | ]
|
45 | 41 | },
|
|
55 | 51 | {
|
56 | 52 | "cell_type": "code",
|
57 | 53 | "execution_count": null,
|
58 |
| - "id": "6820ef4c", |
59 | 54 | "metadata": {},
|
60 | 55 | "outputs": [],
|
61 | 56 | "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", |
72 | 59 | "dj.config[\"database.user\"] = \"{YOUR_USERNAME}\"\n",
|
73 | 60 | "dj.config[\"database.password\"] = getpass.getpass() # enter the password securily"
|
74 | 61 | ]
|
|
106 | 93 | "\n",
|
107 | 94 | "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",
|
108 | 95 | "\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." |
110 | 97 | ]
|
111 | 98 | },
|
112 | 99 | {
|
|
115 | 102 | "metadata": {},
|
116 | 103 | "outputs": [],
|
117 | 104 | "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}" |
119 | 107 | ]
|
120 | 108 | },
|
121 | 109 | {
|
|
130 | 118 | "\n",
|
131 | 119 | "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",
|
132 | 120 | "\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", |
134 | 123 | "\n",
|
135 | 124 | "```\n",
|
136 |
| - "/tmp/test_data/\n", |
137 | 125 | "- subject6\n",
|
138 | 126 | " - session1\n",
|
139 | 127 | " - towersTask_g0_imec0\n",
|
|
151 | 139 | "# If there is only one root path.\n",
|
152 | 140 | "dj.config[\"custom\"][\"ephys_root_data_dir\"] = \"/tmp/test_data\"\n",
|
153 | 141 | "# 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/\"]" |
155 | 143 | ]
|
156 | 144 | },
|
157 | 145 | {
|
|
164 | 152 | ]
|
165 | 153 | },
|
166 | 154 | {
|
167 |
| - "cell_type": "code", |
168 |
| - "execution_count": null, |
| 155 | + "cell_type": "markdown", |
169 | 156 | "id": "f7733450",
|
170 | 157 | "metadata": {},
|
171 |
| - "outputs": [], |
172 | 158 | "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." |
181 | 162 | ]
|
182 | 163 | },
|
183 | 164 | {
|
|
269 | 250 | "formats": "ipynb,py_scripts//py"
|
270 | 251 | },
|
271 | 252 | "kernelspec": {
|
272 |
| - "display_name": "Python 3.10.4 64-bit ('python3p10')", |
| 253 | + "display_name": "Python 3.9.12 ('ele')", |
273 | 254 | "language": "python",
|
274 | 255 | "name": "python3"
|
275 | 256 | },
|
|
283 | 264 | "name": "python",
|
284 | 265 | "nbconvert_exporter": "python",
|
285 | 266 | "pygments_lexer": "ipython3",
|
286 |
| - "version": "3.10.4" |
| 267 | + "version": "3.9.12" |
287 | 268 | },
|
288 | 269 | "vscode": {
|
289 | 270 | "interpreter": {
|
290 |
| - "hash": "ff52d424e56dd643d8b2ec122f40a2e279e94970100b4e6430cb9025a65ba4cf" |
| 271 | + "hash": "61456c693db5d9aa6731701ec9a9b08ab88a172bee0780139a3679beb166da16" |
291 | 272 | }
|
292 | 273 | }
|
293 | 274 | },
|
|
0 commit comments