Skip to content

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

Merged
seisman merged 2 commits intomasterfrom
test/write_data
Sep 5, 2020
Merged

Add a test for Session.write_data() writing netCDF grids#583
seisman merged 2 commits intomasterfrom
test/write_data

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.

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 merged commit 526e38b into master 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

None yet

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