File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,15 @@ class HAMTIDE(TidalDataset):
19
19
def __init__ (self , hamtide_dataset_directory : PathLike = None ):
20
20
if hamtide_dataset_directory is None :
21
21
hamtide_dataset_directory = self .OPENDAP_URL
22
-
23
- if Path (hamtide_dataset_directory ).exists ():
24
- hamtide_dataset_directory = Path (hamtide_dataset_directory )
25
- if len (list (hamtide_dataset_directory .glob ('*.nc' ))) == 0 :
26
- raise FileNotFoundError (f'no NetCDF files found at '
27
- f'"{ hamtide_dataset_directory } "' )
22
+ else :
23
+ try :
24
+ if Path (hamtide_dataset_directory ).exists ():
25
+ hamtide_dataset_directory = Path (hamtide_dataset_directory )
26
+ if len (list (hamtide_dataset_directory .glob ('*.nc' ))) == 0 :
27
+ raise FileNotFoundError (f'no NetCDF files found at '
28
+ f'"{ hamtide_dataset_directory } "' )
29
+ except OSError :
30
+ raise ValueError ('given resource must be a local path' )
28
31
29
32
super ().__init__ (hamtide_dataset_directory )
30
33
You can’t perform that action at this time.
0 commit comments