Skip to content

pygmt.project: Add input validation for geometry parameters#4415

Merged
seisman merged 17 commits into
GenericMappingTools:mainfrom
willschlitzer:project-input-validation
Feb 21, 2026
Merged

pygmt.project: Add input validation for geometry parameters#4415
seisman merged 17 commits into
GenericMappingTools:mainfrom
willschlitzer:project-input-validation

Conversation

@willschlitzer

Copy link
Copy Markdown
Contributor

Add input validation for 'endpoint', 'pole', and 'azimuth' to check for only one paramter being passed. Add testing to check that appropriate error is raised.

Add input validation for 'endpoint', 'pole', and 'azimuth' to check for only one paramter being passed.
Add testing to check that appropriate error is raised.
Comment thread pygmt/src/project.py Outdated
Comment thread pygmt/tests/test_project.py Outdated
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Feb 14, 2026
@seisman seisman added this to the 0.19.0 milestone Feb 14, 2026
@willschlitzer

Copy link
Copy Markdown
Contributor Author

/format

Comment thread pygmt/tests/test_project.py Outdated
with pytest.raises(GMTParameterError):
project(
center=[0, -1],
generate=0.5,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When generate is used, data should not be allowed, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The way I read the docs, the it just says that data will be ignored if generate is set. I removed this line from my PR. Should there be an input validation for data when generate is set?

Comment thread pygmt/src/project.py Outdated
Comment thread pygmt/tests/test_project.py Outdated
willschlitzer and others added 3 commits February 20, 2026 22:41
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@willschlitzer

Copy link
Copy Markdown
Contributor Author

/format

Comment thread pygmt/tests/test_project.py Outdated
@seisman seisman merged commit 3fcb824 into GenericMappingTools:main Feb 21, 2026
16 of 20 checks passed
@seisman seisman changed the title pygmt.project.py: Add input validation for geometry parameters pygmt.project: Add input validation for geometry parameters Feb 21, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants