@@ -104,7 +104,6 @@ def __init__(self, filename,
104
104
self ._variable_names = (self ._cdf_info .rVariables
105
105
+ self ._cdf_info .zVariables )
106
106
else :
107
- # cdflib < 1.0 stores info as a dict
108
107
self ._variable_names = (self ._cdf_info ['rVariables' ]
109
108
+ self ._cdf_info ['zVariables' ])
110
109
@@ -170,13 +169,8 @@ def set_epoch(self, x_axis_var):
170
169
171
170
"""
172
171
173
- if hasattr (self ._cdf_file .varinq (x_axis_var ), 'Data_Type_Description' ):
174
- data_type_description = self ._cdf_file .varinq (
175
- x_axis_var ).Data_Type_Description
176
- else :
177
- # cdflib < 1.0 stores this as a dict
178
- data_type_description = self ._cdf_file .varinq (
179
- x_axis_var )['Data_Type_Description' ]
172
+ data_type_description = self ._cdf_file .varinq (
173
+ x_axis_var ).Data_Type_Description
180
174
181
175
center_measurement = self ._center_measurement
182
176
cdf_file = self ._cdf_file
@@ -317,11 +311,7 @@ def load_variables(self):
317
311
if not re .match (var_regex , variable_name ):
318
312
# Skip this variable
319
313
continue
320
- try :
321
- var_atts = self ._cdf_file .varattsget (variable_name , to_np = True )
322
- except TypeError :
323
- # cdflib 1.0+ drops to_np kwarg, assumes True
324
- var_atts = self ._cdf_file .varattsget (variable_name )
314
+ var_atts = self ._cdf_file .varattsget (variable_name , to_np = True )
325
315
326
316
for k in var_atts :
327
317
var_atts [k ] = var_atts [k ] # [0]
@@ -343,11 +333,7 @@ def load_variables(self):
343
333
continue
344
334
345
335
if "FILLVAL" in var_atts :
346
- if hasattr (var_properties , 'Data_Type_Description' ):
347
- data_type_desc = var_properties .Data_Type_Description
348
- else :
349
- # cdflib < 1.0 stores this as a dict
350
- data_type_desc = var_properties ['Data_Type_Description' ]
336
+ data_type_desc = var_properties .Data_Type_Description
351
337
352
338
if data_type_desc in ['CDF_FLOAT' , 'CDF_REAL4' , 'CDF_DOUBLE' ,
353
339
'CDF_REAL8' ]:
0 commit comments