Commit 1e098f10 authored by eric pellegrini's avatar eric pellegrini
Browse files

added checking for the type of the array

parent 3477139f
......@@ -65,6 +65,10 @@ class MplDataViewer(object):
def __init__(self,dataset,standAlone=True):
# The viewer only supports array with numeric types
if not np.issubdtype(dataset.dtype,np.number):
raise MplDataViewerError("The dataset type ({dtype}) is not numeric".format(dtype=dataset.dtype))
# Remove axis with that has dimension 1 (e.g. (20,1,30) --> (20,30))
self._dataset = np.squeeze(dataset)
Markdown is supported
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