File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ class ScipyBackendEntrypoint(BackendEntrypoint):
335
335
not available. It has the advantage that is is a lightweight engine
336
336
that has no system requirements (unlike netcdf4 and h5netcdf).
337
337
338
- Additionally it can open gizp compressed (".gz") files.
338
+ Additionally it can open gzip compressed (".gz") files.
339
339
340
340
For more information about the underlying library, visit:
341
341
https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.netcdf_file.html
@@ -354,6 +354,8 @@ def guess_can_open(
354
354
self ,
355
355
filename_or_obj : T_PathFileOrDataStore ,
356
356
) -> bool :
357
+ from xarray .core .utils import is_remote_uri
358
+
357
359
filename_or_obj = _normalize_filename_or_obj (filename_or_obj )
358
360
magic_number = try_read_magic_number_from_file_or_path (filename_or_obj )
359
361
if magic_number is not None and magic_number .startswith (b"\x1f \x8b " ):
@@ -365,6 +367,10 @@ def guess_can_open(
365
367
if isinstance (filename_or_obj , str | os .PathLike ):
366
368
from pathlib import Path
367
369
370
+ # scipy can only handle local files
371
+ if isinstance (filename_or_obj , str ) and is_remote_uri (filename_or_obj ):
372
+ return False
373
+
368
374
suffix = "" .join (Path (filename_or_obj ).suffixes )
369
375
return suffix in {".nc" , ".cdf" , ".nc.gz" }
370
376
You can’t perform that action at this time.
0 commit comments