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: Home after markers no longer crash Imviz #1971

Merged
merged 2 commits into from
Jan 24, 2023
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 @@ -79,6 +79,8 @@ Cubeviz
Imviz
^^^^^

- Fixed crashing when clicking Home button after markers are added. [#1971]

Mosviz
^^^^^^

Expand Down
4 changes: 4 additions & 0 deletions jdaviz/configs/imviz/tests/test_astrowidgets_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ def test_mvp_markers(self):
# TODO: How to check imviz.app.data_collection.links is correct?
assert len(self.imviz.app.data_collection.links) == 14

# Just want to make sure nothing crashes. Zooming already testing elsewhere.
# https://github.com/spacetelescope/jdaviz/pull/1971
self.viewer.zoom_level = 'fit'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the record, I did confirm locally that this test fails on main without this patch.


# Remove markers with default name.
self.viewer.remove_markers()
assert self.imviz.app.data_collection.labels == [
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/core/freezable_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def reset_limits(self, *event):
x_min, x_max = -0.5, -np.inf
y_min, y_max = -0.5, -np.inf
for layer in self.layers:
if not layer.visible:
if not layer.visible or layer.layer.data.ndim == 1:
continue
pixel_ids = layer.layer.pixel_component_ids

Expand Down