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.Session
can be called.Warning
Usage of
pygmt.clib.Session
as a context manager in awith
block is preferred over callingpygmt.clib.Session.create
andpygmt.clib.Session.destroy
manually.Calls
GMT_Create_Session
and generates a newGMTAPI_CTRL
struct, which is actypes.c_void_p
pointer. Sets thesession_pointer
attribute to this pointer.Remember to terminate the current session using
pygmt.clib.Session.destroy
before creating a new one.- Parameters:
name (str) – A name for this session. Doesn’t really affect the outcome.