Skip to content

Commit

Permalink
fixes asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
miili committed Nov 5, 2023
1 parent 65beec5 commit 8128f59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lassie/images/phase_net.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import asyncio
import logging
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, Any, Literal
Expand Down Expand Up @@ -162,7 +163,8 @@ async def process_traces(self, traces: list[Trace]) -> list[PhaseNetImage]:
for tr in stream:
tr.stats.sampling_rate = tr.stats.sampling_rate / scale

annotations: Stream = await self._phase_net.annotate_async(
annotations: Stream = await asyncio.to_thread(
self._phase_net.annotate,
stream,
overlap=self.window_overlap_samples,
batch_size=self.batch_size
Expand Down

0 comments on commit 8128f59

Please sign in to comment.