Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Allow passing arguments containing spaces into pygmt functions #1487
Allow passing arguments containing spaces into pygmt functions #1487
Changes from 21 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
There are no files selected for viewing
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 know almost nothing about PROJ4, but does a PROJ4 string always contains
+proj=xxx
orEPSG
? If yes, then we can simplify the if-test to something like:The motivation is, since PROJ4 is not commonly used, it seems a waste of time to do call the
replace
method for GMT-style -J.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.
Not sure if all PROJ-strings have either
+proj=xxx
orEPSG
(see https://proj.org/operations/projections/index.html), but they probably do? I know that there's+init=EPSG:xxx
which kinda works when I tried here, but that's actually deprecated syntax (see https://pyproj4.github.io/pyproj/stable/gotchas.html#init-auth-auth-code-should-be-replaced-with-auth-auth-code) and probably not something we want to allow.Also unsure if 2 extra if-checks saves time, considering that either way, a
str.replace
still needs to happen for the space character - either to\040
or to nothing ``.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.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.
Does
"+t'Windrose diagram'"
still work or not?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.
Yes it does still work, but the single quotes would be printed. I think it was a typo from whoever wrote that test.