Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.0.0rc4 breaks pygmt #1636

Closed
seisman opened this issue Sep 24, 2019 · 3 comments
Closed

6.0.0rc4 breaks pygmt #1636

seisman opened this issue Sep 24, 2019 · 3 comments

Comments

@seisman
Copy link
Member

seisman commented Sep 24, 2019

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
Copy link
Member

weiji14 commented Sep 24, 2019

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

@PaulWessel
Copy link
Member

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.

PaulWessel added a commit that referenced this issue Sep 24, 2019
See issue #1636.  Here, a format instead of file name was set to - and it was passed to the function that determines the graphics format.  It returned -1 (not found) but it was counted as a format and hence we said ONE output format was selected (isntead of zero).  Closes #1636.
PaulWessel added a commit that referenced this issue Sep 24, 2019
* Dont count figure formats that are not recognized

See issue #1636.  Here, a format instead of file name was set to - and it was passed to the function that determines the graphics format.  It returned -1 (not found) but it was counted as a format and hence we said ONE output format was selected (isntead of zero).  Closes #1636.

* Update the docs
@seisman
Copy link
Member Author

seisman commented Sep 24, 2019

Closed as fixed by #1638.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants