-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
[WIP] Functional plugins infrastructure #263
Conversation
Hello @jni! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
@jni this is really cool to see - definitely helps me understand how you're thinking about all this. I'd say this should all live on Looking forward to more discussion later! |
@sofroniewn I've picked this up again finally, fyi. It's looking pretty cool right now. Just need to hook up actions to the functions. =) I've temporarily given up on typing and we'll just have to rely on users to give sane inputs to the functions, which is The Python Way anyway. It should be easy to add typing after an initial version is working. The next stage is to have a popup menu for each action that lets you select either existing layers or variables in the global workspace or Python literals as input. Again, this can be replaced with a drawer with e.g. preview mode in the future. Just keeping everyone updated... ;) |
btw, I do get this warning when adding the scikit-image module: "The gui lock can only be acquired by one toolkit per session. The lock is already acquired by qt". I presume it has something to do with adding menu items at runtime, but I have no idea... If anyone knows what it's about, pointers are appreciated! |
Codecov Report
@@ Coverage Diff @@
## master #263 +/- ##
==========================================
- Coverage 82.01% 81.76% -0.25%
==========================================
Files 136 137 +1
Lines 14814 14886 +72
==========================================
+ Hits 12149 12172 +23
- Misses 2665 2714 +49
Continue to review full report at Codecov.
|
@jni this looks so cool, great that you're picking it up again! i think this is a great time for us to make a push for the plugins :-) when ready I'm very happy to reimplement the project @marshuang80 did this summer around image segmentation as a plugin - https://github.com/transformify-plugins/segmentify - right now it uses napari as a dependency and subclasses the Viewer. We'll have to think about some additional things like how is a plugin allowed to define custom keybindings, and eventually how is a plugin allowed to request UI elements. |
@sofroniewn indeed! To clarify, my goal for this PR is to only provide support for "functional" plugins (things that take in layer data and spit out other layer data). I feel like other stuff can come in later PRs. I haven't thought very much about interactive plugins, but one idea is to have them be Python functions that take the viewer as input. Then the world is their oyster. =) Something to discuss once this is ready for review. Hold please. =) |
Is this something we can close now @jni? Thanks! |
ToDo here is to convert this into an issue containing the code we want to preserve/ reuse in the future - cc @jni |
Closing as outdated, discussion to continue in #3525. |
Description
This is a skeleton for what I envision functional plugins to look like, as a first pass. Things like live update etc I think we should leave till later.
For reference, here's what happens when I crawl the
test_validation
module from image-types:As a side bonus this PR includes a menu bar and a close-window shortcut. 🎉
This isn't even functional yet but wanted to submit to discuss during meeting.
Q: wasn't sure whether this should live in the window or the viewer, guidance here would be much appreciated. I kinda think the window.
Type of change
References
How has this been tested?
Final checklist: