Skip to content

Policy on wrapping new GMT modules step by step from initial implementation to gallery example #1599

Closed

Description

@weiji14

Description of the desired feature

Wrapping a new GMT module in PyGMT is usually a big task (as we've learned the hard way from #804), so it's better on both the contributor and reviewer(s) if small, manageable chunks are done (as per https://github.com/GenericMappingTools/pygmt/blob/v0.5.0/doc/contributing.md#general-guidelines-for-making-a-pull-request-pr).

This step-by-step process seems to have worked well for @willschlitzer and others in the past few months, and for the sake of new contributors, we should probably 1) document the step-by-step policy and 2) track the status of each GMT module being wrapped.

Documenting how new GMT modules should be wrapped

Easiest way would be to modify the 'Reminders' in the Pull Request template at https://github.com/GenericMappingTools/pygmt/blame/v0.5.0/.github/PULL_REQUEST_TEMPLATE.md#L11-L17. Specifically, the - [ ] If adding new functionality, add an example to docstrings or tutorials. line should be made optional or something.

Other than that, we could put a note in https://github.com/GenericMappingTools/pygmt/blob/v0.5.0/doc/contributing.md that these are the general stages on wrapping a GMT module:

  1. Wishlist
  2. 'Wrapper for XXX' feature request issue
  3. 'Wrap XXX' initial feature implementation PR
  4. 'Add missing aliases to XXX' documentation PR / 'Support some functionality in XXX' enhancement PR
  5. 'Add gallery example for XXX' documentation PR
  6. 'Add tutorial for XXX' documentation PR (optional)

Note that step 3 and 4 can be done in parallel in some cases.

Tracking the status (feature completeness) of a PyGMT module

Ideally we would have an issue to track a PyGMT module from its initial implementation to the final gallery example/tutorial, but that's a bit of a hassle. So let's track it using cards instead. See https://github.com/GenericMappingTools/pygmt/projects/9

image

If any of you have a new wishlist item, or find an incomplete module that's not added, please add it to the project board!

Originally posted by @weiji14 in #1072 (comment)

Just on this point (and as I've mentioned to Jiayuan at #1145 (review)), I'd recommend wrapping as few aliases as you can get away with in this PR. We can open up separate PRs to wrap any complicated parameter like inquire=I, or transparency=t, and the gallery example/tutorial can be left for another day too.

To be clear, that means you just have to alias the required arguments (https://docs.generic-mapping-tools.org/dev/histogram.html#required-arguments), and the common aliases (-R, -J, -c, -p, -t, etc) to pass. Maybe add one minimal unit test to hit the code coverage target. I see you've done a few aliases already (and you can leave them in if you want), but don't feel like you have to complete all of them.

Example workflow would be to do: Minimal PR (this one) -> Gallery Example PR -> Complete documentation/aliases PR -> Full Tutorial PR

P.S. Yes, we should document this 'policy' about wrapping modules chunk by chunk somewhere, but thought I'd mention it to you first.

Are you willing to help implement and maintain this feature? Yes/No

Activity

  1. added
    documentation
    on Oct 31, 2021
  2. added this to the 0.6.0 milestone on Oct 31, 2021
  3. maxrjones commented on Nov 1, 2021

    @maxrjones
    Member

    Thanks for the great write-up! I agree with both points about issues being ideal for tracking and also a bit of a hassle. Maybe it's just that I am not used to it yet, but I find it a bit difficult to determine where on the path to completeness a module is based on the project board. What do you think about having a separate Feature request: wrap new GMT module issue template that includes a checklist for these steps? This could be in addition to your points about modifying the contributing guide and pull request template.

  4. willschlitzer commented on Nov 2, 2021

    @willschlitzer
    Contributor

    Thanks for the great write-up! I agree with both points about issues being ideal for tracking and also a bit of a hassle. Maybe it's just that I am not used to it yet, but I find it a bit difficult to determine where on the path to completeness a module is based on the project board. What do you think about having a separate Feature request: wrap new GMT module issue template that includes a checklist for these steps? This could be in addition to your points about modifying the contributing guide and pull request template.

    I think this is a good idea. It's easy to say we want to wrap something in small, manageable chunks, but that's not specific and someone new to the project (or not new at all) may be confused on what the expectations are for wrapping a function.

  5. willschlitzer commented on Nov 19, 2021

    @willschlitzer
    Contributor

    @weiji14 Are you envisioning this as an addition to CONTRIBUTING.md or should it be somewhere else in the documentation?

  6. weiji14 commented on Nov 20, 2021

    @weiji14
    MemberAuthor

    @weiji14 Are you envisioning this as an addition to CONTRIBUTING.md or should it be somewhere else in the documentation?

    Yes, I think it should be in CONTRIBUTING.md somewhere, but the Pull Request template's checklist also needs some modification.

  7. maxrjones commented on Dec 14, 2021

    @maxrjones
    Member

    I'm starting to get a bit more used to the project board and think this could be really helpful. I have a couple suggestions:

    1. Include a checklist on the cards that gives context to the referenced issues/PRs(e.g., https://github.com/GenericMappingTools/pygmt/projects/9#card-71936074) This might be redundant with the feature request issues, so it could be only applied to the modules that aren't being tracked by an issue.
    2. Combine panels 4 (gallery) and 5 (tutorial) since not all modules will need both.
  8. willschlitzer commented on Dec 15, 2021

    @willschlitzer
    Contributor

    I'm a fan of the project board as well; I think it makes it easier to look at the big picture and see what tasks need to be done, rather than look to find issues for specific modules to see if they need additional features.

    This might be redundant with the feature request issues, so it could be only applied to the modules that aren't being tracked by an issue.

    I don't think we have many new modules being tracked by an issue. I think it would be easiest to transition existing feature request issues to the project board, rather than leave issues open for potentially a long time while we wait for the later stages of a module getting wrapped.

    1. Combine panels 4 (gallery) and 5 (tutorial) since not all modules will need both.

    Agreed.

  9. modified the milestones: 0.6.0, 0.6.1 on Mar 11, 2022
  10. maxrjones commented on Mar 29, 2022

    @maxrjones
    Member

    What do you think about modifying the project board so that the modules are placed in the column that requires completion rather than the column that has been completed? I think this would be more clear for finding out what needs to be done and would better account for the fact that not all steps are always completed in order. For example, wiggle is currently in the column 'Added gallery|tutorial example', which is true but not that helpful because it still has missing aliases.

    My suggested columns are:

    1. Feature request issue (where module cards live when there's only an issue open for discussion)
    2. Initial implementation (modules that are being implemented for the first time)
    3. Complete aliases (modules that have an initial implementation but are missing aliases, which may be in progress)
    4. Gallery|tutorial example (modules that need a gallery or tutorial, which may be in progress)
    5. Ongoing maintenance (modules that have steps 1-4 completed)
  11. seisman commented on Mar 30, 2022

    @seisman
    Member

    Sounds good to me. Should we start to use the Projects (beta) instead?

  12. willschlitzer commented on Mar 30, 2022

    @willschlitzer
    Contributor

    I think it is a good idea for modules to be in the column with work to be done instead of work last completed.

    I'm not opposed to Projects (beta), but looking at the GitHub page for it, I'm not sure what it will enable us to do that isn't already covered on the current module wrapping project.

  13. maxrjones commented on Mar 30, 2022

    @maxrjones
    Member

    I don't know of a way to transfer projects from Projects to Projects (beta) anyways. Maybe they will add this feature when it's out of beta. For now, I think we could start try out Projects (beta) for new projects.

  14. removed this from the 0.6.1 milestone on Apr 9, 2022
  15. 20 remaining items

  16. added
    discussions
    on Jan 6, 2025
  17. seisman commented on Jan 6, 2025

    @seisman
    Member

    I've signed up the waiting list for the GMT organization and hopefully, we don't have to wait too long to try it.

    The sub-issue feature is approved for the GenericMappingTools org. You can see the "Create sub-issue" button in the first comment box of issues. Let's try it!

  18. unpinned this issue on Jan 9, 2025
  19. seisman commented on Mar 19, 2025

    @seisman
    Member

    I've made some changes to the project board at PyGMT: Wrapping GMT modules. I added three new fields (1. Initial implementation; 2. Complete Aliases; 3. Tutorial/Example) as shown below.

    Image

    If you visit #3646, and click the arrow in the projects section on the side panel, you'll see the wrapper status like below:

    Image
    It's clear that this wrapper is 100% done and has an examples (but no tutorial). I think the new project board makes it much easier to track the progress (milestone can be the version when the initial implementation was done or when all aliases are supported).

    As I initially mentioned in #1599 (comment), here are the steps:

    1. A PyGMT user opens an issue to request wrapping a module
    2. Discuss if we want to wrap the module, or what users would like to see about the new feature
    3. Create a new central issue (e.g., Figure.paragraph: Typeset one or multiple paragraphs #3710) to track the progress of wrapping the module.
      • The issue should be added to the Project board.
      • The issue should contain a complete list of the module's options and the goal is to alias all the options. For each task, checked->Implemented; unchecked: To be implemented/discussed; Strikethrough->Won't implement (Explain the reason)
      • We need to issue template for such issues
      • This step also take some times, since we need to read the module documentation and write the issue
    4. Close the issue opened in step 1, and leave a comment like "Thank you for opening the request. The progress of wrapping the module will be tracked in issue XXX and project board XXX".
    5. One PR for the initial implementation focusing on required and important parameters
    6. Close the issue opened in step 3 and leave a comment like "The initial implementation of wrapping the XXX module is done in PR XXX, but not all functionalities are implemented yet. Further progress will be tracked in the Projects board.". This is necessary to avoid having hundreds of long-term open issues.
    7. Even after closing the central issue, we can still comment on the issue to discuss the possible implementation of other aliases, and thoughts on gallery example and tutorials.
  20. seisman commented on Oct 9, 2025

    @seisman
    Member

    Since we usually stop merging code changes into the main branch within a week or two after each release, just in case a patch release is needed (xref: #4146 (review)), I think this is a good time to discuss non-code issues.

    @GenericMappingTools/pygmt-maintainers what do you think about the steps I proposed above? I plan to finalize the policy in three or more separate PRs:

    1. Update/simplify the PR template
    2. Add an issue template for wrapping a GMT module
    3. Explain the steps in the contributing guides
  21. weiji14 commented on Oct 10, 2025

    @weiji14
    MemberAuthor

    Yeah, the proposal looks good, and the Table view project board makes a lot more sense (I'm using a similar view for my work projects). Feel free to open the PRs and will review them.

  22. added this to the 0.18.0 milestone on Oct 10, 2025
  23. added
    maintenance
    and removed
    discussions
    on Oct 10, 2025
  24. pinned this issue on Oct 17, 2025
  25. unpinned this issue on Dec 7, 2025
  26. removed this from the 0.18.0 milestone on Dec 18, 2025
  27. added this to the 0.19.0 milestone on Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions