Skip to content

Commit

Permalink
Move dj_config setup to tutorial_pipeline.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalbakshi committed Nov 28, 2023
1 parent b979fec commit 0dbdde7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
18 changes: 0 additions & 18 deletions element_array_ephys/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
import os
import datajoint as dj

if "custom" not in dj.config:
dj.config["custom"] = {}

# overwrite dj.config['custom'] values with environment variables if available

dj.config["custom"]["database.prefix"] = os.getenv(
"DATABASE_PREFIX", dj.config["custom"].get("database.prefix", "")
)

dj.config["custom"]["ephys_root_data_dir"] = os.getenv(
"EPHYS_ROOT_DATA_DIR", dj.config["custom"].get("ephys_root_data_dir", "")
)

db_prefix = dj.config["custom"].get("database.prefix", "")

from . import ephys_acute as ephys
20 changes: 18 additions & 2 deletions notebooks/tutorial_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
import os
import pathlib
import datajoint as dj
from element_animal import subject
from element_animal.subject import Subject
from element_array_ephys import db_prefix, probe, ephys_acute as ephys
from element_array_ephys import probe, ephys_acute as ephys
from element_lab import lab
from element_lab.lab import Lab, Location, Project, Protocol, Source, User
from element_lab.lab import Device as Equipment
from element_lab.lab import User as Experimenter
from element_session import session_with_datetime as session
from element_session.session_with_datetime import Session
import element_interface
import pathlib


if "custom" not in dj.config:
dj.config["custom"] = {}

# overwrite dj.config['custom'] values with environment variables if available

dj.config["custom"]["database.prefix"] = os.getenv(
"DATABASE_PREFIX", dj.config["custom"].get("database.prefix", "")
)

dj.config["custom"]["ephys_root_data_dir"] = os.getenv(
"EPHYS_ROOT_DATA_DIR", dj.config["custom"].get("ephys_root_data_dir", "")
)

db_prefix = dj.config["custom"].get("database.prefix", "")

# Declare functions for retrieving data
def get_ephys_root_data_dir():
"""Retrieve ephys root data directory."""
Expand Down

0 comments on commit 0dbdde7

Please sign in to comment.