diff --git a/process/io/configuration.py b/process/io/configuration.py index 934a901e27..13e9cfc3d0 100644 --- a/process/io/configuration.py +++ b/process/io/configuration.py @@ -36,7 +36,6 @@ def data(self): def data_validate(self, value): """Check that value corresponds to a specific data format.""" - logger.info(f"type of value: {type(value)}") if not isinstance(value, dict) and value is not None: raise ValueError("Configuration data must be specified as a dictionary") diff --git a/process/io/mfile.py b/process/io/mfile.py index 872366b751..2133c828dc 100644 --- a/process/io/mfile.py +++ b/process/io/mfile.py @@ -59,11 +59,9 @@ def __init__( self.var_flag = var_flag self.latest_scan = 0 super().__init__(*args, **kwargs) - logger.debug(f"Initialising variable '{self.var_name}': {self.var_description}") def __getattr__(self, name): result = self.get(name) - # print(f"Trying to get({name}) on {self}, {id(self)}" if result: return result raise AttributeError(f"{self.__class__} object has no attribute {name}") @@ -79,9 +77,6 @@ def set_scan(self, scan_number, scan_value): self[f"scan{scan_number:02}"] = scan_value if scan_number > self.latest_scan: self.latest_scan = scan_number - logger.debug( - f"Scan {scan_number} for variable '{self.var_name}' == {scan_value}" - ) def get_scan(self, scan_number): """Returns the value of a specific scan. For scan = -1 or None the last @@ -94,12 +89,9 @@ def get_scan(self, scan_number): [single scan requested] """ - try: - if scan_number is None or scan_number == -1: - return self[f"scan{self.latest_scan:02}"] - return self[f"scan{scan_number:02}"] - except KeyError: - raise # or substitute with any other exception type you want + if scan_number is None or scan_number == -1: + return self[f"scan{self.latest_scan:02}"] + return self[f"scan{scan_number:02}"] def get_scans(self): """Returns a list of scan values in order of scan number @@ -112,8 +104,6 @@ def get_scans(self): def get_number_of_scans(self): """Function to return the number of scans in the variable class""" - # likely we can just use self.latest_scan, but not guaranteed, so - # keeping this as it is for now... return len([key for key in self.keys() if "scan" in key]) @property @@ -207,10 +197,7 @@ def __repr__(self): class MFile: def __init__(self, filename="MFILE.DAT"): """Class object to store the MFile Objects""" - logger.info(f"Creating MFile class for file '{filename}'") self.filename = filename - # self.data = MFileDataDictionary() - # self.data = OrderedDict() self.data = DefaultOrderedDict() self.mfile_lines = [] self.mfile_modules = {} @@ -218,9 +205,7 @@ def __init__(self, filename="MFILE.DAT"): self.mfile_modules["Misc"] = [] self.current_module = "Misc" if filename is not None: - logger.info(f"Opening file '{self.filename}'") self.open_mfile() - logger.info(f"Parsing file '{self.filename}'") self.parse_mfile() def open_mfile(self): @@ -236,7 +221,6 @@ def open_mfile(self): def parse_mfile(self): """Function to parse MFILE.DAT""" - # for line in (c for c in (clean_line(l) for l in self.mfile_lines if '#' not in l[:2]) for line in ( c for c in (clean_line(lines) for lines in self.mfile_lines) if c != [""] ):