-
Notifications
You must be signed in to change notification settings - Fork 229
Allow passing arguments containing spaces into pygmt functions #1487
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
Changes from 9 commits
b5ad405
14648c2
924f439
707745f
03e4308
095449a
d81b80b
dd849cb
c29e632
83c8c3b
2ba8420
b58af8b
3ec7727
f19c41b
7a518a1
9774d5e
ff40d27
36fdec5
6c399ba
4770396
801ba01
ecb580e
a526d45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
outs: | ||
- md5: 3619720cdfcd857cbdbb49ed7fe6e930 | ||
size: 1392 | ||
path: test_config_format_date_map.png |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
outs: | ||
- md5: 8e1c47b1cf6001dad3b3c0875af4562e | ||
size: 150390 | ||
- md5: ce2d5cd1415b7c7bbeea5bf6ff39c480 | ||
size: 150288 | ||
path: test_rose_no_sectors.png |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,7 @@ def test_figure_savefig_filename_with_spaces(): | |
fig.basemap(region=[0, 1, 0, 1], projection="X1c/1c", frame=True) | ||
with GMTTempFile(prefix="pygmt-filename with spaces", suffix=".png") as imgfile: | ||
fig.savefig(imgfile.name) | ||
assert r"\040" not in os.path.abspath(imgfile.name) | ||
assert os.path.exists(imgfile.name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A problem with this PR is that running Any ideas how to improve the test and/or implementation of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I've manually worked around the problem in 83c8c3b so filenames with spaces will be saved as usual (without |
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,7 +152,7 @@ def test_rose_no_sectors(data_fractures_compilation): | |
region=[0, 500, 0, 360], | ||
diameter="10c", | ||
labels="180/0/90/270", | ||
frame=["xg100", "yg45", "+t'Windrose diagram'"], | ||
frame=["xg100", "yg45", "+tWindrose diagram"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it does still work, but the single quotes would be printed. I think it was a typo from whoever wrote that test. |
||
pen="1.5p,red3", | ||
transparency=40, | ||
scale=0.5, | ||
|
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.
Ok, I've fixed the
FORMAT_DATE_MAP="o dd"
issue reported in the forum by wrapping the arguments in double quotes here in commit c29e632. Didn't use\040
becauseo\040dd
doesn't work. The problem with this solution is that the workaround suggested in the forum (useFORMAT_DATE_MAP='"o dd"'
) will break in PyGMT v0.6.0, but I think that's acceptable since that workaround isn't intuitive anyway.