def write(filename, groupname, items, times, features, properties=None,
          dformat='dense', chunk_size='auto', sparsity=0.1, mode='a'):
    """Write h5features data in a HDF5 file.

    This function is a wrapper to the Writer class. It has three purposes:

    * Check parameters for errors (see details below),
    * Create Items, Times and Features objects
    * Send them to the Writer.

    :param str filename: HDF5 file to be writted, potentially serving
        as a container for many small files. If the file does not
        exist, it is created. If the file is already a valid HDF5
        file, try to append the data in it.

    :param str groupname: Name of the group to write the data in, or
        to append the data to if the group already exists in the file.

    :param items: List of files from which the features where
        extracted. Items must not contain duplicates.
    :type items: list of str

    :param times: Time value for the features array. Elements of
        a 1D array are considered as the center of the time window
        associated with the features. A 2D array must have 2 columns
        corresponding to the begin and end timestamps of the features
        time window.
    :type times: list of  1D or 2D numpy arrays

    :param features: Features should have
        time along the lines and features along the columns
        (accomodating row-major storage in hdf5 files).
    :type features: list of 2D numpy arrays

    :param properties: Optional. Properties associated with each
        item. Properties describe the features associated with each
        item in a dictionnary. It can store parameters or fields
        recorded by the user.
    :type properties: list of dictionnaries

    :param str dformat: Optional. Which format to store the features
        into (sparse or dense). Default is dense.

    :param float chunk_size: Optional. In Mo, tuning parameter
        corresponding to the size of a chunk in the h5file. By default
        the chunk size is guessed automatically. Tis parameter is
        ignored if the file already exists.

    :param float sparsity: Optional. Tuning parameter corresponding to
        the expected proportion (in [0, 1]) of non-zeros elements on
        average in a single frame.

    :param char mode: Optional. The mode for overwriting an existing
        file, 'a' to append data to the file, 'w' to overwrite it

    :raise IOError: if the filename is not valid or parameters are
        inconsistent.

    :raise NotImplementedError: if dformat == 'sparse'

    """
    # Prepare the data, raise on error
    sparsity = sparsity if dformat == 'sparse' else None
    data = Data(items, times, features, properties=properties,
                sparsity=sparsity, check=True)

    # Write all that stuff in the HDF5 file's specified group
    Writer(filename, chunk_size=chunk_size).write(data, groupname, append=True)
Write h5features data in a HDF5 file.

    This function is a wrapper to the Writer class. It has three purposes:

    * Check parameters for errors (see details below),
    * Create Items, Times and Features objects
    * Send them to the Writer.

    :param str filename: HDF5 file to be writted, potentially serving
        as a container for many small files. If the file does not
        exist, it is created. If the file is already a valid HDF5
        file, try to append the data in it.

    :param str groupname: Name of the group to write the data in, or
        to append the data to if the group already exists in the file.

    :param items: List of files from which the features where
        extracted. Items must not contain duplicates.
    :type items: list of str

    :param times: Time value for the features array. Elements of
        a 1D array are considered as the center of the time window
        associated with the features. A 2D array must have 2 columns
        corresponding to the begin and end timestamps of the features
        time window.
    :type times: list of  1D or 2D numpy arrays

    :param features: Features should have
        time along the lines and features along the columns
        (accomodating row-major storage in hdf5 files).
    :type features: list of 2D numpy arrays

    :param properties: Optional. Properties associated with each
        item. Properties describe the features associated with each
        item in a dictionnary. It can store parameters or fields
        recorded by the user.
    :type properties: list of dictionnaries

    :param str dformat: Optional. Which format to store the features
        into (sparse or dense). Default is dense.

    :param float chunk_size: Optional. In Mo, tuning parameter
        corresponding to the size of a chunk in the h5file. By default
        the chunk size is guessed automatically. Tis parameter is
        ignored if the file already exists.

    :param float sparsity: Optional. Tuning parameter corresponding to
        the expected proportion (in [0, 1]) of non-zeros elements on
        average in a single frame.

    :param char mode: Optional. The mode for overwriting an existing
        file, 'a' to append data to the file, 'w' to overwrite it

    :raise IOError: if the filename is not valid or parameters are
        inconsistent.

    :raise NotImplementedError: if dformat == 'sparse'