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,7 +58,8 @@ 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)
|
||||
@ -66,6 +67,18 @@ cdef class View_NUC_SEQS(View):
|
||||
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
|
||||
# def __setitem__(self, index_t line_idx, Nuc_Seq sequence_obj) :
|
||||
# for key in sequence_obj :
|
||||
|
Reference in New Issue
Block a user