Skip to content

Commit 0dbdde7

Browse files
committed
Move dj_config setup to tutorial_pipeline.py
1 parent b979fec commit 0dbdde7

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

element_array_ephys/__init__.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1 @@
1-
import os
2-
import datajoint as dj
3-
4-
if "custom" not in dj.config:
5-
dj.config["custom"] = {}
6-
7-
# overwrite dj.config['custom'] values with environment variables if available
8-
9-
dj.config["custom"]["database.prefix"] = os.getenv(
10-
"DATABASE_PREFIX", dj.config["custom"].get("database.prefix", "")
11-
)
12-
13-
dj.config["custom"]["ephys_root_data_dir"] = os.getenv(
14-
"EPHYS_ROOT_DATA_DIR", dj.config["custom"].get("ephys_root_data_dir", "")
15-
)
16-
17-
db_prefix = dj.config["custom"].get("database.prefix", "")
18-
191
from . import ephys_acute as ephys

notebooks/tutorial_pipeline.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1+
import os
2+
import pathlib
13
import datajoint as dj
24
from element_animal import subject
35
from element_animal.subject import Subject
4-
from element_array_ephys import db_prefix, probe, ephys_acute as ephys
6+
from element_array_ephys import probe, ephys_acute as ephys
57
from element_lab import lab
68
from element_lab.lab import Lab, Location, Project, Protocol, Source, User
79
from element_lab.lab import Device as Equipment
810
from element_lab.lab import User as Experimenter
911
from element_session import session_with_datetime as session
1012
from element_session.session_with_datetime import Session
1113
import element_interface
12-
import pathlib
1314

1415

16+
if "custom" not in dj.config:
17+
dj.config["custom"] = {}
18+
19+
# overwrite dj.config['custom'] values with environment variables if available
20+
21+
dj.config["custom"]["database.prefix"] = os.getenv(
22+
"DATABASE_PREFIX", dj.config["custom"].get("database.prefix", "")
23+
)
24+
25+
dj.config["custom"]["ephys_root_data_dir"] = os.getenv(
26+
"EPHYS_ROOT_DATA_DIR", dj.config["custom"].get("ephys_root_data_dir", "")
27+
)
28+
29+
db_prefix = dj.config["custom"].get("database.prefix", "")
30+
1531
# Declare functions for retrieving data
1632
def get_ephys_root_data_dir():
1733
"""Retrieve ephys root data directory."""

0 commit comments

Comments
 (0)