diff --git a/csst_common/pipeline.py b/csst_common/pipeline.py index 5fad3af614d26d661174cb3d35bcf85d7b095b31..c8f062479947e5a472f10d0284ab95f46aeb335d 100644 --- a/csst_common/pipeline.py +++ b/csst_common/pipeline.py @@ -150,11 +150,11 @@ class Pipeline: h.set("CREATED", self.pipeline_id, comment="pipeline build time") return reformat_header(h, strip=False, comment="Pipeline summary") - def summary(self): + def summarize(self): """Summarize this run.""" t_stop: Time = Time.now() t_cost: float = (t_stop - self.t_start).value * 86400.0 - self.pipeline_logger.info(f"Total cost: {t_cost} sec") + self.pipeline_logger.info(f"Total cost: {t_cost:.1f} sec") def clean_output(self): """Clean output directory.""" @@ -294,10 +294,10 @@ class Message: for d in dlist: f.write(self.dict2msg(d) + "\n") - def preview(self, dlist: list[dict]) -> str: - """Preview messages.""" + def preview(self, dlist: list[dict], n: int = 10) -> None: + """Preview top `n` messages.""" s = "" - for d in dlist: + for d in dlist[:n]: s += self.dict2msg(d) + "\n" print(s)