From b3f35e4abaebc5fabfe1c4a33d1588282dae41d2 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 6 Aug 2020 17:12:40 -0400 Subject: [PATCH] Fix a failing test due to GMT API change The test `test_put_matrix_grid` fails due to recent changes of GMT API in https://github.com/GenericMappingTools/gmt/pull/3848. Before this PR, for a matrix grid, calling GMT_Write_Data always writes the matrix grid as a matrix, no matter the geometry is `GMT_IS_POINT` or `GMT_IS_SURFACE`. This PR declares it as a bug (or an improvement). With that PR merged, `geometry=GMT_IS_POINT` writes a matrix, `geometry=GMT_IS_SURFACE` writes a the matrix grid as a netCDF file. This test expects a matrix, but the new API writes a netCDF grid. That's why it fails. This PR fixes the issue by simply changing `GMT_IS_SURFACE` to `GMT_IS_POINT`, so that the test can pass for GMT 6.1.0, 6.1 and master branches. --- pygmt/tests/test_clib_put_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/tests/test_clib_put_matrix.py b/pygmt/tests/test_clib_put_matrix.py index 8e754ecf109..2dede298fbc 100644 --- a/pygmt/tests/test_clib_put_matrix.py +++ b/pygmt/tests/test_clib_put_matrix.py @@ -76,7 +76,7 @@ def test_put_matrix_grid(): with GMTTempFile() as tmp_file: lib.write_data( "GMT_IS_MATRIX", - "GMT_IS_SURFACE", + "GMT_IS_POINT", "GMT_CONTAINER_AND_DATA", wesn, tmp_file.name,