Utility function for auto_chunk, to fin how much larger or smaller the ideal chunk size is relative to what we have now.
(limit: int, dtype, largest_block: int, result)
| 3242 | |
| 3243 | |
| 3244 | def _compute_multiplier(limit: int, dtype, largest_block: int, result): |
| 3245 | """ |
| 3246 | Utility function for auto_chunk, to fin how much larger or smaller the ideal |
| 3247 | chunk size is relative to what we have now. |
| 3248 | """ |
| 3249 | return ( |
| 3250 | limit |
| 3251 | / dtype.itemsize |
| 3252 | / largest_block |
| 3253 | / math.prod(max(r) if isinstance(r, tuple) else r for r in result.values() if r) |
| 3254 | ) |
| 3255 | |
| 3256 | |
| 3257 | def auto_chunks(chunks, shape, limit, dtype, previous_chunks=None): |
no test coverage detected
searching dependent graphs…