MCPcopy Create free account
hub / github.com/dask/dask / _compute_multiplier

Function _compute_multiplier

dask/array/core.py:3251–3261  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

3249
3250
3251def _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
3264def auto_chunks(chunks, shape, limit, dtype, previous_chunks=None):

Callers 1

auto_chunksFunction · 0.85

Calls 3

maxFunction · 0.90
prodMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected