Skip to content

Commit 452ce23

Browse files
authored
Benchmark grdsample, grdfilter and sph2grd with fixed cores (#2945)
1 parent e0593d2 commit 452ce23

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pygmt/tests/test_grdfilter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_grdfilter_dataarray_in_dataarray_out(grid, expected_grid):
4545
Test grdfilter with an input DataArray, and output as DataArray.
4646
"""
4747
result = grdfilter(
48-
grid=grid, filter="g600", distance="4", region=[-53, -49, -20, -17]
48+
grid=grid, filter="g600", distance="4", region=[-53, -49, -20, -17], cores=2
4949
)
5050
# check information of the output grid
5151
assert isinstance(result, xr.DataArray)

pygmt/tests/test_grdsample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_grdsample_dataarray_out(grid, expected_grid, region, spacing):
7474
"""
7575
Test grdsample with no outgrid set and the spacing is changed.
7676
"""
77-
result = grdsample(grid=grid, spacing=spacing, region=region)
77+
result = grdsample(grid=grid, spacing=spacing, region=region, cores=2)
7878
# check information of the output grid
7979
assert isinstance(result, xr.DataArray)
8080
assert result.gmt.gtype == 1 # Geographic grid

pygmt/tests/test_sph2grd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_sph2grd_no_outgrid():
2626
"""
2727
Test sph2grd with no set outgrid.
2828
"""
29-
temp_grid = sph2grd(data="@EGM96_to_36.txt", spacing=1, region="g")
29+
temp_grid = sph2grd(data="@EGM96_to_36.txt", spacing=1, region="g", cores=2)
3030
assert temp_grid.dims == ("y", "x")
3131
assert temp_grid.gmt.gtype == 0 # Cartesian grid
3232
assert temp_grid.gmt.registration == 0 # Gridline registration

0 commit comments

Comments
 (0)