Skip to content
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

Change default collapse function to sum #1229

Merged
merged 2 commits into from
Apr 5, 2022

Conversation

javerbukh
Copy link
Contributor

@javerbukh javerbukh commented Apr 5, 2022

Description

This pull request changes the default collapse function in the Specviz viewers to sum, instead of maximum.

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 change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set?
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #1229 (4b1b8db) into main (1d8ef1a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1229   +/-   ##
=======================================
  Coverage   77.99%   78.00%           
=======================================
  Files          90       90           
  Lines        7185     7187    +2     
=======================================
+ Hits         5604     5606    +2     
  Misses       1581     1581           
Impacted Files Coverage Δ
jdaviz/configs/specviz/plugins/viewers.py 80.40% <100.00%> (+0.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d8ef1a...4b1b8db. Read the comment docs.

Comment on lines 484 to 487
self.state.function = 'sum'
self.state.reset_limits()
Copy link
Member

Choose a reason for hiding this comment

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

the reset_limits won't be needed with glue-viz/glue#2277

Copy link
Contributor

@pllim pllim Apr 5, 2022

Choose a reason for hiding this comment

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

Would still be needed for older glue even if the upstream PR is accepted?

@javerbukh javerbukh added this to the 2.5 milestone Apr 5, 2022
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.

Does what it says it does - changing from sum, deselecting, the reselecting data re-defaults to sum, but I think that is the behavior we want. Might be nice to consider changing the default upstream in glue, but I think this is a good solution for now!

CHANGES.rst Outdated
Comment on lines 52 to 53
- Change default collapse function to sum. [#1229]

Copy link
Member

Choose a reason for hiding this comment

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

Is this cubeviz-specific (does it belong under the cubeviz header)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, what else is using collapse besides Cubeviz?

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked -- Just Cubeviz is using Collapse, though changing the default might have other side effects. If we accept them, we need to update the change log accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not an API change, bug fix, or new feature as far as I could tell, so I put it in the "other" category. Since the change happens in the Specviz viewer file but is most prominent in Cubeviz, I'm not entirely sure where it goes!

@pllim pllim added the cubeviz label Apr 5, 2022
Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

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

This PR also changes the spectrum shown, not just the default in Collapse plugin. Is this intentional or desirable?

Before this patch

Screenshot 2022-04-05 114346

With this patch

Screenshot 2022-04-05 114156

@javerbukh
Copy link
Contributor Author

I believe so, although @larrybradley was the original reporter of this ticket. Is that the correct behavior, Larry?

@larrybradley
Copy link
Member

Yes, the default collapse on load should be sum. I reported on behalf of @PatrickOgle.

CHANGES.rst Outdated Show resolved Hide resolved
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

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

Thanks!

@pllim pllim merged commit 97219e6 into spacetelescope:main Apr 5, 2022
@javerbukh javerbukh deleted the change_function branch April 5, 2022 16:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants