File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,8 @@ def zarr_dimension(filename):
416
416
417
417
@classmethod
418
418
def load_file (cls , filename , ** kwargs ):
419
- if filename .endswith (".zarr" ):
419
+ end = b".zarr" if isinstance (filename , bytes ) else ".zarr"
420
+ if filename .endswith (end ):
420
421
return cls .load_from_zarr (filename , ** kwargs )
421
422
else :
422
423
return cls .load_from_netcdf (filename , ** kwargs )
Original file line number Diff line number Diff line change @@ -142,9 +142,9 @@ def period(self):
142
142
143
143
"""
144
144
date_start = datetime (1950 , 1 , 1 ) + timedelta (
145
- int (self .class_method .load_from_netcdf (self .datasets [0 ]).obs ['time' ][0 ]))
145
+ int (self .class_method .load_file (self .datasets [0 ]).obs ['time' ][0 ]))
146
146
date_stop = datetime (1950 , 1 , 1 ) + timedelta (
147
- int (self .class_method .load_from_netcdf (self .datasets [- 1 ]).obs ['time' ][0 ]))
147
+ int (self .class_method .load_file (self .datasets [- 1 ]).obs ['time' ][0 ]))
148
148
return date_start , date_stop
149
149
150
150
def swap_dataset (self , dataset , raw_data = False ):
@@ -652,7 +652,7 @@ def get_unused_data(self, raw_data=False):
652
652
j = 0
653
653
for i , dataset in enumerate (self .datasets ):
654
654
logger .debug ('Loaf file : (%d) %s' , i , dataset )
655
- current_obs = self .class_method .load_from_netcdf (dataset , raw_data = raw_data )
655
+ current_obs = self .class_method .load_file (dataset , raw_data = raw_data )
656
656
if i == 0 :
657
657
eddies .sign_type = current_obs .sign_type
658
658
unused_obs = current_obs .observations [list_mask [i ]]
You can’t perform that action at this time.
0 commit comments