Skip to content

BREAKING: Figure.coast: Add parameter river_lakes for setting fills of river-lakes separately#4376

Open
seisman wants to merge 6 commits into
mainfrom
coast/lakes
Open

BREAKING: Figure.coast: Add parameter river_lakes for setting fills of river-lakes separately#4376
seisman wants to merge 6 commits into
mainfrom
coast/lakes

Conversation

@seisman
Copy link
Copy Markdown
Member

@seisman seisman commented Jan 29, 2026

This PR improves the alias of coast's -C option. The GMT CLI syntax is -Cfill[+l|+r].

Set the shade, color, or pattern for lakes and river-lakes [Default is the fill chosen for “wet” areas -S]. Optionally, specify separate fills by appending +l for lakes or +r for river-lakes, repeating the -C option as needed.

Previously, -C was aliased to lakes. This PR split the -C option into two parameters, lakes and river_lakes. Here is a comparison of old and new usages:

Description Old New
Set same fill for lakes and river-lakes lakes="blue" lakes="blue", river_lakes="blue"
Set fill for river-lakes only lakes="blue+r" river_lakes="blue"
Set fill for lakes only lakes="blue+l" lakes="blue"
Set separate fills for river-lakes and lakes lakes=["blue+r", "green+l"] lakes="green", river_lakes="blue"

Please note that in the old syntax, using lakes="blue" also set the fill color of river-lakes to "blue". If we preserved that behavior, there would be no Pythonic way to fill only lakes without also filling river-lakes. Therefore, I decided to alias lakes="blue" to -Cblue+l, meaning “fill lakes only.” This introduces a breaking change.

Related to #4240

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Figure.coast’s handling of GMT’s -C option to provide a clearer long-form API for setting lake vs river-lake fills, while preserving backward compatibility with the existing lakes=[...] list syntax.

Changes:

  • Added a dedicated _alias_option_C helper to build -C arguments from lakes/river_lakes, including a compatibility path for the legacy list form.
  • Introduced new river_lakes parameter and updated coast validation logic and alias mapping accordingly.
  • Updated docstring alias/parameter documentation around lake and river-lake fills.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pygmt/src/coast.py
Comment thread pygmt/src/coast.py
Comment thread pygmt/src/coast.py
Comment thread pygmt/src/coast.py
Comment thread pygmt/src/coast.py Outdated
@seisman seisman marked this pull request as draft January 29, 2026 12:08
@seisman seisman changed the title Figure.coast: Improve parameters lakes/river_lakes for setting fill of lakes/river-lakes BREAKING: Figure.coast: Add parameter river_lakes for setting fills of river-lakes separately May 17, 2026
@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels May 17, 2026
@seisman seisman added this to the 0.19.0 milestone May 17, 2026
@seisman seisman marked this pull request as ready for review May 17, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature needs review This PR has higher priority and needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants