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)
| 3249 | |
| 3250 | |
| 3251 | def _compute_multiplier(limit: int, dtype, largest_block: int, result): |
| 3252 | """ |
| 3253 | Utility function for auto_chunk, to fin how much larger or smaller the ideal |
| 3254 | chunk size is relative to what we have now. |
| 3255 | """ |
| 3256 | return ( |
| 3257 | limit |
| 3258 | / dtype.itemsize |
| 3259 | / largest_block |
| 3260 | / math.prod(max(r) if isinstance(r, tuple) else r for r in result.values() if r) |
| 3261 | ) |
| 3262 | |
| 3263 | |
| 3264 | def auto_chunks(chunks, shape, limit, dtype, previous_chunks=None): |
no test coverage detected