Skip to content

Commit

Permalink
importing display function from IPython.display to display the map image
Browse files Browse the repository at this point in the history
  • Loading branch information
rohannallamadge committed Oct 8, 2024
1 parent 4d5184d commit 20bd453
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/grass/jupyter/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ def wrapper(**kwargs):
def show(self):
"""Displays a PNG image of map"""
# Lazy import to avoid an import-time dependency on IPython.
from IPython.display import Image # pylint: disable=import-outside-toplevel
from IPython.display import Image, display # pylint: disable=import-outside-toplevel

return Image(self._filename)
return display(Image(self._filename))

def save(self, filename):
"""Saves a PNG image of map to the specified *filename*"""
Expand Down
4 changes: 2 additions & 2 deletions python/grass/jupyter/map3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,6 @@ def render(self, **kwargs):
def show(self):
"""Displays a PNG image of map"""
# Lazy import to avoid an import-time dependency on IPython.
from IPython.display import Image # pylint: disable=import-outside-toplevel
from IPython.display import Image,display # pylint: disable=import-outside-toplevel

return Image(self._filename)
return display(Image(self._filename))

0 comments on commit 20bd453

Please sign in to comment.