nwb-extensions / ndx-template

A template for creating Neurodata Extensions for the NWB neurophysiology data standard
https://nwb.org/
Other
5 stars 8 forks source link

RFC: Approach to support loading of extensions #9

Open jcfr opened 5 years ago

jcfr commented 5 years ago

Approach below are not exclusive

(1) Use namespace filepath returned by extension python package

import ndx_my_extension

from pynwb import load_namespaces

load_namespaces(ndx_my_extension.namespace_filepath)

(2) systematic installation of spec files as datafiles

Instead of setting package_data, the spec files could be listed as data_files always installed under a directory called ndx_specs

(3) Use entrypoint to register extensions

Add support for entrypoints allowing to automatically register the ndx python extension after its installation.

pynwb will need to be updated to support the following:

automatic loading of registered namespaces on import. Do we want that ?

To support both cases: automatic loading and explicit loading of extension. The following could be done:

pip install pynwb[extension_autoload]

By installing the extra [extension_autoload], pynwb would load the namespace of all installed extensions on import.

suggested path forward

As first step, I suggest to go with (1), it will:

oruebel commented 5 years ago

@ajtritt @rly thoughts?

rly commented 5 years ago

I also like starting with option 1. Even better if we have a function load_extension(package_name).