From e0af314abeb0967d4f2bcac259e07ff2b41e68f4 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:21:46 +0100 Subject: [PATCH] ruff formatting --- pynxtools/dataconverter/readers/xps/reader.py | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pynxtools/dataconverter/readers/xps/reader.py b/pynxtools/dataconverter/readers/xps/reader.py index aeb99d78a..00a05ba6f 100644 --- a/pynxtools/dataconverter/readers/xps/reader.py +++ b/pynxtools/dataconverter/readers/xps/reader.py @@ -246,7 +246,9 @@ def fill_template_with_xps_data(config_dict, xps_data_dict, template, entry_set) xps_data_dict, key_part, dt_typ=XPS_DETECTOR_TOKEN ) - fill_detector_group(key, entries_values, config_dict, template, entry_set) + fill_detector_group( + key, entries_values, config_dict, template, entry_set + ) elif XPS_TOKEN in str(value): token = value.split(XPS_TOKEN)[-1] @@ -258,7 +260,9 @@ def fill_template_with_xps_data(config_dict, xps_data_dict, template, entry_set) modified_key = key.replace("[entry]", f"[{entry}]") template[modified_key] = ent_value try: - template[f"{modified_key}/@units"] = config_dict[f"{key}/@units"] + template[f"{modified_key}/@units"] = config_dict[ + f"{key}/@units" + ] except KeyError: pass @@ -272,9 +276,11 @@ def fill_template_with_xps_data(config_dict, xps_data_dict, template, entry_set) modified_key = key.replace("[entry]", f"[{entry}]") template[modified_key] = ent_value try: - template[f"{modified_key}/@units"] = config_dict[f"{key}/@units"] + template[f"{modified_key}/@units"] = config_dict[ + f"{key}/@units" + ] except KeyError: - pass + pass # pylint: disable=too-many-branches @@ -338,6 +344,7 @@ def _concatenate_values(value1, value2): return concatenated + def update_dict_without_replacing(existing_dict, new_dict): """ Update an existing dictionary with a new dict, @@ -410,15 +417,13 @@ def read( # If there are multiple input data files of the same type, # make sure that existing keys are not overwritten. - xps_data_dict = update_dict_without_replacing( - xps_data_dict, data_dict) + xps_data_dict = update_dict_without_replacing(xps_data_dict, data_dict) elif file_ext in XpsDataFileParser.__prmt_metadata_file_ext__: parser = XpsDataFileParser([file]) data_dict = parser.get_dict(**kwargs) - xps_data_dict = update_dict_without_replacing( - xps_data_dict, data_dict) + xps_data_dict = update_dict_without_replacing(xps_data_dict, data_dict) # This code is not very robust. elif file_ext == "json":