@@ -131,15 +131,13 @@ def test_delaunay_triples_invalid_format(dataframe):
131
131
triangulate .delaunay_triples (data = dataframe , output_type = "pandas" , header = "o+c" )
132
132
133
133
134
- def test_regular_grid_with_outgrid_true (dataframe , expected_grid ):
134
+ def test_regular_grid_no_outgrid (dataframe , expected_grid ):
135
135
"""
136
- Run triangulate.regular_grid with outgrid=True and see it load into an
136
+ Run triangulate.regular_grid with no set outgrid and see it load into an
137
137
xarray.DataArray.
138
138
"""
139
139
data = dataframe .to_numpy ()
140
- output = triangulate .regular_grid (
141
- data = data , spacing = 1 , region = [2 , 4 , 5 , 6 ], outgrid = True
142
- )
140
+ output = triangulate .regular_grid (data = data , spacing = 1 , region = [2 , 4 , 5 , 6 ])
143
141
assert isinstance (output , xr .DataArray )
144
142
assert output .gmt .registration == 0 # Gridline registration
145
143
assert output .gmt .gtype == 0 # Cartesian type
@@ -162,3 +160,12 @@ def test_regular_grid_with_outgrid_param(dataframe, expected_grid):
162
160
assert grid .gmt .registration == 0 # Gridline registration
163
161
assert grid .gmt .gtype == 0 # Cartesian type
164
162
xr .testing .assert_allclose (a = grid , b = expected_grid )
163
+
164
+
165
+ def test_regular_grid_invalid_format (dataframe ):
166
+ """
167
+ Test that triangulate.regular_grid fails with outgrid that is not None or
168
+ a proper file name.
169
+ """
170
+ with pytest .raises (GMTInvalidInput ):
171
+ triangulate .regular_grid (data = dataframe , outgrid = True )
0 commit comments