GenericMappingTools / GenericMappingTools/sphinx_gmt

The gmtplot directive no longer works for PyGMT output

Offen
#55 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Python
Sterne
7
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in sphinx_gmt/sphinx_gmt/gmtplot.py bei eval_python, insbesondere mit der Behandlung rund um catch_display.output.data. Vergleiche diesen Ablauf mit dem im Issue beschriebenen neu gestalteten Verhalten von PyGMT Figure.show(). Als erledigt gilt die Aufgabe, wenn die gmtplot-Direktive das bereitgestellte PyGMT-Beispiel ohne den NoneType-Fehler rendert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
documentation, tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.