cf.chunksize¶
-
cf.chunksize(*arg)[source]¶ Set the default chunksize used by
daskarrays.If called without any arguments then the existing chunksize is returned.
Note
Setting the chunk size will also change the
daskglobal configuration value'array.chunk-size'. Ifchunksizeis used in a context manager then thedaskconfiguration value is only altered within that context. Setting the chunk size directly from thedaskconfiguration API will affect subsequent data creation, but will not change the value ofchunksize.- Parameters
- arg: number or
strorConstant, optional The chunksize in bytes. Any size accepted by
dask.utils.parse_bytesis accepted, for instance100,'100','1e6','100 MB','100M','5kB','5.4 kB','1kiB','1e6 kB', and'MB'are all valid sizes.Note that if arg is a
float, or a string that implies a non-integral amount of bytes, then the integer part (rounded down) will be used.- Parameter example:
A chunksize of 2 MiB may be specified as
'2097152'or'2 MiB'- Parameter example:
Chunksizes of
'2678.9'and'2.6789 KB'are both equivalent to2678.
- arg: number or
- Returns
ConstantThe value prior to the change, or the current value if no new value was specified.