(self, value)
return self
Add element.

        It will warn if the value to add is existent.

        Parameters
        ----------
        value: object
            same type of the element already in the set.
            Raise if unknown type is given.

        Returns
        -------
        self: object
            return self.
Add element.
Add element .
def add(self, value):
        """
        Add element.

        It will warn if the value to add is existent.

        Parameters
        ----------
        value: object
            same type of the element already in the set.
            Raise if unknown type is given.

        Returns
        -------
        self: object
            return self.
        """
        if self._element_type is None:
            self._element_type = type(value)
        # check validation
        if isinstance(value, np.generic):
            # value = np.asscalar(value)  # deprecated in numpy v1.16
            value = value.item()
        if not isinstance(value, self._element_type):
            raise TypeError(
                "A %s parameter is expected, but received: %s" % (str(self._element_type), str(type(value))))
        if value in self._innercontainer:
            warnings.warn("Adding element %s has already in the collection, skip." % (value.__str__()),
                          category=RepeatElementWarning,
                          stacklevel=3)
        else:
            self._innercontainer.append(value)
        return self
def add ( self , value ) : if self . _element_type is None : self . _element_type = type ( value ) # check validation if isinstance ( value , np . generic ) : # value = np.asscalar(value)  # deprecated in numpy v1.16 value = value . item ( ) if not isinstance ( value , self . _element_type ) : raise TypeError ( "A %s parameter is expected, but received: %s" % ( str ( self . _element_type ) , str ( type ( value ) ) ) ) if value in self . _innercontainer : warnings . warn ( "Adding element %s has already in the collection, skip." % ( value . __str__ ( ) ) , category = RepeatElementWarning , stacklevel = 3 ) else : self . _innercontainer . append ( value ) return self