-
Notifications
You must be signed in to change notification settings - Fork 75
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
Update messaging from unit conversion plugin #3155
Update messaging from unit conversion plugin #3155
Conversation
jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py
Show resolved
Hide resolved
jdaviz/configs/specviz/plugins/unit_conversion/unit_conversion.py
Outdated
Show resolved
Hide resolved
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 think this is good to build on top of now (EDIT: once tests are fixed) - thanks! (Obviously will need the follow-ups for non-steradian support, fixing previews in spectral extraction, and anything remaining from #3144).
@kecnry i just added a call to update based on function selection, does that fix the issue you were seeing? |
I don't think it fully fixes it, but I have that ticket so can take over once this is merged. Since it didn't break here, I think it can be considered out of scope |
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.
These changes look good and to me and should be really helpful for the rest of the effort, great work!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3155 +/- ##
=======================================
Coverage 88.82% 88.82%
=======================================
Files 112 112
Lines 17565 17586 +21
=======================================
+ Hits 15602 15621 +19
- Misses 1963 1965 +2 ☔ View full report in Codecov by Sentry. |
This PR improves the messaging from the unit conversion plugin to broadcast changes in selected display unit. Because some plugins are listening for changes to the spectral y axis (either from toggling flux<>sb, changing flux or angle when it is toggled to SB, or changing flux when it is toggled to flux) this is its own message now.
Every time a new selection of 'flux' is made, there are three GlobalDisplayUnitChanged messages broadcasted : 'flux', 'sb', and 'spectral_y'.
While this is not included in this PR, these changes will make it possible for the correct messaging to be broadcasted when a new angle selection is made (always sending a 'sb' message, and if the spectral y axis is in SB also sending a 'spectral_y' message).
Every time there is a toggle between flux<> sb, the GlobalDisplayUnitChanged axis='spectral_y' message is broadcasted.
A follow up in #3144 will fix how plugins respond to this updated messaging - for now, with the additional broadcasts, there will be some redundant unit conversions in plugins. I fixed some instances of this (in coords_info, spectral extraction) but the follow up for other plugins to intercept the correct message will be in that PR.