code: def remove_invalid(self):
          
          valid = np.array([i.is_valid for i in self.entities],
                           dtype=np.bool)
          self.entities = self.entities[valid]
docs: Remove entities which declare themselves invalid
  
          Alters
          ----------
          self.entities: shortened