Comments in column headers are now working.
This commit is contained in:
@ -24,7 +24,8 @@ cdef class OBIDMS:
|
||||
index_t nb_lines=*,
|
||||
index_t nb_elements_per_line=*,
|
||||
list elements_names=*,
|
||||
str array_name=*)
|
||||
str array_name=*,
|
||||
str comments=*)
|
||||
|
||||
|
||||
cdef class OBIDMS_column:
|
||||
@ -34,7 +35,7 @@ cdef class OBIDMS_column:
|
||||
cdef str data_type # TODO keep as OBIType_t? both?
|
||||
cdef str dms_name
|
||||
cdef str column_name
|
||||
cdef index_t nb_elements_per_line
|
||||
cdef index_t nb_elements_per_line
|
||||
cdef list elements_names
|
||||
|
||||
# cpdef object get_item(self, index_t line_nb, str element_name) TODO can't declare because not the same in all subclasses
|
||||
@ -43,5 +44,6 @@ cdef class OBIDMS_column:
|
||||
cpdef str get_data_type(self)
|
||||
cpdef index_t get_nb_lines_used(self)
|
||||
cpdef str get_creation_date(self)
|
||||
cpdef str get_comments(self)
|
||||
cpdef close(self)
|
||||
|
||||
|
@ -120,7 +120,8 @@ cdef class OBIDMS :
|
||||
index_t nb_lines=0,
|
||||
index_t nb_elements_per_line=0,
|
||||
list elements_names=None,
|
||||
str array_name="default_obiarray"):
|
||||
str array_name="default_obiarray",
|
||||
str comments=""):
|
||||
|
||||
# Declarations
|
||||
cdef OBIDMS_column column
|
||||
@ -221,7 +222,8 @@ cdef class OBIDMS :
|
||||
create, clone, clone_data,
|
||||
version_number, data_type,
|
||||
nb_lines, nb_elements_per_line,
|
||||
elements_names, array_name)
|
||||
elements_names, array_name,
|
||||
comments)
|
||||
|
||||
return column
|
||||
|
||||
@ -240,13 +242,15 @@ cdef class OBIDMS_column :
|
||||
index_t nb_lines,
|
||||
index_t nb_elements_per_line,
|
||||
list elements_names,
|
||||
str array_name):
|
||||
str array_name,
|
||||
str comments):
|
||||
|
||||
# Declarations
|
||||
cdef bytes column_name_b
|
||||
cdef bytes dms_name_b
|
||||
cdef bytes array_name_b
|
||||
cdef bytes elements_names_b
|
||||
cdef bytes comments_b
|
||||
|
||||
# Fill structure
|
||||
self.dms = dms
|
||||
@ -259,6 +263,7 @@ cdef class OBIDMS_column :
|
||||
column_name_b = str2bytes(column_name)
|
||||
dms_name_b = str2bytes(self.dms.dms_name)
|
||||
array_name_b = str2bytes(array_name)
|
||||
comments_b = str2bytes(comments)
|
||||
|
||||
# Create, clone or open column
|
||||
if create :
|
||||
@ -268,7 +273,7 @@ cdef class OBIDMS_column :
|
||||
elements_names_b = str2bytes(";".join(elements_names))
|
||||
self.pointer = obi_create_column(self.dms.pointer, column_name_b, type,
|
||||
nb_lines, nb_elements_per_line,
|
||||
elements_names_b, array_name_b)
|
||||
elements_names_b, array_name_b, comments_b)
|
||||
else :
|
||||
if clone :
|
||||
self.pointer = obi_clone_column(self.dms.pointer, column_name_b, version_number, clone_data)
|
||||
@ -327,6 +332,8 @@ cdef class OBIDMS_column :
|
||||
cpdef str get_creation_date(self):
|
||||
return bytes2str(obi_column_format_date(self.pointer.header.creation_date))
|
||||
|
||||
cpdef str get_comments(self):
|
||||
return bytes2str(self.pointer.header.comments)
|
||||
|
||||
cpdef close(self):
|
||||
raise NotImplementedError
|
||||
|
@ -43,7 +43,8 @@ cdef extern from "obidmscolumn.h" nogil:
|
||||
index_t nb_lines,
|
||||
index_t nb_elements_per_line,
|
||||
const_char_p elements_names,
|
||||
const_char_p array_name)
|
||||
const_char_p array_name,
|
||||
const_char_p comments)
|
||||
|
||||
OBIDMS_column_p obi_open_column(OBIDMS_p dms,
|
||||
const_char_p column_name,
|
||||
|
Reference in New Issue
Block a user