Uh oh!
There was an error while loading. Please reload this page.
Let Figure.savefig support filenames with spaces - #1116
Conversation
weiji14
commented
Mar 25, 2021
See my comment at #804 (comment) on how to fix the space issue. If the tests pass, do we still need this PR? |
seisman
commented
Mar 25, 2021
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). |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
seisman
commented
Apr 1, 2021
@weiji14 Any other concerns? |
seisman
commented
May 9, 2021
Ping @GenericMappingTools/pygmt-contributors for comments if we should allow whitespace in figure names. |
core-man
commented
May 9, 2021
I think so and this PR is simple enough. |
weiji14
left a comment
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
willschlitzer
commented
May 9, 2021
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 <23487320+weiji14@users.noreply.github.com>
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 formatandmake checkto 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