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