Skip to content

Commit

Permalink
finishing up
Browse files Browse the repository at this point in the history
  • Loading branch information
miili committed Sep 13, 2023
1 parent 2ad183d commit b3ed1cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lassie/models/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def add(self, detection: EventDetection) -> None:

self.detections.append(detection)
logger.info(
"%s detection #%d %s: %.5f°, %.5f°, depth %.1f m, "
"%s event detection #%d %s: %.5f°, %.5f°, depth %.1f m, "
"border distance %.1f m, semblance %.3f",
Symbols.Target,
self.n_detections,
Expand Down Expand Up @@ -504,7 +504,7 @@ def load_rundir(cls, rundir: Path) -> EventDetections:

detections = cls(rundir=rundir)

with console.status(f"Loading detections from {rundir}..."), open(
with console.status(f"loading detections from {rundir}..."), open(
detection_file
) as f:
for i_detection, line in enumerate(f):
Expand Down
10 changes: 7 additions & 3 deletions lassie/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,16 @@ async def start(self, force_rundir: bool = False) -> None:

processing_time = datetime_now() - processing_start
self._batch_processing_durations.append(processing_time)
if batch.n_batches:
percent_processed = ((batch.i_batch + 1) / batch.n_batches) * 100
else:
percent_processed = 0.0
logger.info(
"processed batch %d/%s %s - %s in %s",
"%s%% processed - batch %d/%s - %s in %s",
f"{percent_processed:.1f}" if percent_processed else "??",
batch.i_batch + 1,
str(batch.n_batches or "?"),
batch.start_time,
batch.end_time,
processing_time,
)
if batch.n_batches:
Expand All @@ -279,7 +283,7 @@ async def start(self, force_rundir: bool = False) -> None:
* (batch.n_batches - batch.i_batch - 1)
)
logger.info(
"remaining time %s, estimated finish at %s",
"%s remaining - estimated finish at %s",
remaining_time,
datetime.now() + remaining_time, # noqa: DTZ005
)
Expand Down
4 changes: 2 additions & 2 deletions test/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import pytest

from lassie.models.location import locations_to_csv
from lassie.search import SquirrelSearch
from lassie.search import Search

km = 1e3


@pytest.mark.skip(reason="Fail")
def test_search() -> None:
search = SquirrelSearch()
search = Search()

# search.scan_squirrel()
locations = search.stations.model_copy()
Expand Down

0 comments on commit b3ed1cb

Please sign in to comment.