Skip to content

Ensure GMT_Call_Module finds out if classic or modern session - #1144

Merged
joa-quim merged 1 commit into
6.0from
modulecallawareness
Jul 10, 2019
Merged

joa-quim merged 1 commit into
6.0from
modulecallawareness

Conversation

@PaulWessel

Copy link
Copy Markdown
Contributor

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.

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
joa-quim merged commit 5034cf7 into 6.0 Jul 10, 2019
@joa-quim
joa-quim deleted the modulecallawareness branch July 10, 2019 10:33
@PaulWessel
PaulWessel requested a review from a team July 10, 2019 18:31
obaney pushed a commit to obaney/gmt that referenced this pull request Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants