Skip to content

Commit 41a660b

Browse files
committed
Fix a typo
1 parent 13e3283 commit 41a660b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pygmt/datasets/tile_map.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
:class:`xarray.DataArray`.
44
"""
55

6+
import contextlib
67
from typing import Literal
78

89
from packaging.version import Version
@@ -16,9 +17,8 @@
1617
TileProvider = None
1718
_HAS_CONTEXTILY = False
1819

19-
try:
20-
import rioxarray # rioxarray is needed to register the rio accessor # noqa: F401
21-
except ImportError:
20+
# rioxarray is needed to register the rio accessor
21+
with contextlib.suppress(ImportError):
2222
pass
2323

2424
import numpy as np
@@ -123,7 +123,7 @@ def load_tile_map(
123123
* x (x) float64 ... -2.004e+07 -1.996e+07 ... 1.996e+07 2.004e+07
124124
spatial_ref int64 ... 0
125125
>>> # CRS is set only if rioxarray is available
126-
>>> if hasattr(dataarray, "rio"):
126+
>>> if hasattr(raster, "rio"):
127127
... raster.rio.crs
128128
CRS.from_epsg(3857)
129129
"""

0 commit comments

Comments
 (0)