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

expose surface brightness units in internal get_display_units method #3112

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Jul 23, 2024

Description

This pull request exposes surface brightness units (in addition to flux units) in app._get_display_units. This also adds support for requesting app._get_display_units('spectral_y') which will return either flux or SB, depending on which is being use on the y-axis of the spectral viewer. This is intended for internal use only, but could be useful for WIPs developing support in plugins to react to a change in display units.

cubeviz.app._get_display_unit('flux')
cubeviz.app._get_display_unit('sb')
cubeviz.app._get_display_unit('spectral')
cubeviz.app._get_display_unit('spectral_y')

Previously flux, sb, and spectral were supported as long as the plugin existed. This PR adds a fallback in the case where the plugin does not exist and also adds support for spectral_y to read from the flux_or_sb switch and then retrieve the appropriate unit.

Change log entry

  • Is a change log needed? If yes, is it added to 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, maintainer
    should 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.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone. Bugfix milestone also needs an accompanying backport label.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@kecnry kecnry added this to the 4.0 milestone Jul 23, 2024
@kecnry kecnry added the no-changelog-entry-needed changelog bot directive label Jul 23, 2024
@kecnry kecnry force-pushed the app-display-units branch 2 times, most recently from 66b50ff to b1968b5 Compare July 24, 2024 13:08
@kecnry kecnry marked this pull request as draft July 24, 2024 13:08
@haticekaratay
Copy link
Contributor

Thanks for enabling the selection of parameters in the method. Are failing tests related to this PR?

@kecnry
Copy link
Member Author

kecnry commented Jul 24, 2024

Are failing tests related to this PR?

Yep, I just also replied in #3107 (comment) that the default casting is causing issues with tests, so I may split that part out to a follow-up effort so that it doesn't block the review of the rest of this.

Copy link
Contributor

@cshanahan1 cshanahan1 left a 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. maybe a small test to make sure future changes don't break this since a lot of the plugins will be using this? i'll update this function when the non-steradian surface brightness unit support is finished.

@kecnry kecnry marked this pull request as ready for review July 29, 2024 16:51
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.

Outside of the python 3.11 failure everything looks good to me, love the convenience this adds. We might want to make a note that in generalizing the square angle that this will be an additional area to account for when we support more then sr.

@kecnry
Copy link
Member Author

kecnry commented Jul 30, 2024

hmmm I thought this was passing tests before, but still doesn't on a rebase. I'll have to try to track down and fix before merging - if its anything major, I'll ask for re-reviews.

@kecnry
Copy link
Member Author

kecnry commented Aug 2, 2024

passes now on a rebase without any changes 🤷‍♂️ so I'll merge!

@kecnry kecnry merged commit b3bbd9f into spacetelescope:main Aug 2, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants