Skip to content

Commit

Permalink
Fix minor display limits edge case exposed by numpy 2. Appeared as lo…
Browse files Browse the repository at this point in the history
…g message.
  • Loading branch information
cmeyer committed Aug 14, 2024
1 parent 2a840a8 commit e4d5208
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nion/swift/model/DisplayItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,9 @@ def _execute(self) -> None:
data_sample = typing.cast(typing.Optional[_ImageDataType], self._get_parameter("data_sample"))
complex_display_type = self._get_optional_string("complex_display_type")
display_range = calculate_display_range(display_limits, data_range, data_sample, element_data_and_metadata, complex_display_type)
# double check for cases where one or the other display limit is specified and the other is calculated.
if display_range is not None and display_range[0] is not None and display_range[1] is not None:
display_range = min(display_range[0], display_range[1]), max(display_range[0], display_range[1])
self.set_result("display_range", display_range)


Expand Down

0 comments on commit e4d5208

Please sign in to comment.