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

migration support for napari_experimental_provide_function hooks #47

Closed
4 tasks done
Tracked by #32
nclack opened this issue Dec 8, 2021 · 2 comments · Fixed by #51
Closed
4 tasks done
Tracked by #32

migration support for napari_experimental_provide_function hooks #47

nclack opened this issue Dec 8, 2021 · 2 comments · Fixed by #51

Comments

@nclack
Copy link
Collaborator

nclack commented Dec 8, 2021

Description

I discussed this in separate conversations w @tlambert03, @sofroniewn and in the plugin working group meeting.

One of the nice things about migrating these is that it makes it simple for people to integrate functions like these into napari without adding dependencies to their package (no npe2, magicgui, napari etc...just the manifest file)

The proposal is to migrate napari_experimental_provide_function hooks to be npe2 widget contributions. It sounds like something like this might work:

name: myplugin
contributions:
  commands:
    - id: myplugin.func
      python_name: myplugin:my_typed_function
      title: Open dock widget for myplugin function
  widgets:
    - command: myplugin.func
      name: Functionality
      type: magicgui                #<-- new field 

Implementation should cover:

  • schema support
  • npe2 conversion tool support
  • npe2 doc update
  • npe2 cookiecutter update
@nclack nclack mentioned this issue Dec 8, 2021
17 tasks
@tlambert03
Copy link
Collaborator

I like this, since it removes the "function" part from the name (which was always my biggest issue with that, since it wasn't really being used to provide a function as much as a widget) and emphasizes that this is just a subtle variant of provide_dock_widget,

@sofroniewn
Copy link
Contributor

I like this, since it removes the "function" part from the name (which was always my biggest issue with that, since it wasn't really being used to provide a function as much as a widget) and emphasizes that this is just a subtle variant of provide_dock_widget,

very nice! what i like about all of this (e.g. npe2) too is that if we come along and make something new like "workflow-blocks" then we can just reuse the same commands but put them with the new thing.

Great stuff here

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

Successfully merging a pull request may close this issue.

3 participants