clean up write_to_csv for MeasurmentResult (Fixs #30)
Build Debian Packages / build (trixie, debian13) (push) Successful in 13m56s
Build Debian Packages / build (bookworm, debian12) (push) Successful in 14m7s
Build Debian Packages / build (bullseye, debian11) (push) Has been cancelled

This commit is contained in:
2026-07-06 16:55:49 +02:00
parent eab49db8d4
commit 26970ba201
+5 -3
View File
@@ -193,7 +193,7 @@ class MeasurementResult(Drawable.Drawable, collections.UserDict):
def uses_statistics(self):
"""
drawable interface method, returns True
drawable interface method returns True
"""
return True
@@ -203,10 +203,11 @@ class MeasurementResult(Drawable.Drawable, collections.UserDict):
destination can be a file or a filename
suitable for further processing
"""
# write sorted
the_destination=destination
file_opened = False
if type(destination) in (str,):
the_destination=open(destination, "w")
file_opened = True
the_destination.write("# quantity:"+str(self.quantity_name)+"\n")
the_destination.write("# x y ysigma n\n")
@@ -222,7 +223,8 @@ class MeasurementResult(Drawable.Drawable, collections.UserDict):
y.mean_error(),
delimiter,
y.n))
the_destination=None
if file_opened:
the_destination.close()
def write_to_hdf(self, hdffile, where, name, title, complib=None, complevel=None):