Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Jan 19, 2026

@seisman seisman force-pushed the grdgradient/normalize branch from c64f483 to 80afd26 Compare January 27, 2026 04:46
@seisman seisman changed the title pygmt.grdgradient: Pythonic implemention of the normalization pygmt.grdgradient: Add parameters 'normalize'/'norm_ambient'/'norm_amp'/'norm_sigma'/'norm_offset' for normalization Jan 27, 2026
@seisman seisman added this to the 0.19.0 milestone Jan 27, 2026
@seisman seisman added the enhancement Improving an existing feature label Jan 27, 2026
…p'/'norm_sigma'/'norm_offset' for normalization
@seisman seisman force-pushed the grdgradient/normalize branch from 80afd26 to c3d9ee3 Compare January 28, 2026 03:01
@seisman seisman marked this pull request as ready for review January 30, 2026 09:42
@seisman seisman added the needs review This PR has higher priority and needs review. label Jan 31, 2026
Copy link
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 the grdgradient function to provide a more Pythonic interface for the normalization option (-N in GMT). Instead of requiring users to provide GMT CLI-style strings, the PR introduces dedicated parameters for normalization control.

Changes:

  • Adds new parameters normalize, norm_amp, norm_ambient, norm_sigma, and norm_offset to pygmt.grdgradient for more intuitive normalization control
  • Implements backward compatibility by allowing the old GMT CLI string syntax while preventing mixed usage of old and new syntax
  • Updates documentation to explain the new Pythonic parameter interface and mathematical formulas

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
pygmt/src/grdgradient.py Adds helper function _alias_option_N to handle new normalization parameters and their conversion to GMT CLI format; updates function signature and documentation
pygmt/tests/test_grdgradient.py Adds tests to verify that mixing old GMT syntax with new parameters raises appropriate errors
examples/gallery/images/grdgradient_shading.py Updates example to demonstrate new Pythonic normalization syntax with normalize="cauchy"/"laplace" and norm_amp parameter

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

@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 Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature final review call This PR requires final review and approval from a second reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants