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

Commit 5881746

Browse files
authored
Merge pull request #78 from kushalbakshi/main
Fixed Equipment table import & minor issues in .ipynb files
2 parents 6600942 + 885fcc4 commit 5881746

16 files changed

+110
-34111
lines changed

notebooks/01-configure.ipynb

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
},
1818
{
1919
"cell_type": "code",
20-
"execution_count": null,
20+
"execution_count": 1,
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
2424
"import os\n",
25-
"os.chdir('..')"
25+
"if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")"
2626
]
2727
},
2828
{
2929
"cell_type": "code",
30-
"execution_count": null,
30+
"execution_count": 2,
3131
"metadata": {},
3232
"outputs": [],
3333
"source": [
@@ -54,7 +54,7 @@
5454
},
5555
{
5656
"cell_type": "code",
57-
"execution_count": null,
57+
"execution_count": 3,
5858
"metadata": {},
5959
"outputs": [],
6060
"source": [
@@ -73,7 +73,7 @@
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": null,
76+
"execution_count": 4,
7777
"metadata": {},
7878
"outputs": [],
7979
"source": [
@@ -92,16 +92,17 @@
9292
"\n",
9393
"+ 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_imaging` etc.\n",
9494
"\n",
95-
"+ The prefix could be configurated as follows in `dj.config`:"
95+
"+ The prefix could be configurated in `dj.config` as follows. CodeBook users should keep their username as the prefix for schema for declaration permissions."
9696
]
9797
},
9898
{
9999
"cell_type": "code",
100-
"execution_count": null,
100+
"execution_count": 5,
101101
"metadata": {},
102102
"outputs": [],
103103
"source": [
104-
"dj.config['custom'] = {'database.prefix': 'neuro_'}"
104+
"username_as_prefix = dj.config[\"database.user\"] + \"_\"\n",
105+
"dj.config[\"custom\"] = {\"database.prefix\": username_as_prefix}"
105106
]
106107
},
107108
{
@@ -130,7 +131,7 @@
130131
},
131132
{
132133
"cell_type": "code",
133-
"execution_count": null,
134+
"execution_count": 6,
134135
"metadata": {},
135136
"outputs": [],
136137
"source": [
@@ -142,7 +143,7 @@
142143
},
143144
{
144145
"cell_type": "code",
145-
"execution_count": null,
146+
"execution_count": 7,
146147
"metadata": {},
147148
"outputs": [],
148149
"source": [
@@ -160,7 +161,7 @@
160161
},
161162
{
162163
"cell_type": "code",
163-
"execution_count": null,
164+
"execution_count": 8,
164165
"metadata": {},
165166
"outputs": [],
166167
"source": [
@@ -169,7 +170,7 @@
169170
},
170171
{
171172
"cell_type": "code",
172-
"execution_count": null,
173+
"execution_count": 9,
173174
"metadata": {},
174175
"outputs": [],
175176
"source": [
@@ -206,8 +207,9 @@
206207
],
207208
"metadata": {
208209
"kernelspec": {
209-
"display_name": "Python 3.7.9 64-bit ('workflow-calcium-imaging': conda)",
210-
"name": "python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c"
210+
"display_name": "Python 3.9.12 ('elementsPractice')",
211+
"language": "python",
212+
"name": "python3"
211213
},
212214
"language_info": {
213215
"codemirror_mode": {
@@ -219,7 +221,12 @@
219221
"name": "python",
220222
"nbconvert_exporter": "python",
221223
"pygments_lexer": "ipython3",
222-
"version": "3.7.9"
224+
"version": "3.9.12"
225+
},
226+
"vscode": {
227+
"interpreter": {
228+
"hash": "28657e2c4c8fc87d9c51bab987cae00550904d22e795ba7dc84df7e29d09653b"
229+
}
223230
}
224231
},
225232
"nbformat": 4,

notebooks/02-workflow-structure-optional.ipynb

Lines changed: 18 additions & 2765 deletions
Large diffs are not rendered by default.

notebooks/03-process.ipynb

Lines changed: 12 additions & 210 deletions
Large diffs are not rendered by default.

notebooks/04-automate-optional.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
],
2929
"source": [
3030
"import os\n",
31-
"os.chdir('..')\n",
31+
"if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")\n",
3232
"import numpy as np\n",
3333
"from workflow_calcium_imaging.pipeline import lab, subject, session, scan, imaging"
3434
]

notebooks/05-explore.ipynb

Lines changed: 14 additions & 31088 deletions
Large diffs are not rendered by default.

notebooks/06-drop-optional.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"outputs": [],
2626
"source": [
2727
"import os\n",
28-
"os.chdir('..')"
28+
"if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")"
2929
]
3030
},
3131
{

notebooks/07-downstream-analysis-optional.ipynb

Lines changed: 11 additions & 6 deletions
Large diffs are not rendered by default.

notebooks/py_scripts/00-data-download-optional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# extension: .py
66
# format_name: light
77
# format_version: '1.5'
8-
# jupytext_version: 1.13.7
8+
# jupytext_version: 1.14.1
99
# kernelspec:
1010
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
1111
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c

notebooks/py_scripts/01-configure.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
# extension: .py
66
# format_name: light
77
# format_version: '1.5'
8-
# jupytext_version: 1.13.7
8+
# jupytext_version: 1.14.1
99
# kernelspec:
10-
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
11-
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
10+
# display_name: Python 3.9.12 ('elementsPractice')
11+
# language: python
12+
# name: python3
1213
# ---
1314

1415
# # Configure DataJoint connection to the database
@@ -22,8 +23,7 @@
2223
# + As a convention, we set the configuration up in the root directory of the `workflow-calcium-imaging` package and always start importing DataJoint and pipeline modules from there.
2324

2425
import os
25-
if os.path.basename(os.getcwd()) == 'notebooks':
26-
os.chdir('..')
26+
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")
2727

2828
pwd
2929

@@ -50,9 +50,10 @@
5050
#
5151
# + 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_imaging` etc.
5252
#
53-
# + The prefix could be configurated as follows in `dj.config`:
53+
# + The prefix could be configurated in `dj.config` as follows. CodeBook users should keep their username as the prefix for schema for declaration permissions.
5454

55-
dj.config['custom'] = {'database.prefix': 'neuro_'}
55+
username_as_prefix = dj.config["database.user"] + "_"
56+
dj.config["custom"] = {"database.prefix": username_as_prefix}
5657

5758
# ### Root directories for raw calcium imaging data and processed results
5859
#

notebooks/py_scripts/02-workflow-structure-optional.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
# extension: .py
77
# format_name: light
88
# format_version: '1.5'
9-
# jupytext_version: 1.13.7
9+
# jupytext_version: 1.14.1
1010
# kernelspec:
11-
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
12-
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
11+
# display_name: Python 3.9.12 ('elementsPractice')
12+
# language: python
13+
# name: python3
1314
# ---
1415

1516
# # Introduction to the workflow structure
@@ -25,7 +26,7 @@
2526
# To load the local configuration, we will change the directory to the package root.
2627

2728
import os
28-
os.chdir('..')
29+
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")
2930

3031
# ## Schemas and tables
3132
#

0 commit comments

Comments
 (0)