Skip to content

Commit 083bee8

Browse files
committed
Fix failing grdinfo tests
In GMT 6.1, `grdinfo` also reports registration code at the end of the output. See GenericMappingTools/gmt#3359 for upstream changes.
1 parent dbcdfeb commit 083bee8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pygmt/clib/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Session:
111111
... )
112112
... # Read the contents of the temp file before it's deleted.
113113
... print(fout.read().strip())
114-
-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181
114+
-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181 0
115115
"""
116116

117117
# The minimum version of GMT required
@@ -1226,8 +1226,8 @@ def virtualfile_from_grid(self, grid):
12261226
... args = '{} -L0 -Cn ->{}'.format(fin, fout.name)
12271227
... ses.call_module('grdinfo', args)
12281228
... print(fout.read().strip())
1229-
-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181
1230-
>>> # The output is: w e s n z0 z1 dx dy n_columns n_rows
1229+
-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181 0
1230+
>>> # The output is: w e s n z0 z1 dx dy n_columns n_rows registration
12311231
12321232
"""
12331233
# Conversion to a C-contiguous array needs to be done here and not in

pygmt/tests/test_grdinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def test_grdinfo():
1313
"Make sure grd info works as expected"
1414
grid = load_earth_relief()
1515
result = grdinfo(grid, L=0, C="n")
16-
assert result.strip() == "-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181"
16+
assert result.strip() == "-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181 0"
1717

1818

1919
def test_grdinfo_file():
2020
"Test grdinfo with file input"
2121
result = grdinfo("@earth_relief_60m", L=0, C="n")
22-
assert result.strip() == "-180 180 -90 90 -8592.14465255 5558.79248047 1 1 361 181"
22+
assert result.strip() == "-180 180 -90 90 -8592.14465255 5558.79248047 1 1 361 181 0"
2323

2424

2525
def test_grdinfo_fails():

0 commit comments

Comments
 (0)