From 38e603ed57645610f8f012aac37f629d35f3e0e2 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Fri, 10 Jun 2016 10:34:47 +0200 Subject: [PATCH] Deleted some redundant cython code --- python/obitools3/obidms/_obidms.pyx | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/python/obitools3/obidms/_obidms.pyx b/python/obitools3/obidms/_obidms.pyx index 4b3dfcd..f0bf455 100644 --- a/python/obitools3/obidms/_obidms.pyx +++ b/python/obitools3/obidms/_obidms.pyx @@ -314,7 +314,7 @@ cdef class OBIView : cpdef delete_column(self, str column_name) : cdef int i - cdef Obiview_p view + cdef Obiview_p view_p cdef OBIDMS_column column cdef OBIDMS_column_p column_p cdef OBIDMS_column_header_p header @@ -322,7 +322,7 @@ cdef class OBIView : view = self.pointer - if obi_view_delete_column(view, str2bytes(column_name)) < 0 : + if obi_view_delete_column(view_p, str2bytes(column_name)) < 0 : raise Exception("Problem deleting a column from a view") # Update the dictionaries of column pointers and column objects, and update pointers in column objects (make function?): @@ -330,7 +330,7 @@ cdef class OBIView : for column_n in self.columns : (self.columns[column_n]).update_pointer() - + cpdef add_column(self, str column_name, @@ -502,28 +502,6 @@ cdef class OBIView_NUC_SEQS(OBIView): self.sequences = self.columns[bytes2str(NUC_SEQUENCE_COLUMN)] self.definitions = self.columns[bytes2str(DEFINITION_COLUMN)] self.qualities = self.columns[bytes2str(QUALITY_COLUMN)] - - - cpdef delete_column(self, str column_name) : - - cdef int i - cdef Obiview_p view_p - cdef OBIDMS_column column - cdef OBIDMS_column_p column_p - cdef OBIDMS_column_header_p header - cdef str column_n - - view_p = self.pointer - - if obi_view_delete_column(view_p, str2bytes(column_name)) < 0 : - raise Exception("Problem deleting a column from a view") - - # Remove instance from the dictionary - (self.columns).pop(column_name) - - for column_n in self.columns : - (self.columns[column_n]).update_pointer() - def __getitem__(self, object item) : if type(item) == str : @@ -531,7 +509,6 @@ cdef class OBIView_NUC_SEQS(OBIView): elif type(item) == int : return OBI_Nuc_Seq_Stored(self, item) - def __setitem__(self, index_t line_idx, OBI_Nuc_Seq sequence_obj) : for key in sequence_obj : self[line_idx][key] = sequence_obj[key]