GenericMappingTools / gmt

The Generic Mapping Tools
https://www.generic-mapping-tools.org
Other
843 stars 352 forks source link

6.0.0rc4 breaks pygmt #1636

Closed seisman closed 4 years ago

seisman commented 4 years ago

Below is a simple PyGMT script, which used to work with 6.0.0rc1.

import pygmt
fig = pygmt.Figure()
fig.basemap(region="0/10/0/10", frame=True, projection="X10c")
fig.savefig("map.pdf")

The PyGMT script is equivalent to the following bash script:

gmt begin pygmt-session
gmt figure unique_name -
gmt basemap -R0/10/0/10 -Baf -JX10c
gmt psconvert -A -Fmap -Qg2 -Qt2 -Tf
gmt end

Running the bash script above gives following error message:

psconvert [ERROR]: Syntax error: Modern GMT mode requires the -F option
end [ERROR]: Failed to call psconvert
end [ERROR]: process_figures returned error 71

According to the comments in PyGMT codes, passing format - to the figure module means "don't produce files for this figure when running gmt end". It seems it doesn't work correctly in 6.0.0rc4.

weiji14 commented 4 years ago

The '-' format doesn't seem to be properly documented in the figure docs either?

PaulWessel commented 4 years ago

Are you sure that is how Leo used it? The C code checks to see if the figure name equals -, not the format. And since that fails it tries something... I can add a check so that if either name or format equals - then skip it.

seisman commented 4 years ago

Closed as fixed by #1638.