-
Notifications
You must be signed in to change notification settings - Fork 220
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
Let Figure.savefig support filenames with spaces #1116
Conversation
See my comment at #804 (comment) on how to fix the space issue. If the tests pass, do we still need this PR? |
Nice fix in #804 (comment). I think this PR is still needed for people who want to use spaces. It's allowed in GMT (https://docs.generic-mapping-tools.org/dev/begin.html#examples). |
Co-authored-by: Wei Ji <[email protected]>
@weiji14 Any other concerns? |
Ping @GenericMappingTools/pygmt-contributors for comments if we should allow whitespace in figure names. |
I think so and this PR is simple enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still reluctant to allow spaces since it adds an if-clause to the code, but ok with supporting it if three or more people agree.
I think it is good to allow this. I'm glad there is the disclaimer that spaces in filenames isn't recommended, but better to increase compatibility. |
…#1116) Co-authored-by: Wei Ji <[email protected]>
Description of proposed changes
Figure.savefig()
doesn't work if filenames contain spaces.Here is an minimal example to reproduce the issue:
This PR fixes the issue by adding double quotes around filenames.
NOTE: Using filenames with spaces is NOT recommended.
However, we have to support it, because sometimes filenames of some
baseline images must contain spaces.
See https://github.com/GenericMappingTools/pygmt/runs/2179626599 for an example failure.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version