Construct new ``SDfile`` object from ``Molfile`` object.

        :param molfile: ``Molfile`` object.
        :type molfile: :class:`~ctfile.ctfile.Molfile`.
        :return: ``SDfile`` object.
        :rtype: :class:`~ctfile.ctfile.SDfile`.

def from_molfile(cls, molfile, data=None):
        """Construct new ``SDfile`` object from ``Molfile`` object.

        :param molfile: ``Molfile`` object.
        :type molfile: :class:`~ctfile.ctfile.Molfile`.
        :return: ``SDfile`` object.
        :rtype: :class:`~ctfile.ctfile.SDfile`.
        """
        if not data:
            data = OrderedDict()

        if not isinstance(molfile, Molfile):
            raise ValueError('Not a Molfile type: "{}"'.format(type(molfile)))

        if not isinstance(data, dict):
            raise ValueError('Not a dict type: "{}"'.format(type(data)))

        sdfile = cls()
        sdfile['1'] = OrderedDict()
        sdfile['1']['molfile'] = molfile
        sdfile['1']['data'] = data
        return sdfile