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

Closed
wants to merge 8 commits into from
Closed

DOC: Complete list of aliases #3945

wants to merge 8 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.

Copy link
Member

Choose a reason for hiding this comment

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

From my current understanding, I prefer the style of grdfill.py.
An overall alphabetical order makes it much easier to find a specific alias within the list.
The missing aliases have to be added manually anyway. As the aliases directly related to GMT flags will very likely not change (and if only very little), I think we have to add the list of these aliases and then this should be fine.

@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.

@seisman seisman marked this pull request as ready for review June 3, 2025 03:09
@seisman seisman marked this pull request as draft June 4, 2025 01:47
@seisman seisman removed the needs review This PR has higher priority and needs review. label Jun 5, 2025
@seisman
Copy link
Member Author

seisman commented Jun 5, 2025

Will be superseded by #3965. Closing.

@seisman seisman closed this Jun 5, 2025
@seisman seisman deleted the doc/alias-list branch June 5, 2025 02:55
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 skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants