-
Notifications
You must be signed in to change notification settings - Fork 361
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
Add Developer Documentation link to the sidebar #4634
Conversation
This entry in the side-bar will give developers access to low-level documentation only relevant to those who are doing the coding, but is accessible to anyone curious and open for people to comment on.
Long options like |
OK. I was thinking the keywords are strings but you are saying in Julia they are variables (so obviously cannot use hyphens)? |
Nope,
and I'm sure Matlab & Python will scream the same. |
Matlab generally uses CamelCase, I think standard in python is underscores (my preference). |
I understand that variables cannot have hyphens. I am just asking if keywords are in fact variables in Julia. In MATLAB, your example would be 'Vd-aa', 1, and since a string no screaming would ensue. So looks like the same is the case in PyGMT, i.e.,
and I assume fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], read-columns=3) would scream as well. true, @seisman ? If so then read-columns will be changed to readcolumns or incolumns. |
Right, Matlab doesn't have kwargs but I would be very surprised if Python accepted |
Just so I understand and that we are on the same page. If GMT has a common standard option -Rw/e/s/n which on the command-line would be --region=w/e/s/n, this keyword/value combination will be treated differently in the wrappers: MATLAB: gmt ('coast', 'region', [-10 20 -5 44], ...); Just a string/value thing Thus, all keywords must satisfy the usual restrictions on variable names, i.e., cannot start with number, no special symbols, but use underscores or CamelCase to indicate word separations. With that I can revise the common option translation structure. |
To improve correlation between short and long options I think we should do this:
This avoids the read/write-columns. Anyone have feelings about incols versus incolumns? |
It's |
I am OK with the idea that the wrappers can add any number of aliases for the "official" GMT long-option. I have no strong opinion on cols vs columns, but I think it should be plural (so incols, outcols). |
As I told you before I don't intend to use the GMT long-options parsing mechanism. I don't even would know how to implement |
Sorry, the Julia example was meant to be coast(region=[0 360 -90 90], ... straight from your example. |
Description of proposed changes
This PR adds a link to the developer documentation which is a new directory with detailed explanations only relevant to the developers. Currently, it only contains the rationale and design for how to introduce long-options in GMT, but over time the "gurudocs" materials from the sandbox repo will be reformatted and added as new sections in this document. In doing this I broke up the ugly ifdef-ed splitting of the long options for the three blockm*.c programs and I directly show the lines in the codes as part of the docs. Hopefully, this is useful information to the developers as well as wanna-bee developers who may have better ideas on how things should be implemented.