Skip to content

Commit

Permalink
Benchmark grdsample, grdfilter and sph2grd with fixed cores (#2945)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 authored Jan 4, 2024
1 parent e0593d2 commit 452ce23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pygmt/tests/test_grdfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_grdfilter_dataarray_in_dataarray_out(grid, expected_grid):
Test grdfilter with an input DataArray, and output as DataArray.
"""
result = grdfilter(
grid=grid, filter="g600", distance="4", region=[-53, -49, -20, -17]
grid=grid, filter="g600", distance="4", region=[-53, -49, -20, -17], cores=2
)
# check information of the output grid
assert isinstance(result, xr.DataArray)
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_grdsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_grdsample_dataarray_out(grid, expected_grid, region, spacing):
"""
Test grdsample with no outgrid set and the spacing is changed.
"""
result = grdsample(grid=grid, spacing=spacing, region=region)
result = grdsample(grid=grid, spacing=spacing, region=region, cores=2)
# check information of the output grid
assert isinstance(result, xr.DataArray)
assert result.gmt.gtype == 1 # Geographic grid
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_sph2grd.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_sph2grd_no_outgrid():
"""
Test sph2grd with no set outgrid.
"""
temp_grid = sph2grd(data="@EGM96_to_36.txt", spacing=1, region="g")
temp_grid = sph2grd(data="@EGM96_to_36.txt", spacing=1, region="g", cores=2)
assert temp_grid.dims == ("y", "x")
assert temp_grid.gmt.gtype == 0 # Cartesian grid
assert temp_grid.gmt.registration == 0 # Gridline registration
Expand Down

0 comments on commit 452ce23

Please sign in to comment.