Skip to content

DOC: Complete list of aliases #3945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

DOC: Complete list of aliases #3945

wants to merge 6 commits into from

Conversation

seisman
Copy link
Member

@seisman seisman commented May 11, 2025

Addressing the 2nd point raised in issue #3881.

As we break complex options into multiple parameters, the current alias system no longer works, and the {aliases} placeholder in docstrings can't list these parameters anymore.

In issue #3881, I proposed to remove the list of aliases if the documentation on the PyGMT side is complete, but it seems people are against it, and the reasons sounds fair to me.

So, instead of removing the list of aliases, I guess we need to manually add the missing aliases back to the list.

Preview:

@seisman seisman added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels May 11, 2025
Comment on lines 140 to +145
{aliases}
- G = outgrid
- Sa = above
- Sb = below
- Si = between
- Sr = replace
Copy link
Member Author

@seisman seisman May 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The {aliases} placeholder will be expanded to something like:

.. hlist:: 
   :columns: 3
   
   - R = region
   - J = projection

Currently, the solution is to add the missing aliases below the {aliases} placeholder. Does it look bad? Perhaps we should maintain the full list of aliases manually, i.e., remove the {aliases} placeholder and manually add all aliases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should maintain the full list of aliases manually, i.e., remove the {aliases} placeholder and manually add all aliases.

See the changes in grdfill.py for another style.

@seisman seisman added the needs review This PR has higher priority and needs review. label May 12, 2025
@seisman seisman added this to the 0.16.0 milestone May 12, 2025
@seisman seisman added needs review This PR has higher priority and needs review. and removed needs review This PR has higher priority and needs review. labels May 17, 2025
@seisman
Copy link
Member Author

seisman commented May 21, 2025

Please see the changes in grdclip.py and grdfill.py for two ways to list the aliases. I guess we need to vote.

🚀 for the style in grdclip, ❤️ for the style in grdfill, or leave your comments about other solutions.

@seisman
Copy link
Member Author

seisman commented May 27, 2025

Ping @GenericMappingTools/pygmt-maintainers again for comments on this since some PRs are waiting for it.

I prefer the pygmt/src/grdfill.py style.

  • Pros: Keep aliases sorted alphabetically
  • Cons: Need to maintain the alias list manually, but I guess it's mostly a one-time job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation needs review This PR has higher priority and needs review. skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant