Create a chunked array using the chunks hint for dimensions of size > 1.
(
array, chunks, chunkmanager: ChunkManagerEntrypoint[Any]
)
| 1522 | |
| 1523 | |
| 1524 | def _chunked_array_with_chunks_hint( |
| 1525 | array, chunks, chunkmanager: ChunkManagerEntrypoint[Any] |
| 1526 | ): |
| 1527 | """Create a chunked array using the chunks hint for dimensions of size > 1.""" |
| 1528 | |
| 1529 | if len(chunks) < array.ndim: |
| 1530 | raise ValueError("not enough chunks in hint") |
| 1531 | new_chunks = [] |
| 1532 | for chunk, size in zip(chunks, array.shape, strict=False): |
| 1533 | new_chunks.append(chunk if size > 1 else (1,)) |
| 1534 | return chunkmanager.from_array(array, new_chunks) # type: ignore[arg-type] |
| 1535 | |
| 1536 | |
| 1537 | def _logical_any(args): |
no test coverage detected
searching dependent graphs…