Skip to content
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

pygmt.datasets.load_*: Add autocompletion support for the 'resolution' parameter #3260

Merged
merged 4 commits into from
May 25, 2024

Conversation

seisman
Copy link
Member

@seisman seisman commented May 19, 2024

Description of proposed changes

This PR adds type hints to the resolution parameter of the load_** functions, so that editors can autocomplete the resolution parameter.

Preview:https://pygmt-dev--3260.org.readthedocs.build/en/3260/api/generated/pygmt.datasets.load_earth_relief.html

image
  • Pros: autocompletion for the resolution parameter.
  • Cons: The function definition is much longer.

@GenericMappingTools/pygmt-maintainers What do you think?

@seisman
Copy link
Member Author

seisman commented May 23, 2024

Ping @GenericMappingTools/pygmt-maintainers for comments.

@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels May 23, 2024
@seisman seisman changed the title POC: Datasets: Add type hints for the resolution parameter Datasets: Add type hints for the resolution parameter May 23, 2024
@seisman seisman marked this pull request as ready for review May 23, 2024 15:12
@seisman seisman added this to the 0.13.0 milestone May 23, 2024
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels May 24, 2024
Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

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

I thinks the autocompletion for the resolution parameter is an improvement, as the available resolutions differ between the datasets.

pygmt/datasets/earth_magnetic_anomaly.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Show resolved Hide resolved
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
@seisman seisman changed the title Datasets: Add type hints for the resolution parameter pygmt.datasets.load_*: Add autocompletion support for the 'resolution' parameter May 24, 2024
@seisman seisman merged commit 897444a into main May 25, 2024
18 of 19 checks passed
@seisman seisman deleted the typing/resolution branch May 25, 2024 00:35
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants