Skip to content

Convenience classes and additional keywords #219

Open
@mjziebarth

Description

@mjziebarth

Add more convenience classes or keyword parameters to facilitate ease of use

First off: Thanks for the work so far!

Coming from the scipy ecosystem and being an avid matplotlib user, I figured I'd leave some feedback from my experience starting with gmt-python. Since I'll likely be using it during the next couple of years, I'm willing to implement the ideas I have, but they may be quite big so I figured it would be best to discuss them beforehand.

I really like gmt as a tool and the achievable results, but the learning curve is quite steep. Especially since the documentation is not really concise or easy to read and there does not seem to be a big question-answering community around, at least in my limited experience. So I feel like one of the big advantages of gmt-python besides the native interaction with python would be to use the quite common python-intuitivity.

That being said, here's some ideas I had (some obviously inspired by my experiences with matplotlib):

  • Create convenience classes that wrap the interaction with some parts of the gmt workflow. E.g. a Grid-class that can be created from numpy arrays and passed to the grdimage method, handling the xyz2grid calls internally (possibly with caching and whatnot). Or a Colormap class that handles the .cpt creation automatically (like the matplotlib colormaps). Or projection classes that have all the required configuration inside their __init__s

  • Add further self-describing keywords (like List of GMT aliases #48) that are automatically converted to the gmt argument string inside e.g. Figure.plot.

In the end, this mostly boils down to creating more logic inside the methods and wrapping the gmt syntax into the structure supplied by the python language. I have some conceptional code which I use myself in this repository, just to give you a rough idea.

What do you think about the idea? In case the two points seem generally interesting, I'd be willing to discuss in detail what could be possible implementations and develop them.

Are you willing to help implement and maintain this feature?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature wantedlongtermLong standing issues that need to be resolved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions