Commit b45c2ee6 authored by Celine Mercier's avatar Celine Mercier

Cython API: cleaner column rewriting API

parent 6afd1294
......@@ -237,7 +237,8 @@ def run(config):
dcols[tag] = (view.rewrite_column_with_diff_attributes(old_column.name,
new_data_type=new_type,
new_nb_elements_per_line=new_nb_elements_per_line,
new_elements_names=new_elements_names),
new_elements_names=new_elements_names,
rewrite_last_line=False),
value_obitype)
# Update the dictionary:
......
......@@ -32,7 +32,8 @@ cdef class View(OBIWrapper):
object column_name,
obitype_t new_data_type=*,
index_t new_nb_elements_per_line=*,
list new_elements_names=*)
list new_elements_names=*,
bint rewrite_last_line=*)
cpdef Line_selection new_selection(self,
list lines=*)
......
......@@ -267,13 +267,17 @@ cdef class View(OBIWrapper) :
object column_name,
obitype_t new_data_type=<obitype_t>OBI_VOID,
index_t new_nb_elements_per_line=0,
list new_elements_names=None) :
list new_elements_names=None,
bint rewrite_last_line=False) :
cdef Column old_column
cdef Column new_column
cdef index_t length = len(self) - 1
cdef index_t length = len(self) # TODO because last line triggered error that triggered rewriting, but needs a cleaner way, or at least good documentation
cdef column_name_b = tobytes(column_name)
if rewrite_last_line is False:
length-=1
if not self.active() :
raise OBIDeactivatedInstanceError()
......
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