12
12
13
13
schema = dj .schema ()
14
14
15
- _required_module = None
15
+ _linking_module = None
16
16
17
17
18
18
def activate (ephys_schema_name , probe_schema_name = None , * , create_schema = True ,
19
- create_tables = True , required_module = None ):
19
+ create_tables = True , linking_module = None ):
20
20
"""
21
- activate(ephys_schema_name, probe_schema_name=None, *, create_schema=True, create_tables=True, dependency =None)
22
- :param ephys_schema_name: schema name to activate the `ephys` element
23
- :param probe_schema_name: schema name to activate the `probe` element
21
+ activate(ephys_schema_name, probe_schema_name=None, *, create_schema=True, create_tables=True, linking_module =None)
22
+ :param ephys_schema_name: schema name on the database server to activate the `ephys` element
23
+ :param probe_schema_name: schema name on the database server to activate the `probe` element
24
24
- may be omitted if the `probe` element is already activated
25
- :param create_schema: create the schema if not yet existed (default = True)
26
- :param create_tables: create the tables if not yet existed (default = True)
27
- :param required_module : a module name or a module containing the
25
+ :param create_schema: when True (default), create schema in the database if it does not yet exist.
26
+ :param create_tables: when True (default), create tables in the database if they do not yet exist.
27
+ :param linking_module : a module name or a module containing the
28
28
required dependencies to activate the `ephys` element:
29
29
Upstream tables:
30
30
+ Session: parent table to ProbeInsertion, typically identifying a recording session
31
- + SkullReference:
31
+ + SkullReference: Reference table for InsertionLocation, specifying the skull reference
32
+ used for probe insertion location (e.g. Bregma, Lambda)
32
33
Functions:
33
34
+ get_neuropixels_data_directory(probe_insertion_key: dict) -> str
34
35
Retrieve the recorded Neuropixels data directory for a given ProbeInsertion
@@ -44,17 +45,17 @@ def activate(ephys_schema_name, probe_schema_name=None, *, create_schema=True,
44
45
:return: int specifying the `paramset_idx`
45
46
"""
46
47
47
- if isinstance (required_module , str ):
48
- required_module = importlib .import_module (required_module )
49
- assert inspect .ismodule (required_module ), "The argument 'dependency' must be a module's name or a module"
48
+ if isinstance (linking_module , str ):
49
+ linking_module = importlib .import_module (linking_module )
50
+ assert inspect .ismodule (linking_module ), "The argument 'dependency' must be a module's name or a module"
50
51
51
- global _required_module
52
- _required_module = required_module
52
+ global _linking_module
53
+ _linking_module = linking_module
53
54
54
55
# activate
55
56
probe .schema .activate (probe_schema_name , create_schema = create_schema , create_tables = create_tables )
56
57
schema .activate (ephys_schema_name , create_schema = create_schema ,
57
- create_tables = create_tables , add_objects = _required_module .__dict__ )
58
+ create_tables = create_tables , add_objects = _linking_module .__dict__ )
58
59
59
60
60
61
# -------------- Functions required by the elements-ephys ---------------
@@ -67,7 +68,7 @@ def get_neuropixels_data_directory(probe_insertion_key: dict) -> str:
67
68
:param probe_insertion_key: a dictionary of one ProbeInsertion `key`
68
69
:return: a string for full path to the resulting Neuropixels data directory
69
70
"""
70
- return _required_module .get_neuropixels_data_directory (probe_insertion_key )
71
+ return _linking_module .get_neuropixels_data_directory (probe_insertion_key )
71
72
72
73
73
74
def get_kilosort_output_directory (clustering_task_key : dict ) -> str :
@@ -77,7 +78,7 @@ def get_kilosort_output_directory(clustering_task_key: dict) -> str:
77
78
:param clustering_task_key: a dictionary of one ClusteringTask `key`
78
79
:return: a string for full path to the resulting Kilosort output directory
79
80
"""
80
- return _required_module .get_kilosort_output_directory (clustering_task_key )
81
+ return _linking_module .get_kilosort_output_directory (clustering_task_key )
81
82
82
83
83
84
def get_paramset_idx (ephys_rec_key : dict ) -> int :
@@ -87,7 +88,7 @@ def get_paramset_idx(ephys_rec_key: dict) -> int:
87
88
:param ephys_rec_key: a dictionary of one EphysRecording `key`
88
89
:return: int specifying the `paramset_idx`
89
90
"""
90
- return _required_module .get_paramset_idx (ephys_rec_key )
91
+ return _linking_module .get_paramset_idx (ephys_rec_key )
91
92
92
93
93
94
# ----------------------------- Table declarations ----------------------
0 commit comments