def find_columns(self): undone_prices = self.prices.copy() while len(undone_prices) > 0: price1 = undone_prices.pop(0) column = Column(price1) for price2 in undone_prices.copy(): angle = get_angle(price1.top_right, price2.top_right) if get_abs_perp_angle_diff(self.angle, angle) < self.COLUMN_ANGLE_TRESHOLD: undone_prices.remove(price2) column.add(price2) self.columns.append(column) self.columns.sort( key=lambda column_: column_.get_rotated_x(self.angle))
def put(self, col, row, value, compresstype=0): ''' :param compresstype: 0: uncompressed 1: string compressed 2: block compressed :return: ''' self.row_keys.add(row) if col in self.columnlist: if READCACHE_FLAG: self.rc.delete(col, row) return self.columnlist[col].add(row, value) else: newcol = Column(col, compresstype) newcol.add(row, value) self.columnlist[col] = newcol