-
Notifications
You must be signed in to change notification settings - Fork 229
POC: Migrate the parameter 'verbose' to the new alias system and let it support descriptive arguments #4039
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the verbose
parameter to the new alias system and introduces the .add_common()
method to the AliasSystem
class to reduce code duplication when handling common parameters across GMT wrappers.
- Adds the
.add_common()
method toAliasSystem
for centralized management of common parameters likeverbose
- Updates
basemap
function to use the new alias system for theverbose
parameter with type hints and descriptive string arguments - Updates documentation to reflect the change from single-letter codes to descriptive argument names
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
pygmt/src/basemap.py | Migrates verbose parameter to use new alias system with descriptive arguments and type hints |
pygmt/alias.py | Adds add_common method to AliasSystem class and updates docstring examples |
doc/techref/common_parameters.md | Updates documentation to use descriptive verbose argument names instead of single letters |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This PR adds the
.add_common
method to theAliasSystem
class, and also migrate theverbose
parameter to the new alias system.The
.add_common
method is necessary so that we don't have to repeat the following lines in all wrappers:instead, we just need to write like:
We can also write it with class method chaining,
but ruff will format it into an unreadable format like:
so, I prefer to write it like:
Will migrate other wrappers after approval.