Commit 3f81dc01 authored by Celine Mercier's avatar Celine Mercier

Changed the variable name 'nb_elements' to 'nb_lines' for better clarity

parent 8ff34889
......@@ -25,7 +25,7 @@ cdef extern from "obidmscolumn.h" nogil:
ctypedef OBIDMS_column_t* OBIDMS_column_p
ctypedef int32_t obiversion_t
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)
OBIDMS_column_p obi_create_column(OBIDMS_p dms, const char* column_name, OBIType_t type, size_t nb_lines, size_t nb_elements_per_line, const char* elements_names)
size_t obi_column_get_line_count(OBIDMS_column_p column)
const char* obi_column_get_elements_names(OBIDMS_column_p column)
void obi_column_make_unwritable(OBIDMS_column_p column)
......
......@@ -14,7 +14,7 @@ cdef class OBIDMS_column:
def __init__(self, dms_name, column_name,
create, clone, clone_data,
version_number, type,
nb_elements, nb_elements_per_line,
nb_lines, nb_elements_per_line,
elements_names):
column_name_b = column_name.encode(encoding='UTF-8')
dms_name_b = dms_name.encode(encoding='UTF-8')
......@@ -28,7 +28,7 @@ cdef class OBIDMS_column:
elements_names_b = column_name_b
else :
elements_names_b = elements_names.encode(encoding='UTF-8')
self.pointer = obi_create_column(self.dms, column_name_b, type, nb_elements, nb_elements_per_line, elements_names_b)
self.pointer = obi_create_column(self.dms, column_name_b, type, nb_lines, nb_elements_per_line, elements_names_b)
else :
dms = obi_open_dms(dms_name_b)
self.dms = dms
......@@ -78,7 +78,7 @@ cdef class OBIDMS_column:
def open(dms_name, column_name,
create=False, clone=False, clone_data=True,
version_number=-1, type=None,
nb_elements=None, nb_elements_per_line=1,
nb_lines=None, nb_elements_per_line=1,
elements_names=None):
column_name_b = column_name.encode(encoding='UTF-8')
......@@ -95,35 +95,35 @@ cdef class OBIDMS_column:
column = OBIDMS_column_int(dms_name, column_name,
create, clone, clone_data,
version_number, type,
nb_elements, nb_elements_per_line,
nb_lines, nb_elements_per_line,
elements_names)
elif type == 2 :
column = OBIDMS_column_float(dms_name, column_name,
create, clone, clone_data,
version_number, type,
nb_elements, nb_elements_per_line,
nb_lines, nb_elements_per_line,
elements_names)
elif type == 3 :
column = OBIDMS_column_bool(dms_name, column_name,
create, clone, clone_data,
version_number, type,
nb_elements, nb_elements_per_line,
nb_lines, nb_elements_per_line,
elements_names)
elif type == 4 :
column = OBIDMS_column_char(dms_name, column_name,
create, clone, clone_data,
version_number, type,
nb_elements, nb_elements_per_line,
nb_lines, nb_elements_per_line,
elements_names)
elif type == 5 :
column = OBIDMS_column_idx(dms_name, column_name,
create, clone, clone_data,
version_number, type,
nb_elements, nb_elements_per_line,
nb_lines, nb_elements_per_line,
elements_names)
else :
......
......@@ -586,7 +586,7 @@ size_t obi_get_platform_header_size()
OBIDMS_column_p obi_create_column(OBIDMS_p dms,
const char *column_name,
OBIType_t type,
size_t nb_elements,
size_t nb_lines,
size_t nb_elements_per_line,
const char* elements_names)
{
......@@ -625,7 +625,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
// Calculate the size needed
header_size = obi_get_platform_header_size();
data_size = obi_array_sizeof(type, nb_elements, nb_elements_per_line);
data_size = obi_array_sizeof(type, nb_lines, nb_elements_per_line);
file_size = header_size + data_size;
// Get the latest version number
......@@ -717,7 +717,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
header = new_column->header;
header->little_endian = obi_is_little_endian();
header->header_size = header_size;
header->line_count = nb_elements;
header->line_count = nb_lines;
header->lines_used = 0;
header->nb_elements_per_line = nb_elements_per_line;
header->data_type = type;
......
......@@ -133,7 +133,7 @@ size_t obi_get_platform_header_size();
* @param dms a pointer on an OBIDMS
* @param column_name the name of the new column
* @param type the OBIType code used to create the column
* @param nb_elements the number of elements to be stored
* @param nb_lines the number of lines to be stored
*
* @since May 2015
* @author Eric Coissac (eric.coissac@metabarcoding.org)
......@@ -141,7 +141,7 @@ size_t obi_get_platform_header_size();
OBIDMS_column_p obi_create_column(OBIDMS_p dms,
const char* column_name,
OBIType_t type,
size_t nb_elements,
size_t nb_lines,
size_t nb_elements_per_line,
const char* elements_names);
......
......@@ -46,13 +46,13 @@ size_t obi_sizeof(OBIType_t type)
}
size_t obi_array_sizeof(OBIType_t type, size_t nb_elements, size_t nb_elements_per_line)
size_t obi_array_sizeof(OBIType_t type, size_t nb_lines, size_t nb_elements_per_line)
{
size_t size;
size_t rsize;
size_t psize;
size = obi_sizeof(type) * nb_elements * nb_elements_per_line;
size = obi_sizeof(type) * nb_lines * nb_elements_per_line;
psize = getpagesize();
rsize = size % psize;
......
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