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 #4476

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
20bd453
importing display function from IPython.display to display the map image
rohannallamadge Oct 8, 2024
653139e
Merge branch 'main' into display_update
rohannallamadge Oct 8, 2024
e95c87d
grass.jupyter:Add _repr_pretty_ for better Jupyter/Quarto integration
rohannallamadge Oct 17, 2024
4a8e906
Merge branch 'main' into display_update
rohannallamadge Oct 17, 2024
e5fb33c
grass.jupyter:update show() to return Image object instead of calling…
rohannallamadge Oct 17, 2024
25345d9
Merge branch 'display_update' of https://github.com/rohannallamadge/g…
rohannallamadge Oct 17, 2024
fb89f80
git commit -m "Remove empty line as suggested by ruff"
rohannallamadge Oct 18, 2024
be3b9d8
Merge branch 'main' into display_update
rohannallamadge Oct 18, 2024
66157e0
refactor: remove return from show() and use display() for inline rend…
rohannallamadge Oct 19, 2024
8103055
Merge branch 'display_update' of https://github.com/rohannallamadge/g…
rohannallamadge Oct 19, 2024
291030c
Merge branch 'main' into display_update
rohannallamadge Oct 19, 2024
0cc242a
Removed empty line as suggested by ruff
rohannallamadge Oct 19, 2024
dcd7e56
Merge branch 'display_update' of https://github.com/rohannallamadge/g…
rohannallamadge Oct 19, 2024
05d9b90
style: reformat import statements as suggested by black
rohannallamadge Oct 19, 2024
9db48cd
Fix formatting of imports and remove duplicate display line
rohannallamadge Oct 19, 2024
084d246
Update .pylintrc: fix overgeneral-exceptions and remove no-self-use o…
rohannallamadge Oct 20, 2024
53e86f9
git commit -m "Fix formatting issues in parsetab.py"
rohannallamadge Oct 20, 2024
6aef31c
Fix import organization based on review suggestion
rohannallamadge Oct 20, 2024
d16bbf3
Fix import organization based on review suggestion
rohannallamadge Oct 20, 2024
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
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -652,5 +652,6 @@ min-public-methods=1

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=BaseException,Exception


8 changes: 5 additions & 3 deletions python/grass/jupyter/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,11 @@ 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

return Image(self._filename)
from IPython.display import (
Image,
display, # pylint: disable=import-outside-toplevel
)
display(Image(self._filename))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black] reported by reviewdog 🐶

Suggested change
display(Image(self._filename))
display(Image(self._filename))


def save(self, filename):
"""Saves a PNG image of map to the specified *filename*"""
Expand Down
8 changes: 5 additions & 3 deletions python/grass/jupyter/map3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ 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

return Image(self._filename)
from IPython.display import (
Image,
display,
) # pylint: disable=import-outside-toplevel
display(Image(self._filename))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black] reported by reviewdog 🐶

Suggested change
display(Image(self._filename))
display(Image(self._filename))

Loading