Repository navigation
Ensure GMT_Call_Module finds out if classic or modern session - #1144
Merged
Merged
Conversation
Most of ouir experience with GMT_Call_Module is in gmt.c, where it is sandwiched bewteen GMT_Create_Session and GMT_Destroy_Session. However, direct users of the API, such as the GMT/MATLAB toolbox ,Julia, and potentially PyGMT, may issue many GMT_Call_Module commands between those Session calls. Thus, it is important that GMT_Call_Module can determine if we are in a classic or modern mode session. Up until now it did not. At least some of the trouble @joa-quim has in Julia is linked to the need to add extra calls to gmt_manage_session etc to make sure the modern run mode is set. This PR does away with this and moves the test for modern mode, as well as those pesky one-liner modern mode commands, inside GMT_Call_Module. ALl tests still pass. The testgmtshell.c, which I updated a bit, was really helpful in figuring out the details since it can simulate an API multi-command session by being fed strings of GMT and UNIX commands. Closes #1142.
joa-quim
approved these changes
Jul 10, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Most of ouir experience with GMT_Call_Module is in gmt.c, where it is sandwiched bewteen GMT_Create_Session and GMT_Destroy_Session. However, direct users of the API, such as the GMT/MATLAB toolbox, Julia, and potentially PyGMT, may issue many GMT_Call_Module commands between those Session calls. Thus, it is important that GMT_Call_Module can determine if we are in a classic or modern mode session. Up until now it did not. At least some of the trouble @joa-quim has in Julia is linked to the need to add extra calls to gmt_manage_session to make sure the modern run mode is set. This PR does away with this and moves the test for modern mode, as well as the check for those pesky one-liner modern mode commands, inside GMT_Call_Module. All tests still pass for me, but please check on your OS..
The testgmtshell.c program, which I updated a bit, was really helpful in figuring out the details since it can simulate an API multi-command session by being fed strings of GMT and UNIX commands, as discussed in #1142. Closes #1142.