Skip to content

Commit 54a3b89

Browse files
authored
Merge pull request #174 from ImperialCollegeLondon/fix-show_image-bug
Add user warning when running show_image() on Windows
2 parents 214b438 + 1933321 commit 54a3b89

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pyprobe/plot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""A module to contain plotting functions for PyProBE."""
2+
import platform
3+
import warnings
24
from typing import TYPE_CHECKING, List, Optional
35

46
import numpy as np
@@ -60,6 +62,11 @@ def show(self) -> None:
6062

6163
def show_image(self) -> None:
6264
"""Show the plot as an image."""
65+
if platform.system() == "Windows":
66+
warnings.warn(
67+
"show_image() is known to hang indefinitely on Windows. "
68+
"If you encounter this issue, use show() instead."
69+
)
6370
img_bytes = self.fig.to_image(format="png")
6471
display(Image(img_bytes))
6572

0 commit comments

Comments
 (0)