Skip to content

BREAKING: Raise GMTParameterError exception for at_least_one parameters. Previously raise GMTInvalidInput - #4380

Merged
seisman merged 15 commits into
GenericMappingTools:mainfrom
Chuan1937:feat/at_least_one_parameter_validation
Feb 2, 2026
Merged

BREAKING: Raise GMTParameterError exception for at_least_one parameters. Previously raise GMTInvalidInput#4380
seisman merged 15 commits into
GenericMappingTools:mainfrom
Chuan1937:feat/at_least_one_parameter_validation

Conversation

@Chuan1937

Copy link
Copy Markdown
Member

Add GMTParameterError:at_least_one

@seisman
This is the second PR of #4003

Error typesPreferred Parameter NameAlternative Parameter NamesError Message Template
Requiredrequiredmust_have, neededMissing required parameter: '{param}'
Missing required parameters: '{a}', '{b}'
At least one is requiredat_least_oneneed_one_of, , , any_of``one_of``required_anyMissing required parameters: '{a}', '{b}', '{c}'. Must specify at least one.
Must specify at least one of the parameters: '{a}', '{b}', '{c}'
Exactly one is requiredexactly_onemutually_exclusiveMutually exclusive parameters: '{a}', '{b}', '{c}'. Specify exactly one.
At most oneat_most_onemutually_exclusiveMutually exclusive parameters: '{a}', '{b}', '{c}'. Specify at most one
Conflictingconflicts_withconflicts, incompatible_withConflicting parameters: '{a}' cannot be used with '{b}', '{c}'

modified files for grdclip, grdfill, grdgradient,test_grdclip, test_grdfill, test_grdgradient
Comment threadpygmt/exceptions.py Outdated
Comment threadpygmt/src/grdclip.py Outdated
Comment threadpygmt/src/grdfill.py Outdated
Comment threadpygmt/src/grdgradient.py Outdated
@seismanseisman added the maintenance Boring but important stuff for the core devs label Feb 1, 2026
@seismanseisman added this to the 0.19.0 milestone Feb 1, 2026
@seisman

Copy link
Copy Markdown
Member

Also need to update coast.py and dimfilter.py

Xingchen Heand others added 4 commits February 1, 2026 17:18
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment threadpygmt/src/grdgradient.py Outdated
Comment threadpygmt/src/grdfill.py Outdated
Comment threadpygmt/src/grdclip.py Outdated
Xingchen Heand others added 5 commits February 1, 2026 17:49
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment threadpygmt/exceptions.py Outdated
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment threadpygmt/exceptions.py
Comment threadpygmt/exceptions.py Outdated
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Comment threadpygmt/src/grdfill.py Outdated
@seismanseisman added the final review call This PR requires final review and approval from a second reviewer label Feb 2, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@seisman
seisman merged commit 224bf18 into GenericMappingTools:mainFeb 2, 2026
18 of 20 checks passed
@seismanseisman removed the final review call This PR requires final review and approval from a second reviewer label Feb 2, 2026
@Chuan1937
Chuan1937 deleted the feat/at_least_one_parameter_validation branch February 2, 2026 14:01
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenanceBoring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Chuan1937@seisman