-
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
Bugfix: skip color cycler in Mosviz #1900
Conversation
Codecov ReportBase: 88.48% // Head: 88.48% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1900 +/- ##
=======================================
Coverage 88.48% 88.48%
=======================================
Files 95 95
Lines 10540 10543 +3
=======================================
+ Hits 9326 9329 +3
Misses 1214 1214
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@kecnry pointed out that we still want plugins in Mosviz to apply different colors – for example, model fits should still have color. We only want to override the color cycler while selecting different rows. 7c80f2e implements this by manipulating the color cycler from within the row selection methods in the Mosviz table viewer. |
spectrum_viewer = self.jdaviz_app.get_viewer( | ||
self._default_spectrum_viewer_reference_name | ||
) | ||
spectrum_viewer.color_cycler.counter -= 1 |
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.
Interesting solution! I'm wondering if just resetting to 0 would be more general (if adding multiple other entries for the current row, the next row click should still start at gray)?
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.
Good call – in testing I was able to switch between rows with models in such a way that the selected row's spectrum was shown in color other than gray. I'm about to push a commit that sets the counter = -1
-- calls to the cycler always increment the counter by one, even on the zeroth call.
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.
Elegant fix! Some day it would be nice for layers to retain their plot options when changed by the user, in which case this logic might need to change a little... but that is definitely out-of-scope here.
(Would be nice to have green CI before merge, but failure should be unrelated and don't expect this PR to cause any failures)
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.
Confirmed grey only in mosviz, but color cycles in specviz.
Agreed with Kyle, very elegant! It took me a second to read through the code and find where the solution was. Originally I was asking myself, "wait, where's the fix here?" 😅
I'd vote for a squash here to get the other attempts out of the history on main... not sure if squash & merge plays nicely with the automatic backporter or if it needs to be squashed in advance 🤷 |
I seem to remember that they don't play well together, need to squash in advance. |
…0-on-v3.1.x Backport PR #1900 on branch v3.1.x (Bugfix: skip color cycler in Mosviz)
Description
The color cycler update in #1866 unintentionally changes the color of each spectrum visualized with Mosviz. Though the colors are fun, this isn't useful or intended.
This PR only applies the color cycler for configs other than Mosviz. For Mosviz, only the default (gray) color is used.
I've tested locally that Mosviz produces gray lines in the spectrum viewer, and e.g. Cubeviz still cycles colors.
🐱
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.