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: Not all viewers have get_limits #3361

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Bug Fixes
occured when certain flux-to flux-conversions occured, as well as certain conversions between flux and surface
brightness. This PR also fixed an issue with unit string formatting in the aperture photometry plugin. [#3228]

- Fixed broken histogram pan/zoom in Plot Options plugin. [#3361]

Cubeviz
^^^^^^^
- Removed the deprecated ``save as fits`` option from the Collapse, Moment Maps, and Spectral Extraction plugins; use the Export plugin instead. [#3256]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ def test_stretch_histogram(cubeviz_helper, spectrum1d_cube_with_uncerts):
assert po.stretch_histogram.marks['vmin'].x[0] == po.stretch_vmin.value
assert po.stretch_histogram.marks['vmax'].x[0] == po.stretch_vmax.value

# Make sure some tools work

po_panzoom = po.stretch_histogram.toolbar.tools["jdaviz:panzoom"]
po_panzoom.activate()
po_panzoom.deactivate()

po_prevzoom = po.stretch_histogram.toolbar.tools["jdaviz:prevzoom"]
po_prevzoom.activate()


@pytest.mark.filterwarnings('ignore')
def test_user_api(cubeviz_helper, spectrum1d_cube):
Expand Down
5 changes: 4 additions & 1 deletion jdaviz/core/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class _BaseZoomHistory:
# Mixin for custom zoom tools to be able to save their previous zoom state
# which is then used by the PrevZoom tool
def save_prev_zoom(self):
self.viewer._prev_limits = self.viewer.get_limits()
# Cannot use viewer.get_limits() here because viewers from
# glue-jupyter does not have that method.
self.viewer._prev_limits = (self.viewer.state.x_min, self.viewer.state.x_max,
self.viewer.state.y_min, self.viewer.state.y_max)


class _MatchedZoomMixin:
Expand Down
Loading