Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Sep 27, 2024

Description of proposed changes

This PR adds typing hints for the GMT anchor codes like TL/TR.

The new module pygmt._typing is inspired by https://github.com/numpy/numpy/tree/main/numpy/_typing and https://github.com/pandas-dev/pandas/blob/main/pandas/_typing.py.

In GMT, the order of horizontal and vertical alignments doesn't matter, so both TL and LT are accepted, but here only codes like TL are added to avoid making the function signature to long.

@seisman seisman marked this pull request as draft September 27, 2024 05:26
The x and y coordinates, or an array of x and y coordinates to plot
the text.
position : str
position
Copy link
Member

Choose a reason for hiding this comment

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

Small nit, could you reverse the order of L102 and L103 below, so that Vertical (TMD) is on top of Horizontal (LCR)?

@seisman seisman marked this pull request as ready for review October 11, 2024 05:56
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog typing Type hints and static type checking labels Oct 11, 2024
@seisman seisman added this to the 0.14.0 milestone Oct 11, 2024
@seisman seisman merged commit 3e3b575 into main Oct 11, 2024
19 of 21 checks passed
@seisman seisman deleted the typing/justify branch October 11, 2024 06:05
seisman added a commit that referenced this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog typing Type hints and static type checking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants