From 70af18f926d4cdaa1c4e9eb1d61bdf8eb5ccb76a Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Fri, 12 Jul 2024 18:18:20 -0400 Subject: [PATCH] add warnings for list recent results and summarize --- pipestat/pipestat.py | 10 +++++++++- tests/test_pipestat.py | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pipestat/pipestat.py b/pipestat/pipestat.py index 81b02ad2..4b3f9627 100644 --- a/pipestat/pipestat.py +++ b/pipestat/pipestat.py @@ -491,6 +491,9 @@ def list_recent_results( :return dict results: a dict containing start, end, num of records, and list of retrieved records """ + if self.cfg["pephub_path"]: + _LOGGER.warning(f"List recent results not supported for PEPHub backend") + return {} date_format = "%Y-%m-%d %H:%M:%S" if start is None: start = datetime.datetime.now() @@ -904,7 +907,7 @@ def summarize( looper_samples: Optional[list] = None, amendment: Optional[str] = None, portable: Optional[bool] = False, - ) -> None: + ) -> Union[str, None]: """ Builds a browsable html report for reported results. :param Iterable[str] looper_samples: list of looper Samples from PEP @@ -913,6 +916,11 @@ def summarize( :return str: report_path """ + if self.cfg["pephub_path"]: + _LOGGER.warning( + f"Summarize not supported for PEPHub backend. Please generate report via PEPHub website." + ) + return None self.check_multi_results() diff --git a/tests/test_pipestat.py b/tests/test_pipestat.py index aaf4979c..a085a990 100644 --- a/tests/test_pipestat.py +++ b/tests/test_pipestat.py @@ -2689,3 +2689,5 @@ def test_pephub_unsupported_funcs( assert results is None psm.link("somedir") + psm.list_recent_results() + psm.summarize()