clear ruff check for Drawable class
This commit is contained in:
+8
-12
@@ -1,10 +1,5 @@
|
|||||||
# -*- coding: iso-8859-1 -*-
|
# -*- coding: iso-8859-1 -*-
|
||||||
|
|
||||||
import threading
|
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# #
|
# #
|
||||||
# Name: Class Drawable #
|
# Name: Class Drawable #
|
||||||
@@ -106,7 +101,8 @@ class Drawable:
|
|||||||
"Returns labels to be plotted (List)"
|
"Returns labels to be plotted (List)"
|
||||||
if index in self.text:
|
if index in self.text:
|
||||||
return self.text[index]
|
return self.text[index]
|
||||||
else: return None
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def set_text(self, index, text):
|
def set_text(self, index, text):
|
||||||
@@ -158,14 +154,14 @@ class Drawable:
|
|||||||
|
|
||||||
def get_ymin(self):
|
def get_ymin(self):
|
||||||
"Returns minimum of y"
|
"Returns minimum of y"
|
||||||
if type(self.y)==type([]):
|
if isinstance(self.y, list):
|
||||||
return min([l.min() for l in self.y])
|
return min([yarr.min() for yarr in self.y])
|
||||||
else:
|
else:
|
||||||
return self.y.min()
|
return self.y.min()
|
||||||
|
|
||||||
def get_yminpos(self):
|
def get_yminpos(self):
|
||||||
"Returns smallest positive value of y"
|
"Returns smallest positive value of y"
|
||||||
if type(self.y) == type([]):
|
if isinstance(self.y, list):
|
||||||
ymins = []
|
ymins = []
|
||||||
for ys in self.y:
|
for ys in self.y:
|
||||||
mask = ys > 0
|
mask = ys > 0
|
||||||
@@ -173,7 +169,7 @@ class Drawable:
|
|||||||
ymin = min(ymins)
|
ymin = min(ymins)
|
||||||
else:
|
else:
|
||||||
mask = self.y > 0
|
mask = self.y > 0
|
||||||
ymin = y[mask].min()
|
ymin = self.y[mask].min()
|
||||||
return ymin
|
return ymin
|
||||||
|
|
||||||
def set_ymin(self, ymin):
|
def set_ymin(self, ymin):
|
||||||
@@ -182,8 +178,8 @@ class Drawable:
|
|||||||
|
|
||||||
def get_ymax(self):
|
def get_ymax(self):
|
||||||
"Returns maximimum of y"
|
"Returns maximimum of y"
|
||||||
if type(self.y)==type([]):
|
if isinstance(self.y, list):
|
||||||
return max([l.max() for l in self.y])
|
return max([yarr.max() for yarr in self.y])
|
||||||
else:
|
else:
|
||||||
return self.y.max()
|
return self.y.max()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user