1212
1313schema = dj .schema ()
1414
15- _required_module = None
15+ _linking_module = None
1616
1717
1818def 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 ):
2020 """
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
2424 - 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
2828 required dependencies to activate the `ephys` element:
2929 Upstream tables:
3030 + 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)
3233 Functions:
3334 + get_neuropixels_data_directory(probe_insertion_key: dict) -> str
3435 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,
4445 :return: int specifying the `paramset_idx`
4546 """
4647
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"
5051
51- global _required_module
52- _required_module = required_module
52+ global _linking_module
53+ _linking_module = linking_module
5354
5455 # activate
5556 probe .schema .activate (probe_schema_name , create_schema = create_schema , create_tables = create_tables )
5657 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__ )
5859
5960
6061# -------------- Functions required by the elements-ephys ---------------
@@ -67,7 +68,7 @@ def get_neuropixels_data_directory(probe_insertion_key: dict) -> str:
6768 :param probe_insertion_key: a dictionary of one ProbeInsertion `key`
6869 :return: a string for full path to the resulting Neuropixels data directory
6970 """
70- return _required_module .get_neuropixels_data_directory (probe_insertion_key )
71+ return _linking_module .get_neuropixels_data_directory (probe_insertion_key )
7172
7273
7374def get_kilosort_output_directory (clustering_task_key : dict ) -> str :
@@ -77,7 +78,7 @@ def get_kilosort_output_directory(clustering_task_key: dict) -> str:
7778 :param clustering_task_key: a dictionary of one ClusteringTask `key`
7879 :return: a string for full path to the resulting Kilosort output directory
7980 """
80- return _required_module .get_kilosort_output_directory (clustering_task_key )
81+ return _linking_module .get_kilosort_output_directory (clustering_task_key )
8182
8283
8384def get_paramset_idx (ephys_rec_key : dict ) -> int :
@@ -87,7 +88,7 @@ def get_paramset_idx(ephys_rec_key: dict) -> int:
8788 :param ephys_rec_key: a dictionary of one EphysRecording `key`
8889 :return: int specifying the `paramset_idx`
8990 """
90- return _required_module .get_paramset_idx (ephys_rec_key )
91+ return _linking_module .get_paramset_idx (ephys_rec_key )
9192
9293
9394# ----------------------------- Table declarations ----------------------
0 commit comments