diff --git a/src/data/Drawable.py b/src/data/Drawable.py index eaa74cb..b1990f5 100644 --- a/src/data/Drawable.py +++ b/src/data/Drawable.py @@ -1,10 +1,5 @@ # -*- coding: iso-8859-1 -*- -import threading - -import numpy as np - - ############################################################################# # # # Name: Class Drawable # @@ -106,7 +101,8 @@ class Drawable: "Returns labels to be plotted (List)" if index in self.text: return self.text[index] - else: return None + else: + return None def set_text(self, index, text): @@ -158,14 +154,14 @@ class Drawable: def get_ymin(self): "Returns minimum of y" - if type(self.y)==type([]): - return min([l.min() for l in self.y]) + if isinstance(self.y, list): + return min([yarr.min() for yarr in self.y]) else: return self.y.min() def get_yminpos(self): "Returns smallest positive value of y" - if type(self.y) == type([]): + if isinstance(self.y, list): ymins = [] for ys in self.y: mask = ys > 0 @@ -173,7 +169,7 @@ class Drawable: ymin = min(ymins) else: mask = self.y > 0 - ymin = y[mask].min() + ymin = self.y[mask].min() return ymin def set_ymin(self, ymin): @@ -182,8 +178,8 @@ class Drawable: def get_ymax(self): "Returns maximimum of y" - if type(self.y)==type([]): - return max([l.max() for l in self.y]) + if isinstance(self.y, list): + return max([yarr.max() for yarr in self.y]) else: return self.y.max()