@classmethod
def from_data(cls, data):
    """Construct a duration from its data representation.

        Parameters
        ----------
        data : :obj:`dict`
            The data dictionary.

        Returns
        -------
        :class:`Duration`
             An instance of :class:`Duration`.
        """
    duration = cls(0, 0)
    duration.data = data
    return duration
