Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add assertions to ensure relevant functions in linking_module #56

Open
CBroz1 opened this issue Feb 14, 2022 · 0 comments
Open

Add assertions to ensure relevant functions in linking_module #56

CBroz1 opened this issue Feb 14, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@CBroz1
Copy link
Contributor

CBroz1 commented Feb 14, 2022

Currently, the schema activation function can be called with any valid module name as long as the tables already exist.

from element_array_ephys import ephys
ephys.activate(ephys_schema_name='test_ephys', probe_schema_name='test_probe', linking_module=__name__)
ephys.get_ephys_root_data_dir()  # AttributeError: module '__main__' has no attribute 'get_ephys_root_data_dir'

We could do more to check for the relevant functions on activation. For example,

assert hasattr(_linking_module, 'get_ephys_root_data_dir'), "Linking module must specify a root directory"
assert hasattr(_linking_module, 'get_session_directory'), "Linking module must specify a session directory lookup function"
@CBroz1 CBroz1 added enhancement New feature or request good first issue Good for newcomers labels Feb 14, 2022
@CBroz1 CBroz1 self-assigned this May 4, 2022
@CBroz1 CBroz1 added this to the 2023Q2+ milestone May 11, 2022
@CBroz1 CBroz1 removed their assignment Sep 22, 2022
@kabilar kabilar removed this from the 2023Q2+ milestone Feb 17, 2023
kabilar pushed a commit to kabilar/element-array-ephys that referenced this issue Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants