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
Figure.grdcontour: Adjust processing of arguments passed to the "annotation" and "interval" parameters, deprecate "sequence_plus" #3116
Figure.grdcontour: Adjust processing of arguments passed to the "annotation" and "interval" parameters, deprecate "sequence_plus" #3116
Changes from 2 commits
a3fa214
ee143e6
e59f077
05b5abb
99dc353
731d014
c8b805b
584956e
4a7a143
13360d4
57837fb
4f06fe4
311015e
560622d
4ae5073
6925eca
bbeb83c
078553c
1e114cf
c67fcf8
0cd2f0b
ccd6b01
581eef4
a86305c
4c52daa
c646b51
6a6df2c
7c3f012
f2805bb
d442adf
11b2dac
4708483
56afbe8
c8772bf
9a9ae49
ad5c33e
32c4f90
d9c734b
9f394f7
557af15
e964dda
4501bab
5fa02fb
988d77e
7ade301
cb6871b
a4c9216
e25e9ed
7fee937
be21572
a05ec74
fedf60d
6c53454
574c4a7
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 am wondering whether here the squared brackets are used to indicate that
annot_int
should be replaced with the desired value by the user. I find this a bit misleading.The rounded brackets should be replaced by squared brackets as we write "list of arguments".
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 don't think the description is correct. In the PyGMT world, a list of arguments means the option is repeatable. For example
frame=["WSen", "xaf", "yaf"]
is translated to-BWSen -Bxaf -Byaf
. For this parameter, it must beannot_int+e+f10+gred
, not a list.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.
Hm. I tried the following code to understand the input expected by
annotation
. It works for passing a list and I get the same output as for passing a string.Output figure
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.
pygmt/pygmt/src/grdcontour.py
Lines 30 to 32 in 6fd4a00
I see. It's because
A
is defined like above, so the list of arguments is joined by+
.Actually, this is the only parameter that sets to
sequence_plus
.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 think we should disallow the syntax like
annotation=[500, "f10p", "gred"]
, because:500+f10p+gred
So, I think we should remove
A="sequence_plus"
and update the documentation.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 was actually also a bit wondering if we need this possibility, as such a list does not improve the readability significantly compared to the corresponding string. So, I think I am fine with removing
A"sequence_plus"
.