Skip to content

Commit c2011d7

Browse files
committed
Switch from pygmt.io.load_dataarray to xr.load_dataarray
Specifically with arguments (..., engine="gmt", decode_kind="grid").
1 parent 6b87497 commit c2011d7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pygmt/datasets/samples.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pandas as pd
99
import xarray as xr
1010
from pygmt.exceptions import GMTInvalidInput
11-
from pygmt.io import load_dataarray
1211
from pygmt.src import which
1312

1413

@@ -204,7 +203,7 @@ def _load_earth_relief_holes() -> xr.DataArray:
204203
is in meters.
205204
"""
206205
fname = which("@earth_relief_20m_holes.grd", download="c")
207-
return load_dataarray(fname, engine="netcdf4")
206+
return xr.load_dataarray(fname, engine="gmt", decode_kind="grid")
208207

209208

210209
class GMTSampleData(NamedTuple):

pygmt/helpers/testing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import string
88
from pathlib import Path
99

10+
import xarray as xr
1011
from pygmt.exceptions import GMTImageComparisonFailure
11-
from pygmt.io import load_dataarray
1212
from pygmt.src import which
1313

1414

@@ -154,7 +154,7 @@ def load_static_earth_relief():
154154
A grid of Earth relief for internal tests.
155155
"""
156156
fname = which("@static_earth_relief.nc", download="c")
157-
return load_dataarray(fname)
157+
return xr.load_dataarray(fname, engine="gmt", decode_kind="grid")
158158

159159

160160
def skip_if_no(package):

0 commit comments

Comments
 (0)