Skip to content

Commit 4425417

Browse files
Update test
1 parent 43f765f commit 4425417

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

pygmt/tests/test_grdfill.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_grdfill_dataarray_out(grid, expected_grid):
6262
"""
6363
Test grdfill with a DataArray output.
6464
"""
65-
result = grdfill(grid=grid, constantfill=20)
65+
result = grdfill(grid=grid, constant_fill=20)
6666
# check information of the output grid
6767
assert isinstance(result, xr.DataArray)
6868
assert result.gmt.gtype is GridType.GEOGRAPHIC
@@ -77,7 +77,7 @@ def test_grdfill_asymmetric_pad(grid, expected_grid):
7777
7878
Regression test for https://github.com/GenericMappingTools/pygmt/issues/1745.
7979
"""
80-
result = grdfill(grid=grid, constantfill=20, region=[-55, -50, -24, -16])
80+
result = grdfill(grid=grid, constant_fill=20, region=[-55, -50, -24, -16])
8181
# check information of the output grid
8282
assert isinstance(result, xr.DataArray)
8383
assert result.gmt.gtype is GridType.GEOGRAPHIC
@@ -93,14 +93,14 @@ def test_grdfill_file_out(grid, expected_grid):
9393
Test grdfill with an outgrid set.
9494
"""
9595
with GMTTempFile(suffix=".nc") as tmpfile:
96-
result = grdfill(grid=grid, constantfill=20, outgrid=tmpfile.name)
96+
result = grdfill(grid=grid, constant_fill=20, outgrid=tmpfile.name)
9797
assert result is None # return value is None
9898
assert Path(tmpfile.name).stat().st_size > 0 # check that outfile exists
9999
temp_grid = xr.load_dataarray(tmpfile.name, engine="gmt", raster_kind="grid")
100100
xr.testing.assert_allclose(a=temp_grid, b=expected_grid)
101101

102102

103-
def test_grdfill_gridfill_dataarray(grid):
103+
def test_grdfill_grid_fill_dataarray(grid):
104104
"""
105105
Test grdfill with a DataArray input.
106106
"""
@@ -109,7 +109,7 @@ def test_grdfill_gridfill_dataarray(grid):
109109
dims=grid.dims,
110110
coords={"lon": grid.lon, "lat": grid.lat},
111111
)
112-
result = grdfill(grid=grid, gridfill=bggrid)
112+
result = grdfill(grid=grid, grid_fill=bggrid)
113113
assert not result.isnull().any()
114114
npt.assert_array_equal(result[3:6, 3:5], bggrid[3:6, 3:5])
115115

@@ -119,11 +119,11 @@ def test_grdfill_hole(grid, expected_grid):
119119
Test grdfill with a custom value (not NaN) as holes.
120120
"""
121121
# Prepare for a grid with a node value of -99999 for holes.
122-
grid_no_nan = grdfill(grid=grid, constantfill=-99999)
122+
grid_no_nan = grdfill(grid=grid, constant_fill=-99999)
123123
assert not np.isnan(grid_no_nan).any()
124124
assert -99999 in grid_no_nan
125125
# Now fill them with a constant value of 20.
126-
result = grdfill(grid=grid_no_nan, constantfill=20, hole=-99999)
126+
result = grdfill(grid=grid_no_nan, constant_fill=20, hole=-99999)
127127

128128
# Check information of the output grid
129129
assert isinstance(result, xr.DataArray)
@@ -134,7 +134,7 @@ def test_grdfill_hole(grid, expected_grid):
134134
# Test the deprecated 'no_data' parameter.
135135
# TODO(PyGMT>=0.19.0): Remove the following lines.
136136
with pytest.warns(FutureWarning):
137-
result2 = grdfill(grid=grid_no_nan, constantfill=20, no_data=-99999)
137+
result2 = grdfill(grid=grid_no_nan, constant_fill=20, no_data=-99999)
138138
xr.testing.assert_allclose(a=result2, b=expected_grid)
139139

140140

@@ -161,7 +161,7 @@ def test_grdfill_inquire_and_fill(grid):
161161
Test that grdfill fails if both inquire and fill parameters are given.
162162
"""
163163
with pytest.raises(GMTInvalidInput):
164-
grdfill(grid=grid, inquire=True, constantfill=20)
164+
grdfill(grid=grid, inquire=True, constant_fill=20)
165165

166166

167167
# TODO(PyGMT>=0.19.0): Remove this test.

0 commit comments

Comments
 (0)