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

Rampviz fixes for unexpected viewer limit resets #3171

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

bmorris3
Copy link
Contributor

@bmorris3 bmorris3 commented Aug 27, 2024

Description

Three bugs to fix:

  • When updating the selected slice in the integration viewer in Rampviz, the integration viewer's y-limits change twice and the data flash and move around a bit.

  • When a subset is created in the group-viewer, the integration viewer gets a subset profile by default via glue. That profile layer's icon appears in the legend and layer.visible == True, even though the subset profile can't be seen in the viewer. Glue ensures that profile viewers create visible subset profiles by default, it's on us to override that behavior, and some minor bits of logic are missing.

  • When using the single-pixel ramp-extraction-on-hover tool, integration-viewer limits do not get reset when the preview exceeds the y-limits.

This PR fixes these bugs by:

  • adjusting the logic in integration_viewer.reset_limits to avoid redundant calls
  • ensuring that the automatic subset extractions in the integration viewer are never visible

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)? 🐱

@bmorris3 bmorris3 added this to the 4.0 milestone Aug 27, 2024
@github-actions github-actions bot added plugin Label for plugins common to multiple configurations rampviz labels Aug 27, 2024
@bmorris3 bmorris3 force-pushed the rampviz-slider-reset-limits branch from b6c865c to 2501cd5 Compare August 27, 2024 15:48
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.42%. Comparing base (c46a0df) to head (8c1d2e8).
Report is 106 commits behind head on main.

Files with missing lines Patch % Lines
jdaviz/configs/rampviz/plugins/tools.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3171   +/-   ##
=======================================
  Coverage   88.42%   88.42%           
=======================================
  Files         122      122           
  Lines       18275    18286   +11     
=======================================
+ Hits        16159    16169   +10     
- Misses       2116     2117    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -198,7 +198,11 @@ def _expected_subset_layer_default(self, layer_state):
return

# default visibility based on the visibility of the "parent" data layer
layer_state.visible = self._get_layer(layer_state.layer.data.label).visible
if self.__class__.__name__ != 'RampvizProfileView':
Copy link
Member

Choose a reason for hiding this comment

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

can this not do an isinstance check because of circular import?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pretty sure, yep.

Comment on lines 203 to 205
else:
# Rampviz doesn't show subset profiles by default:
layer_state.visible = False
Copy link
Member

Choose a reason for hiding this comment

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

this else applies to more than just rampviz though, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean - the logic introduced here only affects Rampviz.

Copy link
Member

Choose a reason for hiding this comment

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

yes, but this is in the general JdavizViewerMixin used by viewers across all configs, so the else will be entered by all other cases than RampvizProfileView. For non-rampviz cases, we need the previous behavior of adopting visibility from the corresponding parent data layer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The above if is:

        if self.__class__.__name__ != 'RampvizProfileView':

Copy link
Member

Choose a reason for hiding this comment

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

ah, I misread that as == 🤦 and further confused because the comment in the else mentions rampviz. Similar confusion might be avoided by switching the if and else so the else is the default case (or just paying more attention on my part).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

both are true. I'll switch :D

jdaviz/configs/rampviz/plugins/viewers.py Outdated Show resolved Hide resolved
@bmorris3 bmorris3 force-pushed the rampviz-slider-reset-limits branch from 1bc8208 to d2aef1b Compare August 30, 2024 18:18
@bmorris3 bmorris3 force-pushed the rampviz-slider-reset-limits branch from d2aef1b to 64b4a75 Compare August 30, 2024 18:19
@bmorris3 bmorris3 merged commit 3a0aa4c into spacetelescope:main Aug 30, 2024
19 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
plugin Label for plugins common to multiple configurations rampviz
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants