Skip to content

Document how to parse verbose messages to report equivalent GMT commands #573

@seisman

Description

@seisman

Description of the desired feature

Sometimes we may need the equivalent GMT commands. For example,

  1. some PyGMT issues are actually due to upstream GMT bugs (https://forum.generic-mapping-tools.org/t/829). When we open a GMT bug, we need the equivalent bash script
  2. currently, how PyGMT works is a little fragile. Any unknown arguments are directly passed to GMT. See a bug report Fail for invalid parameters #256. The error messages are really confusing. But if the equivalent CLI commands are printed out, it would be much easier to understand why it doesn't work as expected.

GMT already provides 7 verbosity levels by the -V option. The 7 verbosity levels (higher levels add more messages) are:

q < e < w < t < i < c < d

Here I propose to add one more verbosity level, for example, verbose='p'. The verbosity level should be between q and e, i.e.,

q <   < e < w < t < i < c < d
    ^
    |
    p

If verbose='p' is used, they PyGMT should print the equivalent GMT command when calling the function call_module().

I only spent a few seconds to choose the character p and its verbosity level. So I'm open to better choices.

Are you willing to help implement and maintain this feature?

Yes, it should be easy to implement it in the call_module() function. Contributions are welcomed.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationupstreamBug or missing feature of upstream core GMT

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions