Skip to content

Commit

Permalink
Generated new pyscript files
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalbakshi committed Aug 31, 2022
1 parent 814a380 commit 06d8b0d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 28 deletions.
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
17 changes: 8 additions & 9 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,13 +23,10 @@
# + 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

import datajoint as dj

# ## Configure database host address and credentials
#
# Now let's set up the host, user and password in the `dj.config` global variable
Expand All @@ -50,9 +48,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
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -169,7 +169,7 @@

analysis.ActivityAlignment()

# The `AlignedTrialActivity` part table captures aligned traces for each alignment and trial condition specified in the master table.
# The `AlignedTrialActivity` part table captures aligned traces fore each alignment and trial condition specified in the master table.

analysis.ActivityAlignment.AlignedTrialActivity()

Expand Down

0 comments on commit 06d8b0d

Please sign in to comment.