Skip to content

Commit 38051cf

Browse files
authored
Update baseline images for updates of earth relief data (#452)
Update baseline images and some tests, due to the recent updates of global earth relief data.
1 parent cf6efd9 commit 38051cf

18 files changed

+15
-15
lines changed

.azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
# Cache the ${HOME}/.gmt directory, for docs and testing
120120
- task: Cache@2
121121
inputs:
122-
key: cachedata | 20200519
122+
key: cachedata | 20200524
123123
path: $(HOME)/.gmt
124124
cacheHitVar: CACHE_CACHEDATA_RESTORED
125125
displayName: Cache GMT remote data for testing
@@ -215,7 +215,7 @@ jobs:
215215
# Cache the ${HOME}/.gmt directory, for docs and testing
216216
- task: Cache@2
217217
inputs:
218-
key: cachedata | 20200519
218+
key: cachedata | 20200524
219219
path: $(HOMEPATH)/.gmt
220220
cacheHitVar: CACHE_CACHEDATA_RESTORED
221221
displayName: Cache GMT remote data for testing

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 5559 1 1 361 181
114+
-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181
115115
"""
116116

117117
# The minimum version of GMT required
@@ -1218,15 +1218,15 @@ def virtualfile_from_grid(self, grid):
12181218
>>> print(data.lat.values.min(), data.lat.values.max())
12191219
-90.0 90.0
12201220
>>> print(data.values.min(), data.values.max())
1221-
-8592.0 5559.0
1221+
-8592.145 5558.7925
12221222
>>> with Session() as ses:
12231223
... with ses.virtualfile_from_grid(data) as fin:
12241224
... # Send the output to a file so that we can read it
12251225
... with GMTTempFile() as fout:
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 5559 1 1 361 181
1229+
-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181
12301230
>>> # The output is: w e s n z0 z1 dx dy n_columns n_rows
12311231
12321232
"""
-695 Bytes
Loading
-2.03 KB
Loading
Loading
-238 Bytes
Loading
-8 Bytes
Loading
-832 Bytes
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

pygmt/tests/test_datasets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def test_earth_relief_60():
7474
assert data.shape == (181, 361)
7575
npt.assert_allclose(data.lat, np.arange(-90, 91, 1))
7676
npt.assert_allclose(data.lon, np.arange(-180, 181, 1))
77-
npt.assert_allclose(data.min(), -8592)
78-
npt.assert_allclose(data.max(), 5559)
77+
npt.assert_allclose(data.min(), -8592.144531)
78+
npt.assert_allclose(data.max(), 5558.79248)
7979

8080

8181
def test_earth_relief_30():
@@ -84,5 +84,5 @@ def test_earth_relief_30():
8484
assert data.shape == (361, 721)
8585
npt.assert_allclose(data.lat, np.arange(-90, 90.5, 0.5))
8686
npt.assert_allclose(data.lon, np.arange(-180, 180.5, 0.5))
87-
npt.assert_allclose(data.min(), -9460)
88-
npt.assert_allclose(data.max(), 5888)
87+
npt.assert_allclose(data.min(), -9460.310547)
88+
npt.assert_allclose(data.max(), 5887.60791)

pygmt/tests/test_grdtrack.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_grdtrack_input_dataframe_and_dataarray():
2828
output = grdtrack(points=dataframe, grid=dataarray, newcolname="bathymetry")
2929
assert isinstance(output, pd.DataFrame)
3030
assert output.columns.to_list() == ["longitude", "latitude", "bathymetry"]
31-
npt.assert_allclose(output.iloc[0], [-110.9536, -42.2489, -2797.482959])
31+
npt.assert_allclose(output.iloc[0], [-110.9536, -42.2489, -2797.497251])
3232

3333
return output
3434

@@ -46,7 +46,7 @@ def test_grdtrack_input_csvfile_and_dataarray():
4646
assert os.path.exists(path=TEMP_TRACK) # check that outfile exists at path
4747

4848
track = pd.read_csv(TEMP_TRACK, sep="\t", header=None, comment=">")
49-
npt.assert_allclose(track.iloc[0], [-110.9536, -42.2489, -2797.482959])
49+
npt.assert_allclose(track.iloc[0], [-110.9536, -42.2489, -2797.497251])
5050
finally:
5151
os.remove(path=TEMP_TRACK)
5252

@@ -63,7 +63,7 @@ def test_grdtrack_input_dataframe_and_ncfile():
6363
output = grdtrack(points=dataframe, grid=ncfile, newcolname="bathymetry")
6464
assert isinstance(output, pd.DataFrame)
6565
assert output.columns.to_list() == ["longitude", "latitude", "bathymetry"]
66-
npt.assert_allclose(output.iloc[0], [-32.2971, 37.4118, -1686.692142])
66+
npt.assert_allclose(output.iloc[0], [-32.2971, 37.4118, -1686.878079])
6767

6868
return output
6969

@@ -81,7 +81,7 @@ def test_grdtrack_input_csvfile_and_ncfile():
8181
assert os.path.exists(path=TEMP_TRACK) # check that outfile exists at path
8282

8383
track = pd.read_csv(TEMP_TRACK, sep="\t", header=None, comment=">")
84-
npt.assert_allclose(track.iloc[0], [-32.2971, 37.4118, -1686.692142])
84+
npt.assert_allclose(track.iloc[0], [-32.2971, 37.4118, -1686.878079])
8585
finally:
8686
os.remove(path=TEMP_TRACK)
8787

pygmt/tests/test_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ def test_grdinfo():
5959
"Make sure grd info works as expected"
6060
grid = load_earth_relief()
6161
result = grdinfo(grid, L=0, C="n")
62-
assert result.strip() == "-180 180 -90 90 -8592 5559 1 1 361 181"
62+
assert result.strip() == "-180 180 -90 90 -8592.14453125 5558.79248047 1 1 361 181"
6363

6464

6565
def test_grdinfo_file():
6666
"Test grdinfo with file input"
6767
result = grdinfo("@earth_relief_60m", L=0, C="n")
68-
assert result.strip() == "-180 180 -90 90 -8592 5559 1 1 361 181"
68+
assert result.strip() == "-180 180 -90 90 -8592.14465255 5558.79248047 1 1 361 181"
6969

7070

7171
def test_grdinfo_fails():

0 commit comments

Comments
 (0)