diff --git a/lassie/search.py b/lassie/search.py index abc8c372..e17f2a6b 100644 --- a/lassie/search.py +++ b/lassie/search.py @@ -223,6 +223,7 @@ async def start(self, force_rundir: bool = False) -> None: await self.prepare() self.init_rundir(force_rundir) logger.info("starting search...") + batch_processing_start = datetime_now() processing_start = datetime_now() if self._progress.time_progress: @@ -262,7 +263,7 @@ async def start(self, force_rundir: bool = False) -> None: if batch.i_batch % 50 == 0: self._detections.dump_detections(jitter_location=self.octree.size_limit) - processing_time = datetime_now() - processing_start + processing_time = datetime_now() - batch_processing_start self._batch_processing_durations.append(processing_time) if batch.n_batches: percent_processed = ((batch.i_batch + 1) / batch.n_batches) * 100 @@ -288,9 +289,11 @@ async def start(self, force_rundir: bool = False) -> None: datetime.now() + remaining_time, # noqa: DTZ005 ) - processing_start = datetime_now() + batch_processing_start = datetime_now() self.set_progress(batch.end_time) + logger.info("finished search in %s", datetime_now() - processing_start) + async def add_features(self, event: EventDetection) -> None: try: squirrel = self.data_provider.get_squirrel() diff --git a/lassie/waveforms/squirrel.py b/lassie/waveforms/squirrel.py index e9ad91dc..28b40b62 100644 --- a/lassie/waveforms/squirrel.py +++ b/lassie/waveforms/squirrel.py @@ -7,13 +7,7 @@ from pathlib import Path from typing import TYPE_CHECKING, AsyncIterator, Iterator, Literal -from pydantic import ( - AwareDatetime, - PositiveInt, - PrivateAttr, - constr, - model_validator, -) +from pydantic import AwareDatetime, PositiveInt, PrivateAttr, constr, model_validator from pyrocko.squirrel import Squirrel from typing_extensions import Self @@ -138,5 +132,3 @@ async def iter_batches( ) prefetcher.queue.task_done() - - logger.info("squirrel search finished")