cf.Data.HDF_chunks

Data.HDF_chunks(*chunks)[source]

Get or set HDF chunk sizes.

The HDF chunk sizes may be used by external code that allows Data objects to be written to netCDF files.

Deprecated at version 3.14.0 and is no longer available. Use the methods nc_clear_hdf5_chunksizes, nc_hdf5_chunksizes, and nc_set_hdf5_chunksizes instead.

Parameters
chunks: dict or None, optional

Specify HDF chunk sizes.

When no positional argument is provided, the HDF chunk sizes are unchanged.

If None then the HDF chunk sizes for each dimension are cleared, so that the HDF default chunk size value will be used when writing data to disk.

If a dict then it defines for a subset of the dimensions, defined by their integer positions, the corresponding HDF chunk sizes. The HDF chunk sizes are set as a number of elements along the dimension.

Returns
dict

The HDF chunks for each dimension prior to the change, or the current HDF chunks if no new values are specified. A value of None is an indication that the default chunk size should be used for that dimension.

Examples

>>> d = cf.Data(np.arange(30).reshape(5, 6))
>>> d.HDF_chunks()
{0: None, 1: None}
>>> d.HDF_chunks({1: 2})
{0: None, 1: None}
>>> d.HDF_chunks()
{0: None, 1: 2}
>>> d.HDF_chunks({1:None})
{0: None, 1: 2}
>>> d.HDF_chunks()
{0: None, 1: None}
>>> d.HDF_chunks({0: 3, 1: 6})
{0: None, 1: None}
>>> d.HDF_chunks()
{0: 3, 1: 6}
>>> d.HDF_chunks({1: 4})
{0: 3, 1: 6}
>>> d.HDF_chunks()
{0: 3, 1: 4}
>>> d.HDF_chunks({1: 999})
{0: 3, 1: 4}
>>> d.HDF_chunks()
{0: 3, 1: 999}
>>> d.HDF_chunks(None)
{0: 3, 1: 999}
>>> d.HDF_chunks()
{0: None, 1: None}