Commit 0e3d6ed2 authored by Celine Mercier's avatar Celine Mercier

Methods __len__ (number of lines used) and __sizeof__ (total size in

bytes) implemented for columns.
parent 01bfc145
......@@ -274,7 +274,15 @@ cdef class OBIDMS_column :
self.pointer = obi_clone_column(self.dms.pointer, column_name_b, version_number, clone_data)
else :
self.pointer = obi_open_column(self.dms.pointer, column_name_b, version_number)
def __len__(self):
return self.pointer.header.lines_used
def __sizeof__(self):
return (self.pointer.header.header_size + self.pointer.header.data_size)
def __iter__(self):
......@@ -16,7 +16,8 @@ cdef extern from "obidmscolumn.h" nogil:
struct OBIDMS_column_header_t:
bint little_endian
int header_size
size_t header_size
size_t data_size
index_t line_count
index_t lines_used
index_t nb_elements_per_line
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment