-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP Move this supplement to 6.1 support #2
base: master
Are you sure you want to change the base?
Conversation
Rely on main GMT's configuration machinery.
I think the custom-supplements should be a straight type 4 supplement: Only have dependency on the official GMT API (gmt.h). If that is the goal (we have other examples of type 1-3) then what this supplement needs (I think) is:
Without gmt_dev.h there is no glue functions since the gmtlib_module_show_all and other functions are not in the API but in the developer library. So custom.so cannot display anything via The alternative solution to this is to elevate the glue functions to the API. The way I would do that is to introduce two new API functions
and 5 new enums:
This means the glue would only need gmt.h and have code like this instead:
etc. I am not sure if this is worth the work since as far as I know there are no type 4 supplements in the wild. Having those use gmt_dev.h instead does not really impose much hardships since all GMT distros install all the developer includes. It would be up to us to insist on separating gmt and gmt-dev in the ubuntos, etc. Thoughts, @seisman and @joa-quim ? |
We cannot access type 4 modules in Matlab, Python or Julia, right? I think this is the biggest limitation of type 4. |
Type 4 suppls should be accessible from Matlab/Julia (don't know how the Python wrapper works) but only API functions will be at reach. Don't really see the interest of this limitation. Anyone building supplements should be at ease to use gmt_dev.h, even if not always needed. |
Hm, maybe yes and no? My ignorance may be showing because I have not looked at the pyGMT code, but I think each module is wrapped individually, so you can do some things differently for each module? in GMTMEX we chose the abstract model where the gmtmex.c code does not know anything about what modules do and how they are called, and instead rely on the user giving a sensible command string and the KEYS to complete that string. So for GMTMEX: Yes, could not work with type 4 supplements, but if the pyGMT developer knows what a type 4 module does they could write a wrapper since in the end there is just a GMT_Call_Module that runs the module. |
Does a type 4 clock the access to the KEYs? (Then, I agree T4 is a waste and would promote crippled supplements) |
Type 4 cannot access KEYS; see my proposal earlier to add API functions to get to keys. |
Then, either that or no T4 at all. |
I guess adding the two new API function is preferable since it will allow all types 1-4 to be accessed fully (i.e., with keys and usage) in gmt. I will add those functions. |
* Update the root CMakeLists.txt * Add CMake codes for building the custom library * Copy FindGMT and FindNETCDF from the GMT repository * Add gmt_gule.c, generated by gmt --new-glue * GMT_Get_Value was renamed to GMT_Get_Values and has one more parameter * custom_version.h was removed * GMT_STR16 was renamed to GMT_VF_LEN * GMT_GRD_HEADER nx and ny was renamed to n_columns and n_rows * Fix GMT_Get_Values in gmtparser.c
Perhaps we should have type 4 and type 5 supplements.
Currently, the supplement is mixed with types. gmtaverage and gmtmercmap are type 4. gmtparser and grdfourier belong to type 5. Here are some remaining issues:
the path to the custom library is empty. |
Yes, that makes sense. Perhaps we should split custom_supplements into two different repos since they have different purposes and prereqs. |
Just copy and paste the full URL of that issue. I think you're talking about |
Rely on main GMT's configuration machinery. Explore if this is a type 4 supplement or type 2.