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):
416416
417417    @classmethod  
418418    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 ):
420421            return  cls .load_from_zarr (filename , ** kwargs )
421422        else :
422423            return  cls .load_from_netcdf (filename , ** kwargs )
Original file line number Diff line number Diff line change @@ -142,9 +142,9 @@ def period(self):
142142
143143        """ 
144144        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 ]))
146146        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 ]))
148148        return  date_start , date_stop 
149149
150150    def  swap_dataset (self , dataset , raw_data = False ):
@@ -652,7 +652,7 @@ def get_unused_data(self, raw_data=False):
652652        j  =  0 
653653        for  i , dataset  in  enumerate (self .datasets ):
654654            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 )
656656            if  i  ==  0 :
657657                eddies .sign_type  =  current_obs .sign_type 
658658            unused_obs  =  current_obs .observations [list_mask [i ]]
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments