diff --git a/cpdctrl/utility/data.py b/cpdctrl/utility/data.py index cc690b0..2815cc2 100644 --- a/cpdctrl/utility/data.py +++ b/cpdctrl/utility/data.py @@ -4,14 +4,11 @@ import os import matplotlib.pyplot as plt import datetime import pickle -import logging -log = logging.getLogger(__name__) from cpdctrl.utility.file_io import get_next_filename, sanitize_filename FLUSH_TYPE = "pickle-ndarray" METADATA_FILENAME = "_measurement_metadata.pkl" - class DataCollector: columns = ["idx", "t [s]", "V [V]", "LED [%]"] def __init__(self, @@ -59,7 +56,6 @@ class DataCollector: None. """ filepath = os.path.join(self.dirpath, METADATA_FILENAME) - log.debug(f"Writing metadata to {filepath}") with open(filepath, "wb") as file: pickle.dump(self.metadata, file) @@ -89,13 +85,11 @@ class DataCollector: if FLUSH_TYPE == "csv": filename = self._get_filename() + ".csv" filepath = os.path.join(self.dirpath, filename) - log.info(f"Flushing data to {filepath}") if verbose: print(f"Flushing data to {filepath}") self.to_dataframe().to_csv(filepath, sep=",", index=False, metadata=True) elif FLUSH_TYPE == "pickle-ndarray": filename = self._get_filename() + ".ndarray.pkl" filepath = os.path.join(self.dirpath, filename) - log.info(f"Flushing data to {filepath}") if verbose: print(f"Flushing data to {filepath}") with open(filepath, "wb") as file: pickle.dump(np.array(self.data), file) @@ -123,8 +117,7 @@ class DataCollector: def save_csv(self, sep=",", verbose=False): filepath = os.path.join(self.path, self.dirname + ".csv") - if verbose: print(f"Writing csv to {filepath}") - log.info(f"Writing csv to {filepath}") + if verbose: print(f"Writing data to {filepath}") with open(filepath, "w") as file: file.write(self.to_csv(sep=sep))