Cython API: fixed a bug where iteration on a NUC_SEQS view would not be
done correctly (bug appeared with optimization modifications done lately)
This commit is contained in:
@ -58,12 +58,25 @@ cdef class View_NUC_SEQS(View):
|
||||
return view
|
||||
|
||||
|
||||
# TODO
|
||||
# TODO test time gain without
|
||||
@OBIWrapper.checkIsActive
|
||||
def __getitem__(self, object item) :
|
||||
if type(item) == int :
|
||||
return Nuc_Seq_Stored(self, item)
|
||||
else : # TODO assume str or bytes for optimization?
|
||||
return self.get_column(item) # TODO hyper lent dans la pratique
|
||||
|
||||
|
||||
@OBIWrapper.checkIsActive
|
||||
def __iter__(self):
|
||||
# Iteration on each line of all columns
|
||||
|
||||
# Declarations
|
||||
cdef index_t line_nb
|
||||
|
||||
# Yield each line
|
||||
for line_nb in range(self.line_count) :
|
||||
yield Nuc_Seq_Stored(self, line_nb)
|
||||
|
||||
|
||||
# TODO? test if efficiency gain
|
||||
|
Reference in New Issue
Block a user