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

Update messaging from unit conversion plugin #3155

Merged
merged 17 commits into from
Aug 16, 2024

Conversation

cshanahan1
Copy link
Contributor

@cshanahan1 cshanahan1 commented Aug 15, 2024

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.

@github-actions github-actions bot added cubeviz specviz imviz plugin Label for plugins common to multiple configurations labels Aug 15, 2024
@cshanahan1 cshanahan1 added this to the 4.0 milestone Aug 15, 2024
Copy link
Member

@kecnry kecnry left a 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).

@cshanahan1
Copy link
Contributor Author

@kecnry i just added a call to update based on function selection, does that fix the issue you were seeing?

@kecnry
Copy link
Member

kecnry commented Aug 16, 2024

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

Copy link
Contributor

@gibsongreen gibsongreen left a 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!

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.82%. Comparing base (346d22c) to head (4b2aa11).
Report is 4 commits behind head on main.

Files Patch % Lines
...z/configs/imviz/plugins/coords_info/coords_info.py 80.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@cshanahan1 cshanahan1 merged commit 3976983 into spacetelescope:main Aug 16, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cubeviz imviz plugin Label for plugins common to multiple configurations Ready for final review specviz
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants