Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grass.jupyter: importing display function from IPython.display #4340 #4476

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
Loading