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

RFC: Approach to support loading of extensions #9

Open
jcfr opened this issue May 19, 2019 · 2 comments
Open

RFC: Approach to support loading of extensions #9

jcfr opened this issue May 19, 2019 · 2 comments
Assignees

Comments

@jcfr
Copy link
Contributor

jcfr commented May 19, 2019

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:

  • listing installed extensions using a pynwb functions (e.g pnwb.list_registered_namespaces())
  • implement a function named pynwb.load_registered_namespaces()
  • automatic loading of registered namespaces on import. Do we want that ? @oruebel @bendichter

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:

  • not prevent from implementing (2) and/or (3)
  • nicely abstract the location of the spec files
@jcfr jcfr changed the title Use entrypoint to register extension Approach to support loading of extensions May 19, 2019
@jcfr jcfr changed the title Approach to support loading of extensions RFC: Approach to support loading of extensions May 19, 2019
@oruebel
Copy link
Contributor

oruebel commented May 19, 2019

@ajtritt @rly thoughts?

@rly rly mentioned this issue Jun 21, 2019
@rly
Copy link
Contributor

rly commented Jun 22, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants