Open jcfr opened 5 years ago
Approach below are not exclusive
import ndx_my_extension from pynwb import load_namespaces load_namespaces(ndx_my_extension.namespace_filepath)
Instead of setting package_data, the spec files could be listed as data_files always installed under a directory called ndx_specs
package_data
data_files
ndx_specs
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:
pnwb.list_registered_namespaces()
pynwb.load_registered_namespaces()
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.
[extension_autoload]
As first step, I suggest to go with (1), it will:
@ajtritt @rly thoughts?
I also like starting with option 1. Even better if we have a function load_extension(package_name).
load_extension(package_name)
Approach below are not exclusive
(1) Use namespace filepath returned by extension python package
(2) systematic installation of spec files as datafiles
Instead of setting
package_data
, the spec files could be listed asdata_files
always installed under a directory calledndx_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:
pnwb.list_registered_namespaces()
)pynwb.load_registered_namespaces()
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:
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: