Skip to content

Commit

Permalink
sqme: load_chunks fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill888 committed Jun 2, 2024
1 parent 54d81f2 commit c7e26ea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions odc/loader/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,14 @@ def load_tasks(
instances for every possible time, y, x, bins, including empty ones.
"""
# pylint: disable=too-many-locals
extra_dims = extra_dims or {}
chunks = chunks or {}

if nt is None:
nt = max(t for t, _, _ in tyx_bins) + 1

if extra_dims is None:
extra_dims = {}
if chunks is None:
chunks = {}

chunks = {**chunks}
chunks.update(zip(["y", "x"], gbt.chunk_shape((0, 0)).yx))
base_shape = (nt, *gbt.base.shape.yx)

if bands is None:
Expand Down Expand Up @@ -682,6 +682,8 @@ def _do_one(task: LoadChunkTask) -> Tuple[str, int, int, int]:
nt=nt,
extra_dims=template.extra_dims_full(),
)
tasks = list(tasks)
assert len(tasks) == total_tasks

_work = pmap(_do_one, tasks, pool)

Expand Down

0 comments on commit c7e26ea

Please sign in to comment.