More optimized Column item getter
This commit is contained in:
@ -57,12 +57,13 @@ cdef class View_NUC_SEQS(View):
|
|||||||
|
|
||||||
return view
|
return view
|
||||||
|
|
||||||
|
|
||||||
|
# TODO
|
||||||
def __getitem__(self, object item) :
|
def __getitem__(self, object item) :
|
||||||
if type(item) == str :
|
if type(item) == int :
|
||||||
return self.get_column(item) # TODO hyper lent dans la pratique
|
|
||||||
elif type(item) == int :
|
|
||||||
return Nuc_Seq_Stored(self, item)
|
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
|
||||||
|
|
||||||
|
|
||||||
def __setitem__(self, index_t line_idx, Nuc_Seq sequence_obj) :
|
def __setitem__(self, index_t line_idx, Nuc_Seq sequence_obj) :
|
||||||
@ -70,6 +71,8 @@ cdef class View_NUC_SEQS(View):
|
|||||||
self[line_idx][key] = sequence_obj[key]
|
self[line_idx][key] = sequence_obj[key]
|
||||||
|
|
||||||
|
|
||||||
|
# TODO make properties for id, seq, def columns etc
|
||||||
|
|
||||||
|
|
||||||
def register_class() :
|
def register_class() :
|
||||||
register_view_class(VIEW_TYPE_NUC_SEQS, View_NUC_SEQS)
|
register_view_class(VIEW_TYPE_NUC_SEQS, View_NUC_SEQS)
|
||||||
|
Reference in New Issue
Block a user