pygmt.clib.Session.create¶
-
Session.create(name)[source]¶ Create a new GMT C API session.
This is required before most other methods of
pygmt.clib.Sessioncan be called.Warning
Usage of
pygmt.clib.Sessionas a context manager in awithblock is preferred over callingpygmt.clib.Session.createandpygmt.clib.Session.destroymanually.Calls
GMT_Create_Sessionand generates a newGMTAPI_CTRLstruct, which is actypes.c_void_ppointer. Sets thesession_pointerattribute to this pointer.Remember to terminate the current session using
pygmt.clib.Session.destroybefore creating a new one.- Parameters
name (str) – A name for this session. Doesn’t really affect the outcome.