src/amuse/datamodel/particles.py
def union(self, other):
        """
        Returns a new subset containing the union between
        this set and the provided set.

        >>> particles = Particles(3)
        >>> particles.mass = [10.0, 20.0, 30.0] | units.kg
        >>> subset1 = particles.select(lambda x : x > 25.0 | units.kg, ["mass"])
        >>> subset2 = particles.select(lambda x : x < 15.0 | units.kg, ["mass"])
        >>> union = subset1.union(subset2)
        >>> len(union)
        2
        >>> sorted(union.mass.value_in(units.kg))
        [10.0, 30.0]
        """

        self._sync_with_set()
        new_set_of_keys = self._private.set_of_keys.union(other.as_set()._private.set_of_keys)
        return ParticlesSubset(self._private.particles, list(new_set_of_keys))

        Returns a new subset containing the union between
        this set and the provided set.

        >>> particles = Particles(3)
        >>> particles.mass = [10.0, 20.0, 30.0] | units.kg
        >>> subset1 = particles.select(lambda x : x > 25.0 | units.kg, ["mass"])
        >>> subset2 = particles.select(lambda x : x < 15.0 | units.kg, ["mass"])
        >>> union = subset1.union(subset2)
        >>> len(union)
        2
        >>> sorted(union.mass.value_in(units.kg))
        [10.0, 30.0]
        
Returns a new subset containing the union between
this set and the provided set.


Returns a new subset containing the union between this set and the provided set .
def union(self, other):
        self._sync_with_set()
        new_set_of_keys = self._private.set_of_keys.union(other.as_set()._private.set_of_keys)
        return ParticlesSubset(self._private.particles, list(new_set_of_keys))
def union ( self , other ) : self . _sync_with_set ( ) new_set_of_keys = self . _private . set_of_keys . union ( other . as_set ( ) . _private . set_of_keys ) return ParticlesSubset ( self . _private . particles , list ( new_set_of_keys ) )
Returns a new subset containing the union between
this set and the provided set.
Returns a new subset containing the union between this set and the provided set .
"""
        Returns a new subset containing the union between
        this set and the provided set.

        >>> particles = Particles(3)
        >>> particles.mass = [10.0, 20.0, 30.0] | units.kg
        >>> subset1 = particles.select(lambda x : x > 25.0 | units.kg, ["mass"])
        >>> subset2 = particles.select(lambda x : x < 15.0 | units.kg, ["mass"])
        >>> union = subset1.union(subset2)
        >>> len(union)
        2
        >>> sorted(union.mass.value_in(units.kg))
        [10.0, 30.0]
        """
self
other