Skip to content

Add assertions to ensure relevant functions in linking_module #56

@CBroz1

Description

@CBroz1

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions