diff --git a/lhcsmapi/api/analysis/output/qh/_common.py b/lhcsmapi/api/analysis/output/qh/_common.py index a51c4514feaf6a5468eb966263148535775cf0aa..22fa124f83ca8c5d117eeff7a8bdb84318ef13e9 100644 --- a/lhcsmapi/api/analysis/output/qh/_common.py +++ b/lhcsmapi/api/analysis/output/qh/_common.py @@ -16,21 +16,16 @@ SUMMARY_TABLE_ID = "Table" def get_summary_output(events: list[qh.Event], results: list[qh.Result]) -> list[output_types.Output]: - list_result = [] - - for event, result in zip(events, results): - list_result.append( - [ - event.source, - Time.Time.to_string_short(event.timestamp), - event.circuit_type, - event.circuit_name, - "PASSED" if result.is_qh_ok else "FAILED", - ] - ) df_result = pd.DataFrame( - list_result, columns=["source", "datetime", "circuit_type", "circuit_name", "analysis_result"] + { + "source": event.source, + "datetime": Time.Time.to_string_short(event.timestamp), + "circuit_type": event.circuit_type, + "circuit_name": event.circuit_name, + "analysis_result": "PASSED" if result.is_qh_ok else "FAILED", + } + for event, result in zip(events, results) ) df_result["datetime"] = df_result["datetime"].astype("datetime64[ms]") # RQs are in ns whereas other circuits in ms return [output_types.HTMLOutput(df_result.to_html())]