Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Oct 23, 2025

Parameters center/endpoint/pole/width all accept a tuple of two values. This PR migrates them to the new alias system.

The length parameter is slightly complicated in that it can accept a tuple or a string "w" (with the long name "limit" from https://github.com/GenericMappingTools/gmt/blob/88b836ea9f6429e4d94fbadd508ef97497671eb1/src/longopt/project_inc.h#L37).

aliasdict = AliasSystem(
C=Alias(center, name="center", sep="/", size=2),
E=Alias(endpoint, name="endpoint", sep="/", size=2),
L=Alias(length, name="length", sep="/", size=2, mapping={"limit": "w"}),
Copy link
Member Author

Choose a reason for hiding this comment

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

I've added doctests in PR #4173 to ensure that parameters sep and mapping can coexist.

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Oct 23, 2025
@seisman seisman added this to the 0.18.0 milestone Oct 23, 2025
@seisman seisman changed the title project: Migrate the 'center'/'endpoint'/'pole'/'width'/'length' parameters to the new alias system pygmt.project: Migrate the 'center'/'endpoint'/'pole'/'width'/'length' parameters to the new alias system Oct 23, 2025
@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 Nov 5, 2025
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Nov 6, 2025
@seisman seisman merged commit 4219ebe into main Nov 6, 2025
19 of 23 checks passed
@seisman seisman deleted the AliasSystem/project branch November 6, 2025 02:30
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants