Skip to content

Commit

Permalink
Resolve pyright reportOptionalOperand
Browse files Browse the repository at this point in the history
  • Loading branch information
JackEAllen committed Nov 1, 2024
1 parent be277db commit a6aa729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mantidimaging/core/utility/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def set_histogram_log_scale(histogram: HistogramLUTItem) -> None:
:param histogram: The HistogramLUTItem of an image.
"""
x_data, y_data = histogram.plot.getData()
histogram.plot.setData(x_data, np.log(y_data + 1))
if y_data is not None:
histogram.plot.setData(x_data, np.log(y_data + 1))


def generate_histogram_from_image(image_data: np.ndarray, num_bins: int = DEFAULT_NUM_BINS) -> tuple:
Expand Down

0 comments on commit a6aa729

Please sign in to comment.