Commit 98ff730b authored by Eva Schiffer's avatar Eva Schiffer
Browse files

don't choke when loading netcdf string variables

parent 0df97f13
......@@ -300,6 +300,12 @@ class nc (object):
# get our data, save the dtype, and make sure it's a more flexible dtype for now
variable_object.set_auto_maskandscale(False) # for now just do the darn calculations ourselves
temp_input_data = variable_object[:]
# if we have a string, just stop now because Glance can't handle strings usefully
if isinstance(temp_input_data, str,) :
LOG.warning("Variable '" + name + "' has a data type of 'string'. This type of data cannot be "
"analyzed by Glance. This variable will not be analyzed.")
raise IONonnumericalTypeError("Variable '" + name + "' is of data type 'string'. "
"This program can't analyze non-numerical data.")
LOG.debug("Native input dtype: " + str(temp_input_data.dtype))
# if this is object data, stop because we can't run our regular analysis on that kind
if temp_input_data.dtype == object :
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment