Return explicit chunks, expanding any integer member to a tuple of integers.
(chunks, shape)
| 161 | |
| 162 | |
| 163 | def explicit_chunks(chunks, shape): |
| 164 | """Return explicit chunks, expanding any integer member to a tuple of integers.""" |
| 165 | # Emulate `dask.array.core.normalize_chunks` but for simpler inputs. |
| 166 | return tuple( |
| 167 | ( |
| 168 | ( |
| 169 | (size // chunk) * (chunk,) |
| 170 | + ((size % chunk,) if size % chunk or size == 0 else ()) |
| 171 | ) |
| 172 | if isinstance(chunk, Number) |
| 173 | else chunk |
| 174 | ) |
| 175 | for chunk, size in zip(chunks, shape, strict=True) |
| 176 | ) |
| 177 | |
| 178 | |
| 179 | @requires_dask |
no outgoing calls
no test coverage detected
searching dependent graphs…