Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for Session.write_data() writing netCDF grids #583

Merged
merged 2 commits into from
Sep 5, 2020

Conversation

seisman
Copy link
Member

@seisman seisman commented Sep 4, 2020

Description of proposed changes

write_data() can write a netCDF grid since GMT 6.1.1, if geometry is
GMT_IS_SURFACE.

This PR adds a test to make sure write_data() works as expected.

Fixes #557.

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.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

`write_data()` can write a netCDF grid since GMT 6.1.1, if `geometry` is
`GMT_IS_SURFACE`.

This PR adds a test to make sure `write_data()` works as expected.
@seisman seisman added the maintenance Boring but important stuff for the core devs label Sep 4, 2020
@seisman seisman added this to the 0.2.x milestone Sep 4, 2020
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Looks good, feel free to merge once the tests pass.

@@ -55,7 +56,7 @@ def test_put_matrix_fails():


def test_put_matrix_grid():
"Check that assigning a numpy 2d array to a grid works"
"Check that assigning a numpy 2d array to an ASCII and NetCDF grid works"
dtypes = "float32 float64 int32 int64 uint32 uint64".split()
Copy link
Member

Choose a reason for hiding this comment

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

Should probably use pytest parametrize for this, but we can leave it to a separate PR. Our test suite is getting larger and we might want to consider more efficient ways of testing (I'll open an issue for it).

@seisman seisman added this to In progress in Release v0.2.x via automation Sep 5, 2020
@seisman seisman merged commit 526e38b into master Sep 5, 2020
Release v0.2.x automation moved this from In progress to Done Sep 5, 2020
@seisman seisman deleted the test/write_data branch September 5, 2020 01:59
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
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add a test for Session.write_data() after bumping to GMT 6.1.1
2 participants