Пример #1
0
    def from_data(cls, data):
        """Construct a capsule from its data representation.

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

        Returns
        -------
        :class: `Capsule`
            The constructed capsule.
        """
        line = Line.from_data(data['line'])
        capsule = Capsule(line, data['radius'])
        return capsule
Пример #2
0
 def data(self, data):
     self.line = Line.from_data(data['line'])
     self.radius = data['radius']