From 9d969da8679e86f0a1869062cbcb6beb9699c560 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Wed, 18 Mar 2026 17:21:27 +0100 Subject: [PATCH] cleanup sources --- src/data/Drawable.py | 10 +--------- src/data/MeasurementResult.py | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/data/Drawable.py b/src/data/Drawable.py index 8ea4bc4..c9f823f 100644 --- a/src/data/Drawable.py +++ b/src/data/Drawable.py @@ -128,12 +128,10 @@ class Drawable: def set_legend(self, channel, value): "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))) - self.legend[channel] = str(value) - def get_xmin(self): "Returns minimun of x" return self.x.min() @@ -142,17 +140,14 @@ class Drawable: "Sets minimum of x" self.xmin = xmin - def get_xmax(self): "Returns maximum of x" return self.x.max() - def set_xmax(self, xmax): "Sets maximum of x" self.xmax = xmax - def get_ymin(self): "Returns minimum of y" if type(self.y)==type([]): @@ -160,12 +155,10 @@ class Drawable: else: return self.y.min() - def set_ymin(self, ymin): "Sets minimum of y" self.ymin = ymin - def get_ymax(self): "Returns maximimum of y" if type(self.y)==type([]): @@ -173,7 +166,6 @@ class Drawable: else: return self.y.max() - def set_ymax(self, ymax): "Sets maximum of y" self.ymax = ymax diff --git a/src/data/MeasurementResult.py b/src/data/MeasurementResult.py index 53d00c2..a7c0f63 100644 --- a/src/data/MeasurementResult.py +++ b/src/data/MeasurementResult.py @@ -136,7 +136,7 @@ class MeasurementResult(Drawable.Drawable, collections.UserDict): Drawable.Drawable.__init__(self) collections.UserDict.__init__(self) 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 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): - h5_table_format= { "x" : tables.Float32Col(), "y" : tables.Float32Col(),