-
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
Surface brightness -> solid angle conversion updates #3111
Surface brightness -> solid angle conversion updates #3111
Conversation
8465c3d
to
728c0ae
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3111 +/- ##
==========================================
- Coverage 88.93% 88.89% -0.04%
==========================================
Files 112 112
Lines 17411 17385 -26
==========================================
- Hits 15485 15455 -30
- Misses 1926 1930 +4 ☔ View full report in Codecov by Sentry. |
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 looks pretty good, didn't find any problems testing it. I left one suggestion, I think I can approve after that's addressed.
|
||
# sets the angle unit drop down and the surface brightness read-only text | ||
if self.app.data_collection[0]: | ||
dc_unit = self.app.data_collection[0].get_object().flux.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.
dc_unit = self.app.data_collection[0].get_object().flux.unit | |
dc_unit = self.app.data_collection[0].get_component("flux").units |
I think this is probably a little faster than going through the glue-astronomy
translator to create a Spectrum1D
object just to get the flux.
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.
Awesome! I will make the change now, I have this spot that does the same thing from my last PR so I will make the change there too (EDIT: there is actually place where this is done in unit_conversion.py:
#2940 (comment)
and I am going to make this same adjustment of moving the returns outside of conditionals:
#2940 (comment)
2f233f9
to
196659b
Compare
196659b
to
9d6ac06
Compare
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.
testing this out now and is working well
it looks like app._get_display_unit('sb') is no longer available - i know you can use flux and angle to get this unit, but since other plugins are using this would it make sense to keep this way of accessing it and just make sure everything stays in sync?
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.
One small suggestion on a comment, and we spoke offline about some variable name/conditional cleanup, so I'll hold off on approving for you to make that change. But testing in the notebook, everything works!
jdaviz/configs/specviz/plugins/unit_conversion/unit_conversion.py
Outdated
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 looks good now - there are a couple things I noticed that I think were from the previous PR, not changed here, so I might open a quick follow up after this is merged. But no need to hold this up since this PR didn't introduce them.
@cshanahan1 It doesn't look like this PR changed app.py, any idea when this changed? |
i think its because its trying to access the 'sb_unit_selected' from the unit conversion plugin, which now fails |
It comes from removing
In unit_conversion.py I can change the traitlet from self.sb_unit (new to this PR) to self.sb_unit_selected and it will function as it did in the past, any opposition to this change? That or changing the fstring to remove the selected portion but that might have implications I'm unaware of without testing |
Ahh I see, good call - I didn't read to the end of the method 😅. I agree it might be worth adding a manual case for |
This sounds simpler than what I just suggested. |
@cshanahan1 let me know if this suffices, or if the other suggested change is better for the generalization of units ticket I candy that instead |
That change works for me, my approval stands 🙂 |
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.
yep that works for me now, thanks!
Description
This pull request is to address:
To be done:
Untitled1.mov
Currently, we enable the selection of the surface brightness unit drop down. This ticket will make the surface brightness drop down read-only. A new dropdown will be added, for selecting the denominator, the square angle unit. Surface brightness will then be calculated from the selected flux and angle unit.
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.