GenericMappingTools / sphinx_gmt

Sphinx extensions for GMT
https://www.generic-mapping-tools.org/sphinx_gmt
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

The gmtplot directive no longer works for PyGMT output #55

Open seisman opened 2 years ago

seisman commented 2 years ago

Full code that generated the error

.. gmtplot::
    :language: python

    import pygmt

    fig = pygmt.Figure()
    fig.coast(projection="G10/52/12c", region="g", frame="g", land="gray")
    fig.show()

Full error message

Exception occurred:
  File "/Users/seisman/OSS/gmt/sphinx_gmt/sphinx_gmt/gmtplot.py", line 262, in eval_python
    catch_display.output.data
AttributeError: 'NoneType' object has no attribute 'data'

The exceptions are most likely due to the redesign of the PyGMT's Figure.show() method in https://github.com/GenericMappingTools/pygmt/pull/529. The main differences between the old and new Figure.show() method is that, the new Figure.show() method no longer returns the image.