Skip to content

Commit c97bd82

Browse files
committed
Remove guess_can_open method
No auto-detection of engine based on file extension, so users will have to pass `engine="gmt"` explicitly.
1 parent 91df0ee commit c97bd82

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

pygmt/xarray_backend.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,3 @@ def open_dataset( # type: ignore[override]
105105
)
106106
_ = raster.gmt # Load GMTDataArray accessor information
107107
return raster.to_dataset()
108-
109-
def guess_can_open(self, filename_or_obj) -> bool:
110-
"""
111-
Try to guess whether we can read this file.
112-
113-
This allows files ending in '.grd', '.nc', or '.tif(f)' to be automatically
114-
opened by xarray.
115-
"""
116-
try:
117-
ext = Path(filename_or_obj).suffix
118-
except TypeError:
119-
return False
120-
return ext in {".grd", ".nc", ".tif", ".tiff"}

0 commit comments

Comments
 (0)