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

BUG: Handle incompatible Specviz flux unit #2485

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Sep 27, 2023

Description

This pull request is to see if we can handle spectrum with incompatible flux unit without having to introduce more links.

While I was at it, I also try the "hold sync" trick on a couple of plotting code, like Maarten said. Technically irrelevant to the bug but doesn't hurt?

Fixes #2459

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.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@pllim pllim added bug Something isn't working 💤 backport-v3.7.x on-merge: backport to v3.7.x labels Sep 27, 2023
@pllim pllim added this to the 3.7.1 milestone Sep 27, 2023
@pllim pllim force-pushed the specviz-flux-craziness branch from c8f80e3 to bff7eae Compare September 27, 2023 21:21
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
jdaviz/app.py 85.21% <100.00%> (+0.03%) ⬆️
jdaviz/configs/specviz/plugins/viewers.py 84.17% <100.00%> (+0.57%) ⬆️
jdaviz/configs/specviz/tests/test_helper.py 100.00% <100.00%> (ø)

📢 Thoughts on this report? Let us know!.

@pllim pllim marked this pull request as ready for review September 27, 2023 21:41
@pllim pllim requested a review from astrofrog September 27, 2023 21:42
Copy link
Collaborator

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple comments below but otherwise this approach seems fine to me

jdaviz/app.py Outdated Show resolved Hide resolved
jdaviz/configs/specviz/plugins/viewers.py Outdated Show resolved Hide resolved
@pllim pllim force-pushed the specviz-flux-craziness branch 2 times, most recently from 8625317 to f25dae2 Compare September 29, 2023 14:02
@pllim
Copy link
Contributor Author

pllim commented Sep 29, 2023

Thanks for the review, @astrofrog ! I applied your suggestions and added you as co-author for the commit.

pllim and others added 2 commits September 29, 2023 14:37
Co-authored-by: Thomas Robitaille <thomas.robitaille@gmail.com>
@pllim pllim force-pushed the specviz-flux-craziness branch from f25dae2 to 67b7cc5 Compare September 29, 2023 18:37
Copy link
Contributor

@javerbukh javerbukh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good we no longer silently ignore data with incompatible flux units and make a clear snackbar message that it was not loaded. This seems like the best solution while we work on finding a way to work with /sr units.

Copy link
Collaborator

@rosteen rosteen 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 other than the edit I suggested for the snackbar text. Feel free to merge after accepting that (or rejecting if you feel strongly about it!).

jdaviz/configs/specviz/plugins/viewers.py Show resolved Hide resolved
@pllim pllim merged commit b208386 into spacetelescope:main Oct 4, 2023
18 checks passed
@pllim pllim deleted the specviz-flux-craziness branch October 4, 2023 14:59
meeseeksmachine pushed a commit to meeseeksmachine/jdaviz that referenced this pull request Oct 4, 2023
pllim added a commit that referenced this pull request Oct 4, 2023
…5-on-v3.7.x

Backport PR #2485 on branch v3.7.x (BUG: Handle incompatible Specviz flux unit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Ready for final review specviz 💤 backport-v3.7.x on-merge: backport to v3.7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit conversion: Specviz silently ignoring spectrum with almost compatible units
5 participants