-
Notifications
You must be signed in to change notification settings - Fork 235
Figure.coast: Migrate the rivers parameter to the new alias system and improve docstrings #4242
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d improve docstrings
34 tasks
seisman
commented
Dec 4, 2025
pygmt/src/coast.py
Outdated
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. |
Member
Author
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.
I've added a few examples to explain it better.
Member
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.
Looks good to me!
michaelgrund
approved these changes
Dec 8, 2025
yvonnefroehlich
approved these changes
Dec 8, 2025
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR migrates
Figure.coast'sriversparameter 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
riverscan accept values in different formats, e.g, :rivers=1rivers=[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