Skip to content

pygmt.begin/pygmt.end: Initiate and terminate a GMT modern mode session #4574

Closed
0 of 1 issue completed

Description

@seisman

This issue tracks the implementation of pygmt.begin and pygmt.end in PyGMT, which together manage the lifecycle of a GMT modern mode session. Progress is tracked at PyGMT: Wrapping GMT modules.

Documentation

Notes on Implementation

The PyGMT session is implemented like below:

gmt begin pygmt-session
gmt figure figname
gmt basemap ...
...
gmt psconvert ....
gmt end 
  • pygmt.begin is called once at import time to create the global PyGMT session
  • pygmt.end is registered to run automatically when the Python interpreter exits
  • The GMT end module normally displays or saves the finished product; in PyGMT this responsibility is delegated to pygmt.Figure.show and pygmt.Figure.savefig, so the show option of gmt end is intentionally not exposed.

Linked Pull Requests

Related Issues and Discussions

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions