Skip to content

Commit

Permalink
fix: fix conditional when normalized channel axis resolves to 0 (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 authored Feb 11, 2025
1 parent 17dd5c1 commit 2120fc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ndv/controllers/_array_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def _update_visible_sliders(self) -> None:
return
hidden_indices: set[int] = set(self._data_model.normed_visible_axes)
if self._data_model.display.channel_mode.is_multichannel():
if ch := self._data_model.normed_channel_axis:
if (ch := self._data_model.normed_channel_axis) is not None:
hidden_indices.add(ch)

# hide singleton axes
Expand Down
2 changes: 1 addition & 1 deletion src/ndv/models/_data_display_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def current_slice_requests(self) -> list[DataRequest]:

# if we need to request multiple channels (composite mode or RGB),
# ensure that the channel axis is also sliced
if c_ax := self.normed_channel_axis:
if (c_ax := self.normed_channel_axis) is not None:
if self.display.channel_mode.is_multichannel():
if not isinstance(requested_slice.get(c_ax), slice):
requested_slice[c_ax] = slice(None)
Expand Down

0 comments on commit 2120fc9

Please sign in to comment.