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

Commit

Permalink
Merge pull request #78 from kushalbakshi/main
Browse files Browse the repository at this point in the history
Fixed Equipment table import & minor issues in .ipynb files
  • Loading branch information
CBroz1 authored Aug 31, 2022
2 parents 6600942 + 885fcc4 commit 5881746
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 34,111 deletions.
37 changes: 22 additions & 15 deletions notebooks/01-configure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.chdir('..')"
"if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -73,7 +73,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -92,16 +92,17 @@
"\n",
"+ 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",
"\n",
"+ The prefix could be configurated as follows in `dj.config`:"
"+ The prefix could be configurated in `dj.config` as follows. CodeBook users should keep their username as the prefix for schema for declaration permissions."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"dj.config['custom'] = {'database.prefix': 'neuro_'}"
"username_as_prefix = dj.config[\"database.user\"] + \"_\"\n",
"dj.config[\"custom\"] = {\"database.prefix\": username_as_prefix}"
]
},
{
Expand Down Expand Up @@ -130,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -142,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -160,7 +161,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -169,7 +170,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -206,8 +207,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.7.9 64-bit ('workflow-calcium-imaging': conda)",
"name": "python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c"
"display_name": "Python 3.9.12 ('elementsPractice')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -219,7 +221,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.9.12"
},
"vscode": {
"interpreter": {
"hash": "28657e2c4c8fc87d9c51bab987cae00550904d22e795ba7dc84df7e29d09653b"
}
}
},
"nbformat": 4,
Expand Down
2,783 changes: 18 additions & 2,765 deletions notebooks/02-workflow-structure-optional.ipynb

Large diffs are not rendered by default.

222 changes: 12 additions & 210 deletions notebooks/03-process.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notebooks/04-automate-optional.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"source": [
"import os\n",
"os.chdir('..')\n",
"if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")\n",
"import numpy as np\n",
"from workflow_calcium_imaging.pipeline import lab, subject, session, scan, imaging"
]
Expand Down
31,102 changes: 14 additions & 31,088 deletions notebooks/05-explore.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notebooks/06-drop-optional.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"outputs": [],
"source": [
"import os\n",
"os.chdir('..')"
"if os.path.basename(os.getcwd()) == \"notebooks\": os.chdir(\"..\")"
]
},
{
Expand Down
17 changes: 11 additions & 6 deletions notebooks/07-downstream-analysis-optional.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notebooks/py_scripts/00-data-download-optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
Expand Down
15 changes: 8 additions & 7 deletions notebooks/py_scripts/01-configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
# display_name: Python 3.9.12 ('elementsPractice')
# language: python
# name: python3
# ---

# # Configure DataJoint connection to the database
Expand All @@ -22,8 +23,7 @@
# + 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.

import os
if os.path.basename(os.getcwd()) == 'notebooks':
os.chdir('..')
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")

pwd

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

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

# ### Root directories for raw calcium imaging data and processed results
#
Expand Down
9 changes: 5 additions & 4 deletions notebooks/py_scripts/02-workflow-structure-optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
# display_name: Python 3.9.12 ('elementsPractice')
# language: python
# name: python3
# ---

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

import os
os.chdir('..')
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")

# ## Schemas and tables
#
Expand Down
10 changes: 6 additions & 4 deletions notebooks/py_scripts/03-process.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
# display_name: Python 3.9.12 ('elementsPractice')
# language: python
# name: python3
# ---

# # Interactively run workflow calcium imaging
Expand All @@ -26,13 +27,14 @@
# Let's change the directory to the package root directory to load the local configuration (`dj_local_conf.json`).

import os
os.chdir('..')
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")
import numpy as np

# ## `Pipeline.py`
#
# + This script `activates` the DataJoint `elements` and declares other required tables.

import datajoint as dj
from workflow_calcium_imaging.pipeline import *

# ## Schema diagrams
Expand Down
4 changes: 2 additions & 2 deletions notebooks/py_scripts/04-automate-optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
Expand All @@ -18,7 +18,7 @@
# -

import os
os.chdir('..')
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")
import numpy as np
from workflow_calcium_imaging.pipeline import lab, subject, session, scan, imaging

Expand Down
9 changes: 5 additions & 4 deletions notebooks/py_scripts/05-explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
# display_name: Python 3.9.12 ('elementsPractice')
# language: python
# name: python3
# ---

# # DataJoint Workflow Calcium Imaging
#
# + This notebook will describe the steps for interacting with the data ingested into `workflow-calcium-imaging`.

import os
os.chdir('..')
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")

# +
import datajoint as dj
Expand Down
4 changes: 2 additions & 2 deletions notebooks/py_scripts/06-drop-optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: 'Python 3.7.9 64-bit (''workflow-calcium-imaging'': conda)'
# name: python379jvsc74a57bd01a512f474e195e32ad84236879d3bb44800a92b431919ef0b10d543f5012a23c
Expand All @@ -20,7 +20,7 @@
# Change into the parent directory to find the `dj_local_conf.json` file.

import os
os.chdir('..')
if os.path.basename(os.getcwd()) == "notebooks": os.chdir("..")

from workflow_calcium_imaging.pipeline import *

Expand Down
2 changes: 1 addition & 1 deletion notebooks/py_scripts/07-downstream-analysis-optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# jupytext_version: 1.14.1
# kernelspec:
# display_name: venv-nwb
# language: python
Expand Down
1 change: 1 addition & 0 deletions workflow_calcium_imaging/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"subject",
"lab",
"session",
"Equipment",
"trial",
"event",
"scan",
Expand Down

0 comments on commit 5881746

Please sign in to comment.