diff --git a/python/obitools3/commands/test.pyx b/python/obitools3/commands/test.pyx index 6a9d05d..ff65539 100644 --- a/python/obitools3/commands/test.pyx +++ b/python/obitools3/commands/test.pyx @@ -94,7 +94,7 @@ def test_set_and_get(config, infos): col_name = random_column(infos) col = infos['view'][col_name] element_names = col.elements_names - data_type = col.get_data_type() + data_type = col.data_type if data_type == "OBI_QUAL" : print_test(config, "-") return @@ -172,7 +172,7 @@ def random_col_type(): def fill_column(config, infos, col) : - data_type = col.get_data_type() + data_type = col.data_type element_names = col.elements_names if len(element_names) > 1 : diff --git a/python/obitools3/obidms/_obidms.pxd b/python/obitools3/obidms/_obidms.pxd index 2fe4986..1e791a2 100644 --- a/python/obitools3/obidms/_obidms.pxd +++ b/python/obitools3/obidms/_obidms.pxd @@ -14,12 +14,11 @@ cdef class OBIDMS_column: cdef OBIDMS_column_p* pointer cdef OBIDMS dms cdef OBIView view - cdef str data_type + cdef str data_type # associated property: data_type cdef str dms_name cdef index_t nb_elements_per_line # associated property: nb_elements_per_line cdef list elements_names # associated property: elements_names - 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) diff --git a/python/obitools3/obidms/_obidms.pyx b/python/obitools3/obidms/_obidms.pyx index 47ba9c2..bd497d3 100644 --- a/python/obitools3/obidms/_obidms.pyx +++ b/python/obitools3/obidms/_obidms.pyx @@ -124,9 +124,6 @@ cdef class OBIDMS_column : lines_used = (self.pointer)[0].header.lines_used for line_nb in range(lines_used): yield self.get_line(line_nb) - - cpdef str get_data_type(self): - return self.data_type cpdef index_t get_nb_lines_used(self): return (self.pointer)[0].header.lines_used @@ -175,6 +172,11 @@ cdef class OBIDMS_column : def nb_elements_per_line(self): return self.nb_elements_per_line + # data_type property getter + @property + def data_type(self): + return self.data_type + @staticmethod cdef object get_subclass_type(OBIDMS_column_p column_p) :