added the idea of each line of a column corresponding to a vector, with

the added informations of the number of elements per line and the
elements' names in the column's header structure
This commit is contained in:
celinemercier
2015-07-20 16:08:50 +02:00
parent 484fcca557
commit 5c674715ee
6 changed files with 66 additions and 55 deletions

View File

@ -7,7 +7,7 @@ cdef extern from "obidmscolumn.h" nogil:
ctypedef OBIDMS_column_t* OBIDMS_column_p
OBIDMS_column_p obi_create_column(OBIDMS_p dms, char* column_name, OBIType_t type, size_t nb_elements)
OBIDMS_column_p obi_create_column(OBIDMS_p dms, const char* column_name, OBIType_t type, size_t nb_elements, size_t nb_elements_per_line, const char* elements_names)
cdef class OBIDMS_column:

View File

@ -5,6 +5,9 @@ from .capidmscolumn cimport *
cdef class OBIDMS_column:
def __init__(self, dms_name, column_name, type, nb_elements):
def __init__(self, dms_name, column_name, type, nb_elements, nb_elements_per_line=1, elements_names=None):
if elements_names == None :
elements_names = "[\""+column_name.decode('utf-8')+"\"]"
elements_names = bytes(elements_names, 'utf-8')
self.dms = obi_dms(dms_name)
self.pointer = obi_create_column(self.dms, column_name, type, nb_elements)
self.pointer = obi_create_column(self.dms, column_name, type, nb_elements, nb_elements_per_line, elements_names)