From bd44f94ff3d35ff7959b463429eeecd5b7b7624d Mon Sep 17 00:00:00 2001 From: Orion Eiger Date: Fri, 26 Apr 2024 14:09:11 -0700 Subject: [PATCH] For len(failed_quanta)>5, display counts and not data_ids --- doc/changes/DM-44091.bugfix.md | 1 + python/lsst/ctrl/mpexec/cli/script/report.py | 24 +++++++++++++------- tests/test_cliCmdReport.py | 1 - 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 doc/changes/DM-44091.bugfix.md diff --git a/doc/changes/DM-44091.bugfix.md b/doc/changes/DM-44091.bugfix.md new file mode 100644 index 00000000..5df2e8f4 --- /dev/null +++ b/doc/changes/DM-44091.bugfix.md @@ -0,0 +1 @@ +Previous version of the human-readable report only reported the first failed quantum by exiting the loop upon finding it. Following changes in `pipe_base`, display only counts of failures for len(failed_quanta)>5. Data ids can be found in yaml file listing error messages. \ No newline at end of file diff --git a/python/lsst/ctrl/mpexec/cli/script/report.py b/python/lsst/ctrl/mpexec/cli/script/report.py index 913c52f8..7f4c3238 100644 --- a/python/lsst/ctrl/mpexec/cli/script/report.py +++ b/python/lsst/ctrl/mpexec/cli/script/report.py @@ -79,14 +79,22 @@ def report( dataset_table_rows.append(summary_dict[task]["outputs"][data_product]) data_products.append(data_product) - quanta_summary.append( - { - "Task": task, - "Failed Quanta": summary_dict[task]["failed_quanta"], - "Blocked Quanta": summary_dict[task]["n_quanta_blocked"], - } - ) - + if len(summary_dict[task]["failed_quanta"]) > 5: + quanta_summary.append( + { + "Task": task, + "Failed Quanta": len(summary_dict[task]["failed_quanta"]), + "Blocked Quanta": summary_dict[task]["n_quanta_blocked"], + } + ) + else: + quanta_summary.append( + { + "Task": task, + "Failed Quanta": summary_dict[task]["failed_quanta"], + "Blocked Quanta": summary_dict[task]["n_quanta_blocked"], + } + ) if "errors" in summary_dict[task].keys(): error_summary.append({task: summary_dict[task]["errors"]}) quanta = Table(quanta_summary) diff --git a/tests/test_cliCmdReport.py b/tests/test_cliCmdReport.py index 5b97b0e5..8bbfd238 100644 --- a/tests/test_cliCmdReport.py +++ b/tests/test_cliCmdReport.py @@ -98,7 +98,6 @@ def test_report(self): # Check that task0 and the failed quanta for task0 exist in the string self.assertIn("task0", result_hr.stdout) self.assertIn("Failed Quanta", result_hr.stdout) - self.assertIn("{'data_id': {'instrument': 'INSTR', 'detector': 0}}", result_hr.stdout) if __name__ == "__main__":