Skip to content

Commit

Permalink
For len(failed_quanta)>5, display counts and not data_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Apr 26, 2024
1 parent 9f21ca1 commit 3c3e9d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
24 changes: 16 additions & 8 deletions python/lsst/ctrl/mpexec/cli/script/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check warning on line 83 in python/lsst/ctrl/mpexec/cli/script/report.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/ctrl/mpexec/cli/script/report.py#L83

Added line #L83 was not covered by tests
{
"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)
Expand Down
1 change: 0 additions & 1 deletion tests/test_cliCmdReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down

0 comments on commit 3c3e9d6

Please sign in to comment.