Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Dec 4, 2025

This PR migrates Figure.coast's rivers parameter to the new alias system.

I also try my best to improve the docstrings to make them more readable.

Preview: https://pygmt-dev--4242.org.readthedocs.build/en/4242/api/generated/pygmt.Figure.coast.html#pygmt.Figure.coast

rivers can accept values in different formats, e.g, :

  • rivers=1
  • rivers=[1, 3, 5]
  • rivers="1/1p,blue"
  • rivers=["1/1p,blue", "2/2p,red"]

For the last two cases, perhaps it's more Pythonic to pass a dictionary like: rivers = {1: "1p,blue", 2: "2p,red"}, but I also feel that it makes the argument more complicated than strings. So I don't implement the dict-style argument.

Related to #4240

@seisman seisman added this to the 0.18.0 milestone Dec 4, 2025
@seisman seisman added maintenance Boring but important stuff for the core devs needs review This PR has higher priority and needs review. labels Dec 4, 2025
Comment on lines 131 to 138
**Examples:**
- ``rivers=1``: Draw permanent major rivers with default pen.
- ``rivers="1/0.5p,blue"``: Draw permanent major rivers with a 0.5-point blue
pen.
- ``rivers=["1/0.5p,blue", "5/0.3p,cyan,dashed"]``: Draw permanent major rivers
with a 0.5-point blue pen and intermittent major rivers with a 0.3-point
dashed cyan pen.
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 a few examples to explain it better.

Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me!

@seisman seisman added the skip-changelog Skip adding Pull Request to changelog label Dec 7, 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 Dec 8, 2025
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Dec 8, 2025
@seisman seisman merged commit 8b94170 into main Dec 8, 2025
25 checks passed
@seisman seisman deleted the coast/rivers branch December 8, 2025 12:12
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.

4 participants