diff --git a/lassie/search.py b/lassie/search.py index e17f2a6b..8f0c0076 100644 --- a/lassie/search.py +++ b/lassie/search.py @@ -237,11 +237,15 @@ async def start(self, force_rundir: bool = False) -> None: batch.clean_traces() if batch.is_empty(): - logger.warning("batch is empty") + logger.warning("empty batch %s", batch.log_str()) continue if batch.duration < 2 * self._window_padding: - logger.warning("batch duration is too short") + logger.warning( + "duration of batch %s too short %s", + batch.log_str(), + batch.duration, + ) continue search_block = SearchTraces( @@ -270,11 +274,9 @@ async def start(self, force_rundir: bool = False) -> None: else: percent_processed = 0.0 logger.info( - "%s%% processed - batch %d/%s - %s in %s", + "%s%% processed - batch %s in %s", f"{percent_processed:.1f}" if percent_processed else "??", - batch.i_batch + 1, - str(batch.n_batches or "?"), - batch.start_time, + batch.log_str(), processing_time, ) if batch.n_batches: diff --git a/lassie/waveforms/base.py b/lassie/waveforms/base.py index 38319a55..cb27c4fc 100644 --- a/lassie/waveforms/base.py +++ b/lassie/waveforms/base.py @@ -45,6 +45,10 @@ def clean_traces(self) -> None: logger.warning("skipping empty or bad trace: %s", ".".join(tr.nslc_id)) self.traces.remove(tr) + def log_str(self) -> str: + """Log the batch.""" + return f"{self.i_batch}/{self.n_batches or '?'} {self.start_time}" + class WaveformProvider(BaseModel): provider: Literal["WaveformProvider"] = "WaveformProvider"