def write_options_to_file(self, filename, file_format='yaml'):
        """Write options to file.

        This is a wrapper over :func:`.write_options_to_JSON` and
        :func:`.write_options_to_YAML`.

        :param str filename: Target file to write the options.
        :param str file_format: File format (``yaml`` or ``json``).

        :raises:
            :ValueError: If an unknown ``format`` is requested.
        """
        if file_format.lower() == 'yaml':
            self.write_options_to_YAML(filename)
        elif file_format.lower() == 'json':
            self.write_options_to_JSON(filename)
        else:
            raise ValueError('Unknown format {}'.format(file_format))
Write options to file.

        This is a wrapper over :func:`.write_options_to_JSON` and
        :func:`.write_options_to_YAML`.

        :param str filename: Target file to write the options.
        :param str file_format: File format (``yaml`` or ``json``).

        :raises:
            :ValueError: If an unknown ``format`` is requested.