Skip to content

Commit

Permalink
fix naming again
Browse files Browse the repository at this point in the history
  • Loading branch information
nonnontrivial committed Jun 29, 2024
1 parent 16594f9 commit 7fd8037
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pp/pp/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import h3


def get_res_zero_cell_coords() -> List[Tuple[float, float]]:
"""gets list of coordinates of all resolution zero cells"""
def get_h3_cells() -> List[Tuple[float, float]]:
"""gets list of lat,lon coordinates of all resolution zero cells"""
resolution_zero_cells = h3.get_res0_indexes()
return [h3.h3_to_geo(c) for c in resolution_zero_cells]
10 changes: 5 additions & 5 deletions pp/pp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pika.exceptions import AMQPConnectionError

from .prediction import publish_cell_prediction
from .cells import get_res_zero_cell_coords
from .cells import get_h3_cells
from .config import rabbitmq_host, prediction_queue, task_sleep_interval

logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
Expand All @@ -33,13 +33,13 @@ async def main():
except Exception as e:
log.error(f"could not start publisher because {e}")
else:
resolution_zero_cell_coords = get_res_zero_cell_coords()
log.debug(f"using {len(resolution_zero_cell_coords)} resolution zero cells")

try:
h3_cell_coords = get_h3_cells()
log.debug(f"using {len(h3_cell_coords)} resolution zero cells")

async with httpx.AsyncClient() as client:
while True:
for cell_coords in resolution_zero_cell_coords:
for cell_coords in h3_cell_coords:
await asyncio.create_task(publish_cell_prediction(client, cell_coords, channel))
await asyncio.sleep(task_sleep_interval)
except Exception as e:
Expand Down

0 comments on commit 7fd8037

Please sign in to comment.