def set_options_from_file(self, filename, file_format='yaml'):
        """Load options from file.

        This is a wrapper over :func:`.set_options_from_JSON` and
        :func:`.set_options_from_YAML`.

        :param str filename: File from which to load the options.
        :param str file_format: File format (``yaml`` or ``json``).

        :raises:
            :ValueError: If an unknown ``format`` is requested.
        """
        if file_format.lower() == 'yaml':
            return self.set_options_from_YAML(filename)
        elif file_format.lower() == 'json':
            return self.set_options_from_JSON(filename)
        else:
            raise ValueError('Unknown format {}'.format(file_format))