def fill_dicts(self): """ Fill dictionaries. """ if not len(self._cluster_checked_dict): for rod_ in self: identifier = rod_.identifier self._rods_dict[identifier] = methods.compress_rod(rod_) self._cluster_checked_dict[identifier] = False
def check_rods(self): """ Check if rods are correct. """ rods = [] for rod_ in self: if rod_.is_in_circle(self.center, self.radius): rods.append(methods.compress_rod(rod_)) self._rods = queue.Queue(rods)
def check_rods(self): """ Check if rods are correct. """ valid_rods = [] initial_length = len(self._rods) for rod_ in self: valid = rod_.is_valid_rod(self._kappas, self._allowed_kappa_error, self.zone_coords) if valid: valid_rods.append(methods.compress_rod(rod_)) self._rods = queue.Queue(valid_rods) final_length = len(self._rods) self._reset()
def check_rods_with_length(self, length, length_error): """ Check if rods has requiered length and if it is in the circle. """ self._length, self._length_error = length, length_error valid_rods = [] initial_length = len(self._rods) for rod_ in self: valid = rod_.is_valid_rod_length(length, length_error, self._real_kappas, self.zone_coords) if valid: valid_rods.append(methods.compress_rod(rod_)) self._rods = queue.Queue(valid_rods) final_length = len(self._rods) self._reset()
def _remove_rod(self, rod_): """ Removes a rod from the group (queue object mod needed) """ self._rods.delete(methods.compress_rod(rod_))
def put_rod(self, rod_): """ Adds a rod to the group """ self._rods.put(methods.compress_rod(rod_))