|
| 1 | +import os |
| 2 | +import pathlib |
1 | 3 | import datajoint as dj
|
2 | 4 | from element_animal import subject
|
3 | 5 | 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 |
5 | 7 | from element_lab import lab
|
6 | 8 | from element_lab.lab import Lab, Location, Project, Protocol, Source, User
|
7 | 9 | from element_lab.lab import Device as Equipment
|
8 | 10 | from element_lab.lab import User as Experimenter
|
9 | 11 | from element_session import session_with_datetime as session
|
10 | 12 | from element_session.session_with_datetime import Session
|
11 | 13 | import element_interface
|
12 |
| -import pathlib |
13 | 14 |
|
14 | 15 |
|
| 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 | + |
15 | 31 | # Declare functions for retrieving data
|
16 | 32 | def get_ephys_root_data_dir():
|
17 | 33 | """Retrieve ephys root data directory."""
|
|
0 commit comments