-
Notifications
You must be signed in to change notification settings - Fork 76
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
user API for links control #1640
Conversation
Codecov ReportBase: 87.11% // Head: 87.12% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1640 +/- ##
=======================================
Coverage 87.11% 87.12%
=======================================
Files 95 95
Lines 9887 9894 +7
=======================================
+ Hits 8613 8620 +7
Misses 1274 1274
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I am also not sure about this one. This plugin exposes an existing API. This feels... recursive. https://jdaviz.readthedocs.io/en/latest/api/jdaviz.configs.imviz.helper.link_image_data.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the last word up to @pllim but this looks good to me!
It still feels weird to me to let user have a proper API |
@pllim - so what do you propose? I think our options would be:
|
It is a possibility and easy to do. People who use API wouldn't use this plugin anyway. This plugin is only for those who does not want to use API or is stuck in the "standalone" app.
No. It is already advertised as public.
It is also possible but more work. We could have a pixel/WCS toggle but with approx always on. To also add in approx would introduce 3 options, not sure how toggle works with that. 🤷
Isn't this the first option? |
I don't entirely agree with this. I suspect many people will use the API first and then try to write reproducible code that will walk through those same steps. The plugin APIs provide an easy transition to them, as the APIs mimic the exact same options available in the plugin. So if someone uses the plugin to change linking, then the plugin API for that is probably easier to find/learn than the helper method with different syntax. If someone starts using Jdaviz with the API, then they may find the helper method easier to access.
What I mean is that if we were creating this plugin now, I would advocate for not having the helper-method at all, or at least not public. But I agree, in this case it already does exist, so we should avoid removing it. I think that alone is an excuse for having the two ways to do the same thing... and we just need to keep this in mind as we develop new functionality to try to avoid it in the future. But ultimately some things will move from plugins to core functionality, or vice versa, and we can't always predict that. |
Personally, I would find it annoying if the existing helper API is removed. What I can now do in one line, I would need multiple lines to accomplish using the plugin API. |
I think this is a good thing to keep in mind going forward as well. If we were designing this from scratch now (which we're not), we could have a similar helper-method at the plugin level to pass multiple options and update the linking. There are similar calls to that implemented in the spectral extraction plugin now, and might be a good pattern to try to follow elsewhere. But we're not designing this from scratch and already have the method in the helper and the UI in the plugin... my opinion is that duplicated functionality is less confusing than having the exposed API lacking for the plugin just because it exists elsewhere as well 🤷 but I'm curious to hear what others think as well. |
I think my take is that it is ok to both consistently expose APIs for all of the plugins, and have convenient helper functions for commonly used things that are perhaps shorter or more concise to use than the plugin API itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, let's get this in then but please add a change log first. Thanks!
d2660bc
to
0f71b8a
Compare
ah, lost my chance to squash & merge 😢 😂 |
Ooops, sorry. It is only 3 commits though and they look atomic enough. 😬 |
Description
This pull request extends on #1401 and provides user-API access to the links control plugin.
Plugin User API docs
TODO:
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.CHANGES.rst
?