GenericMappingTools / GenericMappingTools/sphinx_gmt
The gmtplot directive no longer works for PyGMT output
- Lingua principale
- Python
- Stelle
- 7
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia in sphinx_gmt/sphinx_gmt/gmtplot.py, in eval_python, prestando particolare attenzione alla gestione intorno a catch_display.output.data. Confronta questo flusso con il comportamento riprogettato di PyGMT Figure.show() descritto nell’issue. Il lavoro è completato quando la direttiva gmtplot esegue il rendering dell’esempio PyGMT fornito senza l’errore NoneType.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100