Skip to content

Commit

Permalink
pygmt.set_display: Do nothing when the display method is set to 'none' (
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Mar 23, 2023
1 parent 00c8370 commit 8501f5d
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pygmt/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def show(self, dpi=300, width=500, method=None, waiting=0.5, **kwargs):
)
)

if method in ["notebook", "none"]:
if method == "notebook":
if IPython is None:
raise GMTError(
(
Expand Down
1 change: 0 additions & 1 deletion pygmt/src/coast.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ def coast(self, **kwargs):
... )
>>> # Show the plot
>>> fig.show()
<IPython.core.display.Image object>
"""
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access
if not args_in_kwargs(args=["C", "G", "S", "I", "N", "E", "Q", "W"], kwargs=kwargs):
Expand Down
1 change: 0 additions & 1 deletion pygmt/src/grd2cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def grd2cpt(grid, **kwargs):
>>> fig.grdimage(grid=grid)
>>> # show the plot
>>> fig.show()
<IPython.core.display.Image object>
"""
if kwargs.get("W") is not None and kwargs.get("Ww") is not None:
raise GMTInvalidInput("Set only categorical or cyclic to True, not both.")
Expand Down
1 change: 0 additions & 1 deletion pygmt/src/grdcontour.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def grdcontour(self, grid, **kwargs):
... )
>>> # show the plot
>>> fig.show()
<IPython.core.display.Image object>
"""
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access
with Session() as lib:
Expand Down
1 change: 0 additions & 1 deletion pygmt/src/grdimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def grdimage(self, grid, **kwargs):
>>> fig.grdimage(grid=grid, cmap="geo", projection="W10c", frame="ag")
>>> # show the plot
>>> fig.show()
<IPython.core.display.Image object>
"""
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access
with Session() as lib:
Expand Down
3 changes: 1 addition & 2 deletions pygmt/src/inset.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ def inset(self, **kwargs):
...
>>> # Map elements outside the "with" block are plotted in the main figure
>>> fig.logo(position="jBR+o0.2c+w3c")
>>> fig.show() # doctest: +SKIP
<IPython.core.display.Image object>
>>> fig.show()
"""
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access
with Session() as lib:
Expand Down
1 change: 0 additions & 1 deletion pygmt/src/solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def solar(self, terminator="d", terminator_datetime=None, **kwargs):
... )
>>> # show the plot
>>> fig.show()
<IPython.core.display.Image object>
"""

kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access
Expand Down
2 changes: 0 additions & 2 deletions pygmt/src/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ def timestamp(
>>> fig = pygmt.Figure()
>>> fig.timestamp()
>>> fig.show()
<IPython.core.display.Image object>
>>> # Plot the GMT timestamp logo with a custom label.
>>> fig = pygmt.Figure()
>>> fig.timestamp(label="Powered by PyGMT")
>>> fig.show()
<IPython.core.display.Image object>
"""
self._preprocess() # pylint: disable=protected-access

Expand Down

0 comments on commit 8501f5d

Please sign in to comment.