Conversation
Member
|
@Chuan1937 I wonder if you would like to continue with this PR? |
Member
Author
of course |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a centralized is_given() helper for determining whether a PyGMT parameter should be treated as “provided” (i.e., not None and not False), and refactors multiple modules to use it for clearer and more consistent option/validation logic.
Changes:
- Add
pygmt.helpers.utils.is_given()(re-exported viapygmt.helpers) and use it inbuild_arg_list/args_in_kwargs. - Refactor parameter conflict checks across several
pygmt.src.*wrappers to useis_given. - Update
Aliasstring conversion andBaseParam.__repr__to use the shared “given” predicate.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pygmt/helpers/utils.py | Adds is_given() and updates argument-building utilities to use it. |
| pygmt/helpers/init.py | Re-exports is_given from helpers for convenient imports. |
| pygmt/alias.py | Uses is_given to normalize None/False handling during alias string conversion. |
| pygmt/src/_common.py | Uses is_given in _parse_position conflict checking. |
| pygmt/params/base.py | Uses is_given to filter fields included in BaseParam.__repr__. |
| pygmt/src/basemap.py | Refactors deprecation-parameter checks to use is_given. |
| pygmt/src/colorbar.py | Refactors _build_frame “old frame” and axis detection logic to use is_given. |
| pygmt/src/grdfill.py | Uses is_given to count mutually exclusive “at least one” parameters. |
| pygmt/src/grdfilter.py | Uses is_given for old-syntax conflict detection. |
| pygmt/src/grdgradient.py | Uses is_given for old-syntax conflict detection. |
| pygmt/src/grdproject.py | Uses is_given for unit/scaling mutual exclusion validation. |
| pygmt/src/grdview.py | Uses is_given for old-syntax conflict detection. |
| pygmt/src/subplot.py | Uses is_given in autolabel/tag conflict checks and tag_box validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace #4439
close #4355