Skip to content

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

Open
willschlitzer wants to merge 8 commits intoGenericMappingTools:mainfrom
willschlitzer:project-input-validation
Open

pygmt.project.py: Add input validation for geometry parameters#4415
willschlitzer wants to merge 8 commits intoGenericMappingTools:mainfrom
willschlitzer:project-input-validation

Conversation

@willschlitzer
Copy link
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 on lines 95 to 120
@pytest.mark.parametrize(
("kwargs"),
[
{
"center": [0, -1],
"generate": 0.5,
"data": [0, 0],
"azimuth": 45,
"endpoint": [0, 1],
},
{
"center": [0, -1],
"generate": 0.5,
"data": [0, 0],
"azimuth": 45,
"pole": [0, 90],
},
{
"center": [0, -1],
"generate": 0.5,
"data": [0, 0],
"endpoint": [0, 1],
"pole": [0, 90],
},
],
)
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps not a good idea to use pytest.mark.parametrize in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@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
Contributor Author

/format

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