Skip to content

Commit ec75e7b

Browse files
authored
Update failing doctests with upstream dataset changes (#2988)
1 parent 32edad0 commit ec75e7b

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed

pygmt/src/grd2xyz.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def grd2xyz(grid, output_type="pandas", outfile=None, **kwargs):
138138
>>> xyz_dataframe = pygmt.grd2xyz(grid=grid, output_type="pandas")
139139
>>> xyz_dataframe.head(n=2)
140140
lon lat elevation
141-
0 10.0 25.0 863.0
142-
1 10.5 25.0 985.5
141+
0 10.0 25.0 965.5
142+
1 10.5 25.0 876.5
143143
"""
144144
output_type = validate_output_table_type(output_type, outfile=outfile)
145145

pygmt/src/grdclip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def grdclip(grid, **kwargs):
8787
... )
8888
>>> # Report the minimum and maximum data values
8989
>>> [grid.data.min(), grid.data.max()]
90-
[170.0, 2275.5]
90+
[183.5, 1807.0]
9191
>>> # Create a new grid from an input grid. Set all values below 1,000 to
9292
>>> # 0 and all values above 1,500 to 10,000
9393
>>> new_grid = pygmt.grdclip(grid=grid, below=[1000, 0], above=[1500, 10000])

pygmt/src/grdhisteq.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,11 @@ def compute_bins(
299299
>>> print(bins)
300300
start stop
301301
bin_id
302-
0 170.0 389.0
303-
1 389.0 470.5
304-
2 470.5 571.0
305-
3 571.0 705.0
306-
4 705.0 2275.5
302+
0 183.5 395.0
303+
1 395.0 472.0
304+
2 472.0 575.0
305+
3 575.0 709.5
306+
4 709.5 1807.0
307307
308308
See Also
309309
--------

pygmt/src/grdproject.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,10 @@ def grdproject(grid, **kwargs):
103103
>>> import pygmt
104104
>>> # Load a grid of @earth_relief_30m data, with a longitude range of
105105
>>> # 10° E to 30° E, and a latitude range of 15° N to 25° N
106-
>>> grid = pygmt.datasets.load_earth_relief(
107-
... resolution="30m", region=[10, 30, 15, 25]
108-
... )
109-
>>> # Create a new grid from the input grid, set the projection to
110-
>>> # Mercator, and set inverse to "True" to change from "geographic"
111-
>>> # to "rectangular"
112-
>>> new_grid = pygmt.grdproject(grid=grid, projection="M10c", inverse=True)
106+
>>> region = [10, 30, 15, 25]
107+
>>> grid = pygmt.datasets.load_earth_relief(resolution="30m", region=region)
108+
>>> # Project the geographic gridded data onto a rectangular grid
109+
>>> new_grid = pygmt.grdproject(grid=grid, projection="M10c", region=region)
113110
"""
114111
if kwargs.get("J") is None:
115112
raise GMTInvalidInput("The projection must be specified.")

pygmt/src/grdvolume.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ def grdvolume(grid, output_type="pandas", outfile=None, **kwargs):
9494
... )
9595
>>> print(output_dataframe)
9696
0 1 2 3
97-
0 200 2.318187e+12 8.533727e+14 368.120722
98-
1 250 2.272471e+12 7.383936e+14 324.929840
99-
2 300 2.162074e+12 6.273066e+14 290.141086
100-
3 350 2.018302e+12 5.222640e+14 258.764032
101-
4 400 1.857370e+12 4.252699e+14 228.963499
97+
0 200 2.323600e+12 8.523815e+14 366.836554
98+
1 250 2.275864e+12 7.371655e+14 323.905736
99+
2 300 2.166707e+12 6.258570e+14 288.851699
100+
3 350 2.019284e+12 5.207732e+14 257.899955
101+
4 400 1.870441e+12 4.236191e+14 226.480847
102102
"""
103103
output_type = validate_output_table_type(output_type, outfile=outfile)
104104

0 commit comments

Comments
 (0)