-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Update the mouse over units by listening to the unit-conversion plugin #2931
Update the mouse over units by listening to the unit-conversion plugin #2931
Conversation
a70ec65
to
dae87e7
Compare
It looks to me like the remaining test failures are because |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2931 +/- ##
==========================================
+ Coverage 88.78% 88.93% +0.15%
==========================================
Files 111 112 +1
Lines 17372 17411 +39
==========================================
+ Hits 15424 15485 +61
+ Misses 1948 1926 -22 ☔ View full report in Codecov by Sentry. |
The code is clean and the tests make sure the data is being converted from sb to sb. The only thing that I’m seeing is what Ricky pointed out. There is one thing that I hadn’t considered and so definitely not in the scope of your ticket. When we create subsets, depending on what viewer it I would think we would want the unit of that subset to be based on what viewer it was created in. Right now I think it is listening to that data collection (which doesn’t update from conversions or translation). That could get messy if the user creates subsets with a bunch of different units, but I'll look into this. |
jdaviz/configs/specviz/plugins/unit_conversion/tests/test_unit_conversion.py
Outdated
Show resolved
Hide resolved
value = self._get_cube_value( | ||
image, arr, x, y, viewer | ||
) | ||
if self.current_unit is not None and self.current_unit.is_equivalent(unit): |
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.
this seems to be the logic that keeps velocity mouseover working for moment maps. Just a note that we'll need to rethink this if/when we have velocity display units as well, since we'll then need to have per-viewer image units based on each viewers "physical type" and its corresponding display units 🤔
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
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.
Looks great - thanks!
self.hub.broadcast(GlobalDisplayUnitChanged('flux', | ||
flux_or_sb, | ||
sender=self)) | ||
self.hub.broadcast( | ||
GlobalDisplayUnitChanged( | ||
"flux" if name == "flux_unit_selected" else "sb", flux_or_sb, sender=self | ||
) | ||
) |
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.
@gibsongreen - does this affect you in #3111? Will we need to emit messages for (flux AND surface brightness) OR (solid angle AND surface brightness)?
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 believe it will be solid_angle and flux, but in my PR solid_angle isn't computed/changed in this function currently (since it is either /sr if surface brightness, or, / pix is the cube loaded is flux (which really should spaxel). Right now it is computed here:
self.angle_unit.choices = create_angle_equivalencies_list(dc_unit) |
When enabling changes to the solid_angle unit then there would be addition of something like solid_angle_unit_selected
that would need to be observed in this function
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.
Looks good to me now, thanks!
Description
This pull request adds the functionality for the mouse over on the image viewers to listen to the unit conversion plugin.
Fixes #
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.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.