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

Function _compute_multiplier

dask/array/core.py:3239–3249  ·  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

3237
3238
3239def _compute_multiplier(limit: int, dtype, largest_block: int, result):
3240 """
3241 Utility function for auto_chunk, to fin how much larger or smaller the ideal
3242 chunk size is relative to what we have now.
3243 """
3244 return (
3245 limit
3246 / dtype.itemsize
3247 / largest_block
3248 / math.prod(max(r) if isinstance(r, tuple) else r for r in result.values() if r)
3249 )
3250
3251
3252def 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