cleanup sources
This commit is contained in:
@@ -128,12 +128,10 @@ class Drawable:
|
|||||||
|
|
||||||
def set_legend(self, channel, value):
|
def set_legend(self, channel, value):
|
||||||
"Sets the legend of the plot"
|
"Sets the legend of the plot"
|
||||||
if key in self.legend:
|
if channel in self.legend:
|
||||||
print("Drawable Warning: Legend key \"%s\" will be overwritten with \"%s\"" % (str(channel), str(value)))
|
print("Drawable Warning: Legend key \"%s\" will be overwritten with \"%s\"" % (str(channel), str(value)))
|
||||||
|
|
||||||
self.legend[channel] = str(value)
|
self.legend[channel] = str(value)
|
||||||
|
|
||||||
|
|
||||||
def get_xmin(self):
|
def get_xmin(self):
|
||||||
"Returns minimun of x"
|
"Returns minimun of x"
|
||||||
return self.x.min()
|
return self.x.min()
|
||||||
@@ -142,17 +140,14 @@ class Drawable:
|
|||||||
"Sets minimum of x"
|
"Sets minimum of x"
|
||||||
self.xmin = xmin
|
self.xmin = xmin
|
||||||
|
|
||||||
|
|
||||||
def get_xmax(self):
|
def get_xmax(self):
|
||||||
"Returns maximum of x"
|
"Returns maximum of x"
|
||||||
return self.x.max()
|
return self.x.max()
|
||||||
|
|
||||||
|
|
||||||
def set_xmax(self, xmax):
|
def set_xmax(self, xmax):
|
||||||
"Sets maximum of x"
|
"Sets maximum of x"
|
||||||
self.xmax = xmax
|
self.xmax = xmax
|
||||||
|
|
||||||
|
|
||||||
def get_ymin(self):
|
def get_ymin(self):
|
||||||
"Returns minimum of y"
|
"Returns minimum of y"
|
||||||
if type(self.y)==type([]):
|
if type(self.y)==type([]):
|
||||||
@@ -160,12 +155,10 @@ class Drawable:
|
|||||||
else:
|
else:
|
||||||
return self.y.min()
|
return self.y.min()
|
||||||
|
|
||||||
|
|
||||||
def set_ymin(self, ymin):
|
def set_ymin(self, ymin):
|
||||||
"Sets minimum of y"
|
"Sets minimum of y"
|
||||||
self.ymin = ymin
|
self.ymin = ymin
|
||||||
|
|
||||||
|
|
||||||
def get_ymax(self):
|
def get_ymax(self):
|
||||||
"Returns maximimum of y"
|
"Returns maximimum of y"
|
||||||
if type(self.y)==type([]):
|
if type(self.y)==type([]):
|
||||||
@@ -173,7 +166,6 @@ class Drawable:
|
|||||||
else:
|
else:
|
||||||
return self.y.max()
|
return self.y.max()
|
||||||
|
|
||||||
|
|
||||||
def set_ymax(self, ymax):
|
def set_ymax(self, ymax):
|
||||||
"Sets maximum of y"
|
"Sets maximum of y"
|
||||||
self.ymax = ymax
|
self.ymax = ymax
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class MeasurementResult(Drawable.Drawable, collections.UserDict):
|
|||||||
Drawable.Drawable.__init__(self)
|
Drawable.Drawable.__init__(self)
|
||||||
collections.UserDict.__init__(self)
|
collections.UserDict.__init__(self)
|
||||||
self.quantity_name=quantity_name
|
self.quantity_name=quantity_name
|
||||||
self.lock=threading.RLock()
|
self.lock = threading.RLock()
|
||||||
|
|
||||||
# get the selected item, if it does not exist, create an empty one
|
# get the selected item, if it does not exist, create an empty one
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
@@ -226,7 +226,6 @@ class MeasurementResult(Drawable.Drawable, collections.UserDict):
|
|||||||
|
|
||||||
|
|
||||||
def write_to_hdf(self, hdffile, where, name, title, complib=None, complevel=None):
|
def write_to_hdf(self, hdffile, where, name, title, complib=None, complevel=None):
|
||||||
|
|
||||||
h5_table_format= {
|
h5_table_format= {
|
||||||
"x" : tables.Float32Col(),
|
"x" : tables.Float32Col(),
|
||||||
"y" : tables.Float32Col(),
|
"y" : tables.Float32Col(),
|
||||||
|
|||||||
Reference in New Issue
Block a user