Skip to content

Raise an error for zero increment grid - #1484

Merged
weiji14 merged 12 commits into
GenericMappingTools:mainfrom
yohaimagen:upstream/raise_inalid_input_for_zero_inc_grid
Sep 12, 2021
Merged

weiji14 merged 12 commits into
GenericMappingTools:mainfrom
yohaimagen:upstream/raise_inalid_input_for_zero_inc_grid

Conversation

@yohaimagen

@yohaimagen yohaimagen commented Sep 4, 2021 •

Copy link
Copy Markdown
Contributor

Raise an error when DataArray has zero increment grid.

Fixes #1483

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@yohaimagen

Copy link
Copy Markdown
Contributor Author

/format

@yohaimagen yohaimagen self-assigned this Sep 7, 2021
@yohaimagen yohaimagen added the bug Something isn't working label Sep 7, 2021

@maxrjones maxrjones left a comment

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.

Looks good, thanks!

@maxrjones maxrjones added the final review call This PR requires final review and approval from a second reviewer label Sep 11, 2021
Comment thread pygmt/clib/conversion.py Resolved
@seisman seisman changed the title add error for not monotonically increasing grid Raise an error for zero increment grid Sep 11, 2021
@seisman

seisman commented Sep 11, 2021

Copy link
Copy Markdown
Member

I changed the PR title to "Raise an error for zero increment grid" so that it better describes the changes in this PR. Feel free to improve the PR title yourself.

@seisman seisman added this to the 0.5.0 milestone Sep 11, 2021
Comment thread pygmt/clib/conversion.py Resolved
Comment thread pygmt/tests/test_clib.py Resolved
Comment thread pygmt/tests/test_clib.py Resolved
@yohaimagen

Copy link
Copy Markdown
Contributor Author

I think this one is ready to be merged into main, let me know if there is anything else still to be done over here.

@weiji14 weiji14 left a comment

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.

Thanks @yohaimagen! I'll merge this in now 😃

@weiji14
weiji14 merged commit b69fd0c into GenericMappingTools:main Sep 12, 2021
@weiji14 weiji14 removed the final review call This PR requires final review and approval from a second reviewer label Sep 12, 2021
@yohaimagen
yohaimagen deleted the upstream/raise_inalid_input_for_zero_inc_grid branch September 14, 2021 08:58
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Raise GMTInvalidInput error when xarray.DataArray
grid input has zero increment coordinates to prevent
segmentation fault in the PyGMT clib API.

Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Wei Ji <[email protected]>

This branch was previously deployed

1 inactive deployment
Preview — b073c0c1 Deployed Sep 12, 2021 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segmentation fault if a grid has zero increments

5 participants