|
1 | 1 | """
|
2 | 2 | grdtrack - Sample grids at specified (x,y) locations.
|
3 | 3 | """
|
4 |
| -import warnings |
5 |
| - |
6 | 4 | import pandas as pd
|
7 |
| -import xarray as xr |
8 | 5 | from pygmt.clib import Session
|
9 | 6 | from pygmt.exceptions import GMTInvalidInput
|
10 | 7 | from pygmt.helpers import (
|
|
14 | 11 | kwargs_to_strings,
|
15 | 12 | use_alias,
|
16 | 13 | )
|
17 |
| -from pygmt.src.which import which |
18 | 14 |
|
19 | 15 | __doctest_skip__ = ["grdtrack"]
|
20 | 16 |
|
@@ -297,29 +293,6 @@ def grdtrack(grid, points=None, newcolname=None, outfile=None, **kwargs):
|
297 | 293 | if hasattr(points, "columns") and newcolname is None:
|
298 | 294 | raise GMTInvalidInput("Please pass in a str to 'newcolname'")
|
299 | 295 |
|
300 |
| - # Backward compatibility with old parameter order "points, grid". |
301 |
| - # deprecated_version="0.7.0", remove_version="v0.9.0" |
302 |
| - is_a_grid = True |
303 |
| - if not isinstance(grid, (xr.DataArray, str)): |
304 |
| - is_a_grid = False |
305 |
| - elif isinstance(grid, str): |
306 |
| - try: |
307 |
| - xr.open_dataarray(which(grid, download="a"), engine="netcdf4").close() |
308 |
| - is_a_grid = True |
309 |
| - except (ValueError, OSError): |
310 |
| - is_a_grid = False |
311 |
| - if not is_a_grid: |
312 |
| - msg = ( |
313 |
| - "Positional parameters 'points, grid' of pygmt.grdtrack() has changed " |
314 |
| - "to 'grid, points=None' since v0.7.0. It's likely that you're NOT " |
315 |
| - "passing a valid grid as the first positional argument or " |
316 |
| - "are passing an invalid grid to the 'grid' parameter. " |
317 |
| - "Please check the order of arguments with the latest documentation. " |
318 |
| - "This warning will be removed in v0.9.0." |
319 |
| - ) |
320 |
| - grid, points = points, grid |
321 |
| - warnings.warn(msg, category=FutureWarning, stacklevel=1) |
322 |
| - |
323 | 296 | with GMTTempFile(suffix=".csv") as tmpfile:
|
324 | 297 | with Session() as lib:
|
325 | 298 | # Store the xarray.DataArray grid in virtualfile
|
|
0 commit comments