2
2
triangulate - Delaunay triangulation or Voronoi partitioning and gridding of
3
3
Cartesian data.
4
4
"""
5
+ import warnings
6
+
5
7
import pandas as pd
6
8
from pygmt .clib import Session
7
9
from pygmt .exceptions import GMTInvalidInput
@@ -165,7 +167,7 @@ def regular_grid( # pylint: disable=too-many-arguments,too-many-locals
165
167
registration = None ,
166
168
skiprows = None ,
167
169
wrap = None ,
168
- ** kwargs
170
+ ** kwargs ,
169
171
):
170
172
"""
171
173
Delaunay triangle based gridding of Cartesian data.
@@ -257,7 +259,7 @@ def regular_grid( # pylint: disable=too-many-arguments,too-many-locals
257
259
registration = registration ,
258
260
skiprows = skiprows ,
259
261
wrap = wrap ,
260
- ** kwargs
262
+ ** kwargs ,
261
263
)
262
264
263
265
@staticmethod
@@ -281,7 +283,7 @@ def delaunay_triples( # pylint: disable=too-many-arguments,too-many-locals
281
283
incols = None ,
282
284
skiprows = None ,
283
285
wrap = None ,
284
- ** kwargs
286
+ ** kwargs ,
285
287
):
286
288
"""
287
289
Delaunay triangle based gridding of Cartesian data.
@@ -344,6 +346,15 @@ def delaunay_triples( # pylint: disable=too-many-arguments,too-many-locals
344
346
"Must specify 'output_type' either as 'numpy', 'pandas' or 'file'."
345
347
)
346
348
349
+ if isinstance (outfile , str ) and output_type != "file" :
350
+ msg = (
351
+ f"Changing 'output_type' from '{ output_type } ' to 'file' "
352
+ "since 'outfile' parameter is set. Please use output_type='file' "
353
+ "to silence this warning."
354
+ )
355
+ warnings .warn (message = msg , category = RuntimeWarning , stacklevel = 2 )
356
+ output_type = "file"
357
+
347
358
# Return a pandas.DataFrame if ``outfile`` is not set
348
359
with GMTTempFile (suffix = ".txt" ) as tmpfile :
349
360
if output_type != "file" :
@@ -366,5 +377,5 @@ def delaunay_triples( # pylint: disable=too-many-arguments,too-many-locals
366
377
incols = incols ,
367
378
skiprows = skiprows ,
368
379
wrap = wrap ,
369
- ** kwargs
380
+ ** kwargs ,
370
381
)
0 commit comments