Skip to content

Commit

Permalink
Show number of expected quanta in pipetask report
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Jun 28, 2024
1 parent 2883a1f commit e828a6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/changes/DM-44368.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Display successful and expected quanta in `pipetask report`.
12 changes: 8 additions & 4 deletions python/lsst/ctrl/mpexec/cli/script/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,20 @@ def report(
quanta_summary.append(
{
"Task": task,
"Failed Quanta": len(summary_dict[task]["failed_quanta"]),
"Blocked Quanta": summary_dict[task]["n_quanta_blocked"],
"Failed": len(summary_dict[task]["failed_quanta"]),
"Blocked": summary_dict[task]["n_quanta_blocked"],
"Succeeded": summary_dict[task]["n_succeeded"],
"Expected": summary_dict[task]["n_expected"],
}
)
else:
quanta_summary.append(
{
"Task": task,
"Failed Quanta": summary_dict[task]["failed_quanta"],
"Blocked Quanta": summary_dict[task]["n_quanta_blocked"],
"Failed": summary_dict[task]["failed_quanta"],
"Blocked": summary_dict[task]["n_quanta_blocked"],
"Succeeded": summary_dict[task]["n_succeeded"],
"Expected": summary_dict[task]["n_expected"],
}
)
if "errors" in summary_dict[task].keys():
Expand Down
5 changes: 4 additions & 1 deletion tests/test_cliCmdReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_report(self):
report_output_dict = yaml.load(f, Loader=SafeLoader)
self.assertIsNotNone(report_output_dict["task0"])
self.assertIsNotNone(report_output_dict["task0"]["failed_quanta"])
self.assertIsInstance(report_output_dict["task0"]["n_expected"], int)

result_hr = self.runner.invoke(
pipetask_cli,
Expand All @@ -97,7 +98,9 @@ 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("Failed", result_hr.stdout)
self.assertIn("Expected", result_hr.stdout)
self.assertIn("Succeeded", result_hr.stdout)


if __name__ == "__main__":
Expand Down

0 comments on commit e828a6d

Please sign in to comment.