Skip to content

Commit

Permalink
Merge pull request #338 from clEsperanto/mute-warnings
Browse files Browse the repository at this point in the history
mute warnings when showing images using repr_html
  • Loading branch information
haesleinhuepf authored May 12, 2024
2 parents ae15f44 + 2faf896 commit c0dd39a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pyclesperanto_prototype/_tier0/_array_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ def _repr_html_(self):
imshow(self,
labels=labels,
continue_drawing=True,
colorbar=not labels)
colorbar=not labels,
mute_warning=True)
image = self._png_to_html(self._plt_to_png())
else:
return "<pre>cle.array(" + str(np.asarray(self)) + ", dtype=" + str(self.dtype) + ")</pre>"
Expand Down
7 changes: 4 additions & 3 deletions pyclesperanto_prototype/_tier9/_imshow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .._tier0 import Image, plugin_function

@plugin_function
def imshow(image : Image, title : str = None, labels : bool = False, min_display_intensity : float = None, max_display_intensity : float = None, color_map = None, plot = None, colorbar:bool = False, colormap = None, alpha:float = None, continue_drawing:bool = False):
def imshow(image : Image, title : str = None, labels : bool = False, min_display_intensity : float = None, max_display_intensity : float = None, color_map = None, plot = None, colorbar:bool = False, colormap = None, alpha:float = None, continue_drawing:bool = False, mute_warning:bool=False):
"""Visualize an image, e.g. in Jupyter notebooks.
Parameters
Expand Down Expand Up @@ -30,8 +30,9 @@ def imshow(image : Image, title : str = None, labels : bool = False, min_display
continue_drawing: float
True: the next shown image can be visualized on top of the current one, e.g. with alpha = 0.5
"""
import warnings
warnings.warn("cle.imshow is deprecated, use stackview.imshow instead.")
if not mute_warning:
import warnings
warnings.warn("cle.imshow is deprecated, use stackview.imshow instead.")
import numpy as np
from .._tier0 import pull
from .._tier1 import maximum_z_projection
Expand Down

0 comments on commit c0dd39a

Please sign in to comment.