-
Notifications
You must be signed in to change notification settings - Fork 8
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
Updating to napari YAML plugin format with category-specific menu definitions. #47
Conversation
…ugin definition format.
@jni could you please take a look at this PR? Is there anything npe2-related missing? |
(1) yes, in addition to commands, each of those commands produces a widget (right?), which needs to be added in a new section (same level as |
I'm not sure if I understand the concept of commands and widgets. Obviously all the menu entries discussed here create function widgets. Why do we need commands then? git-bob comment |
This message was generated by git-bob (version: 0.14.0, model: gpt-4o-2024-08-06, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully. The changes in the However, as per @ jni's comments, it seems necessary to also add widgets for each command under a new section, since napari expects widgets to accompany commands as per the current framework limitations. This might require further adjustments to the Regarding the categorization, it is up to your discretion, but it might indeed be beneficial to reconsider some placements such as moving Additionally, the mention of Finally, consider removing the npe1 decorators from functions as a follow-up for completing the conversion to the new plugin format. |
The vapid answer above perfectly illustrates why I remain unimpressed with AI.
A command is a function that gets called under some circumstances. But napari doesn't know what the function does. For example, in the hopefully-near future, we could add functions that are mouse event callbacks (napari/npe2#153). So even though currently all commands are widgets, that will not be true forever, so you have to in a separate place say, we are contributing widgets, and the widgets are created by these commands. I realise the manifest structure is a bit cumbersome — we hope to improve it in the future. Here is the issue where we are discussing simplification ideas: napari/napari#6227 But for now, to reiterate, you need the widgets section to say, these commands are actually generating widgets, which helps napari understand what to do when they are called. |
Consider blaming the humans involved in the discussion, too. For example: I was misleadingly asking the model to review this PR under the hood. This is a bug that can be fixed. No big deal. Also I must admit, that I am as confused about napari.yaml as the LLM might be. For example, you said we cannot contribute to I may give this another try with the next version of napari, its yaml documentation and the next version of git-bob. For now, I enjoyed this experiment! Thanks for joining the discussion @jni 🙌 |
But as a human, you can understand when I say "the documentation matches an earlier implementation that was since changed, and it is out of date. Here are the new instructions." And you can act accordingly. Based on my comment above, I believe there is a very clear and low-effort path forward (actually, |
git-bob would retrieve this info if it was a github link:
I just blocked links outside github for copyright reasons. E.g. in case of the napari website it says: "Copyright 2024, The napari team", a phrase technically peventing others from re-using contens on the website. I may reconsider this very general block. I think US ans EU lawsuits recently argued that breaking copyright for AI research is ok. But I need to read a little more.
It's possible to solve this, either by adding new info to the discussion or by starting from scratch. This is similar to how humans interact with complicated isssues.
That' should possible with LLMs, too. Worth a try: Let's forget the entire discussion above. git-bob implement a new "jokes.py" with a function containing a print statement that prints out a joke about programmers in a bar. Again, ignore the technical details discussed above and focus on the joke and please add the new function to the napari.yaml |
This message was generated by git-bob (version: 0.14.0, model: gpt-4o-2024-08-06, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully. The project has been updated to incorporate a new function to tell a programmer joke, which was added to the
|
Well almost. And funny 😁 It is maybe a good strategy to start a new discussion. 😄 |
@haesleinhuepf the docs have been updated: Let me know if you want to try again. btw one motivation for me pushing you here is that we would like to throw out npe1 ASAP. We would like to make sure that the tools-menu ecosystem can effectively migrate to layers menu. For that, I need you (and other tools menu users) to tell us whether there's missing pigeonholes and you really really can't fit some of your tools into the layers menu. (Edit: And this is something where I suspect you need to exercise your human brain and not leave the answer to the LLM...) |
This message was generated by git-bob (version: 0.14.0, model: gpt-4o-2024-08-06, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.
The
napari-segment-blobs-and-things-with-membranes
repository has been updated to use napari's YAML plugin definition format. A newnapari.yaml
file was created to statically define plugin contributions, transforming the previously used@ register_function
decorators into this format. This involved creating command entries for each function and properly categorizing them under the correct menus based on their functionality, such as segmentation, filtering, or transformation.napari.yaml
file adds plugin commands and menu categories following napari's static plugin definition format.closes #45