|
async def _run_one_date( |
|
t_idx: int, |
|
plan: _ChunkReadPlan, |
|
) -> dict[str, np.ndarray] | None: |
|
"""Read and mosaic all COGs for a single time step. |
|
|
|
Issues one DuckDB query for items overlapping the chunk at this date, then |
|
calls async_mosaic_chunk to fetch and reproject all tiles. |
|
Returns None if no items match the query. |
|
|
|
Args: |
|
t_idx: Index into ``plan.dates`` for the time step to read. |
|
plan: Read plan carrying all parameters for this chunk. |
|
|
|
Returns: |
|
Per-band arrays keyed by band name, or ``None`` if no items matched. |
|
|
|
""" |
|
date = plan.dates[t_idx] |
|
|
|
with plan.duckdb_lock: |
|
items = _search_items( |
|
plan.duckdb_client, |
|
plan.parquet_path, |
|
plan.chunk_bbox_4326, |
|
date, |
|
plan.sortby, |
|
plan.filter_expr, |
|
plan.ids, |
|
plan.filter_fields, |
|
label=f"bands={plan.selected_bands!r}", |
|
) |
This looks to be a synchronous, blocking duckdb call inside the main-thread async executor?
lazycogs/src/lazycogs/_backend.py
Lines 337 to 368 in 577205d
This looks to be a synchronous, blocking duckdb call inside the main-thread async executor?