From 9040989de1829c9ba630c09a5bc984106b661f01 Mon Sep 17 00:00:00 2001 From: Travis Thompson Date: Sun, 4 Feb 2024 14:06:12 -0500 Subject: [PATCH] Changed messaging on study assays errors The messaging on the 2 checks dealing with study assays did not make it clear exactly which assay and which study had the issue. I changed the messaging so it clearly indicates the affected study and assay. --- isatools/isatab/validate/rules/rules_30xx.py | 2 +- isatools/isatab/validate/rules/rules_40xx.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/isatools/isatab/validate/rules/rules_30xx.py b/isatools/isatab/validate/rules/rules_30xx.py index a659786f..be876dc5 100644 --- a/isatools/isatab/validate/rules/rules_30xx.py +++ b/isatools/isatab/validate/rules/rules_30xx.py @@ -19,7 +19,7 @@ def check_filenames_present(i_df_dict: dict) -> None: if filename == '': spl = "STUDY.{}, STUDY ASSAY.{}".format(s_pos, a_pos) validator.add_warning.append(message="Missing assay file name", supplemental=spl, code=3005) - log.warning("(W) An assay filename is missing for STUDY ASSAY.{}".format(a_pos)) + log.warning("(W) An assay filename is missing for STUDY.{}, STUDY ASSAY.{}".format(s_pos, a_pos)) def check_date_formats(i_df_dict): diff --git a/isatools/isatab/validate/rules/rules_40xx.py b/isatools/isatab/validate/rules/rules_40xx.py index 84b87ace..f7c78adb 100644 --- a/isatools/isatab/validate/rules/rules_40xx.py +++ b/isatools/isatab/validate/rules/rules_40xx.py @@ -107,10 +107,10 @@ def check_measurement_technology_types(i_df_dict, configs): lowered_mt = measurement_types[x].lower() lowered_tt = technology_types[x].lower() if (lowered_mt, lowered_tt) not in configs.keys(): - spl = "Measurement {}/technology {}, STUDY ASSAY.{}" - spl = spl.format(measurement_types[x], technology_types[x], i) + spl = "Measurement {}/technology {}, STUDY.{}, STUDY ASSAY.{}" + spl = spl.format(measurement_types[x], technology_types[x], i, x) error = ("(E) Could not load configuration for measurement type '{}' and technology type '{}' " - "for STUDY ASSAY.{}'").format(measurement_types[x], technology_types[x], i) + "for STUDY.{}, STUDY ASSAY.{}'").format(measurement_types[x], technology_types[x], i, x) validator.add_error(message="Measurement/technology type invalid", supplemental=spl, code=4002) log.error(error)