From 4fcf2e28f2c5f65349ca5e619388683340d16c70 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Wed, 18 May 2022 11:52:31 +0200 Subject: [PATCH 1/7] raising error if duplicated columns when writing. Renaming duplicated columns when reading. Solves #188 --- change_log.md | 6 +- docs/conf.py | 2 +- pyreadstat/__init__.py | 2 +- pyreadstat/_readstat_parser.c | 2181 +++++++++++++++++-------------- pyreadstat/_readstat_parser.pyx | 15 + pyreadstat/_readstat_writer.c | 1245 +++++++++--------- pyreadstat/_readstat_writer.pyx | 3 + setup.py | 2 +- 8 files changed, 1883 insertions(+), 1573 deletions(-) diff --git a/change_log.md b/change_log.md index ff3e9ea..899ea0b 100644 --- a/change_log.md +++ b/change_log.md @@ -1,4 +1,8 @@ -# 1.1.6 (github, pypi and conda xxxx.xx.xx) +# 1.1.7 (github, pypi and conda 2022.xx.xx) +* Updated Readstat code to Release 1.1.8 + + +# 1.1.6 (github, pypi and conda 2022.05.09) * Solved #183 * new parameter output_type to switch between returning a pandas dataframe or a dict of numpy arrays, partial solution for #184 diff --git a/docs/conf.py b/docs/conf.py index 44dc8a4..e9444fd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = '' # The full version, including alpha/beta/rc tags -release = '1.1.6' +release = '1.1.7' # -- General configuration --------------------------------------------------- diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index c6b1f1b..4041247 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -20,4 +20,4 @@ from .pyreadstat import read_file_in_chunks, read_file_multiprocessing from ._readstat_parser import ReadstatError, metadata_container -__version__ = "1.1.6" +__version__ = "1.1.7" diff --git a/pyreadstat/_readstat_parser.c b/pyreadstat/_readstat_parser.c index ca3b256..8174f55 100644 --- a/pyreadstat/_readstat_parser.c +++ b/pyreadstat/_readstat_parser.c @@ -1908,6 +1908,7 @@ static const char __pyx_k_DATETIME20[] = "DATETIME20"; static const char __pyx_k_DATETIME21[] = "DATETIME21"; static const char __pyx_k_DATETIME22[] = "DATETIME22"; static const char __pyx_k_YMDHMS19_2[] = "YMDHMS19.2"; +static const char __pyx_k_duplicated[] = "_duplicated"; static const char __pyx_k_expanduser[] = "expanduser"; static const char __pyx_k_file_label[] = "file_label"; static const char __pyx_k_sas_origin[] = "sas_origin"; @@ -1973,6 +1974,7 @@ static const char __pyx_k_pyreadstat__readstat_parser_pyx[] = "pyreadstat/_reads static const char __pyx_k_Failed_convert_C_to_python_value[] = "Failed convert C to python value"; static const char __pyx_k_Failed_to_read_number_of_variabl[] = "Failed to read number of variables"; static const char __pyx_k_STRING_type_with_value_s_with_da[] = "STRING type with value '%s' with date type in column '%s'"; +static const char __pyx_k_column_0_is_duplicated_renamed_t[] = "column '{0}' is duplicated, renamed to '{1}'"; static const char __pyx_k_file_path_could_not_be_encoded_w[] = "file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly."; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_output_format_must_be_one_of_all[] = "output format must be one of {allowed_formats}, '{output_format}' was given"; @@ -2083,6 +2085,7 @@ static PyObject *__pyx_n_s_center; static PyObject *__pyx_n_s_chr; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_kp_s_column_0_is_duplicated_renamed_t; static PyObject *__pyx_n_s_column_labels; static PyObject *__pyx_n_s_column_names; static PyObject *__pyx_n_s_column_names_to_labels; @@ -2094,6 +2097,7 @@ static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_double; static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_duplicated; static PyObject *__pyx_n_s_empty; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_expanduser; @@ -5302,7 +5306,10 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i int __pyx_v_obs_count; int __pyx_v_iscurnptypefloat; int __pyx_v_iscurnptypeobject; + PyObject *__pyx_v_newcolname = 0; + int __pyx_v_dupcolcnt; struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_dc = 0; + PyObject *__pyx_v_msg = NULL; long __pyx_v_i; size_t __pyx_v_storage_width; readstat_alignment_t __pyx_v_align; @@ -5316,11 +5323,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; - int __pyx_t_6; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_t_7; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; + __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_t_10; int __pyx_t_11; long __pyx_t_12; int __pyx_lineno = 0; @@ -5328,8 +5335,8 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_variable", 0); - /* "pyreadstat/_readstat_parser.pyx":426 - * cdef bint iscurnptypeobject + /* "pyreadstat/_readstat_parser.pyx":428 + * cdef int dupcolcnt * * cdef data_container dc = ctx # <<<<<<<<<<<<<< * @@ -5340,7 +5347,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":429 + /* "pyreadstat/_readstat_parser.pyx":431 * * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) # <<<<<<<<<<<<<< @@ -5349,7 +5356,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_name = readstat_variable_get_name(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":430 + /* "pyreadstat/_readstat_parser.pyx":432 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -5359,7 +5366,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = ((__pyx_v_var_name == NULL) != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":431 + /* "pyreadstat/_readstat_parser.pyx":433 * var_name = readstat_variable_get_name(variable) * if var_name == NULL: * col_name = None # <<<<<<<<<<<<<< @@ -5369,7 +5376,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_name = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":430 + /* "pyreadstat/_readstat_parser.pyx":432 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -5379,7 +5386,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":433 + /* "pyreadstat/_readstat_parser.pyx":435 * col_name = None * else: * col_name = var_name # <<<<<<<<<<<<<< @@ -5387,7 +5394,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * # if the user introduced a list of columns to include, continue only if the column is in the list */ /*else*/ { - __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); @@ -5397,7 +5404,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":436 + /* "pyreadstat/_readstat_parser.pyx":438 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -5410,13 +5417,13 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":437 + /* "pyreadstat/_readstat_parser.pyx":439 * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 # <<<<<<<<<<<<<< @@ -5425,7 +5432,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dc->n_vars = (__pyx_v_dc->n_vars - 1); - /* "pyreadstat/_readstat_parser.pyx":438 + /* "pyreadstat/_readstat_parser.pyx":440 * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 * return READSTAT_HANDLER_SKIP_VARIABLE # <<<<<<<<<<<<<< @@ -5435,7 +5442,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_r = READSTAT_HANDLER_SKIP_VARIABLE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":436 + /* "pyreadstat/_readstat_parser.pyx":438 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -5444,29 +5451,237 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":440 + /* "pyreadstat/_readstat_parser.pyx":442 * return READSTAT_HANDLER_SKIP_VARIABLE * * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< * - * dc.col_names.append(col_name) + * if col_name in dc.col_names: */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":442 + /* "pyreadstat/_readstat_parser.pyx":444 + * index = readstat_variable_get_index_after_skipping(variable) + * + * if col_name in dc.col_names: # <<<<<<<<<<<<<< + * dupcolcnt = 1 + * while True: + */ + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->col_names, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_2 != 0); + if (__pyx_t_5) { + + /* "pyreadstat/_readstat_parser.pyx":445 + * + * if col_name in dc.col_names: + * dupcolcnt = 1 # <<<<<<<<<<<<<< + * while True: + * newcolname = col_name + "_duplicated" + str(dupcolcnt) + */ + __pyx_v_dupcolcnt = 1; + + /* "pyreadstat/_readstat_parser.pyx":446 + * if col_name in dc.col_names: + * dupcolcnt = 1 + * while True: # <<<<<<<<<<<<<< + * newcolname = col_name + "_duplicated" + str(dupcolcnt) + * if newcolname in col_name: + */ + while (1) { + + /* "pyreadstat/_readstat_parser.pyx":447 + * dupcolcnt = 1 + * while True: + * newcolname = col_name + "_duplicated" + str(dupcolcnt) # <<<<<<<<<<<<<< + * if newcolname in col_name: + * dupcolcnt += 1 + */ + __pyx_t_3 = PyNumber_Add(__pyx_v_col_name, __pyx_n_s_duplicated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dupcolcnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 447, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_newcolname, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_parser.pyx":448 + * while True: + * newcolname = col_name + "_duplicated" + str(dupcolcnt) + * if newcolname in col_name: # <<<<<<<<<<<<<< + * dupcolcnt += 1 + * continue + */ + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_newcolname, __pyx_v_col_name, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_5 != 0); + if (__pyx_t_2) { + + /* "pyreadstat/_readstat_parser.pyx":449 + * newcolname = col_name + "_duplicated" + str(dupcolcnt) + * if newcolname in col_name: + * dupcolcnt += 1 # <<<<<<<<<<<<<< + * continue + * else: + */ + __pyx_v_dupcolcnt = (__pyx_v_dupcolcnt + 1); + + /* "pyreadstat/_readstat_parser.pyx":450 + * if newcolname in col_name: + * dupcolcnt += 1 + * continue # <<<<<<<<<<<<<< + * else: + * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) + */ + goto __pyx_L8_continue; + + /* "pyreadstat/_readstat_parser.pyx":448 + * while True: + * newcolname = col_name + "_duplicated" + str(dupcolcnt) + * if newcolname in col_name: # <<<<<<<<<<<<<< + * dupcolcnt += 1 + * continue + */ + } + + /* "pyreadstat/_readstat_parser.pyx":452 + * continue + * else: + * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) # <<<<<<<<<<<<<< + * warnings.warn(msg) + * col_name = newcolname + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_column_0_is_duplicated_renamed_t, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_col_name, __pyx_v_newcolname}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_col_name, __pyx_v_newcolname}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_col_name); + __Pyx_GIVEREF(__pyx_v_col_name); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_col_name); + __Pyx_INCREF(__pyx_v_newcolname); + __Pyx_GIVEREF(__pyx_v_newcolname); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_newcolname); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_msg = __pyx_t_1; + __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_parser.pyx":453 + * else: + * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) + * warnings.warn(msg) # <<<<<<<<<<<<<< + * col_name = newcolname + * break + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_warnings); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_warn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pyreadstat/_readstat_parser.pyx":454 + * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) + * warnings.warn(msg) + * col_name = newcolname # <<<<<<<<<<<<<< + * break + * + */ + __Pyx_INCREF(__pyx_v_newcolname); + __Pyx_DECREF_SET(__pyx_v_col_name, __pyx_v_newcolname); + + /* "pyreadstat/_readstat_parser.pyx":455 + * warnings.warn(msg) + * col_name = newcolname + * break # <<<<<<<<<<<<<< + * + * dc.col_names.append(col_name) + */ + goto __pyx_L9_break; + } + __pyx_L8_continue:; + } + __pyx_L9_break:; + + /* "pyreadstat/_readstat_parser.pyx":444 * index = readstat_variable_get_index_after_skipping(variable) * + * if col_name in dc.col_names: # <<<<<<<<<<<<<< + * dupcolcnt = 1 + * while True: + */ + } + + /* "pyreadstat/_readstat_parser.pyx":457 + * break + * * dc.col_names.append(col_name) # <<<<<<<<<<<<<< * * # the name of the value label for the variable */ if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 442, __pyx_L1_error) + __PYX_ERR(0, 457, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 457, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":445 + /* "pyreadstat/_readstat_parser.pyx":460 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -5476,41 +5691,41 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = ((__pyx_v_val_labels != NULL) != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":446 + /* "pyreadstat/_readstat_parser.pyx":461 * # the name of the value label for the variable * if val_labels != NULL: * label_name = val_labels # <<<<<<<<<<<<<< * if label_name: * dc.label_to_var_name[col_name] = label_name */ - __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_label_name = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_label_name = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":447 + /* "pyreadstat/_readstat_parser.pyx":462 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< * dc.label_to_var_name[col_name] = label_name * */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_label_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_label_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 462, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":448 + /* "pyreadstat/_readstat_parser.pyx":463 * label_name = val_labels * if label_name: * dc.label_to_var_name[col_name] = label_name # <<<<<<<<<<<<<< * * var_label = readstat_variable_get_label(variable) */ - if (unlikely(PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0)) __PYX_ERR(0, 448, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0)) __PYX_ERR(0, 463, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":447 + /* "pyreadstat/_readstat_parser.pyx":462 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< @@ -5519,7 +5734,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":445 + /* "pyreadstat/_readstat_parser.pyx":460 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -5528,7 +5743,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":450 + /* "pyreadstat/_readstat_parser.pyx":465 * dc.label_to_var_name[col_name] = label_name * * var_label = readstat_variable_get_label(variable) # <<<<<<<<<<<<<< @@ -5537,7 +5752,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_label = readstat_variable_get_label(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":451 + /* "pyreadstat/_readstat_parser.pyx":466 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< @@ -5547,7 +5762,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = ((__pyx_v_var_label == NULL) != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":452 + /* "pyreadstat/_readstat_parser.pyx":467 * var_label = readstat_variable_get_label(variable) * if var_label == NULL: * col_label = None # <<<<<<<<<<<<<< @@ -5557,17 +5772,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_label = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":451 + /* "pyreadstat/_readstat_parser.pyx":466 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< * col_label = None * else: */ - goto __pyx_L9; + goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":454 + /* "pyreadstat/_readstat_parser.pyx":469 * col_label = None * else: * col_label = var_label # <<<<<<<<<<<<<< @@ -5575,17 +5790,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ /*else*/ { - __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_t_1; - __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_col_label = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyStr_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_col_label = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; } - __pyx_L9:; + __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":455 + /* "pyreadstat/_readstat_parser.pyx":470 * else: * col_label = var_label * dc.col_labels.append(col_label) # <<<<<<<<<<<<<< @@ -5594,11 +5809,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 455, __pyx_L1_error) + __PYX_ERR(0, 470, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 470, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":458 + /* "pyreadstat/_readstat_parser.pyx":473 * * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) # <<<<<<<<<<<<<< @@ -5607,7 +5822,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_format = readstat_variable_get_format(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":459 + /* "pyreadstat/_readstat_parser.pyx":474 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< @@ -5617,7 +5832,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = ((__pyx_v_var_format == NULL) != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":460 + /* "pyreadstat/_readstat_parser.pyx":475 * var_format = readstat_variable_get_format(variable) * if var_format == NULL: * col_format_original = "NULL" # <<<<<<<<<<<<<< @@ -5627,17 +5842,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_NULL); __pyx_v_col_format_original = __pyx_n_s_NULL; - /* "pyreadstat/_readstat_parser.pyx":459 + /* "pyreadstat/_readstat_parser.pyx":474 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< * col_format_original = "NULL" * else: */ - goto __pyx_L10; + goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":462 + /* "pyreadstat/_readstat_parser.pyx":477 * col_format_original = "NULL" * else: * col_format_original = var_format # <<<<<<<<<<<<<< @@ -5645,27 +5860,27 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * dc.col_formats_original.append(col_format_original) */ /*else*/ { - __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_col_format_original = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_t_1; + __Pyx_INCREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_col_format_original = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; } - __pyx_L10:; + __pyx_L14:; - /* "pyreadstat/_readstat_parser.pyx":463 + /* "pyreadstat/_readstat_parser.pyx":478 * else: * col_format_original = var_format * file_format = dc.file_format # <<<<<<<<<<<<<< * dc.col_formats_original.append(col_format_original) * col_format_final = transform_variable_format(col_format_original, file_format) */ - __pyx_t_7 = __pyx_v_dc->file_format; - __pyx_v_file_format = __pyx_t_7; + __pyx_t_10 = __pyx_v_dc->file_format; + __pyx_v_file_format = __pyx_t_10; - /* "pyreadstat/_readstat_parser.pyx":464 + /* "pyreadstat/_readstat_parser.pyx":479 * col_format_original = var_format * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) # <<<<<<<<<<<<<< @@ -5674,11 +5889,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_formats_original == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 464, __pyx_L1_error) + __PYX_ERR(0, 479, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 479, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":465 + /* "pyreadstat/_readstat_parser.pyx":480 * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) * col_format_final = transform_variable_format(col_format_original, file_format) # <<<<<<<<<<<<<< @@ -5687,7 +5902,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_col_format_final = __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(__pyx_v_col_format_original, __pyx_v_file_format); - /* "pyreadstat/_readstat_parser.pyx":466 + /* "pyreadstat/_readstat_parser.pyx":481 * dc.col_formats_original.append(col_format_original) * col_format_final = transform_variable_format(col_format_original, file_format) * dc.col_formats.append(col_format_final) # <<<<<<<<<<<<<< @@ -5696,14 +5911,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 466, __pyx_L1_error) + __PYX_ERR(0, 481, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":468 + /* "pyreadstat/_readstat_parser.pyx":483 * dc.col_formats.append(col_format_final) * # readstat type * var_type = readstat_variable_get_type(variable) # <<<<<<<<<<<<<< @@ -5712,7 +5927,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_type = readstat_variable_get_type(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":469 + /* "pyreadstat/_readstat_parser.pyx":484 * # readstat type * var_type = readstat_variable_get_type(variable) * dc.col_dtypes.append(var_type) # <<<<<<<<<<<<<< @@ -5721,14 +5936,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_dtypes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 469, __pyx_L1_error) + __PYX_ERR(0, 484, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyInt_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyInt_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 484, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":472 + /* "pyreadstat/_readstat_parser.pyx":487 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< @@ -5739,14 +5954,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; - goto __pyx_L12_bool_binop_done; + goto __pyx_L16_bool_binop_done; } __pyx_t_5 = ((__pyx_v_dc->no_datetime_conversion == 0) != 0); __pyx_t_2 = __pyx_t_5; - __pyx_L12_bool_binop_done:; + __pyx_L16_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":473 + /* "pyreadstat/_readstat_parser.pyx":488 * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: * curnptype = object # <<<<<<<<<<<<<< @@ -5756,17 +5971,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_builtin_object); __pyx_v_curnptype = __pyx_builtin_object; - /* "pyreadstat/_readstat_parser.pyx":472 + /* "pyreadstat/_readstat_parser.pyx":487 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< * curnptype = object * else: */ - goto __pyx_L11; + goto __pyx_L15; } - /* "pyreadstat/_readstat_parser.pyx":475 + /* "pyreadstat/_readstat_parser.pyx":490 * curnptype = object * else: * curnptype = readstat_to_numpy_types[var_type] # <<<<<<<<<<<<<< @@ -5776,19 +5991,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i /*else*/ { if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 475, __pyx_L1_error) + __PYX_ERR(0, 490, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyInt_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_curnptype = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_curnptype = __pyx_t_1; + __pyx_t_1 = 0; } - __pyx_L11:; + __pyx_L15:; - /* "pyreadstat/_readstat_parser.pyx":476 + /* "pyreadstat/_readstat_parser.pyx":491 * else: * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 # <<<<<<<<<<<<<< @@ -5797,7 +6012,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 0; - /* "pyreadstat/_readstat_parser.pyx":477 + /* "pyreadstat/_readstat_parser.pyx":492 * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 * iscurnptypeobject = 0 # <<<<<<<<<<<<<< @@ -5806,7 +6021,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 0; - /* "pyreadstat/_readstat_parser.pyx":479 + /* "pyreadstat/_readstat_parser.pyx":494 * iscurnptypeobject = 0 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype # <<<<<<<<<<<<<< @@ -5815,23 +6030,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 479, __pyx_L1_error) + __PYX_ERR(0, 494, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 479, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 494, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":480 + /* "pyreadstat/_readstat_parser.pyx":495 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< * iscurnptypeobject = 1 * if curnptype == np.float64: */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":481 + /* "pyreadstat/_readstat_parser.pyx":496 * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -5840,7 +6055,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":480 + /* "pyreadstat/_readstat_parser.pyx":495 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< @@ -5849,25 +6064,25 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":482 + /* "pyreadstat/_readstat_parser.pyx":497 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":483 + /* "pyreadstat/_readstat_parser.pyx":498 * iscurnptypeobject = 1 * if curnptype == np.float64: * iscurnptypefloat = 1 # <<<<<<<<<<<<<< @@ -5876,7 +6091,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 1; - /* "pyreadstat/_readstat_parser.pyx":482 + /* "pyreadstat/_readstat_parser.pyx":497 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< @@ -5885,39 +6100,39 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":484 + /* "pyreadstat/_readstat_parser.pyx":499 * if curnptype == np.float64: * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject # <<<<<<<<<<<<<< * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly */ - __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 484, __pyx_L1_error) + __PYX_ERR(0, 499, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 484, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":485 + /* "pyreadstat/_readstat_parser.pyx":500 * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat # <<<<<<<<<<<<<< * metaonly = dc.metaonly * # pre-allocate data */ - __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 485, __pyx_L1_error) + __PYX_ERR(0, 500, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":486 + /* "pyreadstat/_readstat_parser.pyx":501 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly # <<<<<<<<<<<<<< @@ -5927,7 +6142,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_v_dc->metaonly; __pyx_v_metaonly = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":488 + /* "pyreadstat/_readstat_parser.pyx":503 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< @@ -5937,39 +6152,39 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_metaonly != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":489 + /* "pyreadstat/_readstat_parser.pyx":504 * # pre-allocate data * if metaonly: * row = np.empty(1, dtype=curnptype) # <<<<<<<<<<<<<< * else: * obs_count = dc.n_obs */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_curnptype) < 0) __PYX_ERR(0, 489, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_row = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_curnptype) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_row = __pyx_t_6; + __pyx_t_6 = 0; - /* "pyreadstat/_readstat_parser.pyx":488 + /* "pyreadstat/_readstat_parser.pyx":503 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< * row = np.empty(1, dtype=curnptype) * else: */ - goto __pyx_L16; + goto __pyx_L20; } - /* "pyreadstat/_readstat_parser.pyx":491 + /* "pyreadstat/_readstat_parser.pyx":506 * row = np.empty(1, dtype=curnptype) * else: * obs_count = dc.n_obs # <<<<<<<<<<<<<< @@ -5977,40 +6192,40 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * if iscurnptypeobject or iscurnptypefloat: */ /*else*/ { - __pyx_t_9 = __pyx_v_dc->n_obs; - __pyx_v_obs_count = __pyx_t_9; + __pyx_t_7 = __pyx_v_dc->n_obs; + __pyx_v_obs_count = __pyx_t_7; - /* "pyreadstat/_readstat_parser.pyx":492 + /* "pyreadstat/_readstat_parser.pyx":507 * else: * obs_count = dc.n_obs * row = np.empty(obs_count, dtype=curnptype) # <<<<<<<<<<<<<< * if iscurnptypeobject or iscurnptypefloat: * row.fill(np.nan) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_v_curnptype) < 0) __PYX_ERR(0, 492, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_v_curnptype) < 0) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_row = __pyx_t_10; - __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_row = __pyx_t_3; + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":493 + /* "pyreadstat/_readstat_parser.pyx":508 * obs_count = dc.n_obs * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -6021,46 +6236,46 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; - goto __pyx_L18_bool_binop_done; + goto __pyx_L22_bool_binop_done; } __pyx_t_5 = (__pyx_v_iscurnptypefloat != 0); __pyx_t_2 = __pyx_t_5; - __pyx_L18_bool_binop_done:; + __pyx_L22_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":494 + /* "pyreadstat/_readstat_parser.pyx":509 * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * row.fill(np.nan) # <<<<<<<<<<<<<< * dc.col_data.append(row) * */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_row, __pyx_n_s_fill); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_row, __pyx_n_s_fill); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_10 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "pyreadstat/_readstat_parser.pyx":493 + /* "pyreadstat/_readstat_parser.pyx":508 * obs_count = dc.n_obs * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -6069,9 +6284,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } } - __pyx_L16:; + __pyx_L20:; - /* "pyreadstat/_readstat_parser.pyx":495 + /* "pyreadstat/_readstat_parser.pyx":510 * if iscurnptypeobject or iscurnptypefloat: * row.fill(np.nan) * dc.col_data.append(row) # <<<<<<<<<<<<<< @@ -6080,11 +6295,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 495, __pyx_L1_error) + __PYX_ERR(0, 510, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 510, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":498 + /* "pyreadstat/_readstat_parser.pyx":513 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -6094,7 +6309,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_dc->usernan != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":499 + /* "pyreadstat/_readstat_parser.pyx":514 * # missing values * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) # <<<<<<<<<<<<<< @@ -6103,7 +6318,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_n_ranges = readstat_variable_get_missing_ranges_count(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":500 + /* "pyreadstat/_readstat_parser.pyx":515 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -6113,31 +6328,31 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = ((__pyx_v_n_ranges > 0) != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":501 + /* "pyreadstat/_readstat_parser.pyx":516 * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: * missing_ranges = list() # <<<<<<<<<<<<<< * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_v_missing_ranges = ((PyObject*)__pyx_t_10); - __pyx_t_10 = 0; + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_missing_ranges = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":502 + /* "pyreadstat/_readstat_parser.pyx":517 * if n_ranges>0: * missing_ranges = list() * for i in range(0, n_ranges): # <<<<<<<<<<<<<< * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) */ - __pyx_t_9 = __pyx_v_n_ranges; - __pyx_t_11 = __pyx_t_9; + __pyx_t_7 = __pyx_v_n_ranges; + __pyx_t_11 = __pyx_t_7; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "pyreadstat/_readstat_parser.pyx":503 + /* "pyreadstat/_readstat_parser.pyx":518 * missing_ranges = list() * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) # <<<<<<<<<<<<<< @@ -6146,19 +6361,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_loval = readstat_variable_get_missing_range_lo(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":504 + /* "pyreadstat/_readstat_parser.pyx":519 * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) # <<<<<<<<<<<<<< * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) */ - __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_v_pyloval, __pyx_t_10); - __pyx_t_10 = 0; + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_pyloval, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":505 + /* "pyreadstat/_readstat_parser.pyx":520 * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) # <<<<<<<<<<<<<< @@ -6167,34 +6382,34 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_hival = readstat_variable_get_missing_range_hi(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":506 + /* "pyreadstat/_readstat_parser.pyx":521 * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) # <<<<<<<<<<<<<< * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges */ - __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_v_pyhival, __pyx_t_10); - __pyx_t_10 = 0; + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_pyhival, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":507 + /* "pyreadstat/_readstat_parser.pyx":522 * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) # <<<<<<<<<<<<<< * dc.missing_ranges[col_name] = missing_ranges * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_lo, __pyx_v_pyloval) < 0) __PYX_ERR(0, 507, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_hi, __pyx_v_pyhival) < 0) __PYX_ERR(0, 507, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_10); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 507, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_lo, __pyx_v_pyloval) < 0) __PYX_ERR(0, 522, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hi, __pyx_v_pyhival) < 0) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "pyreadstat/_readstat_parser.pyx":508 + /* "pyreadstat/_readstat_parser.pyx":523 * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges # <<<<<<<<<<<<<< @@ -6203,11 +6418,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->missing_ranges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 508, __pyx_L1_error) + __PYX_ERR(0, 523, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0)) __PYX_ERR(0, 508, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0)) __PYX_ERR(0, 523, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":500 + /* "pyreadstat/_readstat_parser.pyx":515 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -6216,7 +6431,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":498 + /* "pyreadstat/_readstat_parser.pyx":513 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -6225,7 +6440,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":511 + /* "pyreadstat/_readstat_parser.pyx":526 * * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) # <<<<<<<<<<<<<< @@ -6234,35 +6449,35 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_storage_width = readstat_variable_get_storage_width(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":512 + /* "pyreadstat/_readstat_parser.pyx":527 * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) * dc.variable_storage_width[col_name] = storage_width # <<<<<<<<<<<<<< * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) */ - __pyx_t_10 = __Pyx_PyInt_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyInt_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_v_dc->variable_storage_width == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 512, __pyx_L1_error) + __PYX_ERR(0, 527, __pyx_L1_error) } - if (unlikely(PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_10) < 0)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_3) < 0)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":514 + /* "pyreadstat/_readstat_parser.pyx":529 * dc.variable_storage_width[col_name] = storage_width * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) # <<<<<<<<<<<<<< * * cdef readstat_alignment_t align */ - __pyx_t_10 = __Pyx_PyInt_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (unlikely(PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_10) < 0)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_3 = __Pyx_PyInt_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_3) < 0)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":518 + /* "pyreadstat/_readstat_parser.pyx":533 * cdef readstat_alignment_t align * cdef str pyalign * align = readstat_variable_get_alignment(variable) # <<<<<<<<<<<<<< @@ -6271,7 +6486,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_align = readstat_variable_get_alignment(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":519 + /* "pyreadstat/_readstat_parser.pyx":534 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -6281,7 +6496,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_align) { case READSTAT_ALIGNMENT_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":520 + /* "pyreadstat/_readstat_parser.pyx":535 * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" # <<<<<<<<<<<<<< @@ -6291,7 +6506,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_unknown); __pyx_v_pyalign = __pyx_n_s_unknown; - /* "pyreadstat/_readstat_parser.pyx":519 + /* "pyreadstat/_readstat_parser.pyx":534 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -6301,7 +6516,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_LEFT: - /* "pyreadstat/_readstat_parser.pyx":522 + /* "pyreadstat/_readstat_parser.pyx":537 * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" # <<<<<<<<<<<<<< @@ -6311,7 +6526,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_left); __pyx_v_pyalign = __pyx_n_s_left; - /* "pyreadstat/_readstat_parser.pyx":521 + /* "pyreadstat/_readstat_parser.pyx":536 * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: # <<<<<<<<<<<<<< @@ -6321,7 +6536,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_CENTER: - /* "pyreadstat/_readstat_parser.pyx":524 + /* "pyreadstat/_readstat_parser.pyx":539 * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" # <<<<<<<<<<<<<< @@ -6331,7 +6546,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_center); __pyx_v_pyalign = __pyx_n_s_center; - /* "pyreadstat/_readstat_parser.pyx":523 + /* "pyreadstat/_readstat_parser.pyx":538 * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: # <<<<<<<<<<<<<< @@ -6341,7 +6556,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_RIGHT: - /* "pyreadstat/_readstat_parser.pyx":526 + /* "pyreadstat/_readstat_parser.pyx":541 * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: * pyalign = "right" # <<<<<<<<<<<<<< @@ -6351,7 +6566,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_right); __pyx_v_pyalign = __pyx_n_s_right; - /* "pyreadstat/_readstat_parser.pyx":525 + /* "pyreadstat/_readstat_parser.pyx":540 * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: # <<<<<<<<<<<<<< @@ -6361,7 +6576,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":528 + /* "pyreadstat/_readstat_parser.pyx":543 * pyalign = "right" * else: * pyalign = "undetermined" # <<<<<<<<<<<<<< @@ -6373,16 +6588,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":530 + /* "pyreadstat/_readstat_parser.pyx":545 * pyalign = "undetermined" * * dc.variable_alignment[col_name] = pyalign # <<<<<<<<<<<<<< * * cdef readstat_measure_t measure */ - if (unlikely(PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0)) __PYX_ERR(0, 530, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0)) __PYX_ERR(0, 545, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":534 + /* "pyreadstat/_readstat_parser.pyx":549 * cdef readstat_measure_t measure * cdef str pymeasure * measure = readstat_variable_get_measure(variable) # <<<<<<<<<<<<<< @@ -6391,7 +6606,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_measure = readstat_variable_get_measure(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":535 + /* "pyreadstat/_readstat_parser.pyx":550 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -6401,7 +6616,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_measure) { case READSTAT_MEASURE_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":536 + /* "pyreadstat/_readstat_parser.pyx":551 * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" # <<<<<<<<<<<<<< @@ -6411,7 +6626,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_unknown); __pyx_v_pymeasure = __pyx_n_s_unknown; - /* "pyreadstat/_readstat_parser.pyx":535 + /* "pyreadstat/_readstat_parser.pyx":550 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -6421,7 +6636,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_NOMINAL: - /* "pyreadstat/_readstat_parser.pyx":538 + /* "pyreadstat/_readstat_parser.pyx":553 * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" # <<<<<<<<<<<<<< @@ -6431,7 +6646,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_nominal); __pyx_v_pymeasure = __pyx_n_s_nominal; - /* "pyreadstat/_readstat_parser.pyx":537 + /* "pyreadstat/_readstat_parser.pyx":552 * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: # <<<<<<<<<<<<<< @@ -6441,7 +6656,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_ORDINAL: - /* "pyreadstat/_readstat_parser.pyx":540 + /* "pyreadstat/_readstat_parser.pyx":555 * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" # <<<<<<<<<<<<<< @@ -6451,7 +6666,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_ordinal); __pyx_v_pymeasure = __pyx_n_s_ordinal; - /* "pyreadstat/_readstat_parser.pyx":539 + /* "pyreadstat/_readstat_parser.pyx":554 * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: # <<<<<<<<<<<<<< @@ -6461,7 +6676,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_SCALE: - /* "pyreadstat/_readstat_parser.pyx":542 + /* "pyreadstat/_readstat_parser.pyx":557 * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: * pymeasure = "scale" # <<<<<<<<<<<<<< @@ -6471,7 +6686,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_n_s_scale); __pyx_v_pymeasure = __pyx_n_s_scale; - /* "pyreadstat/_readstat_parser.pyx":541 + /* "pyreadstat/_readstat_parser.pyx":556 * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: # <<<<<<<<<<<<<< @@ -6481,7 +6696,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":544 + /* "pyreadstat/_readstat_parser.pyx":559 * pymeasure = "scale" * else: * pymeasure = "undetermined" # <<<<<<<<<<<<<< @@ -6493,16 +6708,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":546 + /* "pyreadstat/_readstat_parser.pyx":561 * pymeasure = "undetermined" * * dc.variable_measure[col_name] = pymeasure # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely(PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0)) __PYX_ERR(0, 546, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0)) __PYX_ERR(0, 561, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":548 + /* "pyreadstat/_readstat_parser.pyx":563 * dc.variable_measure[col_name] = pymeasure * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -6524,8 +6739,8 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pyreadstat._readstat_parser.handle_variable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = READSTAT_HANDLER_ABORT; __pyx_L0:; @@ -6538,14 +6753,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_XDECREF(__pyx_v_missing_ranges); __Pyx_XDECREF(__pyx_v_curnptype); __Pyx_XDECREF(__pyx_v_row); + __Pyx_XDECREF(__pyx_v_newcolname); __Pyx_XDECREF((PyObject *)__pyx_v_dc); + __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_pyalign); __Pyx_XDECREF(__pyx_v_pymeasure); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":551 +/* "pyreadstat/_readstat_parser.pyx":566 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -6582,7 +6799,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value", 0); - /* "pyreadstat/_readstat_parser.pyx":573 + /* "pyreadstat/_readstat_parser.pyx":588 * * # extract variables we need from data container * dc = ctx # <<<<<<<<<<<<<< @@ -6594,7 +6811,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":574 + /* "pyreadstat/_readstat_parser.pyx":589 * # extract variables we need from data container * dc = ctx * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< @@ -6603,7 +6820,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":575 + /* "pyreadstat/_readstat_parser.pyx":590 * dc = ctx * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs # <<<<<<<<<<<<<< @@ -6613,7 +6830,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_2 = __pyx_v_dc->max_n_obs; __pyx_v_max_n_obs = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":576 + /* "pyreadstat/_readstat_parser.pyx":591 * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs * is_unkown_number_rows = dc.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -6623,7 +6840,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = __pyx_v_dc->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":582 + /* "pyreadstat/_readstat_parser.pyx":597 * # check that we still have enough room in our pre-allocated lists * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -6632,15 +6849,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 582, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":583 + /* "pyreadstat/_readstat_parser.pyx":598 * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] # <<<<<<<<<<<<<< @@ -6649,15 +6866,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 583, __pyx_L1_error) + __PYX_ERR(0, 598, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypefloat = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":584 + /* "pyreadstat/_readstat_parser.pyx":599 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -6667,7 +6884,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_is_unkown_number_rows != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":585 + /* "pyreadstat/_readstat_parser.pyx":600 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -6677,7 +6894,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = ((__pyx_v_max_n_obs <= __pyx_v_obs_index) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":586 + /* "pyreadstat/_readstat_parser.pyx":601 * if is_unkown_number_rows: * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 # <<<<<<<<<<<<<< @@ -6686,7 +6903,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_dc->max_n_obs = (__pyx_v_obs_index + 1); - /* "pyreadstat/_readstat_parser.pyx":585 + /* "pyreadstat/_readstat_parser.pyx":600 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -6695,7 +6912,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":587 + /* "pyreadstat/_readstat_parser.pyx":602 * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] # <<<<<<<<<<<<<< @@ -6704,15 +6921,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 587, __pyx_L1_error) + __PYX_ERR(0, 602, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_max_rows = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":588 + /* "pyreadstat/_readstat_parser.pyx":603 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -6722,7 +6939,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = ((__pyx_v_var_max_rows <= __pyx_v_obs_index) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":589 + /* "pyreadstat/_readstat_parser.pyx":604 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: * curnptype = dc.col_numpy_dtypes[index] # <<<<<<<<<<<<<< @@ -6731,36 +6948,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 589, __pyx_L1_error) + __PYX_ERR(0, 604, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_curnptype = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":590 + /* "pyreadstat/_readstat_parser.pyx":605 * if var_max_rows <= obs_index: * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) # <<<<<<<<<<<<<< * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_curnptype) < 0) __PYX_ERR(0, 590, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_curnptype) < 0) __PYX_ERR(0, 605, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_buf_list = __pyx_t_5; __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":591 + /* "pyreadstat/_readstat_parser.pyx":606 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -6778,18 +6995,18 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L7_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":592 + /* "pyreadstat/_readstat_parser.pyx":607 * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) # <<<<<<<<<<<<<< * dc.col_data[index] = np.append(dc.col_data[index], buf_list) * var_max_rows += 100000 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf_list, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf_list, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -6805,12 +7022,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":591 + /* "pyreadstat/_readstat_parser.pyx":606 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -6819,23 +7036,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":593 + /* "pyreadstat/_readstat_parser.pyx":608 * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) * dc.col_data[index] = np.append(dc.col_data[index], buf_list) # <<<<<<<<<<<<<< * var_max_rows += 100000 * dc.col_data_len[index] = var_max_rows */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_append); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_append); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 608, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_2 = 0; @@ -6852,7 +7069,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_buf_list}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6861,14 +7078,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_buf_list}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -6879,19 +7096,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __Pyx_GIVEREF(__pyx_v_buf_list); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_v_buf_list); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 593, __pyx_L1_error) + __PYX_ERR(0, 608, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 593, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":594 + /* "pyreadstat/_readstat_parser.pyx":609 * buf_list.fill(np.nan) * dc.col_data[index] = np.append(dc.col_data[index], buf_list) * var_max_rows += 100000 # <<<<<<<<<<<<<< @@ -6900,23 +7117,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_var_max_rows = (__pyx_v_var_max_rows + 0x186A0); - /* "pyreadstat/_readstat_parser.pyx":595 + /* "pyreadstat/_readstat_parser.pyx":610 * dc.col_data[index] = np.append(dc.col_data[index], buf_list) * var_max_rows += 100000 * dc.col_data_len[index] = var_max_rows # <<<<<<<<<<<<<< * * # transform to python value types */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 595, __pyx_L1_error) + __PYX_ERR(0, 610, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 595, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":588 + /* "pyreadstat/_readstat_parser.pyx":603 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -6925,7 +7142,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":584 + /* "pyreadstat/_readstat_parser.pyx":599 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -6934,7 +7151,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":598 + /* "pyreadstat/_readstat_parser.pyx":613 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -6944,7 +7161,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":600 + /* "pyreadstat/_readstat_parser.pyx":615 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -6962,7 +7179,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L11_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":601 + /* "pyreadstat/_readstat_parser.pyx":616 * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): * if iscurnptypefloat == 1 or iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -6982,7 +7199,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":607 + /* "pyreadstat/_readstat_parser.pyx":622 * # for any type except float, the numpy type will be object as now we have nans * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -6992,11 +7209,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 607, __pyx_L1_error) + __PYX_ERR(0, 622, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 607, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 622, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":608 + /* "pyreadstat/_readstat_parser.pyx":623 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -7005,11 +7222,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 608, __pyx_L1_error) + __PYX_ERR(0, 623, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_int_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 608, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_int_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 623, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":609 + /* "pyreadstat/_readstat_parser.pyx":624 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -7018,7 +7235,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":610 + /* "pyreadstat/_readstat_parser.pyx":625 * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -7027,52 +7244,52 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 610, __pyx_L1_error) + __PYX_ERR(0, 625, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 610, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 610, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 610, __pyx_L1_error) + __PYX_ERR(0, 625, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 610, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":611 + /* "pyreadstat/_readstat_parser.pyx":626 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index:] = np.nan # <<<<<<<<<<<<<< * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 611, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_PyObject_SetSlice(__pyx_t_8, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < 0) __PYX_ERR(0, 611, __pyx_L1_error) + if (__Pyx_PyObject_SetSlice(__pyx_t_8, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":600 + /* "pyreadstat/_readstat_parser.pyx":615 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -7082,7 +7299,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":613 + /* "pyreadstat/_readstat_parser.pyx":628 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -7092,19 +7309,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_defined_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":615 + /* "pyreadstat/_readstat_parser.pyx":630 * elif readstat_value_is_defined_missing(value, variable): * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): */ - __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyvalue = __pyx_t_5; __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":616 + /* "pyreadstat/_readstat_parser.pyx":631 * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -7113,14 +7330,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 616, __pyx_L1_error) + __PYX_ERR(0, 631, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 616, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":613 + /* "pyreadstat/_readstat_parser.pyx":628 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -7130,7 +7347,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":617 + /* "pyreadstat/_readstat_parser.pyx":632 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -7140,7 +7357,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":618 + /* "pyreadstat/_readstat_parser.pyx":633 * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -7149,15 +7366,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 618, __pyx_L1_error) + __PYX_ERR(0, 633, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":620 + /* "pyreadstat/_readstat_parser.pyx":635 * iscurnptypeobject = dc.col_dtypes_isobject[index] * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -7166,7 +7383,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":623 + /* "pyreadstat/_readstat_parser.pyx":638 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -7176,29 +7393,29 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = ((__pyx_v_iscurnptypeobject == 1) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":624 + /* "pyreadstat/_readstat_parser.pyx":639 * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if iscurnptypeobject == 1: * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * else: * dc.col_numpy_dtypes[index] = object */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 624, __pyx_L1_error) + __PYX_ERR(0, 639, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 624, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":623 + /* "pyreadstat/_readstat_parser.pyx":638 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -7208,7 +7425,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L16; } - /* "pyreadstat/_readstat_parser.pyx":626 + /* "pyreadstat/_readstat_parser.pyx":641 * dc.col_data[index][obs_index] = chr(missing_tag) * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -7218,11 +7435,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 641, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":627 + /* "pyreadstat/_readstat_parser.pyx":642 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -7231,11 +7448,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 627, __pyx_L1_error) + __PYX_ERR(0, 642, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_int_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 627, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_int_1, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 642, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":628 + /* "pyreadstat/_readstat_parser.pyx":643 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 # <<<<<<<<<<<<<< @@ -7244,11 +7461,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 628, __pyx_L1_error) + __PYX_ERR(0, 643, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_int_0, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_int_0, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 643, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":629 + /* "pyreadstat/_readstat_parser.pyx":644 * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -7257,7 +7474,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":630 + /* "pyreadstat/_readstat_parser.pyx":645 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -7266,52 +7483,52 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 630, __pyx_L1_error) + __PYX_ERR(0, 645, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 630, __pyx_L1_error) + __PYX_ERR(0, 645, __pyx_L1_error) } - if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 630, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":631 + /* "pyreadstat/_readstat_parser.pyx":646 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * curset = dc.missing_user_values.get(index) * if curset is None: */ - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 631, __pyx_L1_error) + __PYX_ERR(0, 646, __pyx_L1_error) } - __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_v_obs_index, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_t_7, __pyx_v_obs_index, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L16:; - /* "pyreadstat/_readstat_parser.pyx":632 + /* "pyreadstat/_readstat_parser.pyx":647 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) # <<<<<<<<<<<<<< @@ -7320,18 +7537,18 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 647, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(PySet_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 632, __pyx_L1_error) + if (!(likely(PySet_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 647, __pyx_L1_error) __pyx_v_curset = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":633 + /* "pyreadstat/_readstat_parser.pyx":648 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -7342,19 +7559,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_6 = (__pyx_t_3 != 0); if (__pyx_t_6) { - /* "pyreadstat/_readstat_parser.pyx":634 + /* "pyreadstat/_readstat_parser.pyx":649 * curset = dc.missing_user_values.get(index) * if curset is None: * curset = set() # <<<<<<<<<<<<<< * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset */ - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_curset, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":633 + /* "pyreadstat/_readstat_parser.pyx":648 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -7363,7 +7580,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":635 + /* "pyreadstat/_readstat_parser.pyx":650 * if curset is None: * curset = set() * curset.add(chr(missing_tag)) # <<<<<<<<<<<<<< @@ -7372,17 +7589,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_curset == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); - __PYX_ERR(0, 635, __pyx_L1_error) + __PYX_ERR(0, 650, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":636 + /* "pyreadstat/_readstat_parser.pyx":651 * curset = set() * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset # <<<<<<<<<<<<<< @@ -7391,14 +7608,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 636, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_8, __pyx_v_curset) < 0)) __PYX_ERR(0, 636, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_8, __pyx_v_curset) < 0)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":617 + /* "pyreadstat/_readstat_parser.pyx":632 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -7408,7 +7625,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":598 + /* "pyreadstat/_readstat_parser.pyx":613 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -7418,7 +7635,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L9; } - /* "pyreadstat/_readstat_parser.pyx":638 + /* "pyreadstat/_readstat_parser.pyx":653 * dc.missing_user_values[index] = curset * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< @@ -7426,12 +7643,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * */ /*else*/ { - __pyx_t_8 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_8 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_pyvalue = __pyx_t_8; __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":639 + /* "pyreadstat/_readstat_parser.pyx":654 * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -7440,16 +7657,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 639, __pyx_L1_error) + __PYX_ERR(0, 654, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_SetItemInt(__pyx_t_8, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 639, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_t_8, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L9:; - /* "pyreadstat/_readstat_parser.pyx":641 + /* "pyreadstat/_readstat_parser.pyx":656 * dc.col_data[index][obs_index] = pyvalue * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -7459,7 +7676,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":551 + /* "pyreadstat/_readstat_parser.pyx":566 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -7486,7 +7703,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":644 +/* "pyreadstat/_readstat_parser.pyx":659 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -7524,7 +7741,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value_label", 0); - /* "pyreadstat/_readstat_parser.pyx":650 + /* "pyreadstat/_readstat_parser.pyx":665 * """ * * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -7536,14 +7753,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":668 + /* "pyreadstat/_readstat_parser.pyx":683 * cdef str value_label_name * * var_label = val_labels # <<<<<<<<<<<<<< * value_label_name = label * */ - __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -7551,14 +7768,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_var_label = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":669 + /* "pyreadstat/_readstat_parser.pyx":684 * * var_label = val_labels * value_label_name = label # <<<<<<<<<<<<<< * * cdef readstat_type_t value_type */ - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); @@ -7566,7 +7783,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_value_label_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":672 + /* "pyreadstat/_readstat_parser.pyx":687 * * cdef readstat_type_t value_type * value_type = readstat_value_type(value) # <<<<<<<<<<<<<< @@ -7575,7 +7792,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_value_type = readstat_value_type(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":674 + /* "pyreadstat/_readstat_parser.pyx":689 * value_type = readstat_value_type(value) * * labels_raw = dc.labels_raw # <<<<<<<<<<<<<< @@ -7587,14 +7804,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_labels_raw = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":675 + /* "pyreadstat/_readstat_parser.pyx":690 * * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) # <<<<<<<<<<<<<< * if not cur_dict: * cur_dict = dict() */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels_raw, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels_raw, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -7608,36 +7825,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_var_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_var_label); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_cur_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":676 + /* "pyreadstat/_readstat_parser.pyx":691 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< * cur_dict = dict() * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 691, __pyx_L1_error) __pyx_t_5 = ((!__pyx_t_4) != 0); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":677 + /* "pyreadstat/_readstat_parser.pyx":692 * cur_dict = labels_raw.get(var_label) * if not cur_dict: * cur_dict = dict() # <<<<<<<<<<<<<< * * if readstat_value_is_tagged_missing(value): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_dict, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":676 + /* "pyreadstat/_readstat_parser.pyx":691 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< @@ -7646,7 +7863,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ } - /* "pyreadstat/_readstat_parser.pyx":679 + /* "pyreadstat/_readstat_parser.pyx":694 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -7656,7 +7873,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_5 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":681 + /* "pyreadstat/_readstat_parser.pyx":696 * if readstat_value_is_tagged_missing(value): * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -7665,22 +7882,22 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":683 + /* "pyreadstat/_readstat_parser.pyx":698 * missing_tag = readstat_value_tag(value) * # In SAS missing values are A to Z or _ in stata a to z * cur_dict[chr(missing_tag)] = value_label_name # <<<<<<<<<<<<<< * else: * */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0)) __PYX_ERR(0, 683, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":679 + /* "pyreadstat/_readstat_parser.pyx":694 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -7690,7 +7907,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py goto __pyx_L4; } - /* "pyreadstat/_readstat_parser.pyx":686 + /* "pyreadstat/_readstat_parser.pyx":701 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -7699,7 +7916,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ /*else*/ { - /* "pyreadstat/_readstat_parser.pyx":706 + /* "pyreadstat/_readstat_parser.pyx":721 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -7709,7 +7926,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_value_type) { case READSTAT_TYPE_STRING: - /* "pyreadstat/_readstat_parser.pyx":686 + /* "pyreadstat/_readstat_parser.pyx":701 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -7718,7 +7935,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":687 + /* "pyreadstat/_readstat_parser.pyx":702 * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) # <<<<<<<<<<<<<< @@ -7727,14 +7944,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_str_value = readstat_string_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":688 + /* "pyreadstat/_readstat_parser.pyx":703 * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * py_str_value = c_str_value # <<<<<<<<<<<<<< * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: */ - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); @@ -7742,7 +7959,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_py_str_value = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":689 + /* "pyreadstat/_readstat_parser.pyx":704 * c_str_value = readstat_string_value(value) * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING # <<<<<<<<<<<<<< @@ -7751,7 +7968,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING; - /* "pyreadstat/_readstat_parser.pyx":686 + /* "pyreadstat/_readstat_parser.pyx":701 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -7761,7 +7978,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":691 + /* "pyreadstat/_readstat_parser.pyx":706 * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) # <<<<<<<<<<<<<< @@ -7770,7 +7987,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int8_value = readstat_int8_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":692 + /* "pyreadstat/_readstat_parser.pyx":707 * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value # <<<<<<<<<<<<<< @@ -7779,7 +7996,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int8_value); - /* "pyreadstat/_readstat_parser.pyx":693 + /* "pyreadstat/_readstat_parser.pyx":708 * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -7788,7 +8005,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":690 + /* "pyreadstat/_readstat_parser.pyx":705 * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -7798,7 +8015,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":695 + /* "pyreadstat/_readstat_parser.pyx":710 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) # <<<<<<<<<<<<<< @@ -7807,7 +8024,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int16_value = readstat_int16_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":696 + /* "pyreadstat/_readstat_parser.pyx":711 * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value # <<<<<<<<<<<<<< @@ -7816,7 +8033,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int16_value); - /* "pyreadstat/_readstat_parser.pyx":697 + /* "pyreadstat/_readstat_parser.pyx":712 * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -7825,7 +8042,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":694 + /* "pyreadstat/_readstat_parser.pyx":709 * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -7835,7 +8052,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":699 + /* "pyreadstat/_readstat_parser.pyx":714 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) # <<<<<<<<<<<<<< @@ -7844,7 +8061,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int32_value = readstat_int32_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":700 + /* "pyreadstat/_readstat_parser.pyx":715 * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value # <<<<<<<<<<<<<< @@ -7853,7 +8070,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int32_value); - /* "pyreadstat/_readstat_parser.pyx":701 + /* "pyreadstat/_readstat_parser.pyx":716 * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -7862,7 +8079,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":698 + /* "pyreadstat/_readstat_parser.pyx":713 * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -7872,7 +8089,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":703 + /* "pyreadstat/_readstat_parser.pyx":718 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) # <<<<<<<<<<<<<< @@ -7881,7 +8098,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_float_value = readstat_float_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":704 + /* "pyreadstat/_readstat_parser.pyx":719 * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) * py_float_value = c_float_value # <<<<<<<<<<<<<< @@ -7890,7 +8107,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_float_value); - /* "pyreadstat/_readstat_parser.pyx":705 + /* "pyreadstat/_readstat_parser.pyx":720 * c_float_value = readstat_float_value(value) * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -7899,7 +8116,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":702 + /* "pyreadstat/_readstat_parser.pyx":717 * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -7909,7 +8126,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":707 + /* "pyreadstat/_readstat_parser.pyx":722 * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); # <<<<<<<<<<<<<< @@ -7918,7 +8135,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_double_value = readstat_double_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":708 + /* "pyreadstat/_readstat_parser.pyx":723 * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); * py_float_value = c_double_value # <<<<<<<<<<<<<< @@ -7927,7 +8144,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_double_value); - /* "pyreadstat/_readstat_parser.pyx":709 + /* "pyreadstat/_readstat_parser.pyx":724 * c_double_value = readstat_double_value(value); * py_float_value = c_double_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -7936,7 +8153,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":706 + /* "pyreadstat/_readstat_parser.pyx":721 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -7946,14 +8163,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":711 + /* "pyreadstat/_readstat_parser.pyx":726 * pyformat = VAR_FORMAT_FLOAT * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -7967,16 +8184,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Unkown_data_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Unkown_data_type); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 711, __pyx_L1_error) + __PYX_ERR(0, 726, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":714 + /* "pyreadstat/_readstat_parser.pyx":729 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -7986,17 +8203,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_pyformat) { case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING: - /* "pyreadstat/_readstat_parser.pyx":715 + /* "pyreadstat/_readstat_parser.pyx":730 * * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name */ - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 715, __pyx_L1_error) } - if (unlikely(PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0)) __PYX_ERR(0, 715, __pyx_L1_error) + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 730, __pyx_L1_error) } + if (unlikely(PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0)) __PYX_ERR(0, 730, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":714 + /* "pyreadstat/_readstat_parser.pyx":729 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -8006,16 +8223,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG: - /* "pyreadstat/_readstat_parser.pyx":717 + /* "pyreadstat/_readstat_parser.pyx":732 * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name */ - if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 717, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 732, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":716 + /* "pyreadstat/_readstat_parser.pyx":731 * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: # <<<<<<<<<<<<<< @@ -8025,19 +8242,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":719 + /* "pyreadstat/_readstat_parser.pyx":734 * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_MISSING: * pass */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0)) __PYX_ERR(0, 719, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":718 + /* "pyreadstat/_readstat_parser.pyx":733 * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: # <<<<<<<<<<<<<< @@ -8047,7 +8264,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_MISSING: - /* "pyreadstat/_readstat_parser.pyx":720 + /* "pyreadstat/_readstat_parser.pyx":735 * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name * elif pyformat == VAR_FORMAT_MISSING: # <<<<<<<<<<<<<< @@ -8057,14 +8274,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":723 + /* "pyreadstat/_readstat_parser.pyx":738 * pass * else: * raise PyreadstatError("Failed convert C to python value") # <<<<<<<<<<<<<< * * dc.labels_raw[var_label] = cur_dict */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -8078,27 +8295,27 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Failed_convert_C_to_python_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Failed_convert_C_to_python_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 723, __pyx_L1_error) + __PYX_ERR(0, 738, __pyx_L1_error) break; } } __pyx_L4:; - /* "pyreadstat/_readstat_parser.pyx":725 + /* "pyreadstat/_readstat_parser.pyx":740 * raise PyreadstatError("Failed convert C to python value") * * dc.labels_raw[var_label] = cur_dict # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely(PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0)) __PYX_ERR(0, 725, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0)) __PYX_ERR(0, 740, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":727 + /* "pyreadstat/_readstat_parser.pyx":742 * dc.labels_raw[var_label] = cur_dict * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -8108,7 +8325,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":644 + /* "pyreadstat/_readstat_parser.pyx":659 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8134,7 +8351,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":729 +/* "pyreadstat/_readstat_parser.pyx":744 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8155,7 +8372,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_note", 0); - /* "pyreadstat/_readstat_parser.pyx":735 + /* "pyreadstat/_readstat_parser.pyx":750 * * cdef str pynote * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -8167,14 +8384,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":737 + /* "pyreadstat/_readstat_parser.pyx":752 * cdef data_container dc = ctx * * pynote = note # <<<<<<<<<<<<<< * dc.notes.append(pynote) * */ - __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyStr_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -8182,16 +8399,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_pynote = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":738 + /* "pyreadstat/_readstat_parser.pyx":753 * * pynote = note * dc.notes.append(pynote) # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 753, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":740 + /* "pyreadstat/_readstat_parser.pyx":755 * dc.notes.append(pynote) * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -8201,7 +8418,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":729 + /* "pyreadstat/_readstat_parser.pyx":744 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8222,7 +8439,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":742 +/* "pyreadstat/_readstat_parser.pyx":757 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8248,22 +8465,22 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_open", 0); - /* "pyreadstat/_readstat_parser.pyx":752 + /* "pyreadstat/_readstat_parser.pyx":767 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< * return -1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -8278,15 +8495,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = ((!__pyx_t_5) != 0); if (__pyx_t_6) { - /* "pyreadstat/_readstat_parser.pyx":753 + /* "pyreadstat/_readstat_parser.pyx":768 * * if not os.path.isfile(u8_path): * return -1 # <<<<<<<<<<<<<< @@ -8296,7 +8513,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = -1; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":752 + /* "pyreadstat/_readstat_parser.pyx":767 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< @@ -8305,36 +8522,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":756 + /* "pyreadstat/_readstat_parser.pyx":771 * * #IF UNAME_SYSNAME == 'Windows': * if os.name == "nt": # <<<<<<<<<<<<<< * * u16_path = PyUnicode_AsWideCharString(u8_path, &length) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "pyreadstat/_readstat_parser.pyx":758 + /* "pyreadstat/_readstat_parser.pyx":773 * if os.name == "nt": * * u16_path = PyUnicode_AsWideCharString(u8_path, &length) # <<<<<<<<<<<<<< * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) */ - __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyUnicode_AsWideCharString(__pyx_t_2, (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((wchar_t *)NULL))) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_7 = PyUnicode_AsWideCharString(__pyx_t_2, (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((wchar_t *)NULL))) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_u16_path = __pyx_t_7; - /* "pyreadstat/_readstat_parser.pyx":759 + /* "pyreadstat/_readstat_parser.pyx":774 * * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) # <<<<<<<<<<<<<< @@ -8343,7 +8560,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ __pyx_v_fd = _wsopen(__pyx_v_u16_path, (_O_RDONLY | _O_BINARY), _SH_DENYWR, 0); - /* "pyreadstat/_readstat_parser.pyx":760 + /* "pyreadstat/_readstat_parser.pyx":775 * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) # <<<<<<<<<<<<<< @@ -8352,7 +8569,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ assign_fd(__pyx_v_io_ctx, __pyx_v_fd); - /* "pyreadstat/_readstat_parser.pyx":761 + /* "pyreadstat/_readstat_parser.pyx":776 * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) * return fd # <<<<<<<<<<<<<< @@ -8362,7 +8579,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = __pyx_v_fd; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":756 + /* "pyreadstat/_readstat_parser.pyx":771 * * #IF UNAME_SYSNAME == 'Windows': * if os.name == "nt": # <<<<<<<<<<<<<< @@ -8371,7 +8588,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":764 + /* "pyreadstat/_readstat_parser.pyx":779 * #ELSE: * else: * return -1 # <<<<<<<<<<<<<< @@ -8383,7 +8600,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":742 + /* "pyreadstat/_readstat_parser.pyx":757 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8404,7 +8621,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":769 +/* "pyreadstat/_readstat_parser.pyx":784 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -8425,7 +8642,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_exit_status", 0); - /* "pyreadstat/_readstat_parser.pyx":776 + /* "pyreadstat/_readstat_parser.pyx":791 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -8435,7 +8652,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_t_1 = ((__pyx_v_retcode != READSTAT_OK) != 0); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":777 + /* "pyreadstat/_readstat_parser.pyx":792 * cdef str err_message * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) # <<<<<<<<<<<<<< @@ -8444,14 +8661,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ __pyx_v_err_readstat = readstat_error_message(__pyx_v_retcode); - /* "pyreadstat/_readstat_parser.pyx":778 + /* "pyreadstat/_readstat_parser.pyx":793 * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) * err_message = err_readstat # <<<<<<<<<<<<<< * raise ReadstatError(err_message) * */ - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); @@ -8459,14 +8676,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_v_err_message = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":779 + /* "pyreadstat/_readstat_parser.pyx":794 * err_readstat = readstat_error_message(retcode) * err_message = err_readstat * raise ReadstatError(err_message) # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ReadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ReadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -8480,14 +8697,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_err_message) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_err_message); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 779, __pyx_L1_error) + __PYX_ERR(0, 794, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":776 + /* "pyreadstat/_readstat_parser.pyx":791 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -8496,7 +8713,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ } - /* "pyreadstat/_readstat_parser.pyx":769 + /* "pyreadstat/_readstat_parser.pyx":784 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -8516,7 +8733,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":782 +/* "pyreadstat/_readstat_parser.pyx":797 * * * cdef void run_readstat_parser(char * filename, data_container data, readstat_error_t parse_func(readstat_parser_t *parse, const char *, void *), long row_limit, long row_offset) except *: # <<<<<<<<<<<<<< @@ -8548,7 +8765,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("run_readstat_parser", 0); - /* "pyreadstat/_readstat_parser.pyx":802 + /* "pyreadstat/_readstat_parser.pyx":817 * cdef bytes encoding_byte * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -8558,7 +8775,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":803 + /* "pyreadstat/_readstat_parser.pyx":818 * * metaonly = data.metaonly * ctx = data # <<<<<<<<<<<<<< @@ -8567,7 +8784,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":806 + /* "pyreadstat/_readstat_parser.pyx":821 * * #readstat_error_t error = READSTAT_OK; * parser = readstat_parser_init() # <<<<<<<<<<<<<< @@ -8576,7 +8793,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_parser = readstat_parser_init(); - /* "pyreadstat/_readstat_parser.pyx":807 + /* "pyreadstat/_readstat_parser.pyx":822 * #readstat_error_t error = READSTAT_OK; * parser = readstat_parser_init() * metadata_handler = handle_metadata # <<<<<<<<<<<<<< @@ -8585,7 +8802,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_metadata_handler = ((readstat_metadata_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_metadata); - /* "pyreadstat/_readstat_parser.pyx":808 + /* "pyreadstat/_readstat_parser.pyx":823 * parser = readstat_parser_init() * metadata_handler = handle_metadata * variable_handler = handle_variable # <<<<<<<<<<<<<< @@ -8594,7 +8811,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_variable_handler = ((readstat_variable_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_variable); - /* "pyreadstat/_readstat_parser.pyx":809 + /* "pyreadstat/_readstat_parser.pyx":824 * metadata_handler = handle_metadata * variable_handler = handle_variable * value_handler = handle_value # <<<<<<<<<<<<<< @@ -8603,7 +8820,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_handler = ((readstat_value_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value); - /* "pyreadstat/_readstat_parser.pyx":810 + /* "pyreadstat/_readstat_parser.pyx":825 * variable_handler = handle_variable * value_handler = handle_value * value_label_handler = handle_value_label # <<<<<<<<<<<<<< @@ -8612,7 +8829,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_label_handler = ((readstat_value_label_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value_label); - /* "pyreadstat/_readstat_parser.pyx":811 + /* "pyreadstat/_readstat_parser.pyx":826 * value_handler = handle_value * value_label_handler = handle_value_label * note_handler = handle_note # <<<<<<<<<<<<<< @@ -8621,59 +8838,59 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_note_handler = ((readstat_note_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_note); - /* "pyreadstat/_readstat_parser.pyx":814 + /* "pyreadstat/_readstat_parser.pyx":829 * * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 829, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":815 + /* "pyreadstat/_readstat_parser.pyx":830 * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 815, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":816 + /* "pyreadstat/_readstat_parser.pyx":831 * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_note_handler(parser, note_handler)) * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 831, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":817 + /* "pyreadstat/_readstat_parser.pyx":832 * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) # <<<<<<<<<<<<<< * * # on windows we need a custom open handler in order to deal with internation characters in the path. */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":821 + /* "pyreadstat/_readstat_parser.pyx":836 * # on windows we need a custom open handler in order to deal with internation characters in the path. * IF PY_MAJOR_VERSION >2: * if os.name == "nt": # <<<<<<<<<<<<<< * open_handler = handle_open * readstat_set_open_handler(parser, open_handler) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":822 + /* "pyreadstat/_readstat_parser.pyx":837 * IF PY_MAJOR_VERSION >2: * if os.name == "nt": * open_handler = handle_open # <<<<<<<<<<<<<< @@ -8682,7 +8899,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_open_handler = ((readstat_open_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_open); - /* "pyreadstat/_readstat_parser.pyx":823 + /* "pyreadstat/_readstat_parser.pyx":838 * if os.name == "nt": * open_handler = handle_open * readstat_set_open_handler(parser, open_handler) # <<<<<<<<<<<<<< @@ -8691,7 +8908,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_open_handler(__pyx_v_parser, __pyx_v_open_handler)); - /* "pyreadstat/_readstat_parser.pyx":821 + /* "pyreadstat/_readstat_parser.pyx":836 * # on windows we need a custom open handler in order to deal with internation characters in the path. * IF PY_MAJOR_VERSION >2: * if os.name == "nt": # <<<<<<<<<<<<<< @@ -8700,7 +8917,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":828 + /* "pyreadstat/_readstat_parser.pyx":843 * raise PyreadstatError("Python 2 on windows not supported!") * * if not metaonly: # <<<<<<<<<<<<<< @@ -8710,16 +8927,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = ((!(__pyx_v_metaonly != 0)) != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":829 + /* "pyreadstat/_readstat_parser.pyx":844 * * if not metaonly: * check_exit_status(readstat_set_value_handler(parser, value_handler)) # <<<<<<<<<<<<<< * * # if the user set the encoding manually */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 829, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":828 + /* "pyreadstat/_readstat_parser.pyx":843 * raise PyreadstatError("Python 2 on windows not supported!") * * if not metaonly: # <<<<<<<<<<<<<< @@ -8728,24 +8945,24 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":832 + /* "pyreadstat/_readstat_parser.pyx":847 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< * encoding_bytes = data.user_encoding.encode("utf-8") * readstat_set_file_character_encoding(parser, encoding_bytes) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_data->user_encoding); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_data->user_encoding); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 847, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":833 + /* "pyreadstat/_readstat_parser.pyx":848 * # if the user set the encoding manually * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") # <<<<<<<<<<<<<< * readstat_set_file_character_encoding(parser, encoding_bytes) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data->user_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data->user_encoding, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -8759,23 +8976,23 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_encoding_bytes = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":834 + /* "pyreadstat/_readstat_parser.pyx":849 * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") * readstat_set_file_character_encoding(parser, encoding_bytes) # <<<<<<<<<<<<<< * * if row_limit: */ - __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 849, __pyx_L1_error) (void)(readstat_set_file_character_encoding(__pyx_v_parser, ((char *)__pyx_t_5))); - /* "pyreadstat/_readstat_parser.pyx":832 + /* "pyreadstat/_readstat_parser.pyx":847 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< @@ -8784,7 +9001,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":836 + /* "pyreadstat/_readstat_parser.pyx":851 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -8794,16 +9011,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_limit != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":837 + /* "pyreadstat/_readstat_parser.pyx":852 * * if row_limit: * check_exit_status(readstat_set_row_limit(parser, row_limit)) # <<<<<<<<<<<<<< * * if row_offset: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":836 + /* "pyreadstat/_readstat_parser.pyx":851 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -8812,7 +9029,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":839 + /* "pyreadstat/_readstat_parser.pyx":854 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -8822,16 +9039,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_offset != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":840 + /* "pyreadstat/_readstat_parser.pyx":855 * * if row_offset: * check_exit_status(readstat_set_row_offset(parser, row_offset)) # <<<<<<<<<<<<<< * * # parse! */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 840, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 855, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":839 + /* "pyreadstat/_readstat_parser.pyx":854 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -8840,7 +9057,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":843 + /* "pyreadstat/_readstat_parser.pyx":858 * * # parse! * error = parse_func(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -8849,7 +9066,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = __pyx_v_parse_func(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":844 + /* "pyreadstat/_readstat_parser.pyx":859 * # parse! * error = parse_func(parser, filename, ctx); * readstat_parser_free(parser) # <<<<<<<<<<<<<< @@ -8858,7 +9075,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ readstat_parser_free(__pyx_v_parser); - /* "pyreadstat/_readstat_parser.pyx":847 + /* "pyreadstat/_readstat_parser.pyx":862 * # check if a python error ocurred, if yes, it will be printed by the interpreter, * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() # <<<<<<<<<<<<<< @@ -8867,7 +9084,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_pyerr = PyErr_Occurred(); - /* "pyreadstat/_readstat_parser.pyx":848 + /* "pyreadstat/_readstat_parser.pyx":863 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -8877,16 +9094,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = ((((void *)__pyx_v_pyerr) == NULL) != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":849 + /* "pyreadstat/_readstat_parser.pyx":864 * pyerr = PyErr_Occurred() * if pyerr == NULL: * check_exit_status(error) # <<<<<<<<<<<<<< * * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 849, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":848 + /* "pyreadstat/_readstat_parser.pyx":863 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -8895,7 +9112,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":782 + /* "pyreadstat/_readstat_parser.pyx":797 * * * cdef void run_readstat_parser(char * filename, data_container data, readstat_error_t parse_func(readstat_parser_t *parse, const char *, void *), long row_limit, long row_offset) except *: # <<<<<<<<<<<<<< @@ -8915,7 +9132,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":852 +/* "pyreadstat/_readstat_parser.pyx":867 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -8948,14 +9165,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_to_dict", 0); - /* "pyreadstat/_readstat_parser.pyx":866 + /* "pyreadstat/_readstat_parser.pyx":881 * cdef bint metaonly * * final_container = OrderedDict() # <<<<<<<<<<<<<< * col_data = data.col_data * col_names = data.col_names */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -8969,13 +9186,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_final_container = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":867 + /* "pyreadstat/_readstat_parser.pyx":882 * * final_container = OrderedDict() * col_data = data.col_data # <<<<<<<<<<<<<< @@ -8987,7 +9204,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":868 + /* "pyreadstat/_readstat_parser.pyx":883 * final_container = OrderedDict() * col_data = data.col_data * col_names = data.col_names # <<<<<<<<<<<<<< @@ -8999,7 +9216,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":869 + /* "pyreadstat/_readstat_parser.pyx":884 * col_data = data.col_data * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -9009,7 +9226,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_4 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_4; - /* "pyreadstat/_readstat_parser.pyx":870 + /* "pyreadstat/_readstat_parser.pyx":885 * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs # <<<<<<<<<<<<<< @@ -9019,7 +9236,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = __pyx_v_data->max_n_obs; __pyx_v_max_n_obs = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":871 + /* "pyreadstat/_readstat_parser.pyx":886 * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -9029,7 +9246,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_4 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_4; - /* "pyreadstat/_readstat_parser.pyx":873 + /* "pyreadstat/_readstat_parser.pyx":888 * metaonly = data.metaonly * * for fc_cnt in range(0, len(col_names)): # <<<<<<<<<<<<<< @@ -9038,14 +9255,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 873, __pyx_L1_error) + __PYX_ERR(0, 888, __pyx_L1_error) } - __pyx_t_6 = PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_t_6 = PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 888, __pyx_L1_error) __pyx_t_7 = __pyx_t_6; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) { __pyx_v_fc_cnt = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":874 + /* "pyreadstat/_readstat_parser.pyx":889 * * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] # <<<<<<<<<<<<<< @@ -9054,15 +9271,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 874, __pyx_L1_error) + __PYX_ERR(0, 889, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 874, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cur_name_str, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":875 + /* "pyreadstat/_readstat_parser.pyx":890 * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] # <<<<<<<<<<<<<< @@ -9071,14 +9288,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 875, __pyx_L1_error) + __PYX_ERR(0, 890, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":876 + /* "pyreadstat/_readstat_parser.pyx":891 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -9096,19 +9313,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_L6_bool_binop_done:; if (__pyx_t_4) { - /* "pyreadstat/_readstat_parser.pyx":877 + /* "pyreadstat/_readstat_parser.pyx":892 * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] # <<<<<<<<<<<<<< * if not metaonly: * final_container[cur_name_str] = cur_data */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":876 + /* "pyreadstat/_readstat_parser.pyx":891 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -9117,7 +9334,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ } - /* "pyreadstat/_readstat_parser.pyx":878 + /* "pyreadstat/_readstat_parser.pyx":893 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -9127,16 +9344,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_4 = ((!(__pyx_v_metaonly != 0)) != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_parser.pyx":879 + /* "pyreadstat/_readstat_parser.pyx":894 * cur_data = cur_data[0:max_n_obs] * if not metaonly: * final_container[cur_name_str] = cur_data # <<<<<<<<<<<<<< * else: * final_container[cur_name_str] = list() */ - if (unlikely(PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0)) __PYX_ERR(0, 879, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0)) __PYX_ERR(0, 894, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":878 + /* "pyreadstat/_readstat_parser.pyx":893 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -9146,7 +9363,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( goto __pyx_L8; } - /* "pyreadstat/_readstat_parser.pyx":881 + /* "pyreadstat/_readstat_parser.pyx":896 * final_container[cur_name_str] = cur_data * else: * final_container[cur_name_str] = list() # <<<<<<<<<<<<<< @@ -9154,15 +9371,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( * return final_container */ /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0)) __PYX_ERR(0, 881, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; } - /* "pyreadstat/_readstat_parser.pyx":883 + /* "pyreadstat/_readstat_parser.pyx":898 * final_container[cur_name_str] = list() * * return final_container # <<<<<<<<<<<<<< @@ -9174,7 +9391,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_r = __pyx_v_final_container; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":852 + /* "pyreadstat/_readstat_parser.pyx":867 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -9200,7 +9417,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":886 +/* "pyreadstat/_readstat_parser.pyx":901 * * * cdef object dict_to_pandas_dataframe(object dict_data): # <<<<<<<<<<<<<< @@ -9221,29 +9438,29 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dict_to_pandas_dataframe", 0); - /* "pyreadstat/_readstat_parser.pyx":891 + /* "pyreadstat/_readstat_parser.pyx":906 * """ * * if dict_data: # <<<<<<<<<<<<<< * data_frame = pd.DataFrame.from_dict(dict_data) * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 906, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":892 + /* "pyreadstat/_readstat_parser.pyx":907 * * if dict_data: * data_frame = pd.DataFrame.from_dict(dict_data) # <<<<<<<<<<<<<< * else: * data_frame = pd.DataFrame() */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_from_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_from_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -9258,13 +9475,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_dict_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dict_data); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_data_frame = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":891 + /* "pyreadstat/_readstat_parser.pyx":906 * """ * * if dict_data: # <<<<<<<<<<<<<< @@ -9274,7 +9491,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":894 + /* "pyreadstat/_readstat_parser.pyx":909 * data_frame = pd.DataFrame.from_dict(dict_data) * else: * data_frame = pd.DataFrame() # <<<<<<<<<<<<<< @@ -9282,9 +9499,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram * return data_frame */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -9299,7 +9516,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 894, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_data_frame = __pyx_t_2; @@ -9307,7 +9524,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":896 + /* "pyreadstat/_readstat_parser.pyx":911 * data_frame = pd.DataFrame() * * return data_frame # <<<<<<<<<<<<<< @@ -9319,7 +9536,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram __pyx_r = __pyx_v_data_frame; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":886 + /* "pyreadstat/_readstat_parser.pyx":901 * * * cdef object dict_to_pandas_dataframe(object dict_data): # <<<<<<<<<<<<<< @@ -9341,7 +9558,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_datafram return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":899 +/* "pyreadstat/_readstat_parser.pyx":914 * * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -9387,7 +9604,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_extract_metadata", 0); - /* "pyreadstat/_readstat_parser.pyx":916 + /* "pyreadstat/_readstat_parser.pyx":931 * cdef readstat_type_t var_type * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -9397,7 +9614,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":917 + /* "pyreadstat/_readstat_parser.pyx":932 * * metaonly = data.metaonly * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -9407,14 +9624,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":919 + /* "pyreadstat/_readstat_parser.pyx":934 * is_unkown_number_rows = data.is_unkown_number_rows * * cdef object metadata = metadata_container() # <<<<<<<<<<<<<< * * # number of rows */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_metadata_container); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_metadata_container); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -9428,25 +9645,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_metadata = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":922 + /* "pyreadstat/_readstat_parser.pyx":937 * * # number of rows * metadata.number_columns = data.n_vars # <<<<<<<<<<<<<< * if is_unkown_number_rows: * if not metaonly: */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_number_columns, __pyx_t_2) < 0) __PYX_ERR(0, 922, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_number_columns, __pyx_t_2) < 0) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":923 + /* "pyreadstat/_readstat_parser.pyx":938 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -9456,7 +9673,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = (__pyx_v_is_unkown_number_rows != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":924 + /* "pyreadstat/_readstat_parser.pyx":939 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -9466,19 +9683,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = ((!(__pyx_v_metaonly != 0)) != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":925 + /* "pyreadstat/_readstat_parser.pyx":940 * if is_unkown_number_rows: * if not metaonly: * metadata.number_rows = data.max_n_obs # <<<<<<<<<<<<<< * else: * metadata.number_rows = data.n_obs */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 925, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":924 + /* "pyreadstat/_readstat_parser.pyx":939 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -9487,7 +9704,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":923 + /* "pyreadstat/_readstat_parser.pyx":938 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -9497,7 +9714,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":927 + /* "pyreadstat/_readstat_parser.pyx":942 * metadata.number_rows = data.max_n_obs * else: * metadata.number_rows = data.n_obs # <<<<<<<<<<<<<< @@ -9505,14 +9722,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * # value labels */ /*else*/ { - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 927, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":930 + /* "pyreadstat/_readstat_parser.pyx":945 * * # value labels * labels_raw = data.labels_raw # <<<<<<<<<<<<<< @@ -9524,7 +9741,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_labels_raw = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":931 + /* "pyreadstat/_readstat_parser.pyx":946 * # value labels * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name # <<<<<<<<<<<<<< @@ -9536,36 +9753,36 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_label_to_var_name = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":932 + /* "pyreadstat/_readstat_parser.pyx":947 * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name * variable_value_labels = dict() # <<<<<<<<<<<<<< * * if labels_raw: */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_variable_value_labels = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":934 + /* "pyreadstat/_readstat_parser.pyx":949 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 949, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":935 + /* "pyreadstat/_readstat_parser.pyx":950 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< * current_labels = labels_raw.get(var_label) * if current_labels: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_label_to_var_name, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_label_to_var_name, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -9579,16 +9796,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 950, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -9596,17 +9813,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 950, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 950, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -9616,7 +9833,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 935, __pyx_L1_error) + else __PYX_ERR(0, 950, __pyx_L1_error) } break; } @@ -9628,7 +9845,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 935, __pyx_L1_error) + __PYX_ERR(0, 950, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -9641,15 +9858,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -9657,7 +9874,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 935, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 950, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_unpacking_done; @@ -9665,24 +9882,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 935, __pyx_L1_error) + __PYX_ERR(0, 950, __pyx_L1_error) __pyx_L9_unpacking_done:; } - if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 935, __pyx_L1_error) - if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 935, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 950, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_var_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_var_label, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":936 + /* "pyreadstat/_readstat_parser.pyx":951 * if labels_raw: * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) # <<<<<<<<<<<<<< * if current_labels: * variable_value_labels[var_name] = current_labels */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels_raw, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 936, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_labels_raw, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -9696,32 +9913,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_var_label) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_var_label); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_current_labels, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":937 + /* "pyreadstat/_readstat_parser.pyx":952 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< * variable_value_labels[var_name] = current_labels * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 937, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 952, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":938 + /* "pyreadstat/_readstat_parser.pyx":953 * current_labels = labels_raw.get(var_label) * if current_labels: * variable_value_labels[var_name] = current_labels # <<<<<<<<<<<<<< * * original_types = dict() */ - if (unlikely(PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0)) __PYX_ERR(0, 938, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0)) __PYX_ERR(0, 953, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":937 + /* "pyreadstat/_readstat_parser.pyx":952 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< @@ -9730,7 +9947,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":935 + /* "pyreadstat/_readstat_parser.pyx":950 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< @@ -9740,7 +9957,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":934 + /* "pyreadstat/_readstat_parser.pyx":949 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< @@ -9749,49 +9966,49 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":940 + /* "pyreadstat/_readstat_parser.pyx":955 * variable_value_labels[var_name] = current_labels * * original_types = dict() # <<<<<<<<<<<<<< * readstat_types = dict() * for indx in range(metadata.number_columns): */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 940, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_original_types = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":941 + /* "pyreadstat/_readstat_parser.pyx":956 * * original_types = dict() * readstat_types = dict() # <<<<<<<<<<<<<< * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_readstat_types = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":942 + /* "pyreadstat/_readstat_parser.pyx":957 * original_types = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_n_s_number_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_n_s_number_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 957, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -9799,17 +10016,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 957, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 957, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -9819,7 +10036,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 942, __pyx_L1_error) + else __PYX_ERR(0, 957, __pyx_L1_error) } break; } @@ -9828,7 +10045,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":943 + /* "pyreadstat/_readstat_parser.pyx":958 * readstat_types = dict() * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -9837,14 +10054,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 943, __pyx_L1_error) + __PYX_ERR(0, 958, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":944 + /* "pyreadstat/_readstat_parser.pyx":959 * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] # <<<<<<<<<<<<<< @@ -9853,23 +10070,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_formats_original == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 944, __pyx_L1_error) + __PYX_ERR(0, 959, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_cur_type, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":945 + /* "pyreadstat/_readstat_parser.pyx":960 * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] * original_types[cur_col] = cur_type # <<<<<<<<<<<<<< * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: */ - if (unlikely(PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0)) __PYX_ERR(0, 945, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0)) __PYX_ERR(0, 960, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":946 + /* "pyreadstat/_readstat_parser.pyx":961 * cur_type = data.col_formats_original[indx] * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] # <<<<<<<<<<<<<< @@ -9878,15 +10095,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 946, __pyx_L1_error) + __PYX_ERR(0, 961, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = ((readstat_type_t)__Pyx_PyInt_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_10 = ((readstat_type_t)__Pyx_PyInt_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_var_type = __pyx_t_10; - /* "pyreadstat/_readstat_parser.pyx":947 + /* "pyreadstat/_readstat_parser.pyx":962 * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -9897,16 +10114,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ case READSTAT_TYPE_STRING: case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":948 + /* "pyreadstat/_readstat_parser.pyx":963 * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" */ - if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_string) < 0)) __PYX_ERR(0, 948, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_string) < 0)) __PYX_ERR(0, 963, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":947 + /* "pyreadstat/_readstat_parser.pyx":962 * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -9916,16 +10133,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":950 + /* "pyreadstat/_readstat_parser.pyx":965 * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" */ - if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_int8) < 0)) __PYX_ERR(0, 950, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_int8) < 0)) __PYX_ERR(0, 965, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":949 + /* "pyreadstat/_readstat_parser.pyx":964 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -9935,16 +10152,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":952 + /* "pyreadstat/_readstat_parser.pyx":967 * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" */ - if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_int16) < 0)) __PYX_ERR(0, 952, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_int16) < 0)) __PYX_ERR(0, 967, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":951 + /* "pyreadstat/_readstat_parser.pyx":966 * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -9954,16 +10171,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":954 + /* "pyreadstat/_readstat_parser.pyx":969 * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" */ - if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_int32) < 0)) __PYX_ERR(0, 954, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_int32) < 0)) __PYX_ERR(0, 969, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":953 + /* "pyreadstat/_readstat_parser.pyx":968 * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -9973,16 +10190,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":956 + /* "pyreadstat/_readstat_parser.pyx":971 * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" */ - if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_float) < 0)) __PYX_ERR(0, 956, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_float) < 0)) __PYX_ERR(0, 971, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":955 + /* "pyreadstat/_readstat_parser.pyx":970 * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -9992,16 +10209,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":958 + /* "pyreadstat/_readstat_parser.pyx":973 * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" # <<<<<<<<<<<<<< * else: * raise PyreadstatError("Unkown data type") */ - if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_double) < 0)) __PYX_ERR(0, 958, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_n_s_double) < 0)) __PYX_ERR(0, 973, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":957 + /* "pyreadstat/_readstat_parser.pyx":972 * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -10011,14 +10228,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; default: - /* "pyreadstat/_readstat_parser.pyx":960 + /* "pyreadstat/_readstat_parser.pyx":975 * readstat_types[cur_col] = "double" * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< * * for indx, curset in data.missing_user_values.items(): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 960, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { @@ -10032,16 +10249,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_kp_s_Unkown_data_type) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_Unkown_data_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 960, __pyx_L1_error) + __PYX_ERR(0, 975, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":942 + /* "pyreadstat/_readstat_parser.pyx":957 * original_types = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< @@ -10051,7 +10268,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":962 + /* "pyreadstat/_readstat_parser.pyx":977 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -10060,17 +10277,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 962, __pyx_L1_error) + __PYX_ERR(0, 977, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 977, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -10078,17 +10295,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 977, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 977, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -10098,7 +10315,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 962, __pyx_L1_error) + else __PYX_ERR(0, 977, __pyx_L1_error) } break; } @@ -10110,7 +10327,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 962, __pyx_L1_error) + __PYX_ERR(0, 977, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -10123,15 +10340,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -10139,7 +10356,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 962, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 977, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L16_unpacking_done; @@ -10147,7 +10364,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 962, __pyx_L1_error) + __PYX_ERR(0, 977, __pyx_L1_error) __pyx_L16_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_7); @@ -10155,7 +10372,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_curset, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":963 + /* "pyreadstat/_readstat_parser.pyx":978 * * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -10164,35 +10381,35 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 963, __pyx_L1_error) + __PYX_ERR(0, 978, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":964 + /* "pyreadstat/_readstat_parser.pyx":979 * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] * metadata.missing_user_values[cur_col] = sorted(list(curset)) # <<<<<<<<<<<<<< * * metadata.notes = data.notes */ - __pyx_t_4 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_4 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_7 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 964, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_n_s_missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L1_error) + __pyx_t_11 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_n_s_missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_cur_col, __pyx_t_3) < 0)) __PYX_ERR(0, 964, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_cur_col, __pyx_t_3) < 0)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":962 + /* "pyreadstat/_readstat_parser.pyx":977 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -10202,7 +10419,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":966 + /* "pyreadstat/_readstat_parser.pyx":981 * metadata.missing_user_values[cur_col] = sorted(list(curset)) * * metadata.notes = data.notes # <<<<<<<<<<<<<< @@ -10211,10 +10428,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->notes; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_notes, __pyx_t_2) < 0) __PYX_ERR(0, 966, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_notes, __pyx_t_2) < 0) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":967 + /* "pyreadstat/_readstat_parser.pyx":982 * * metadata.notes = data.notes * metadata.column_names = data.col_names # <<<<<<<<<<<<<< @@ -10223,10 +10440,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->col_names; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_column_names, __pyx_t_2) < 0) __PYX_ERR(0, 967, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_column_names, __pyx_t_2) < 0) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":968 + /* "pyreadstat/_readstat_parser.pyx":983 * metadata.notes = data.notes * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels # <<<<<<<<<<<<<< @@ -10235,10 +10452,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->col_labels; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_column_labels, __pyx_t_2) < 0) __PYX_ERR(0, 968, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_column_labels, __pyx_t_2) < 0) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":969 + /* "pyreadstat/_readstat_parser.pyx":984 * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} # <<<<<<<<<<<<<< @@ -10246,9 +10463,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * metadata.file_label = data.file_label */ { /* enter inner scope */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_data->col_names); __Pyx_GIVEREF(__pyx_v_data->col_names); @@ -10256,16 +10473,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_v_data->col_labels); __Pyx_GIVEREF(__pyx_v_data->col_labels); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_data->col_labels); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 984, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -10273,17 +10490,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 984, __pyx_L19_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 984, __pyx_L19_error) #else - __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -10293,7 +10510,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 969, __pyx_L19_error) + else __PYX_ERR(0, 984, __pyx_L19_error) } break; } @@ -10305,7 +10522,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 969, __pyx_L19_error) + __PYX_ERR(0, 984, __pyx_L19_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -10318,15 +10535,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; - __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 969, __pyx_L19_error) + __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 984, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_12)->tp_iternext; @@ -10334,7 +10551,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L22_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_12), 2) < 0) __PYX_ERR(0, 969, __pyx_L19_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_12), 2) < 0) __PYX_ERR(0, 984, __pyx_L19_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L23_unpacking_done; @@ -10342,14 +10559,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 969, __pyx_L19_error) + __PYX_ERR(0, 984, __pyx_L19_error) __pyx_L23_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_8); __pyx_t_8 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 969, __pyx_L19_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 984, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; @@ -10361,10 +10578,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_column_names_to_labels, __pyx_t_2) < 0) __PYX_ERR(0, 969, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_column_names_to_labels, __pyx_t_2) < 0) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":970 + /* "pyreadstat/_readstat_parser.pyx":985 * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding # <<<<<<<<<<<<<< @@ -10373,10 +10590,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->file_encoding; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_file_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 970, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_file_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":971 + /* "pyreadstat/_readstat_parser.pyx":986 * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label # <<<<<<<<<<<<<< @@ -10385,55 +10602,55 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->file_label; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_file_label, __pyx_t_2) < 0) __PYX_ERR(0, 971, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_file_label, __pyx_t_2) < 0) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":972 + /* "pyreadstat/_readstat_parser.pyx":987 * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels # <<<<<<<<<<<<<< * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_value_labels, __pyx_v_variable_value_labels) < 0) __PYX_ERR(0, 972, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_value_labels, __pyx_v_variable_value_labels) < 0) __PYX_ERR(0, 987, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":973 + /* "pyreadstat/_readstat_parser.pyx":988 * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw # <<<<<<<<<<<<<< * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_value_labels, __pyx_v_labels_raw) < 0) __PYX_ERR(0, 973, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_value_labels, __pyx_v_labels_raw) < 0) __PYX_ERR(0, 988, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":974 + /* "pyreadstat/_readstat_parser.pyx":989 * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name # <<<<<<<<<<<<<< * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_to_label, __pyx_v_label_to_var_name) < 0) __PYX_ERR(0, 974, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_to_label, __pyx_v_label_to_var_name) < 0) __PYX_ERR(0, 989, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":975 + /* "pyreadstat/_readstat_parser.pyx":990 * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types # <<<<<<<<<<<<<< * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_original_variable_types, __pyx_v_original_types) < 0) __PYX_ERR(0, 975, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_original_variable_types, __pyx_v_original_types) < 0) __PYX_ERR(0, 990, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":976 + /* "pyreadstat/_readstat_parser.pyx":991 * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types # <<<<<<<<<<<<<< * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_readstat_variable_types, __pyx_v_readstat_types) < 0) __PYX_ERR(0, 976, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_readstat_variable_types, __pyx_v_readstat_types) < 0) __PYX_ERR(0, 991, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":977 + /* "pyreadstat/_readstat_parser.pyx":992 * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name # <<<<<<<<<<<<<< @@ -10442,10 +10659,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->table_name; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_table_name, __pyx_t_2) < 0) __PYX_ERR(0, 977, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_table_name, __pyx_t_2) < 0) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":978 + /* "pyreadstat/_readstat_parser.pyx":993 * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges # <<<<<<<<<<<<<< @@ -10454,10 +10671,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->missing_ranges; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_missing_ranges, __pyx_t_2) < 0) __PYX_ERR(0, 978, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_missing_ranges, __pyx_t_2) < 0) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":979 + /* "pyreadstat/_readstat_parser.pyx":994 * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width # <<<<<<<<<<<<<< @@ -10466,10 +10683,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->variable_storage_width; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_storage_width, __pyx_t_2) < 0) __PYX_ERR(0, 979, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_storage_width, __pyx_t_2) < 0) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":980 + /* "pyreadstat/_readstat_parser.pyx":995 * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width # <<<<<<<<<<<<<< @@ -10478,10 +10695,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->variable_display_width; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_display_width, __pyx_t_2) < 0) __PYX_ERR(0, 980, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_display_width, __pyx_t_2) < 0) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":981 + /* "pyreadstat/_readstat_parser.pyx":996 * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment # <<<<<<<<<<<<<< @@ -10490,10 +10707,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->variable_alignment; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_alignment, __pyx_t_2) < 0) __PYX_ERR(0, 981, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_alignment, __pyx_t_2) < 0) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":982 + /* "pyreadstat/_readstat_parser.pyx":997 * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment * metadata.variable_measure = data.variable_measure # <<<<<<<<<<<<<< @@ -10502,10 +10719,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->variable_measure; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_measure, __pyx_t_2) < 0) __PYX_ERR(0, 982, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_n_s_variable_measure, __pyx_t_2) < 0) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":984 + /* "pyreadstat/_readstat_parser.pyx":999 * metadata.variable_measure = data.variable_measure * * return metadata # <<<<<<<<<<<<<< @@ -10517,7 +10734,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_r = __pyx_v_metadata; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":899 + /* "pyreadstat/_readstat_parser.pyx":914 * * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -10556,7 +10773,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":987 +/* "pyreadstat/_readstat_parser.pyx":1002 * * * cdef object run_conversion(object filename_path, py_file_format file_format, readstat_error_t parse_func(readstat_parser_t *parse, const char *, void *), # <<<<<<<<<<<<<< @@ -10597,21 +10814,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_RefNannySetupContext("run_conversion", 0); __Pyx_INCREF(__pyx_v_output_format); - /* "pyreadstat/_readstat_parser.pyx":1003 + /* "pyreadstat/_readstat_parser.pyx":1018 * cdef object data_frame * * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_bytes = os.fsencode(filename_path) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_fsencode); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_fsencode); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1004 + /* "pyreadstat/_readstat_parser.pyx":1019 * * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -10627,16 +10844,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1005 + /* "pyreadstat/_readstat_parser.pyx":1020 * if hasattr(os, 'fsencode'): * try: * filename_bytes = os.fsencode(filename_path) # <<<<<<<<<<<<<< * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L4_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1020, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1005, __pyx_L4_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1020, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -10651,14 +10868,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_filename_path) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filename_path); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L4_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1005, __pyx_L4_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1020, __pyx_L4_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1004 + /* "pyreadstat/_readstat_parser.pyx":1019 * * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -10675,7 +10892,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1006 + /* "pyreadstat/_readstat_parser.pyx":1021 * try: * filename_bytes = os.fsencode(filename_path) * except UnicodeError: # <<<<<<<<<<<<<< @@ -10685,26 +10902,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeError); if (__pyx_t_9) { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(0, 1006, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(0, 1021, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1007 + /* "pyreadstat/_readstat_parser.pyx":1022 * filename_bytes = os.fsencode(filename_path) * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) # <<<<<<<<<<<<<< * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_warnings); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1007, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_warnings); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1022, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_warn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1007, __pyx_L6_except_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_warn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1022, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_sys); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1007, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_sys); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1022, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1007, __pyx_L6_except_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1022, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; @@ -10719,10 +10936,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1007, __pyx_L6_except_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1022, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyString_FormatSafe(__pyx_kp_s_file_path_could_not_be_encoded_w, __pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1007, __pyx_L6_except_error) + __pyx_t_14 = __Pyx_PyString_FormatSafe(__pyx_kp_s_file_path_could_not_be_encoded_w, __pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1022, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -10738,21 +10955,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_t_14) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_14); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1007, __pyx_L6_except_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1022, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "pyreadstat/_readstat_parser.pyx":1008 + /* "pyreadstat/_readstat_parser.pyx":1023 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< * else: * IF PY_MAJOR_VERSION >2: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_os); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1008, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_os); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1023, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1008, __pyx_L6_except_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1023, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -10767,16 +10984,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_10 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_12, __pyx_v_filename_path) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_filename_path); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1008, __pyx_L6_except_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1023, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1008, __pyx_L6_except_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1023, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1008, __pyx_L6_except_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1023, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_10)->tp_name), 0))) __PYX_ERR(0, 1008, __pyx_L6_except_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_10)->tp_name), 0))) __PYX_ERR(0, 1023, __pyx_L6_except_error) __Pyx_XDECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10787,7 +11004,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "pyreadstat/_readstat_parser.pyx":1004 + /* "pyreadstat/_readstat_parser.pyx":1019 * * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -10807,7 +11024,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L9_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1003 + /* "pyreadstat/_readstat_parser.pyx":1018 * cdef object data_frame * * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< @@ -10817,7 +11034,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1011 + /* "pyreadstat/_readstat_parser.pyx":1026 * else: * IF PY_MAJOR_VERSION >2: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -10825,19 +11042,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * elif type(filename_path) == bytes: */ /*else*/ { - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1011, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1026, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1012 + /* "pyreadstat/_readstat_parser.pyx":1027 * IF PY_MAJOR_VERSION >2: * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< * elif type(filename_path) == bytes: * filename_bytes = filename_path */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -10851,14 +11068,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1012, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1012, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1027, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1011 + /* "pyreadstat/_readstat_parser.pyx":1026 * else: * IF PY_MAJOR_VERSION >2: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -10868,32 +11085,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L12; } - /* "pyreadstat/_readstat_parser.pyx":1013 + /* "pyreadstat/_readstat_parser.pyx":1028 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1013, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1013, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(__pyx_t_3)) { - /* "pyreadstat/_readstat_parser.pyx":1014 + /* "pyreadstat/_readstat_parser.pyx":1029 * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: * filename_bytes = filename_path # <<<<<<<<<<<<<< * else: * raise PyreadstatError("path must be either str or bytes") */ - if (!(likely(PyBytes_CheckExact(__pyx_v_filename_path))||((__pyx_v_filename_path) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename_path)->tp_name), 0))) __PYX_ERR(0, 1014, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_filename_path))||((__pyx_v_filename_path) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename_path)->tp_name), 0))) __PYX_ERR(0, 1029, __pyx_L1_error) __pyx_t_7 = __pyx_v_filename_path; __Pyx_INCREF(__pyx_t_7); __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1013 + /* "pyreadstat/_readstat_parser.pyx":1028 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< @@ -10903,7 +11120,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L12; } - /* "pyreadstat/_readstat_parser.pyx":1016 + /* "pyreadstat/_readstat_parser.pyx":1031 * filename_bytes = filename_path * else: * raise PyreadstatError("path must be either str or bytes") # <<<<<<<<<<<<<< @@ -10911,7 +11128,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if type(filename_path) not in (str, bytes, unicode): */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -10925,30 +11142,30 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_kp_s_path_must_be_either_str_or_bytes) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_path_must_be_either_str_or_bytes); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1016, __pyx_L1_error) + __PYX_ERR(0, 1031, __pyx_L1_error) } __pyx_L12:; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1023 + /* "pyreadstat/_readstat_parser.pyx":1038 * * * filename_bytes = os.path.expanduser(filename_bytes) # <<<<<<<<<<<<<< * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1023, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -10963,26 +11180,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_v_filename_bytes) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filename_bytes); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1023, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1023, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1024 + /* "pyreadstat/_readstat_parser.pyx":1039 * * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isfile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isfile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -10997,24 +11214,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_v_filename_bytes) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filename_bytes); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1024, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = ((!__pyx_t_3) != 0); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":1025 + /* "pyreadstat/_readstat_parser.pyx":1040 * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) # <<<<<<<<<<<<<< * * if output_format is None: */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_0_does_not_exist, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1025, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_0_does_not_exist, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { @@ -11028,7 +11245,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_14, __pyx_v_filename_path) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_filename_path); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -11044,14 +11261,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1025, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1025, __pyx_L1_error) + __PYX_ERR(0, 1040, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1024 + /* "pyreadstat/_readstat_parser.pyx":1039 * * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< @@ -11060,7 +11277,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1027 + /* "pyreadstat/_readstat_parser.pyx":1042 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -11071,7 +11288,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1028 + /* "pyreadstat/_readstat_parser.pyx":1043 * * if output_format is None: * output_format = 'pandas' # <<<<<<<<<<<<<< @@ -11081,7 +11298,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_n_s_pandas); __Pyx_DECREF_SET(__pyx_v_output_format, __pyx_n_s_pandas); - /* "pyreadstat/_readstat_parser.pyx":1027 + /* "pyreadstat/_readstat_parser.pyx":1042 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -11090,47 +11307,47 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1029 + /* "pyreadstat/_readstat_parser.pyx":1044 * if output_format is None: * output_format = 'pandas' * allowed_formats = {'pandas', 'dict'} # <<<<<<<<<<<<<< * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) */ - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_n_s_pandas) < 0) __PYX_ERR(0, 1029, __pyx_L1_error) - if (PySet_Add(__pyx_t_7, __pyx_n_s_dict) < 0) __PYX_ERR(0, 1029, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_n_s_pandas) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_n_s_dict) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) __pyx_v_allowed_formats = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1030 + /* "pyreadstat/_readstat_parser.pyx":1045 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * */ - __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":1031 + /* "pyreadstat/_readstat_parser.pyx":1046 * allowed_formats = {'pandas', 'dict'} * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) # <<<<<<<<<<<<<< * * */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_output_format_must_be_one_of_all, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_output_format_must_be_one_of_all, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_allowed_formats, __pyx_v_allowed_formats) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_output_format, __pyx_v_output_format) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1031, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_allowed_formats, __pyx_v_allowed_formats) < 0) __PYX_ERR(0, 1046, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_output_format, __pyx_v_output_format) < 0) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -11147,14 +11364,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_14) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_14); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1031, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1031, __pyx_L1_error) + __PYX_ERR(0, 1046, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1030 + /* "pyreadstat/_readstat_parser.pyx":1045 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< @@ -11163,7 +11380,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1034 + /* "pyreadstat/_readstat_parser.pyx":1049 * * * filename = filename_bytes # <<<<<<<<<<<<<< @@ -11172,24 +11389,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_filename_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 1034, __pyx_L1_error) + __PYX_ERR(0, 1049, __pyx_L1_error) } - __pyx_t_15 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L1_error) __pyx_v_filename = ((char *)__pyx_t_15); - /* "pyreadstat/_readstat_parser.pyx":1036 + /* "pyreadstat/_readstat_parser.pyx":1051 * filename = filename_bytes * * data = data_container() # <<<<<<<<<<<<<< * ctx = data * */ - __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_10pyreadstat_16_readstat_parser_data_container)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1036, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_10pyreadstat_16_readstat_parser_data_container)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_data = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1037 + /* "pyreadstat/_readstat_parser.pyx":1052 * * data = data_container() * ctx = data # <<<<<<<<<<<<<< @@ -11198,7 +11415,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":1039 + /* "pyreadstat/_readstat_parser.pyx":1054 * ctx = data * * data.file_format = file_format # <<<<<<<<<<<<<< @@ -11207,7 +11424,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->file_format = __pyx_v_file_format; - /* "pyreadstat/_readstat_parser.pyx":1040 + /* "pyreadstat/_readstat_parser.pyx":1055 * * data.file_format = file_format * data.metaonly = metaonly # <<<<<<<<<<<<<< @@ -11216,7 +11433,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->metaonly = __pyx_v_metaonly; - /* "pyreadstat/_readstat_parser.pyx":1041 + /* "pyreadstat/_readstat_parser.pyx":1056 * data.file_format = file_format * data.metaonly = metaonly * data.dates_as_pandas = dates_as_pandas # <<<<<<<<<<<<<< @@ -11225,17 +11442,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->dates_as_pandas = __pyx_v_dates_as_pandas; - /* "pyreadstat/_readstat_parser.pyx":1043 + /* "pyreadstat/_readstat_parser.pyx":1058 * data.dates_as_pandas = dates_as_pandas * * if encoding: # <<<<<<<<<<<<<< * data.user_encoding = encoding * */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1043, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1058, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":1044 + /* "pyreadstat/_readstat_parser.pyx":1059 * * if encoding: * data.user_encoding = encoding # <<<<<<<<<<<<<< @@ -11248,7 +11465,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->user_encoding); __pyx_v_data->user_encoding = __pyx_v_encoding; - /* "pyreadstat/_readstat_parser.pyx":1043 + /* "pyreadstat/_readstat_parser.pyx":1058 * data.dates_as_pandas = dates_as_pandas * * if encoding: # <<<<<<<<<<<<<< @@ -11257,7 +11474,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1046 + /* "pyreadstat/_readstat_parser.pyx":1061 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -11267,7 +11484,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1047 + /* "pyreadstat/_readstat_parser.pyx":1062 * * if file_format == FILE_FORMAT_SAS: * origin = sas_origin # <<<<<<<<<<<<<< @@ -11277,7 +11494,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_sas_origin; - /* "pyreadstat/_readstat_parser.pyx":1046 + /* "pyreadstat/_readstat_parser.pyx":1061 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -11287,7 +11504,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1049 + /* "pyreadstat/_readstat_parser.pyx":1064 * origin = sas_origin * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin # <<<<<<<<<<<<<< @@ -11297,7 +11514,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_spss_origin; - /* "pyreadstat/_readstat_parser.pyx":1048 + /* "pyreadstat/_readstat_parser.pyx":1063 * if file_format == FILE_FORMAT_SAS: * origin = sas_origin * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -11307,7 +11524,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1051 + /* "pyreadstat/_readstat_parser.pyx":1066 * origin = spss_origin * elif file_format == FILE_FORMAT_STATA: * origin = stata_origin # <<<<<<<<<<<<<< @@ -11317,7 +11534,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_stata_origin; - /* "pyreadstat/_readstat_parser.pyx":1050 + /* "pyreadstat/_readstat_parser.pyx":1065 * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -11327,14 +11544,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1053 + /* "pyreadstat/_readstat_parser.pyx":1068 * origin = stata_origin * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< * * data.origin = origin */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1053, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -11348,16 +11565,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_t_7 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_14, __pyx_kp_s_Unknown_file_format) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_Unknown_file_format); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1053, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 1053, __pyx_L1_error) + __PYX_ERR(0, 1068, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1055 + /* "pyreadstat/_readstat_parser.pyx":1070 * raise PyreadstatError("Unknown file format") * * data.origin = origin # <<<<<<<<<<<<<< @@ -11370,7 +11587,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->origin); __pyx_v_data->origin = __pyx_v_origin; - /* "pyreadstat/_readstat_parser.pyx":1057 + /* "pyreadstat/_readstat_parser.pyx":1072 * data.origin = origin * * if usecols is not None: # <<<<<<<<<<<<<< @@ -11381,7 +11598,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1058 + /* "pyreadstat/_readstat_parser.pyx":1073 * * if usecols is not None: * data.filter_cols = 1 # <<<<<<<<<<<<<< @@ -11390,7 +11607,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->filter_cols = 1; - /* "pyreadstat/_readstat_parser.pyx":1059 + /* "pyreadstat/_readstat_parser.pyx":1074 * if usecols is not None: * data.filter_cols = 1 * data.use_cols = usecols # <<<<<<<<<<<<<< @@ -11403,7 +11620,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->use_cols); __pyx_v_data->use_cols = __pyx_v_usecols; - /* "pyreadstat/_readstat_parser.pyx":1057 + /* "pyreadstat/_readstat_parser.pyx":1072 * data.origin = origin * * if usecols is not None: # <<<<<<<<<<<<<< @@ -11412,7 +11629,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1061 + /* "pyreadstat/_readstat_parser.pyx":1076 * data.use_cols = usecols * * data.usernan = usernan # <<<<<<<<<<<<<< @@ -11421,7 +11638,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->usernan = __pyx_v_usernan; - /* "pyreadstat/_readstat_parser.pyx":1062 + /* "pyreadstat/_readstat_parser.pyx":1077 * * data.usernan = usernan * data.no_datetime_conversion = no_datetime_conversion # <<<<<<<<<<<<<< @@ -11430,39 +11647,39 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->no_datetime_conversion = __pyx_v_no_datetime_conversion; - /* "pyreadstat/_readstat_parser.pyx":1065 + /* "pyreadstat/_readstat_parser.pyx":1080 * * # go! * run_readstat_parser(filename, data, parse_func, row_limit, row_offset) # <<<<<<<<<<<<<< * data_dict = data_container_to_dict(data) * if output_format == 'dict': */ - __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_parse_func, __pyx_v_row_limit, __pyx_v_row_offset); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1065, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_parse_func, __pyx_v_row_limit, __pyx_v_row_offset); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1066 + /* "pyreadstat/_readstat_parser.pyx":1081 * # go! * run_readstat_parser(filename, data, parse_func, row_limit, row_offset) * data_dict = data_container_to_dict(data) # <<<<<<<<<<<<<< * if output_format == 'dict': * data_frame = data_dict */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_data_dict = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1067 + /* "pyreadstat/_readstat_parser.pyx":1082 * run_readstat_parser(filename, data, parse_func, row_limit, row_offset) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< * data_frame = data_dict * elif output_format == 'pandas': */ - __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_output_format, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_output_format, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1082, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":1068 + /* "pyreadstat/_readstat_parser.pyx":1083 * data_dict = data_container_to_dict(data) * if output_format == 'dict': * data_frame = data_dict # <<<<<<<<<<<<<< @@ -11472,7 +11689,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_data_dict); __pyx_v_data_frame = __pyx_v_data_dict; - /* "pyreadstat/_readstat_parser.pyx":1067 + /* "pyreadstat/_readstat_parser.pyx":1082 * run_readstat_parser(filename, data, parse_func, row_limit, row_offset) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< @@ -11482,30 +11699,30 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L18; } - /* "pyreadstat/_readstat_parser.pyx":1069 + /* "pyreadstat/_readstat_parser.pyx":1084 * if output_format == 'dict': * data_frame = data_dict * elif output_format == 'pandas': # <<<<<<<<<<<<<< * data_frame = dict_to_pandas_dataframe(data_dict) * metadata = data_container_extract_metadata(data) */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_output_format, __pyx_n_s_pandas, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1069, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_output_format, __pyx_n_s_pandas, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1084, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1070 + /* "pyreadstat/_readstat_parser.pyx":1085 * data_frame = data_dict * elif output_format == 'pandas': * data_frame = dict_to_pandas_dataframe(data_dict) # <<<<<<<<<<<<<< * metadata = data_container_extract_metadata(data) * */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_dataframe(__pyx_v_data_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_pandas_dataframe(__pyx_v_data_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_data_frame = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1069 + /* "pyreadstat/_readstat_parser.pyx":1084 * if output_format == 'dict': * data_frame = data_dict * elif output_format == 'pandas': # <<<<<<<<<<<<<< @@ -11515,27 +11732,27 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } __pyx_L18:; - /* "pyreadstat/_readstat_parser.pyx":1071 + /* "pyreadstat/_readstat_parser.pyx":1086 * elif output_format == 'pandas': * data_frame = dict_to_pandas_dataframe(data_dict) * metadata = data_container_extract_metadata(data) # <<<<<<<<<<<<<< * * return data_frame, metadata */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1071, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_metadata = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1073 + /* "pyreadstat/_readstat_parser.pyx":1088 * metadata = data_container_extract_metadata(data) * * return data_frame, metadata # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_data_frame)) { __Pyx_RaiseUnboundLocalError("data_frame"); __PYX_ERR(0, 1073, __pyx_L1_error) } - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1073, __pyx_L1_error) + if (unlikely(!__pyx_v_data_frame)) { __Pyx_RaiseUnboundLocalError("data_frame"); __PYX_ERR(0, 1088, __pyx_L1_error) } + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_data_frame); __Pyx_GIVEREF(__pyx_v_data_frame); @@ -11547,7 +11764,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":987 + /* "pyreadstat/_readstat_parser.pyx":1002 * * * cdef object run_conversion(object filename_path, py_file_format file_format, readstat_error_t parse_func(readstat_parser_t *parse, const char *, void *), # <<<<<<<<<<<<<< @@ -13027,6 +13244,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_kp_s_column_0_is_duplicated_renamed_t, __pyx_k_column_0_is_duplicated_renamed_t, sizeof(__pyx_k_column_0_is_duplicated_renamed_t), 0, 0, 1, 0}, {&__pyx_n_s_column_labels, __pyx_k_column_labels, sizeof(__pyx_k_column_labels), 0, 0, 1, 1}, {&__pyx_n_s_column_names, __pyx_k_column_names, sizeof(__pyx_k_column_names), 0, 0, 1, 1}, {&__pyx_n_s_column_names_to_labels, __pyx_k_column_names_to_labels, sizeof(__pyx_k_column_names_to_labels), 0, 0, 1, 1}, @@ -13038,6 +13256,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_duplicated, __pyx_k_duplicated, sizeof(__pyx_k_duplicated), 0, 0, 1, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_expanduser, __pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 0, 1, 1}, @@ -13155,10 +13374,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 64, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 502, __pyx_L1_error) - __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 624, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 969, __pyx_L1_error) - __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 984, __pyx_L1_error) + __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 1021, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -13187,58 +13406,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "pyreadstat/_readstat_parser.pyx":489 + /* "pyreadstat/_readstat_parser.pyx":504 * # pre-allocate data * if metaonly: * row = np.empty(1, dtype=curnptype) # <<<<<<<<<<<<<< * else: * obs_count = dc.n_obs */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "pyreadstat/_readstat_parser.pyx":590 + /* "pyreadstat/_readstat_parser.pyx":605 * if var_max_rows <= obs_index: * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) # <<<<<<<<<<<<<< * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_100000); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_100000); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "pyreadstat/_readstat_parser.pyx":610 + /* "pyreadstat/_readstat_parser.pyx":625 * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "pyreadstat/_readstat_parser.pyx":630 + /* "pyreadstat/_readstat_parser.pyx":645 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "pyreadstat/_readstat_parser.pyx":1008 + /* "pyreadstat/_readstat_parser.pyx":1023 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< * else: * IF PY_MAJOR_VERSION >2: */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_s_utf_8, __pyx_n_s_surrogateescape); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1008, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_s_utf_8, __pyx_n_s_surrogateescape); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); diff --git a/pyreadstat/_readstat_parser.pyx b/pyreadstat/_readstat_parser.pyx index 8f30242..57c658a 100644 --- a/pyreadstat/_readstat_parser.pyx +++ b/pyreadstat/_readstat_parser.pyx @@ -422,6 +422,8 @@ cdef int handle_variable(int index, readstat_variable_t *variable, cdef int obs_count cdef bint iscurnptypefloat cdef bint iscurnptypeobject + cdef str newcolname + cdef int dupcolcnt cdef data_container dc = ctx @@ -439,6 +441,19 @@ cdef int handle_variable(int index, readstat_variable_t *variable, index = readstat_variable_get_index_after_skipping(variable) + if col_name in dc.col_names: + dupcolcnt = 1 + while True: + newcolname = col_name + "_duplicated" + str(dupcolcnt) + if newcolname in col_name: + dupcolcnt += 1 + continue + else: + msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) + warnings.warn(msg) + col_name = newcolname + break + dc.col_names.append(col_name) # the name of the value label for the variable diff --git a/pyreadstat/_readstat_writer.c b/pyreadstat/_readstat_writer.c index 0505afc..e3dde31 100644 --- a/pyreadstat/_readstat_writer.c +++ b/pyreadstat/_readstat_writer.c @@ -1808,6 +1808,7 @@ static const char __pyx_k_length_of_column_labels_must_be[] = "length of column static const char __pyx_k_missing_ranges_hi_and_lo_values[] = "missing_ranges: hi and lo values must be both the same for string type"; static const char __pyx_k_missing_user_values_not_allowed[] = "missing_user_values not allowed for character variable %s"; static const char __pyx_k_variable_value_labels_value_for[] = "variable_value_labels: value for key %s must be dict, got %s"; +static const char __pyx_k_Non_unique_column_names_detected[] = "Non unique column names detected in the dataframe!"; static const char __pyx_k_Unknown_pywriter_variable_format[] = "Unknown pywriter variable format"; static const char __pyx_k_alignment_for_variable_s_must_be[] = "alignment for variable %s must be either right, center, left or unknown got %s instead"; static const char __pyx_k_character_missing_ranges_value_g[] = "character missing_ranges value given for non character variable %s"; @@ -1845,6 +1846,7 @@ static PyObject *__pyx_n_s_Int32Dtype; static PyObject *__pyx_n_s_Int64Dtype; static PyObject *__pyx_n_s_Int8Dtype; static PyObject *__pyx_kp_s_M8_ns; +static PyObject *__pyx_kp_s_Non_unique_column_names_detected; static PyObject *__pyx_n_s_PyreadstatError; static PyObject *__pyx_n_s_ReadstatError; static PyObject *__pyx_n_s_Timestamp; @@ -9803,8 +9805,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * cdef char *file_labl * * cdef list col_names = df.columns.values.tolist() # <<<<<<<<<<<<<< - * - * for variable_name in col_names: + * if len(col_names) != len(set(col_names)): + * msg = "Non unique column names detected in the dataframe!" */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9833,8 +9835,74 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_v_col_names = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":598 + /* "pyreadstat/_readstat_writer.pyx":597 + * + * cdef list col_names = df.columns.values.tolist() + * if len(col_names) != len(set(col_names)): # <<<<<<<<<<<<<< + * msg = "Non unique column names detected in the dataframe!" + * raise PyreadstatError(msg) + */ + if (unlikely(__pyx_v_col_names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 597, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = PySet_New(__pyx_v_col_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PySet_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((__pyx_t_6 != __pyx_t_11) != 0); + if (unlikely(__pyx_t_4)) { + + /* "pyreadstat/_readstat_writer.pyx":598 + * cdef list col_names = df.columns.values.tolist() + * if len(col_names) != len(set(col_names)): + * msg = "Non unique column names detected in the dataframe!" # <<<<<<<<<<<<<< + * raise PyreadstatError(msg) + * + */ + __Pyx_INCREF(__pyx_kp_s_Non_unique_column_names_detected); + __pyx_v_msg = __pyx_kp_s_Non_unique_column_names_detected; + + /* "pyreadstat/_readstat_writer.pyx":599 + * if len(col_names) != len(set(col_names)): + * msg = "Non unique column names detected in the dataframe!" + * raise PyreadstatError(msg) # <<<<<<<<<<<<<< + * + * for variable_name in col_names: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_msg); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 599, __pyx_L1_error) + + /* "pyreadstat/_readstat_writer.pyx":597 + * * cdef list col_names = df.columns.values.tolist() + * if len(col_names) != len(set(col_names)): # <<<<<<<<<<<<<< + * msg = "Non unique column names detected in the dataframe!" + * raise PyreadstatError(msg) + */ + } + + /* "pyreadstat/_readstat_writer.pyx":601 + * raise PyreadstatError(msg) * * for variable_name in col_names: # <<<<<<<<<<<<<< * if type(variable_name) != str: @@ -9842,44 +9910,44 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 598, __pyx_L1_error) + __PYX_ERR(0, 601, __pyx_L1_error) } - __pyx_t_2 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_2 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0; for (;;) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 601, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":599 + /* "pyreadstat/_readstat_writer.pyx":602 * * for variable_name in col_names: * if type(variable_name) != str: # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":600 + /* "pyreadstat/_readstat_writer.pyx":603 * for variable_name in col_names: * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) # <<<<<<<<<<<<<< * if not variable_name[0].isalpha(): * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_variable_name); __Pyx_GIVEREF(__pyx_v_variable_name); @@ -9887,7 +9955,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_is_of_type_s_and, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_is_of_type_s_and, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -9903,14 +9971,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 600, __pyx_L1_error) + __PYX_ERR(0, 603, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":599 + /* "pyreadstat/_readstat_writer.pyx":602 * * for variable_name in col_names: * if type(variable_name) != str: # <<<<<<<<<<<<<< @@ -9919,16 +9987,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":601 + /* "pyreadstat/_readstat_writer.pyx":604 * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isalpha); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isalpha); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -9943,32 +10011,32 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_4) != 0); if (unlikely(__pyx_t_3)) { - /* "pyreadstat/_readstat_writer.pyx":602 + /* "pyreadstat/_readstat_writer.pyx":605 * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) # <<<<<<<<<<<<<< * if " " in variable_name: * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_t_9); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_t_9); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_variable_name); __Pyx_GIVEREF(__pyx_v_variable_name); @@ -9979,7 +10047,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_starts_with_an_i, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_starts_with_an_i, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; @@ -9995,14 +10063,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 602, __pyx_L1_error) + __PYX_ERR(0, 605, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":601 + /* "pyreadstat/_readstat_writer.pyx":604 * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): # <<<<<<<<<<<<<< @@ -10011,27 +10079,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":603 + /* "pyreadstat/_readstat_writer.pyx":606 * if not variable_name[0].isalpha(): * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * */ - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__2, __pyx_v_variable_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__2, __pyx_v_variable_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 606, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":604 + /* "pyreadstat/_readstat_writer.pyx":607 * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) # <<<<<<<<<<<<<< * * if file_format == FILE_FORMAT_POR: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyString_FormatSafe(__pyx_kp_s_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_FormatSafe(__pyx_kp_s_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -10046,14 +10114,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 604, __pyx_L1_error) + __PYX_ERR(0, 607, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":603 + /* "pyreadstat/_readstat_writer.pyx":606 * if not variable_name[0].isalpha(): * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: # <<<<<<<<<<<<<< @@ -10062,8 +10130,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":598 - * cdef list col_names = df.columns.values.tolist() + /* "pyreadstat/_readstat_writer.pyx":601 + * raise PyreadstatError(msg) * * for variable_name in col_names: # <<<<<<<<<<<<<< * if type(variable_name) != str: @@ -10072,7 +10140,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":606 + /* "pyreadstat/_readstat_writer.pyx":609 * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -10082,31 +10150,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = ((__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR) != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":607 + /* "pyreadstat/_readstat_writer.pyx":610 * * if file_format == FILE_FORMAT_POR: * col_names = [x.upper() for x in col_names] # <<<<<<<<<<<<<< * * cdef list col_types = get_pandas_column_types(df, missing_user_values, variable_value_labels) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 607, __pyx_L1_error) + __PYX_ERR(0, 610, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; + __pyx_t_1 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = 0; for (;;) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 610, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { @@ -10120,17 +10188,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 607, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_col_names, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":606 + /* "pyreadstat/_readstat_writer.pyx":609 * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -10139,29 +10207,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":609 + /* "pyreadstat/_readstat_writer.pyx":612 * col_names = [x.upper() for x in col_names] * * cdef list col_types = get_pandas_column_types(df, missing_user_values, variable_value_labels) # <<<<<<<<<<<<<< * cdef int row_count = len(df) * cdef int col_count = len(col_names) */ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types(__pyx_v_df, __pyx_v_missing_user_values, __pyx_v_variable_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types(__pyx_v_df, __pyx_v_missing_user_values, __pyx_v_variable_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_col_types = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":610 + /* "pyreadstat/_readstat_writer.pyx":613 * * cdef list col_types = get_pandas_column_types(df, missing_user_values, variable_value_labels) * cdef int row_count = len(df) # <<<<<<<<<<<<<< * cdef int col_count = len(col_names) * cdef dict col_names_to_types = {k:v[0] for k,v in zip(col_names, col_types)} */ - __pyx_t_6 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 610, __pyx_L1_error) - __pyx_v_row_count = __pyx_t_6; + __pyx_t_11 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_v_row_count = __pyx_t_11; - /* "pyreadstat/_readstat_writer.pyx":611 + /* "pyreadstat/_readstat_writer.pyx":614 * cdef list col_types = get_pandas_column_types(df, missing_user_values, variable_value_labels) * cdef int row_count = len(df) * cdef int col_count = len(col_names) # <<<<<<<<<<<<<< @@ -10170,12 +10238,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 611, __pyx_L1_error) + __PYX_ERR(0, 614, __pyx_L1_error) } - __pyx_t_6 = PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 611, __pyx_L1_error) - __pyx_v_col_count = __pyx_t_6; + __pyx_t_11 = PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_v_col_count = __pyx_t_11; - /* "pyreadstat/_readstat_writer.pyx":612 + /* "pyreadstat/_readstat_writer.pyx":615 * cdef int row_count = len(df) * cdef int col_count = len(col_names) * cdef dict col_names_to_types = {k:v[0] for k,v in zip(col_names, col_types)} # <<<<<<<<<<<<<< @@ -10183,9 +10251,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * cdef readstat_variable_t *variable */ { /* enter inner scope */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_col_names); __Pyx_GIVEREF(__pyx_v_col_names); @@ -10193,34 +10261,34 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_col_types); __Pyx_GIVEREF(__pyx_v_col_types); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_col_types); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { - __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; + __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L30_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L30_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L30_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -10230,7 +10298,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 612, __pyx_L29_error) + else __PYX_ERR(0, 615, __pyx_L30_error) } break; } @@ -10242,7 +10310,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 612, __pyx_L29_error) + __PYX_ERR(0, 615, __pyx_L30_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -10255,56 +10323,56 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_14); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_14); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_9 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L32_unpacking_failed; + index = 0; __pyx_t_9 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L33_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - index = 1; __pyx_t_14 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_14)) goto __pyx_L32_unpacking_failed; + index = 1; __pyx_t_14 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_14)) goto __pyx_L33_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 612, __pyx_L29_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 615, __pyx_L30_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L33_unpacking_done; - __pyx_L32_unpacking_failed:; + goto __pyx_L34_unpacking_done; + __pyx_L33_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 612, __pyx_L29_error) - __pyx_L33_unpacking_done:; + __PYX_ERR(0, 615, __pyx_L30_error) + __pyx_L34_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_14); __pyx_t_14 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L29_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 612, __pyx_L29_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 615, __pyx_L30_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0; - goto __pyx_L34_exit_scope; - __pyx_L29_error:; + goto __pyx_L35_exit_scope; + __pyx_L30_error:; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0; goto __pyx_L1_error; - __pyx_L34_exit_scope:; + __pyx_L35_exit_scope:; } /* exit inner scope */ __pyx_v_col_names_to_types = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":621 + /* "pyreadstat/_readstat_writer.pyx":624 * cdef int col_indx * cdef bytes cur_col_label * cdef int col_label_count = 0 # <<<<<<<<<<<<<< @@ -10313,7 +10381,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_col_label_count = 0; - /* "pyreadstat/_readstat_writer.pyx":630 + /* "pyreadstat/_readstat_writer.pyx":633 * cdef object values * cdef dict value_labels * cdef int lblset_cnt = 0 # <<<<<<<<<<<<<< @@ -10322,21 +10390,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_lblset_cnt = 0; - /* "pyreadstat/_readstat_writer.pyx":634 + /* "pyreadstat/_readstat_writer.pyx":637 * cdef list col_label_temp * * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_path = os.fsencode(filename_path) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_fsencode); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_fsencode); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":638 * * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -10352,16 +10420,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { - /* "pyreadstat/_readstat_writer.pyx":636 + /* "pyreadstat/_readstat_writer.pyx":639 * if hasattr(os, 'fsencode'): * try: * filename_path = os.fsencode(filename_path) # <<<<<<<<<<<<<< * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L36_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 636, __pyx_L36_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fsencode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -10376,13 +10444,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_filename_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename_path); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L36_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L37_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_filename_path, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":638 * * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -10393,8 +10461,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; - goto __pyx_L41_try_end; - __pyx_L36_error:; + goto __pyx_L42_try_end; + __pyx_L37_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -10402,7 +10470,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":637 + /* "pyreadstat/_readstat_writer.pyx":640 * try: * filename_path = os.fsencode(filename_path) * except UnicodeError: # <<<<<<<<<<<<<< @@ -10412,26 +10480,26 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_18 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeError); if (__pyx_t_18) { __Pyx_AddTraceback("pyreadstat._readstat_writer.run_write", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 637, __pyx_L38_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 640, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); - /* "pyreadstat/_readstat_writer.pyx":638 + /* "pyreadstat/_readstat_writer.pyx":641 * filename_path = os.fsencode(filename_path) * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) # <<<<<<<<<<<<<< * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_warnings); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L38_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_warnings); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 641, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_warn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 638, __pyx_L38_except_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_warn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_sys); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 638, __pyx_L38_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_sys); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 641, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 638, __pyx_L38_except_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = NULL; @@ -10446,10 +10514,10 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_9 = (__pyx_t_19) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19) : __Pyx_PyObject_CallNoArg(__pyx_t_20); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L38_except_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 641, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyString_FormatSafe(__pyx_kp_s_file_path_could_not_be_encoded_w, __pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 638, __pyx_L38_except_error) + __pyx_t_20 = __Pyx_PyString_FormatSafe(__pyx_kp_s_file_path_could_not_be_encoded_w, __pyx_t_9); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -10465,21 +10533,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_14 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_20) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_20); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L38_except_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 641, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":639 + /* "pyreadstat/_readstat_writer.pyx":642 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< * else: * IF PY_MAJOR_VERSION >2: */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 639, __pyx_L38_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 642, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 639, __pyx_L38_except_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_fsdecode); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 642, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -10494,13 +10562,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_14 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_8, __pyx_v_filename_path) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_v_filename_path); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 639, __pyx_L38_except_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 642, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_encode); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 639, __pyx_L38_except_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_encode); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 642, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 639, __pyx_L38_except_error) + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 642, __pyx_L39_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_v_filename_bytes = __pyx_t_14; @@ -10508,12 +10576,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L37_exception_handled; + goto __pyx_L38_exception_handled; } - goto __pyx_L38_except_error; - __pyx_L38_except_error:; + goto __pyx_L39_except_error; + __pyx_L39_except_error:; - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":638 * * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -10525,25 +10593,25 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L1_error; - __pyx_L37_exception_handled:; + __pyx_L38_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); - __pyx_L41_try_end:; + __pyx_L42_try_end:; } - /* "pyreadstat/_readstat_writer.pyx":634 + /* "pyreadstat/_readstat_writer.pyx":637 * cdef list col_label_temp * * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_path = os.fsencode(filename_path) */ - goto __pyx_L35; + goto __pyx_L36; } - /* "pyreadstat/_readstat_writer.pyx":642 + /* "pyreadstat/_readstat_writer.pyx":645 * else: * IF PY_MAJOR_VERSION >2: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -10551,19 +10619,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * elif type(filename_path) == bytes: */ /*else*/ { - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":643 + /* "pyreadstat/_readstat_writer.pyx":646 * IF PY_MAJOR_VERSION >2: * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< * elif type(filename_path) == bytes: * filename_bytes = filename_path */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -10577,35 +10645,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_filename_bytes = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":642 + /* "pyreadstat/_readstat_writer.pyx":645 * else: * IF PY_MAJOR_VERSION >2: * if type(filename_path) == str: # <<<<<<<<<<<<<< * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: */ - goto __pyx_L44; + goto __pyx_L45; } - /* "pyreadstat/_readstat_writer.pyx":644 + /* "pyreadstat/_readstat_writer.pyx":647 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { - /* "pyreadstat/_readstat_writer.pyx":645 + /* "pyreadstat/_readstat_writer.pyx":648 * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: * filename_bytes = filename_path # <<<<<<<<<<<<<< @@ -10615,17 +10683,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_filename_path); __pyx_v_filename_bytes = __pyx_v_filename_path; - /* "pyreadstat/_readstat_writer.pyx":644 + /* "pyreadstat/_readstat_writer.pyx":647 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - goto __pyx_L44; + goto __pyx_L45; } - /* "pyreadstat/_readstat_writer.pyx":647 + /* "pyreadstat/_readstat_writer.pyx":650 * filename_bytes = filename_path * else: * raise PyreadstatError("path must be either str or bytes") # <<<<<<<<<<<<<< @@ -10633,7 +10701,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if type(filename_path) not in (str, bytes, unicode): */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -10647,30 +10715,30 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_kp_s_path_must_be_either_str_or_bytes) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_path_must_be_either_str_or_bytes); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 647, __pyx_L1_error) + __PYX_ERR(0, 650, __pyx_L1_error) } - __pyx_L44:; + __pyx_L45:; } - __pyx_L35:; + __pyx_L36:; - /* "pyreadstat/_readstat_writer.pyx":653 + /* "pyreadstat/_readstat_writer.pyx":656 * filename_bytes = filename_path.encode('utf-8') * * filename_path = os.path.expanduser(filename_path) # <<<<<<<<<<<<<< * cdef int fd = open_file(filename_path) * writer = readstat_writer_init() */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10685,23 +10753,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_filename_path) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename_path); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_filename_path, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":654 + /* "pyreadstat/_readstat_writer.pyx":657 * * filename_path = os.path.expanduser(filename_path) * cdef int fd = open_file(filename_path) # <<<<<<<<<<<<<< * writer = readstat_writer_init() * */ - if (!(likely(PyBytes_CheckExact(__pyx_v_filename_path))||((__pyx_v_filename_path) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename_path)->tp_name), 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v_filename_path))||((__pyx_v_filename_path) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename_path)->tp_name), 0))) __PYX_ERR(0, 657, __pyx_L1_error) __pyx_v_fd = __pyx_f_10pyreadstat_16_readstat_writer_open_file(((PyObject*)__pyx_v_filename_path)); - /* "pyreadstat/_readstat_writer.pyx":655 + /* "pyreadstat/_readstat_writer.pyx":658 * filename_path = os.path.expanduser(filename_path) * cdef int fd = open_file(filename_path) * writer = readstat_writer_init() # <<<<<<<<<<<<<< @@ -10710,7 +10778,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_writer = readstat_writer_init(); - /* "pyreadstat/_readstat_writer.pyx":657 + /* "pyreadstat/_readstat_writer.pyx":660 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -10727,39 +10795,39 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { - /* "pyreadstat/_readstat_writer.pyx":659 + /* "pyreadstat/_readstat_writer.pyx":662 * try: * * check_exit_status(readstat_set_data_writer(writer, write_bytes)) # <<<<<<<<<<<<<< * * if file_label: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_data_writer(__pyx_v_writer, __pyx_f_10pyreadstat_16_readstat_writer_write_bytes)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_data_writer(__pyx_v_writer, __pyx_f_10pyreadstat_16_readstat_writer_write_bytes)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":661 + /* "pyreadstat/_readstat_writer.pyx":664 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) * * if file_label: # <<<<<<<<<<<<<< * file_label_bytes = file_label.encode("utf-8") * file_labl = file_label_bytes */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_file_label); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 661, __pyx_L48_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_file_label); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 664, __pyx_L49_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":662 + /* "pyreadstat/_readstat_writer.pyx":665 * * if file_label: * file_label_bytes = file_label.encode("utf-8") # <<<<<<<<<<<<<< * file_labl = file_label_bytes * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) */ - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_file_label, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L48_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_file_label, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 662, __pyx_L48_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 665, __pyx_L49_error) __pyx_v_file_label_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":663 + /* "pyreadstat/_readstat_writer.pyx":666 * if file_label: * file_label_bytes = file_label.encode("utf-8") * file_labl = file_label_bytes # <<<<<<<<<<<<<< @@ -10768,21 +10836,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_file_label_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 663, __pyx_L48_error) + __PYX_ERR(0, 666, __pyx_L49_error) } - __pyx_t_21 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 663, __pyx_L48_error) + __pyx_t_21 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L49_error) __pyx_v_file_labl = ((char *)__pyx_t_21); - /* "pyreadstat/_readstat_writer.pyx":664 + /* "pyreadstat/_readstat_writer.pyx":667 * file_label_bytes = file_label.encode("utf-8") * file_labl = file_label_bytes * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) # <<<<<<<<<<<<<< * * if note: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_label(__pyx_v_writer, __pyx_v_file_labl)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_label(__pyx_v_writer, __pyx_v_file_labl)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":661 + /* "pyreadstat/_readstat_writer.pyx":664 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) * * if file_label: # <<<<<<<<<<<<<< @@ -10791,30 +10859,30 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":666 + /* "pyreadstat/_readstat_writer.pyx":669 * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) * * if note: # <<<<<<<<<<<<<< * readstat_add_note(writer, note.encode("utf-8")) * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 666, __pyx_L48_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 669, __pyx_L49_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":667 + /* "pyreadstat/_readstat_writer.pyx":670 * * if note: * readstat_add_note(writer, note.encode("utf-8")) # <<<<<<<<<<<<<< * * if file_format_version > -1: */ - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_note, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L48_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_note, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L48_error) + __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L49_error) readstat_add_note(__pyx_v_writer, __pyx_t_22); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":666 + /* "pyreadstat/_readstat_writer.pyx":669 * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) * * if note: # <<<<<<<<<<<<<< @@ -10823,7 +10891,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":669 + /* "pyreadstat/_readstat_writer.pyx":672 * readstat_add_note(writer, note.encode("utf-8")) * * if file_format_version > -1: # <<<<<<<<<<<<<< @@ -10833,16 +10901,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((__pyx_v_file_format_version > -1L) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":670 + /* "pyreadstat/_readstat_writer.pyx":673 * * if file_format_version > -1: * check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) # <<<<<<<<<<<<<< * * if row_compression: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_format_version(__pyx_v_writer, __pyx_v_file_format_version)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 670, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_format_version(__pyx_v_writer, __pyx_v_file_format_version)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":669 + /* "pyreadstat/_readstat_writer.pyx":672 * readstat_add_note(writer, note.encode("utf-8")) * * if file_format_version > -1: # <<<<<<<<<<<<<< @@ -10851,7 +10919,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":672 + /* "pyreadstat/_readstat_writer.pyx":675 * check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) * * if row_compression: # <<<<<<<<<<<<<< @@ -10861,16 +10929,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = (__pyx_v_row_compression != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":673 + /* "pyreadstat/_readstat_writer.pyx":676 * * if row_compression: * check_exit_status(readstat_writer_set_compression(writer, READSTAT_COMPRESS_ROWS)) # <<<<<<<<<<<<<< * * # table name is used only for xpt files */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_compression(__pyx_v_writer, READSTAT_COMPRESS_ROWS)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_compression(__pyx_v_writer, READSTAT_COMPRESS_ROWS)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":672 + /* "pyreadstat/_readstat_writer.pyx":675 * check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) * * if row_compression: # <<<<<<<<<<<<<< @@ -10879,48 +10947,48 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":679 * * # table name is used only for xpt files * if table_name: # <<<<<<<<<<<<<< * table_name_bytes = table_name.encode("utf-8") * tab_name = table_name_bytes */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_table_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 676, __pyx_L48_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_table_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 679, __pyx_L49_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":677 + /* "pyreadstat/_readstat_writer.pyx":680 * # table name is used only for xpt files * if table_name: * table_name_bytes = table_name.encode("utf-8") # <<<<<<<<<<<<<< * tab_name = table_name_bytes * check_exit_status(readstat_writer_set_table_name(writer, tab_name)) */ - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_table_name, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L48_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_table_name, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_table_name_bytes = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":678 + /* "pyreadstat/_readstat_writer.pyx":681 * if table_name: * table_name_bytes = table_name.encode("utf-8") * tab_name = table_name_bytes # <<<<<<<<<<<<<< * check_exit_status(readstat_writer_set_table_name(writer, tab_name)) * */ - __pyx_t_21 = __Pyx_PyObject_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L48_error) + __pyx_t_21 = __Pyx_PyObject_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L49_error) __pyx_v_tab_name = ((char *)__pyx_t_21); - /* "pyreadstat/_readstat_writer.pyx":679 + /* "pyreadstat/_readstat_writer.pyx":682 * table_name_bytes = table_name.encode("utf-8") * tab_name = table_name_bytes * check_exit_status(readstat_writer_set_table_name(writer, tab_name)) # <<<<<<<<<<<<<< * * # add variables */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_table_name(__pyx_v_writer, __pyx_v_tab_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_table_name(__pyx_v_writer, __pyx_v_tab_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":679 * * # table name is used only for xpt files * if table_name: # <<<<<<<<<<<<<< @@ -10929,46 +10997,46 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":682 + /* "pyreadstat/_readstat_writer.pyx":685 * * # add variables * if column_labels: # <<<<<<<<<<<<<< * if type(column_labels) != list and type(column_labels) != dict: * raise PyreadstatError("column_labels must be either list or dict!") */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_column_labels); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 682, __pyx_L48_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_column_labels); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 685, __pyx_L49_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":683 + /* "pyreadstat/_readstat_writer.pyx":686 * # add variables * if column_labels: * if type(column_labels) != list and type(column_labels) != dict: # <<<<<<<<<<<<<< * raise PyreadstatError("column_labels must be either list or dict!") * if type(column_labels) == dict: */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyList_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L48_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 683, __pyx_L48_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyList_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L49_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 686, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; - goto __pyx_L61_bool_binop_done; + goto __pyx_L62_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L48_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 683, __pyx_L48_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L49_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 686, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_4; - __pyx_L61_bool_binop_done:; + __pyx_L62_bool_binop_done:; if (unlikely(__pyx_t_3)) { - /* "pyreadstat/_readstat_writer.pyx":684 + /* "pyreadstat/_readstat_writer.pyx":687 * if column_labels: * if type(column_labels) != list and type(column_labels) != dict: * raise PyreadstatError("column_labels must be either list or dict!") # <<<<<<<<<<<<<< * if type(column_labels) == dict: * col_label_temp = list() */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L48_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 687, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -10982,14 +11050,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_kp_s_column_labels_must_be_either_lis) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_column_labels_must_be_either_lis); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L48_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 684, __pyx_L48_error) + __PYX_ERR(0, 687, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":683 + /* "pyreadstat/_readstat_writer.pyx":686 * # add variables * if column_labels: * if type(column_labels) != list and type(column_labels) != dict: # <<<<<<<<<<<<<< @@ -10998,31 +11066,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":685 + /* "pyreadstat/_readstat_writer.pyx":688 * if type(column_labels) != list and type(column_labels) != dict: * raise PyreadstatError("column_labels must be either list or dict!") * if type(column_labels) == dict: # <<<<<<<<<<<<<< * col_label_temp = list() * for col_indx in range(col_count): */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L48_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 685, __pyx_L48_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_column_labels)), ((PyObject *)(&PyDict_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L49_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 688, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":686 + /* "pyreadstat/_readstat_writer.pyx":689 * raise PyreadstatError("column_labels must be either list or dict!") * if type(column_labels) == dict: * col_label_temp = list() # <<<<<<<<<<<<<< * for col_indx in range(col_count): * variable_name = col_names[col_indx] */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L48_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_col_label_temp = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":687 + /* "pyreadstat/_readstat_writer.pyx":690 * if type(column_labels) == dict: * col_label_temp = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -11034,7 +11102,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { __pyx_v_col_indx = __pyx_t_24; - /* "pyreadstat/_readstat_writer.pyx":688 + /* "pyreadstat/_readstat_writer.pyx":691 * col_label_temp = list() * for col_indx in range(col_count): * variable_name = col_names[col_indx] # <<<<<<<<<<<<<< @@ -11043,21 +11111,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 688, __pyx_L48_error) + __PYX_ERR(0, 691, __pyx_L49_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":689 + /* "pyreadstat/_readstat_writer.pyx":692 * for col_indx in range(col_count): * variable_name = col_names[col_indx] * if variable_name in column_labels.keys(): # <<<<<<<<<<<<<< * col_label_temp.append(column_labels[variable_name]) * else: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_column_labels, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L48_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_column_labels, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -11071,37 +11139,37 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L48_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 689, __pyx_L48_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 692, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":690 + /* "pyreadstat/_readstat_writer.pyx":693 * variable_name = col_names[col_indx] * if variable_name in column_labels.keys(): * col_label_temp.append(column_labels[variable_name]) # <<<<<<<<<<<<<< * else: * col_label_temp.append(None) */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_column_labels, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_column_labels, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_col_label_temp, __pyx_t_1); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 690, __pyx_L48_error) + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_col_label_temp, __pyx_t_1); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 693, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":689 + /* "pyreadstat/_readstat_writer.pyx":692 * for col_indx in range(col_count): * variable_name = col_names[col_indx] * if variable_name in column_labels.keys(): # <<<<<<<<<<<<<< * col_label_temp.append(column_labels[variable_name]) * else: */ - goto __pyx_L66; + goto __pyx_L67; } - /* "pyreadstat/_readstat_writer.pyx":692 + /* "pyreadstat/_readstat_writer.pyx":695 * col_label_temp.append(column_labels[variable_name]) * else: * col_label_temp.append(None) # <<<<<<<<<<<<<< @@ -11109,12 +11177,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * */ /*else*/ { - __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_col_label_temp, Py_None); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 692, __pyx_L48_error) + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_col_label_temp, Py_None); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 695, __pyx_L49_error) } - __pyx_L66:; + __pyx_L67:; } - /* "pyreadstat/_readstat_writer.pyx":693 + /* "pyreadstat/_readstat_writer.pyx":696 * else: * col_label_temp.append(None) * column_labels = col_label_temp # <<<<<<<<<<<<<< @@ -11124,7 +11192,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_col_label_temp); __Pyx_DECREF_SET(__pyx_v_column_labels, __pyx_v_col_label_temp); - /* "pyreadstat/_readstat_writer.pyx":685 + /* "pyreadstat/_readstat_writer.pyx":688 * if type(column_labels) != list and type(column_labels) != dict: * raise PyreadstatError("column_labels must be either list or dict!") * if type(column_labels) == dict: # <<<<<<<<<<<<<< @@ -11133,17 +11201,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":695 + /* "pyreadstat/_readstat_writer.pyx":698 * column_labels = col_label_temp * * col_label_count = len(column_labels) # <<<<<<<<<<<<<< * if col_label_count != col_count: * raise PyreadstatError("length of column labels must be the same as number of columns") */ - __pyx_t_6 = PyObject_Length(__pyx_v_column_labels); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 695, __pyx_L48_error) - __pyx_v_col_label_count = __pyx_t_6; + __pyx_t_11 = PyObject_Length(__pyx_v_column_labels); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 698, __pyx_L49_error) + __pyx_v_col_label_count = __pyx_t_11; - /* "pyreadstat/_readstat_writer.pyx":696 + /* "pyreadstat/_readstat_writer.pyx":699 * * col_label_count = len(column_labels) * if col_label_count != col_count: # <<<<<<<<<<<<<< @@ -11153,14 +11221,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = ((__pyx_v_col_label_count != __pyx_v_col_count) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":697 + /* "pyreadstat/_readstat_writer.pyx":700 * col_label_count = len(column_labels) * if col_label_count != col_count: * raise PyreadstatError("length of column labels must be the same as number of columns") # <<<<<<<<<<<<<< * * for col_indx in range(col_count): */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L48_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -11174,14 +11242,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_kp_s_length_of_column_labels_must_be) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_length_of_column_labels_must_be); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L48_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 697, __pyx_L48_error) + __PYX_ERR(0, 700, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":696 + /* "pyreadstat/_readstat_writer.pyx":699 * * col_label_count = len(column_labels) * if col_label_count != col_count: # <<<<<<<<<<<<<< @@ -11190,7 +11258,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":682 + /* "pyreadstat/_readstat_writer.pyx":685 * * # add variables * if column_labels: # <<<<<<<<<<<<<< @@ -11199,7 +11267,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":699 + /* "pyreadstat/_readstat_writer.pyx":702 * raise PyreadstatError("length of column labels must be the same as number of columns") * * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -11211,7 +11279,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { __pyx_v_col_indx = __pyx_t_24; - /* "pyreadstat/_readstat_writer.pyx":700 + /* "pyreadstat/_readstat_writer.pyx":703 * * for col_indx in range(col_count): * curtype, max_length, _ = col_types[col_indx] # <<<<<<<<<<<<<< @@ -11220,9 +11288,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 700, __pyx_L48_error) + __PYX_ERR(0, 703, __pyx_L49_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -11230,7 +11298,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 700, __pyx_L48_error) + __PYX_ERR(0, 703, __pyx_L49_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11246,47 +11314,47 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_14); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L48_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L48_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 700, __pyx_L48_error) + __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 703, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_20 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 700, __pyx_L48_error) + __pyx_t_20 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 703, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_20)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_5)) goto __pyx_L70_unpacking_failed; + index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_5)) goto __pyx_L71_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_2)) goto __pyx_L70_unpacking_failed; + index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_2)) goto __pyx_L71_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - index = 2; __pyx_t_14 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_14)) goto __pyx_L70_unpacking_failed; + index = 2; __pyx_t_14 = __pyx_t_10(__pyx_t_20); if (unlikely(!__pyx_t_14)) goto __pyx_L71_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_20), 3) < 0) __PYX_ERR(0, 700, __pyx_L48_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_20), 3) < 0) __PYX_ERR(0, 703, __pyx_L49_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - goto __pyx_L71_unpacking_done; - __pyx_L70_unpacking_failed:; + goto __pyx_L72_unpacking_done; + __pyx_L71_unpacking_failed:; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 700, __pyx_L48_error) - __pyx_L71_unpacking_done:; + __PYX_ERR(0, 703, __pyx_L49_error) + __pyx_L72_unpacking_done:; } - __pyx_t_26 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L48_error) + __pyx_t_26 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L49_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L48_error) + __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L49_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_curtype = __pyx_t_26; __pyx_v_max_length = __pyx_t_27; __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":701 + /* "pyreadstat/_readstat_writer.pyx":704 * for col_indx in range(col_count): * curtype, max_length, _ = col_types[col_indx] * variable_name = col_names[col_indx] # <<<<<<<<<<<<<< @@ -11295,21 +11363,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 701, __pyx_L48_error) + __PYX_ERR(0, 704, __pyx_L49_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":702 + /* "pyreadstat/_readstat_writer.pyx":705 * curtype, max_length, _ = col_types[col_indx] * variable_name = col_names[col_indx] * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) # <<<<<<<<<<<<<< * if variable_format: * tempformat = variable_format.get(variable_name) */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_variable_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 702, __pyx_L48_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_variable_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 705, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { @@ -11323,35 +11391,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_2, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L48_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_28 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_28) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L48_error) + __pyx_t_28 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_28) && PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L49_error) if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 702, __pyx_L48_error) + __PYX_ERR(0, 705, __pyx_L49_error) } - __pyx_t_14 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 702, __pyx_L48_error) + __pyx_t_14 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 705, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_29 = ((readstat_type_t)__Pyx_PyInt_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L48_error) + __pyx_t_29 = ((readstat_type_t)__Pyx_PyInt_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L49_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_variable = readstat_add_variable(__pyx_v_writer, __pyx_t_28, __pyx_t_29, __pyx_v_max_length); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":703 + /* "pyreadstat/_readstat_writer.pyx":706 * variable_name = col_names[col_indx] * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) * if variable_format: # <<<<<<<<<<<<<< * tempformat = variable_format.get(variable_name) * if tempformat: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_format); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 703, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_format); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 706, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":704 + /* "pyreadstat/_readstat_writer.pyx":707 * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) * if variable_format: * tempformat = variable_format.get(variable_name) # <<<<<<<<<<<<<< @@ -11360,38 +11428,38 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_format == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 704, __pyx_L48_error) + __PYX_ERR(0, 707, __pyx_L49_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_format, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_format, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 704, __pyx_L48_error) + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 707, __pyx_L49_error) __Pyx_XDECREF_SET(__pyx_v_tempformat, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":705 + /* "pyreadstat/_readstat_writer.pyx":708 * if variable_format: * tempformat = variable_format.get(variable_name) * if tempformat: # <<<<<<<<<<<<<< * readstat_variable_set_format(variable, tempformat.encode("utf-8")) * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_tempformat); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 705, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_tempformat); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 708, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":706 + /* "pyreadstat/_readstat_writer.pyx":709 * tempformat = variable_format.get(variable_name) * if tempformat: * readstat_variable_set_format(variable, tempformat.encode("utf-8")) # <<<<<<<<<<<<<< * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): * curformat = get_datetimelike_format_for_readstat(file_format, curtype) */ - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_tempformat, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L48_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_tempformat, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_30 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_30) && PyErr_Occurred())) __PYX_ERR(0, 706, __pyx_L48_error) + __pyx_t_30 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_30) && PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L49_error) readstat_variable_set_format(__pyx_v_variable, __pyx_t_30); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":705 + /* "pyreadstat/_readstat_writer.pyx":708 * if variable_format: * tempformat = variable_format.get(variable_name) * if tempformat: # <<<<<<<<<<<<<< @@ -11400,7 +11468,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":703 + /* "pyreadstat/_readstat_writer.pyx":706 * variable_name = col_names[col_indx] * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) * if variable_format: # <<<<<<<<<<<<<< @@ -11409,48 +11477,48 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":707 + /* "pyreadstat/_readstat_writer.pyx":710 * if tempformat: * readstat_variable_set_format(variable, tempformat.encode("utf-8")) * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): # <<<<<<<<<<<<<< * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) */ - __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 707, __pyx_L48_error) + __PYX_ERR(0, 710, __pyx_L49_error) } - __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 707, __pyx_L48_error) + __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 710, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_31 = (__pyx_t_3 != 0); if (__pyx_t_31) { } else { __pyx_t_4 = __pyx_t_31; - goto __pyx_L75_bool_binop_done; + goto __pyx_L76_bool_binop_done; } __pyx_t_31 = (__pyx_v_variable_format == ((PyObject*)Py_None)); __pyx_t_3 = (__pyx_t_31 != 0); if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; - goto __pyx_L75_bool_binop_done; + goto __pyx_L76_bool_binop_done; } if (unlikely(__pyx_v_variable_format == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 707, __pyx_L48_error) + __PYX_ERR(0, 710, __pyx_L49_error) } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_variable_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_variable_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 707, __pyx_L48_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 710, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_31 = (__pyx_t_3 != 0); __pyx_t_4 = __pyx_t_31; - __pyx_L75_bool_binop_done:; + __pyx_L76_bool_binop_done:; if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":708 + /* "pyreadstat/_readstat_writer.pyx":711 * readstat_variable_set_format(variable, tempformat.encode("utf-8")) * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): * curformat = get_datetimelike_format_for_readstat(file_format, curtype) # <<<<<<<<<<<<<< @@ -11459,7 +11527,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_curformat = __pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat(__pyx_v_file_format, __pyx_v_curtype); - /* "pyreadstat/_readstat_writer.pyx":709 + /* "pyreadstat/_readstat_writer.pyx":712 * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) # <<<<<<<<<<<<<< @@ -11468,7 +11536,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_variable_set_format(__pyx_v_variable, __pyx_v_curformat); - /* "pyreadstat/_readstat_writer.pyx":707 + /* "pyreadstat/_readstat_writer.pyx":710 * if tempformat: * readstat_variable_set_format(variable, tempformat.encode("utf-8")) * if curtype in pyrwriter_datetimelike_types and (variable_format is None or variable_name not in variable_format.keys()): # <<<<<<<<<<<<<< @@ -11477,7 +11545,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":710 + /* "pyreadstat/_readstat_writer.pyx":713 * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) * if col_label_count: # <<<<<<<<<<<<<< @@ -11487,43 +11555,43 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = (__pyx_v_col_label_count != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":711 + /* "pyreadstat/_readstat_writer.pyx":714 * readstat_variable_set_format(variable, curformat) * if col_label_count: * if column_labels[col_indx] is not None: # <<<<<<<<<<<<<< * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_31 = (__pyx_t_4 != 0); if (__pyx_t_31) { - /* "pyreadstat/_readstat_writer.pyx":712 + /* "pyreadstat/_readstat_writer.pyx":715 * if col_label_count: * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: # <<<<<<<<<<<<<< * raise PyreadstatError("Column labels must be strings") * cur_col_label = column_labels[col_indx].encode("utf-8") */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_1)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L48_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_1)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 712, __pyx_L48_error) + __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 715, __pyx_L49_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_31)) { - /* "pyreadstat/_readstat_writer.pyx":713 + /* "pyreadstat/_readstat_writer.pyx":716 * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") # <<<<<<<<<<<<<< * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L48_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -11537,14 +11605,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_14, __pyx_kp_s_Column_labels_must_be_strings) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_Column_labels_must_be_strings); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L48_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 713, __pyx_L48_error) + __PYX_ERR(0, 716, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":712 + /* "pyreadstat/_readstat_writer.pyx":715 * if col_label_count: * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: # <<<<<<<<<<<<<< @@ -11553,16 +11621,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":714 + /* "pyreadstat/_readstat_writer.pyx":717 * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") * cur_col_label = column_labels[col_indx].encode("utf-8") # <<<<<<<<<<<<<< * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 714, __pyx_L48_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 717, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -11577,14 +11645,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_1, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L48_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 714, __pyx_L48_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 717, __pyx_L49_error) __Pyx_XDECREF_SET(__pyx_v_cur_col_label, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":715 + /* "pyreadstat/_readstat_writer.pyx":718 * raise PyreadstatError("Column labels must be strings") * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) # <<<<<<<<<<<<<< @@ -11593,12 +11661,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_cur_col_label == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 715, __pyx_L48_error) + __PYX_ERR(0, 718, __pyx_L49_error) } - __pyx_t_32 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_32) && PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L48_error) + __pyx_t_32 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_32) && PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L49_error) readstat_variable_set_label(__pyx_v_variable, __pyx_t_32); - /* "pyreadstat/_readstat_writer.pyx":711 + /* "pyreadstat/_readstat_writer.pyx":714 * readstat_variable_set_format(variable, curformat) * if col_label_count: * if column_labels[col_indx] is not None: # <<<<<<<<<<<<<< @@ -11607,7 +11675,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":710 + /* "pyreadstat/_readstat_writer.pyx":713 * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) * if col_label_count: # <<<<<<<<<<<<<< @@ -11616,17 +11684,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":716 + /* "pyreadstat/_readstat_writer.pyx":719 * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: # <<<<<<<<<<<<<< * value_labels = variable_value_labels.get(variable_name) * if value_labels: */ - __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 716, __pyx_L48_error) + __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 719, __pyx_L49_error) if (__pyx_t_31) { - /* "pyreadstat/_readstat_writer.pyx":717 + /* "pyreadstat/_readstat_writer.pyx":720 * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) # <<<<<<<<<<<<<< @@ -11635,43 +11703,43 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 717, __pyx_L48_error) + __PYX_ERR(0, 720, __pyx_L49_error) } - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 717, __pyx_L48_error) + if (!(likely(PyDict_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 720, __pyx_L49_error) __Pyx_XDECREF_SET(__pyx_v_value_labels, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":718 + /* "pyreadstat/_readstat_writer.pyx":721 * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) * if value_labels: # <<<<<<<<<<<<<< * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 */ - __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 718, __pyx_L48_error) + __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 721, __pyx_L49_error) if (__pyx_t_31) { - /* "pyreadstat/_readstat_writer.pyx":719 + /* "pyreadstat/_readstat_writer.pyx":722 * value_labels = variable_value_labels.get(variable_name) * if value_labels: * labelset_name = variable_name + str(lblset_cnt) # <<<<<<<<<<<<<< * lblset_cnt += 1 * curuser_missing = None */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 719, __pyx_L48_error) + __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 722, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L48_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF_SET(__pyx_v_labelset_name, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":720 + /* "pyreadstat/_readstat_writer.pyx":723 * if value_labels: * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 # <<<<<<<<<<<<<< @@ -11680,7 +11748,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_lblset_cnt = (__pyx_v_lblset_cnt + 1); - /* "pyreadstat/_readstat_writer.pyx":721 + /* "pyreadstat/_readstat_writer.pyx":724 * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 * curuser_missing = None # <<<<<<<<<<<<<< @@ -11690,17 +11758,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":722 + /* "pyreadstat/_readstat_writer.pyx":725 * lblset_cnt += 1 * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, */ - __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 722, __pyx_L48_error) + __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 725, __pyx_L49_error) if (__pyx_t_31) { - /* "pyreadstat/_readstat_writer.pyx":723 + /* "pyreadstat/_readstat_writer.pyx":726 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) # <<<<<<<<<<<<<< @@ -11709,14 +11777,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 723, __pyx_L48_error) + __PYX_ERR(0, 726, __pyx_L49_error) } - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":722 + /* "pyreadstat/_readstat_writer.pyx":725 * lblset_cnt += 1 * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -11725,40 +11793,40 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":724 + /* "pyreadstat/_readstat_writer.pyx":727 * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, # <<<<<<<<<<<<<< * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) */ - if (!(likely(PyString_CheckExact(__pyx_v_labelset_name))||((__pyx_v_labelset_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_labelset_name)->tp_name), 0))) __PYX_ERR(0, 724, __pyx_L48_error) + if (!(likely(PyString_CheckExact(__pyx_v_labelset_name))||((__pyx_v_labelset_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_labelset_name)->tp_name), 0))) __PYX_ERR(0, 727, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":725 + /* "pyreadstat/_readstat_writer.pyx":728 * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) # <<<<<<<<<<<<<< * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: */ - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_26 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 725, __pyx_L48_error) + __pyx_t_26 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L49_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 725, __pyx_L48_error) - if (!(likely(PyList_CheckExact(__pyx_v_curuser_missing))||((__pyx_v_curuser_missing) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_curuser_missing)->tp_name), 0))) __PYX_ERR(0, 725, __pyx_L48_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 728, __pyx_L49_error) + if (!(likely(PyList_CheckExact(__pyx_v_curuser_missing))||((__pyx_v_curuser_missing) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_curuser_missing)->tp_name), 0))) __PYX_ERR(0, 728, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":724 + /* "pyreadstat/_readstat_writer.pyx":727 * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, # <<<<<<<<<<<<<< * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) */ - __pyx_t_33 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_v_labelset_name), __pyx_t_26, __pyx_v_file_format, ((PyObject*)__pyx_v_variable_name), ((PyObject*)__pyx_v_curuser_missing)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L48_error) + __pyx_t_33 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_v_labelset_name), __pyx_t_26, __pyx_v_file_format, ((PyObject*)__pyx_v_variable_name), ((PyObject*)__pyx_v_curuser_missing)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L49_error) __pyx_v_label_set = __pyx_t_33; - /* "pyreadstat/_readstat_writer.pyx":726 + /* "pyreadstat/_readstat_writer.pyx":729 * label_set = set_value_label(writer, value_labels, labelset_name, * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) # <<<<<<<<<<<<<< @@ -11767,7 +11835,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_variable_set_label_set(__pyx_v_variable, __pyx_v_label_set); - /* "pyreadstat/_readstat_writer.pyx":718 + /* "pyreadstat/_readstat_writer.pyx":721 * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) * if value_labels: # <<<<<<<<<<<<<< @@ -11776,7 +11844,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":716 + /* "pyreadstat/_readstat_writer.pyx":719 * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: # <<<<<<<<<<<<<< @@ -11785,17 +11853,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":727 + /* "pyreadstat/_readstat_writer.pyx":730 * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: # <<<<<<<<<<<<<< * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: */ - __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 727, __pyx_L48_error) + __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 730, __pyx_L49_error) if (__pyx_t_31) { - /* "pyreadstat/_readstat_writer.pyx":728 + /* "pyreadstat/_readstat_writer.pyx":731 * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) # <<<<<<<<<<<<<< @@ -11804,24 +11872,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_ranges == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 728, __pyx_L48_error) + __PYX_ERR(0, 731, __pyx_L49_error) } - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_cur_ranges, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":729 + /* "pyreadstat/_readstat_writer.pyx":732 * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: # <<<<<<<<<<<<<< * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" */ - __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 729, __pyx_L48_error) + __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 732, __pyx_L49_error) if (__pyx_t_31) { - /* "pyreadstat/_readstat_writer.pyx":730 + /* "pyreadstat/_readstat_writer.pyx":733 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -11832,7 +11900,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = ((!(__pyx_t_31 != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":731 + /* "pyreadstat/_readstat_writer.pyx":734 * if cur_ranges: * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" # <<<<<<<<<<<<<< @@ -11842,14 +11910,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_kp_s_missing_ranges_values_in_diction); __pyx_v_msg = __pyx_kp_s_missing_ranges_values_in_diction; - /* "pyreadstat/_readstat_writer.pyx":732 + /* "pyreadstat/_readstat_writer.pyx":735 * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< * add_missing_ranges(cur_ranges, variable, curtype, variable_name) * if variable_alignment: */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 732, __pyx_L48_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 735, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { @@ -11863,14 +11931,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_1, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L48_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 732, __pyx_L48_error) + __PYX_ERR(0, 735, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":730 + /* "pyreadstat/_readstat_writer.pyx":733 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -11879,18 +11947,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":733 + /* "pyreadstat/_readstat_writer.pyx":736 * msg = "missing_ranges: values in dictionary must be list" * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable, curtype, variable_name) # <<<<<<<<<<<<<< * if variable_alignment: * # At the moment this is ineffective for sav and dta (the function runs but in */ - if (!(likely(PyList_CheckExact(__pyx_v_cur_ranges))||((__pyx_v_cur_ranges) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_cur_ranges)->tp_name), 0))) __PYX_ERR(0, 733, __pyx_L48_error) - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 733, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_v_cur_ranges), __pyx_v_variable, __pyx_v_curtype, ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L48_error) + if (!(likely(PyList_CheckExact(__pyx_v_cur_ranges))||((__pyx_v_cur_ranges) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_cur_ranges)->tp_name), 0))) __PYX_ERR(0, 736, __pyx_L49_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 736, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_v_cur_ranges), __pyx_v_variable, __pyx_v_curtype, ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":729 + /* "pyreadstat/_readstat_writer.pyx":732 * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: # <<<<<<<<<<<<<< @@ -11899,7 +11967,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":727 + /* "pyreadstat/_readstat_writer.pyx":730 * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: # <<<<<<<<<<<<<< @@ -11908,17 +11976,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":734 + /* "pyreadstat/_readstat_writer.pyx":737 * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable, curtype, variable_name) * if variable_alignment: # <<<<<<<<<<<<<< * # At the moment this is ineffective for sav and dta (the function runs but in * # the resulting file all alignments are still unknown) */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 734, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 737, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":737 + /* "pyreadstat/_readstat_writer.pyx":740 * # At the moment this is ineffective for sav and dta (the function runs but in * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) # <<<<<<<<<<<<<< @@ -11927,35 +11995,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_alignment == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 737, __pyx_L48_error) + __PYX_ERR(0, 740, __pyx_L49_error) } - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_cur_alignment, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":738 + /* "pyreadstat/_readstat_writer.pyx":741 * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: # <<<<<<<<<<<<<< * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 738, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 741, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":739 + /* "pyreadstat/_readstat_writer.pyx":742 * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) # <<<<<<<<<<<<<< * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) */ - if (!(likely(PyString_CheckExact(__pyx_v_cur_alignment))||((__pyx_v_cur_alignment) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_alignment)->tp_name), 0))) __PYX_ERR(0, 739, __pyx_L48_error) - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 739, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_v_cur_alignment), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L48_error) + if (!(likely(PyString_CheckExact(__pyx_v_cur_alignment))||((__pyx_v_cur_alignment) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_alignment)->tp_name), 0))) __PYX_ERR(0, 742, __pyx_L49_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 742, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_v_cur_alignment), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":738 + /* "pyreadstat/_readstat_writer.pyx":741 * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: # <<<<<<<<<<<<<< @@ -11964,7 +12032,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":734 + /* "pyreadstat/_readstat_writer.pyx":737 * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable, curtype, variable_name) * if variable_alignment: # <<<<<<<<<<<<<< @@ -11973,17 +12041,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":740 + /* "pyreadstat/_readstat_writer.pyx":743 * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: # <<<<<<<<<<<<<< * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 740, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 743, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":741 + /* "pyreadstat/_readstat_writer.pyx":744 * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) # <<<<<<<<<<<<<< @@ -11992,35 +12060,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_display_width == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 741, __pyx_L48_error) + __PYX_ERR(0, 744, __pyx_L49_error) } - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_cur_display_width, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":742 + /* "pyreadstat/_readstat_writer.pyx":745 * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: # <<<<<<<<<<<<<< * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 742, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 745, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":743 + /* "pyreadstat/_readstat_writer.pyx":746 * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) # <<<<<<<<<<<<<< * if variable_measure: * cur_measure = variable_measure.get(variable_name) */ - __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L48_error) - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 743, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_27, ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L48_error) + __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L49_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 746, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_27, ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":742 + /* "pyreadstat/_readstat_writer.pyx":745 * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: # <<<<<<<<<<<<<< @@ -12029,7 +12097,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":740 + /* "pyreadstat/_readstat_writer.pyx":743 * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: # <<<<<<<<<<<<<< @@ -12038,17 +12106,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":744 + /* "pyreadstat/_readstat_writer.pyx":747 * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: # <<<<<<<<<<<<<< * cur_measure = variable_measure.get(variable_name) * if cur_measure: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 744, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 747, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":745 + /* "pyreadstat/_readstat_writer.pyx":748 * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: * cur_measure = variable_measure.get(variable_name) # <<<<<<<<<<<<<< @@ -12057,35 +12125,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_measure == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 745, __pyx_L48_error) + __PYX_ERR(0, 748, __pyx_L49_error) } - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_cur_measure, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":746 + /* "pyreadstat/_readstat_writer.pyx":749 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< * set_variable_measure(variable, cur_measure, variable_name) * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 746, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 749, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":747 + /* "pyreadstat/_readstat_writer.pyx":750 * cur_measure = variable_measure.get(variable_name) * if cur_measure: * set_variable_measure(variable, cur_measure, variable_name) # <<<<<<<<<<<<<< * * # start writing */ - if (!(likely(PyString_CheckExact(__pyx_v_cur_measure))||((__pyx_v_cur_measure) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_measure)->tp_name), 0))) __PYX_ERR(0, 747, __pyx_L48_error) - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 747, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_v_cur_measure), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 747, __pyx_L48_error) + if (!(likely(PyString_CheckExact(__pyx_v_cur_measure))||((__pyx_v_cur_measure) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_measure)->tp_name), 0))) __PYX_ERR(0, 750, __pyx_L49_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 750, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_v_cur_measure), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":746 + /* "pyreadstat/_readstat_writer.pyx":749 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< @@ -12094,7 +12162,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":744 + /* "pyreadstat/_readstat_writer.pyx":747 * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: # <<<<<<<<<<<<<< @@ -12104,7 +12172,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } } - /* "pyreadstat/_readstat_writer.pyx":750 + /* "pyreadstat/_readstat_writer.pyx":753 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -12114,16 +12182,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BCAT: - /* "pyreadstat/_readstat_writer.pyx":751 + /* "pyreadstat/_readstat_writer.pyx":754 * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bcat(__pyx_v_writer, (&__pyx_v_fd))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bcat(__pyx_v_writer, (&__pyx_v_fd))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":750 + /* "pyreadstat/_readstat_writer.pyx":753 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -12133,16 +12201,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA: - /* "pyreadstat/_readstat_writer.pyx":753 + /* "pyreadstat/_readstat_writer.pyx":756 * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_dta(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_dta(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":752 + /* "pyreadstat/_readstat_writer.pyx":755 * if file_format == FILE_FORMAT_SAS7BCAT: * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) * elif file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -12152,16 +12220,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: - /* "pyreadstat/_readstat_writer.pyx":755 + /* "pyreadstat/_readstat_writer.pyx":758 * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sav(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sav(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":754 + /* "pyreadstat/_readstat_writer.pyx":757 * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAV: # <<<<<<<<<<<<<< @@ -12171,16 +12239,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":757 + /* "pyreadstat/_readstat_writer.pyx":760 * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_por(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_por(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":756 + /* "pyreadstat/_readstat_writer.pyx":759 * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -12190,16 +12258,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BDAT: - /* "pyreadstat/_readstat_writer.pyx":759 + /* "pyreadstat/_readstat_writer.pyx":762 * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_XPORT: * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bdat(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bdat(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":758 + /* "pyreadstat/_readstat_writer.pyx":761 * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAS7BDAT: # <<<<<<<<<<<<<< @@ -12209,16 +12277,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT: - /* "pyreadstat/_readstat_writer.pyx":761 + /* "pyreadstat/_readstat_writer.pyx":764 * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_XPORT: * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) # <<<<<<<<<<<<<< * else: * raise PyreadstatError("unknown file format") */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_xport(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_xport(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":760 + /* "pyreadstat/_readstat_writer.pyx":763 * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_XPORT: # <<<<<<<<<<<<<< @@ -12228,14 +12296,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; default: - /* "pyreadstat/_readstat_writer.pyx":763 + /* "pyreadstat/_readstat_writer.pyx":766 * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) * else: * raise PyreadstatError("unknown file format") # <<<<<<<<<<<<<< * * # validation */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 763, __pyx_L48_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 766, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { @@ -12249,25 +12317,25 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_1, __pyx_kp_s_unknown_file_format) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_unknown_file_format); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L48_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 763, __pyx_L48_error) + __PYX_ERR(0, 766, __pyx_L49_error) break; } - /* "pyreadstat/_readstat_writer.pyx":766 + /* "pyreadstat/_readstat_writer.pyx":769 * * # validation * check_exit_status(readstat_validate_metadata(writer)) # <<<<<<<<<<<<<< * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_metadata(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 766, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_metadata(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":767 + /* "pyreadstat/_readstat_writer.pyx":770 * # validation * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -12279,7 +12347,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { __pyx_v_col_indx = __pyx_t_24; - /* "pyreadstat/_readstat_writer.pyx":768 + /* "pyreadstat/_readstat_writer.pyx":771 * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -12288,29 +12356,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_tempvar = readstat_get_variable(__pyx_v_writer, __pyx_v_col_indx); - /* "pyreadstat/_readstat_writer.pyx":769 + /* "pyreadstat/_readstat_writer.pyx":772 * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) * check_exit_status(readstat_validate_variable(writer, tempvar)) # <<<<<<<<<<<<<< * * # inserting */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_variable(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_variable(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L49_error) } - /* "pyreadstat/_readstat_writer.pyx":772 + /* "pyreadstat/_readstat_writer.pyx":775 * * # inserting * values = df.values # <<<<<<<<<<<<<< * * for row in values: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L48_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_values = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":774 + /* "pyreadstat/_readstat_writer.pyx":777 * values = df.values * * for row in values: # <<<<<<<<<<<<<< @@ -12318,29 +12386,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * */ if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) { - __pyx_t_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L48_error) + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 774, __pyx_L48_error) + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L49_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_14 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 774, __pyx_L48_error) + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_14); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 777, __pyx_L49_error) #else - __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 774, __pyx_L48_error) + __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 777, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); #endif } else { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 774, __pyx_L48_error) + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_14); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 777, __pyx_L49_error) #else - __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 774, __pyx_L48_error) + __pyx_t_14 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 777, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); #endif } @@ -12350,7 +12418,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 774, __pyx_L48_error) + else __PYX_ERR(0, 777, __pyx_L49_error) } break; } @@ -12359,16 +12427,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":775 + /* "pyreadstat/_readstat_writer.pyx":778 * * for row in values: * check_exit_status(readstat_begin_row(writer)) # <<<<<<<<<<<<<< * * for col_indx in range(col_count): */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":777 + /* "pyreadstat/_readstat_writer.pyx":780 * check_exit_status(readstat_begin_row(writer)) * * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -12380,7 +12448,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { __pyx_v_col_indx = __pyx_t_24; - /* "pyreadstat/_readstat_writer.pyx":779 + /* "pyreadstat/_readstat_writer.pyx":782 * for col_indx in range(col_count): * * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -12389,19 +12457,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_tempvar = readstat_get_variable(__pyx_v_writer, __pyx_v_col_indx); - /* "pyreadstat/_readstat_writer.pyx":780 + /* "pyreadstat/_readstat_writer.pyx":783 * * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] # <<<<<<<<<<<<<< * curtype = col_types[col_indx][0] * is_missing = col_types[col_indx][2] */ - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 780, __pyx_L48_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 783, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF_SET(__pyx_v_curval, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":781 + /* "pyreadstat/_readstat_writer.pyx":784 * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] * curtype = col_types[col_indx][0] # <<<<<<<<<<<<<< @@ -12410,18 +12478,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 781, __pyx_L48_error) + __PYX_ERR(0, 784, __pyx_L49_error) } - __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 781, __pyx_L48_error) + __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 784, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_26 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 781, __pyx_L48_error) + __pyx_t_26 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 784, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_curtype = __pyx_t_26; - /* "pyreadstat/_readstat_writer.pyx":782 + /* "pyreadstat/_readstat_writer.pyx":785 * curval = row[col_indx] * curtype = col_types[col_indx][0] * is_missing = col_types[col_indx][2] # <<<<<<<<<<<<<< @@ -12430,17 +12498,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 782, __pyx_L48_error) + __PYX_ERR(0, 785, __pyx_L49_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L48_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 782, __pyx_L48_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 785, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_is_missing, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":783 + /* "pyreadstat/_readstat_writer.pyx":786 * curtype = col_types[col_indx][0] * is_missing = col_types[col_indx][2] * curuser_missing = None # <<<<<<<<<<<<<< @@ -12450,17 +12518,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":784 + /* "pyreadstat/_readstat_writer.pyx":787 * is_missing = col_types[col_indx][2] * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(col_names[col_indx]) * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 784, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 787, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":785 + /* "pyreadstat/_readstat_writer.pyx":788 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(col_names[col_indx]) # <<<<<<<<<<<<<< @@ -12469,21 +12537,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 785, __pyx_L48_error) + __PYX_ERR(0, 788, __pyx_L49_error) } if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 785, __pyx_L48_error) + __PYX_ERR(0, 788, __pyx_L49_error) } - __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 785, __pyx_L48_error) + __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 788, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_14, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_14, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":784 + /* "pyreadstat/_readstat_writer.pyx":787 * is_missing = col_types[col_indx][2] * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -12492,26 +12560,26 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":787 + /* "pyreadstat/_readstat_writer.pyx":790 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 787, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 790, __pyx_L49_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":789 + /* "pyreadstat/_readstat_writer.pyx":792 * if is_missing: * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_pd); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 789, __pyx_L48_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_pd); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 792, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_isna); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L48_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_isna); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 792, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; @@ -12526,32 +12594,32 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_v_curval) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_curval); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L48_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 789, __pyx_L48_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 792, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":790 + /* "pyreadstat/_readstat_writer.pyx":793 * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): * check_exit_status(readstat_insert_missing_value(writer, tempvar)) # <<<<<<<<<<<<<< * continue * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_missing_value(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_missing_value(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 793, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":791 + /* "pyreadstat/_readstat_writer.pyx":794 * if pd.isna(curval): * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue # <<<<<<<<<<<<<< * * if curuser_missing and curtype in pywriter_numeric_types: */ - goto __pyx_L97_continue; + goto __pyx_L98_continue; - /* "pyreadstat/_readstat_writer.pyx":789 + /* "pyreadstat/_readstat_writer.pyx":792 * if is_missing: * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): # <<<<<<<<<<<<<< @@ -12560,7 +12628,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":787 + /* "pyreadstat/_readstat_writer.pyx":790 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< @@ -12569,63 +12637,63 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":793 + /* "pyreadstat/_readstat_writer.pyx":796 * continue * * if curuser_missing and curtype in pywriter_numeric_types: # <<<<<<<<<<<<<< * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) */ - __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 793, __pyx_L48_error) + __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 796, __pyx_L49_error) if (__pyx_t_31) { } else { __pyx_t_4 = __pyx_t_31; - goto __pyx_L103_bool_binop_done; + goto __pyx_L104_bool_binop_done; } - __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 793, __pyx_L48_error) + __PYX_ERR(0, 796, __pyx_L49_error) } - __pyx_t_31 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 793, __pyx_L48_error) + __pyx_t_31 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 796, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_31 != 0); __pyx_t_4 = __pyx_t_3; - __pyx_L103_bool_binop_done:; + __pyx_L104_bool_binop_done:; if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":794 + /* "pyreadstat/_readstat_writer.pyx":797 * * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) * continue */ - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 794, __pyx_L48_error) + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 797, __pyx_L49_error) __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":795 + /* "pyreadstat/_readstat_writer.pyx":798 * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 795, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L48_error) + __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 798, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":796 + /* "pyreadstat/_readstat_writer.pyx":799 * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) * continue # <<<<<<<<<<<<<< * * if curtype == PYWRITER_DOUBLE: */ - goto __pyx_L97_continue; + goto __pyx_L98_continue; - /* "pyreadstat/_readstat_writer.pyx":794 + /* "pyreadstat/_readstat_writer.pyx":797 * * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: # <<<<<<<<<<<<<< @@ -12634,7 +12702,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":793 + /* "pyreadstat/_readstat_writer.pyx":796 * continue * * if curuser_missing and curtype in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -12643,7 +12711,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":798 + /* "pyreadstat/_readstat_writer.pyx":801 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -12653,27 +12721,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":799 + /* "pyreadstat/_readstat_writer.pyx":802 * * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) */ - __pyx_t_34 = __pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_34 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 799, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_34))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 799, __pyx_L48_error) + __pyx_t_34 = __pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_34 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 802, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_34))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 802, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":798 + /* "pyreadstat/_readstat_writer.pyx":801 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: */ - goto __pyx_L106; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":800 + /* "pyreadstat/_readstat_writer.pyx":803 * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< @@ -12683,27 +12751,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":801 + /* "pyreadstat/_readstat_writer.pyx":804 * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) */ - __pyx_t_35 = __Pyx_PyInt_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_35 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 801, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_35)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 801, __pyx_L48_error) + __pyx_t_35 = __Pyx_PyInt_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_35 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_35)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":800 + /* "pyreadstat/_readstat_writer.pyx":803 * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: */ - goto __pyx_L106; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":802 + /* "pyreadstat/_readstat_writer.pyx":805 * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< @@ -12713,27 +12781,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":803 + /* "pyreadstat/_readstat_writer.pyx":806 * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) */ - __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_v_curval); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_27))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L48_error) + __pyx_t_27 = __Pyx_PyInt_As_int(__pyx_v_curval); if (unlikely((__pyx_t_27 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 806, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_27))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 806, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":802 + /* "pyreadstat/_readstat_writer.pyx":805 * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: */ - goto __pyx_L106; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":804 + /* "pyreadstat/_readstat_writer.pyx":807 * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: # <<<<<<<<<<<<<< @@ -12743,14 +12811,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":805 + /* "pyreadstat/_readstat_writer.pyx":808 * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_curval, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L48_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_curval, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 808, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -12764,24 +12832,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L48_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_36 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_36) && PyErr_Occurred())) __PYX_ERR(0, 805, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_36)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 805, __pyx_L48_error) + __pyx_t_36 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_36) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_36)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":804 + /* "pyreadstat/_readstat_writer.pyx":807 * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: */ - goto __pyx_L106; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":806 + /* "pyreadstat/_readstat_writer.pyx":809 * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< @@ -12791,90 +12859,90 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":807 + /* "pyreadstat/_readstat_writer.pyx":810 * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 807, __pyx_L48_error) + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 810, __pyx_L49_error) __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":808 + /* "pyreadstat/_readstat_writer.pyx":811 * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) # <<<<<<<<<<<<<< * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) */ - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_curvalstr, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L48_error) + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_curvalstr, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_36 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_36) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L48_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_36)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L48_error) + __pyx_t_36 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_36) && PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L49_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_36)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":806 + /* "pyreadstat/_readstat_writer.pyx":809 * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) */ - goto __pyx_L106; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":809 + /* "pyreadstat/_readstat_writer.pyx":812 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) */ - __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L48_error) + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 809, __pyx_L48_error) + __PYX_ERR(0, 812, __pyx_L49_error) } - __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 809, __pyx_L48_error) + __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 812, __pyx_L49_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (likely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":810 + /* "pyreadstat/_readstat_writer.pyx":813 * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) * else: */ - __pyx_t_34 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_34 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 810, __pyx_L48_error) + __pyx_t_34 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_34 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 813, __pyx_L49_error) __pyx_v_dtimelikeval = __pyx_t_34; - /* "pyreadstat/_readstat_writer.pyx":811 + /* "pyreadstat/_readstat_writer.pyx":814 * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) # <<<<<<<<<<<<<< * else: * raise PyreadstatError("Unknown data format to insert") */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_dtimelikeval)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_dtimelikeval)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":809 + /* "pyreadstat/_readstat_writer.pyx":812 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) */ - goto __pyx_L106; + goto __pyx_L107; } - /* "pyreadstat/_readstat_writer.pyx":813 + /* "pyreadstat/_readstat_writer.pyx":816 * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) * else: * raise PyreadstatError("Unknown data format to insert") # <<<<<<<<<<<<<< @@ -12882,7 +12950,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_end_row(writer)) */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 813, __pyx_L48_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -12896,27 +12964,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_kp_s_Unknown_data_format_to_insert) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_Unknown_data_format_to_insert); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L48_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 813, __pyx_L48_error) + __PYX_ERR(0, 816, __pyx_L49_error) } - __pyx_L106:; - __pyx_L97_continue:; + __pyx_L107:; + __pyx_L98_continue:; } - /* "pyreadstat/_readstat_writer.pyx":815 + /* "pyreadstat/_readstat_writer.pyx":818 * raise PyreadstatError("Unknown data format to insert") * * check_exit_status(readstat_end_row(writer)) # <<<<<<<<<<<<<< * * check_exit_status(readstat_end_writing(writer)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 815, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":774 + /* "pyreadstat/_readstat_writer.pyx":777 * values = df.values * * for row in values: # <<<<<<<<<<<<<< @@ -12926,16 +12994,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":817 + /* "pyreadstat/_readstat_writer.pyx":820 * check_exit_status(readstat_end_row(writer)) * * check_exit_status(readstat_end_writing(writer)) # <<<<<<<<<<<<<< * * except: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_writing(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L48_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_writing(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L49_error) - /* "pyreadstat/_readstat_writer.pyx":657 + /* "pyreadstat/_readstat_writer.pyx":660 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -12946,8 +13014,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L53_try_end; - __pyx_L48_error:; + goto __pyx_L54_try_end; + __pyx_L49_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; @@ -12957,7 +13025,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":819 + /* "pyreadstat/_readstat_writer.pyx":822 * check_exit_status(readstat_end_writing(writer)) * * except: # <<<<<<<<<<<<<< @@ -12966,12 +13034,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_writer.run_write", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(0, 819, __pyx_L50_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(0, 822, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_5); - /* "pyreadstat/_readstat_writer.pyx":820 + /* "pyreadstat/_readstat_writer.pyx":823 * * except: * raise # <<<<<<<<<<<<<< @@ -12983,11 +13051,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; - __PYX_ERR(0, 820, __pyx_L50_except_error) + __PYX_ERR(0, 823, __pyx_L51_except_error) } - __pyx_L50_except_error:; + __pyx_L51_except_error:; - /* "pyreadstat/_readstat_writer.pyx":657 + /* "pyreadstat/_readstat_writer.pyx":660 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -12998,12 +13066,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15); - goto __pyx_L46_error; - __pyx_L53_try_end:; + goto __pyx_L47_error; + __pyx_L54_try_end:; } } - /* "pyreadstat/_readstat_writer.pyx":822 + /* "pyreadstat/_readstat_writer.pyx":825 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -13014,7 +13082,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d /*normal exit:*/{ readstat_writer_free(__pyx_v_writer); - /* "pyreadstat/_readstat_writer.pyx":823 + /* "pyreadstat/_readstat_writer.pyx":826 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< @@ -13022,9 +13090,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * return 0 */ (void)(__pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd)); - goto __pyx_L47; + goto __pyx_L48; } - __pyx_L46_error:; + __pyx_L47_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -13048,7 +13116,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_18 = __pyx_lineno; __pyx_t_23 = __pyx_clineno; __pyx_t_37 = __pyx_filename; { - /* "pyreadstat/_readstat_writer.pyx":822 + /* "pyreadstat/_readstat_writer.pyx":825 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -13057,7 +13125,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_writer_free(__pyx_v_writer); - /* "pyreadstat/_readstat_writer.pyx":823 + /* "pyreadstat/_readstat_writer.pyx":826 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< @@ -13080,10 +13148,10 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_23; __pyx_filename = __pyx_t_37; goto __pyx_L1_error; } - __pyx_L47:; + __pyx_L48:; } - /* "pyreadstat/_readstat_writer.pyx":825 + /* "pyreadstat/_readstat_writer.pyx":828 * close_file(fd) * * return 0 # <<<<<<<<<<<<<< @@ -13207,6 +13275,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Int64Dtype, __pyx_k_Int64Dtype, sizeof(__pyx_k_Int64Dtype), 0, 0, 1, 1}, {&__pyx_n_s_Int8Dtype, __pyx_k_Int8Dtype, sizeof(__pyx_k_Int8Dtype), 0, 0, 1, 1}, {&__pyx_kp_s_M8_ns, __pyx_k_M8_ns, sizeof(__pyx_k_M8_ns), 0, 0, 1, 0}, + {&__pyx_kp_s_Non_unique_column_names_detected, __pyx_k_Non_unique_column_names_detected, sizeof(__pyx_k_Non_unique_column_names_detected), 0, 0, 1, 0}, {&__pyx_n_s_PyreadstatError, __pyx_k_PyreadstatError, sizeof(__pyx_k_PyreadstatError), 0, 0, 1, 1}, {&__pyx_n_s_ReadstatError, __pyx_k_ReadstatError, sizeof(__pyx_k_ReadstatError), 0, 0, 1, 1}, {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1}, @@ -13353,7 +13422,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 226, __pyx_L1_error) - __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 640, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -13374,14 +13443,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); - /* "pyreadstat/_readstat_writer.pyx":639 + /* "pyreadstat/_readstat_writer.pyx":642 * except UnicodeError: * warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") # <<<<<<<<<<<<<< * else: * IF PY_MAJOR_VERSION >2: */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_kp_s_utf_8, __pyx_n_s_surrogateescape); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(2, __pyx_kp_s_utf_8, __pyx_n_s_surrogateescape); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); diff --git a/pyreadstat/_readstat_writer.pyx b/pyreadstat/_readstat_writer.pyx index 6e345ad..e25f463 100644 --- a/pyreadstat/_readstat_writer.pyx +++ b/pyreadstat/_readstat_writer.pyx @@ -594,6 +594,9 @@ cdef int run_write(df, object filename_path, dst_file_format file_format, str fi cdef char *file_labl cdef list col_names = df.columns.values.tolist() + if len(col_names) != len(set(col_names)): + msg = "Non unique column names detected in the dataframe!" + raise PyreadstatError(msg) for variable_name in col_names: if type(variable_name) != str: diff --git a/setup.py b/setup.py index 2db8d6d..837ff2f 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,7 @@ setup( name='pyreadstat', - version='1.1.6', + version='1.1.7', description=short_description, author="Otto Fajardo", author_email="pleasecontactviagithub@notvalid.com", From c5a610db038f36183e68567d0b72b9c6a2a68fa0 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Wed, 18 May 2022 11:58:09 +0200 Subject: [PATCH 2/7] Updated Readstat source to Release 1.1.8 --- change_log.md | 1 + src/readstat_writer.c | 4 +- src/sas/readstat_sas7bdat_read.c | 3 +- src/sas/readstat_xport_parse_format.rl | 68 ++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 src/sas/readstat_xport_parse_format.rl diff --git a/change_log.md b/change_log.md index 899ea0b..fc55174 100644 --- a/change_log.md +++ b/change_log.md @@ -1,5 +1,6 @@ # 1.1.7 (github, pypi and conda 2022.xx.xx) * Updated Readstat code to Release 1.1.8 +* Solved issue with duplicated columns, #188 # 1.1.6 (github, pypi and conda 2022.05.09) diff --git a/src/readstat_writer.c b/src/readstat_writer.c index bf20748..82219f2 100644 --- a/src/readstat_writer.c +++ b/src/readstat_writer.c @@ -604,8 +604,8 @@ readstat_error_t readstat_insert_string_ref(readstat_writer_t *writer, const rea return READSTAT_ERROR_STRING_REFS_NOT_SUPPORTED; if (ref && ref->first_o == -1 && ref->first_v == -1) { - ref->first_o = writer->current_row; - ref->first_v = variable->index; + ref->first_o = writer->current_row + 1; + ref->first_v = variable->index + 1; } return writer->callbacks.write_string_ref(&writer->row[variable->offset], variable, ref); diff --git a/src/sas/readstat_sas7bdat_read.c b/src/sas/readstat_sas7bdat_read.c index cfc2750..1a745a7 100644 --- a/src/sas/readstat_sas7bdat_read.c +++ b/src/sas/readstat_sas7bdat_read.c @@ -703,7 +703,6 @@ static readstat_variable_t *sas7bdat_init_variable(sas7bdat_ctx_t *ctx, int i, cleanup: if (retval != READSTAT_OK) { - free(variable); if (out_retval) *out_retval = retval; @@ -716,6 +715,8 @@ static readstat_variable_t *sas7bdat_init_variable(sas7bdat_ctx_t *ctx, int i, } } + free(variable); + return NULL; } diff --git a/src/sas/readstat_xport_parse_format.rl b/src/sas/readstat_xport_parse_format.rl new file mode 100644 index 0000000..b2ee89a --- /dev/null +++ b/src/sas/readstat_xport_parse_format.rl @@ -0,0 +1,68 @@ + +#include "../readstat.h" +#include "readstat_xport.h" +#include "readstat_xport_parse_format.h" + +%%{ + machine xport_format_parse; + write data nofinal noerror; +}%% + +readstat_error_t xport_parse_format(const char *data, size_t len, xport_format_t *fmt, + readstat_error_handler error_handler, void *user_ctx) { + + fmt->name[0] = '\0'; + fmt->width = 0; + fmt->decimals = 0; + + readstat_error_t retval = READSTAT_OK; + const char *p = data; + const char *pe = p + len; + const char *eof = pe; + + int cs; + unsigned int temp_val = 0; + size_t parsed_len = 0; + + %%{ + action incr_val { + temp_val = 10 * temp_val + (fc - '0'); + } + + action write_name { + parsed_len = p - data; + if (parsed_len < sizeof(fmt->name)) { + memcpy(fmt->name, data, parsed_len); + fmt->name[parsed_len] = '\0'; + } + } + + integer = [0-9]+ >{ temp_val = 0; } $incr_val; + + name = [A-Za-z_] ([A-Za-z0-9_]+ [A-Za-z_a])?; + + char_name = '$' name? %write_name; + dbl_name = name? %write_name; + + width = integer %{ fmt->width = temp_val; }; + decimals = integer %{ fmt->decimals = temp_val; }; + + main := (char_name width? '.'?) | (dbl_name? (width? ('.' decimals?)?)?); + + write init; + write exec; + }%% + + if (cs < %%{ write first_final; }%%|| p != pe || parsed_len + 1 > sizeof(fmt->name)) { + char error_buf[1024]; + if (error_handler) { + snprintf(error_buf, sizeof(error_buf), "Invalid format string (length=%d): %.*s", (int)len, (int)len, data); + error_handler(error_buf, user_ctx); + } + retval = READSTAT_ERROR_BAD_FORMAT_STRING; + } + + (void)xport_format_parse_en_main; + + return retval; +} From ca84fecb13fab36679455c6685dc63c317cfe104 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Mon, 23 May 2022 17:35:02 +0200 Subject: [PATCH 3/7] adding truncate flag for windows when writing --- pyreadstat/_readstat_writer.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyreadstat/_readstat_writer.pyx b/pyreadstat/_readstat_writer.pyx index e25f463..793b665 100644 --- a/pyreadstat/_readstat_writer.pyx +++ b/pyreadstat/_readstat_writer.pyx @@ -522,7 +522,7 @@ cdef int open_file(bytes filename_path): if os.name == "nt": filename_str = os.fsdecode(filename_path) u16_path = PyUnicode_AsWideCharString(filename_str, &length) - flags = _O_WRONLY | _O_CREAT | _O_BINARY + flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) else: #filename_bytes = filename_path.encode("utf-8") From 7dec722c2db261ab3e7f28653a47086a3975a5b8 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Mon, 23 May 2022 17:43:37 +0200 Subject: [PATCH 4/7] added flag definition for truncate --- pyreadstat/_readstat_writer.c | 14 +++++++------- pyreadstat/_readstat_writer.pxd | 1 + pyreadstat/pyreadstat.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pyreadstat/_readstat_writer.c b/pyreadstat/_readstat_writer.c index e3dde31..84d7a34 100644 --- a/pyreadstat/_readstat_writer.c +++ b/pyreadstat/_readstat_writer.c @@ -957,7 +957,7 @@ enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; -/* "pyreadstat/_readstat_writer.pxd":51 +/* "pyreadstat/_readstat_writer.pxd":52 * wchar_t* PyUnicode_AsWideCharString(object, Py_ssize_t *) except NULL * * ctypedef enum dst_file_format: # <<<<<<<<<<<<<< @@ -974,7 +974,7 @@ enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format; -/* "pyreadstat/_readstat_writer.pxd":59 +/* "pyreadstat/_readstat_writer.pxd":60 * FILE_FORMAT_POR * * ctypedef enum pywriter_variable_type: # <<<<<<<<<<<<<< @@ -8847,7 +8847,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f * if os.name == "nt": * filename_str = os.fsdecode(filename_path) # <<<<<<<<<<<<<< * u16_path = PyUnicode_AsWideCharString(filename_str, &length) - * flags = _O_WRONLY | _O_CREAT | _O_BINARY + * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8876,7 +8876,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f * if os.name == "nt": * filename_str = os.fsdecode(filename_path) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) # <<<<<<<<<<<<<< - * flags = _O_WRONLY | _O_CREAT | _O_BINARY + * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) */ __pyx_t_5 = PyUnicode_AsWideCharString(__pyx_v_filename_str, (&__pyx_v_length)); if (unlikely(__pyx_t_5 == ((wchar_t *)NULL))) __PYX_ERR(0, 524, __pyx_L1_error) @@ -8885,15 +8885,15 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f /* "pyreadstat/_readstat_writer.pyx":525 * filename_str = os.fsdecode(filename_path) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) - * flags = _O_WRONLY | _O_CREAT | _O_BINARY # <<<<<<<<<<<<<< + * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC # <<<<<<<<<<<<<< * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) * else: */ - __pyx_v_flags = ((_O_WRONLY | _O_CREAT) | _O_BINARY); + __pyx_v_flags = (((_O_WRONLY | _O_CREAT) | _O_BINARY) | _O_TRUNC); /* "pyreadstat/_readstat_writer.pyx":526 * u16_path = PyUnicode_AsWideCharString(filename_str, &length) - * flags = _O_WRONLY | _O_CREAT | _O_BINARY + * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) # <<<<<<<<<<<<<< * else: * #filename_bytes = filename_path.encode("utf-8") diff --git a/pyreadstat/_readstat_writer.pxd b/pyreadstat/_readstat_writer.pxd index 12efdbf..3fb9bab 100644 --- a/pyreadstat/_readstat_writer.pxd +++ b/pyreadstat/_readstat_writer.pxd @@ -35,6 +35,7 @@ cdef extern from "conditional_includes.h": int _O_BINARY int _O_WRONLY int _O_CREAT + int _O_TRUNC int _SH_DENYRW # Denies read and write access to a file. int _SH_DENYWR # Denies write access to a file. int _SH_DENYRD # Denies read access to a file. diff --git a/pyreadstat/pyreadstat.c b/pyreadstat/pyreadstat.c index 0dbe3df..9c6c61d 100644 --- a/pyreadstat/pyreadstat.c +++ b/pyreadstat/pyreadstat.c @@ -958,7 +958,7 @@ enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; -/* "_readstat_writer.pxd":51 +/* "_readstat_writer.pxd":52 * wchar_t* PyUnicode_AsWideCharString(object, Py_ssize_t *) except NULL * * ctypedef enum dst_file_format: # <<<<<<<<<<<<<< @@ -975,7 +975,7 @@ enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format; -/* "_readstat_writer.pxd":59 +/* "_readstat_writer.pxd":60 * FILE_FORMAT_POR * * ctypedef enum pywriter_variable_type: # <<<<<<<<<<<<<< From 26f952206f9daa01ca6107a279cea50c3b46f04f Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Mon, 23 May 2022 19:53:25 +0200 Subject: [PATCH 5/7] changed log --- change_log.md | 1 + 1 file changed, 1 insertion(+) diff --git a/change_log.md b/change_log.md index fc55174..45d2125 100644 --- a/change_log.md +++ b/change_log.md @@ -1,6 +1,7 @@ # 1.1.7 (github, pypi and conda 2022.xx.xx) * Updated Readstat code to Release 1.1.8 * Solved issue with duplicated columns, #188 +* Solved issue with no truncation of written files on windows #191 # 1.1.6 (github, pypi and conda 2022.05.09) From 8d619983276018eca7a86c5b71c6cfa5879a35b2 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Fri, 3 Jun 2022 20:42:43 +0200 Subject: [PATCH 6/7] added CITATITON file --- CITATION.cff | 11 + change_log.md | 2 +- docs/_build/doctrees/environment.pickle | Bin 15982 -> 15995 bytes docs/_build/doctrees/index.doctree | Bin 241281 -> 238738 bytes docs/_build/html/.buildinfo | 2 +- docs/_build/html/_static/basic.css | 3 +- docs/_build/html/_static/doctools.js | 5 +- .../html/_static/documentation_options.js | 2 +- docs/_build/html/_static/language_data.js | 2 +- docs/_build/html/_static/searchtools.js | 2 +- docs/_build/html/genindex.html | 2 +- docs/_build/html/index.html | 2 +- docs/_build/html/py-modindex.html | 2 +- docs/_build/html/search.html | 2 +- pyreadstat/_readstat_parser.c | 29 +- pyreadstat/_readstat_writer.c | 28 +- pyreadstat/pyreadstat.c | 414 ++++++++---------- 17 files changed, 234 insertions(+), 274 deletions(-) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..b1da8ff --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,11 @@ +cff-version: 1.2.0 +message: "If you use this software, please cite it as below." +authors: +- family-names: "Fajardo" + given-names: "Otto" + orcid: "https://orcid.org/0000-0002-3363-9287" +title: "Pyreadstat" +version: 1.1.6 +doi: 10.5281/zenodo.1234 +date-released: 2018-09-24 +url: "https://github.com/Roche/pyreadstat" diff --git a/change_log.md b/change_log.md index 45d2125..95a54aa 100644 --- a/change_log.md +++ b/change_log.md @@ -1,4 +1,4 @@ -# 1.1.7 (github, pypi and conda 2022.xx.xx) +# 1.1.7 (github, pypi and conda 2022.06.03) * Updated Readstat code to Release 1.1.8 * Solved issue with duplicated columns, #188 * Solved issue with no truncation of written files on windows #191 diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 91ecdd87540873420582e4da539f285cf80d46c3..b81011bfd88c28a0eee517eb8ae3482329767123 100644 GIT binary patch delta 3109 zcmcImO>7fK6!vaRen=oBgy5gVjIMpYdu8dU%%zpwG&@lN{{2<`OkYl~db_NKKM_x92|k*T;#!)|s7h{b<7U=rQ~48O zCMiYZvZN?cnNRXEpNaE|@osKSy}>eme8tuba@yAH^s^Sr$azCw&tWGmW1U{M-NtFE1c^k|lUZI6A(?1WlGB`O=+#Lrl{(pZT;oz=Qsfgk zSL0ol6>Ru#x0e;lach&C6Ka>cZs~3?2_c80l>$H zwtP}591%){bGXYJTsH;z?|$X}N0;N{m#^TocYv9~AA3FckvCkg_jYv!mcGRwfu~sq z{@q(%cS+I9#SHxg2?IR+nG7M%YTrW z#aI3H4zf6!1EJ_vRf;RdX#-K)4F1;d=$;3U;6@Lj88uqa477ShN>tRSsPbt88?9$x zMhjXThaJtm)r$(9gl6#JW?St_+hcIy2fk2*n9)B(JR!ncVzFp34q2cjuq?Er2C|w> zso9j9&00L$?i?er>T9`7T#)1pm*x$@t)VIyfjmS|R2TG~8{ zu{<@%2_C%+7*u7Rf0`GF67qPiv;b(-&`Yx%oEX*o8G0FXWf6`Kc&hS0JSnDl1#f6M z(=tMWGn0;xFiI6kljFRhhYAicJ@XCtUQ68=B_&KIJulTXru-5$pqRXxr0_+gMIoXV zRKJ9=k%oabL$iX|MP3`9<=FBp$76iEwH0>y?N(37j59^oC}LN^nTfUajIG*6Vlgl< zcGP%k8zqZ@AnPq*yjaF2+Z!v+8u_D)C)-^?x<@V*6D~Q9K-{{H;A-M776Vh5^z!+; zPz=OaA;t?Oj$A&quVoS8&_#@hAF+?iTX@f2(bkKE% zp$Zh{fCD`_#*TmL$(Gu!up5%1TbK7 zVuizVseM6JBGgLADU4z#MH$}FW=?$-)Qu$?+Knf6c!tc(A!NZV zxW`qv5lwdV5?N7A;+FroUZSW8V$>_M@IscdWVg`=)WUm_I4gv3D&njVLg)hkL?2=t z>9!ILe^X%o9M4ATHs$D&Xp)k3jVNSX0p)uN5;1{)B

5}~!3&Q7~?o$f5Nvp^M6 zj6s4KgUub|53z~Q1Vq%VCQTq3{}_H44ZkFsNC=o{w3SB$6KeF_JG)QO*lp-bfNpdWu z#V?~=yec0TC5{z&8pNAzjX)&YNF~_j0i3Z#0DrT!0lMrE&1|*14Vic9zBQ~;OOmpL zcuvu<>~xo@=9J9E1X;sxI2{n&%gZSN%FfIExNgl)B zY&==27W0X{TD%zVG`sLYclf>&punSBF1)q<{_y4yKI4uuC-6$K@s_sc2Gkn@DzS+gxOdm?Ihah3q|{ZSlo(sIk0iMYkW!6`#OYjQZWcf- zA4!WMuMCSqiX^Rn5mNaP;g37e4H$;NoyFUImeSlL-s5ZQ$~km}PE{uJqrA)~IQ||) z=q9YjVQ)(h*^O=!m?z*YCY7`3Z*WNZe_$Na5ChXN6zhXYA4>4RCi^52U0uZ{xVR)I z*l}nHM;evE3bcU$WwnE~Vpd9?rLZng)KChv8ipmxlx3ws7JO|}?L$k&SkWnHKGmFL zK`@2-$MM{TN+fLX%2q8RS%3^EWehpF@-MknLp4N~NPovk5A}(RI=f$*)ZP zJjHMkTD!ne1y*_lRl~4EsGLr=dj%Z#3f#mS8tR$rfUXw3PJ!kqpiAH)&NPH4m$k)c zAvCadNV}sgxI!pM*$W*1tzzdJy`b3n#=5LxuNG1#xmTbV*A!W<*eiw5EIw`iA{{A& z;(t_Zy4g~8Sj&F&@N}~^LT}Zlg_N5W&J^%37w&W+GY6V~LB2{tcACS`~U-J7N!Q!9R4HJ`pi{oU!%B_;&s5I=msFX z4}a1jJ))Y(OF-W@l7nP635giLe<5vuky-+uTUp4xsN>-bW5KRS(rhup!Fus*#EL(O zJPVVnTXq4WmKfl76kA)#%&}Gyooh`14z(e`b8Ulw-uA)Ol%#o|EGYbNirtGZwfOLS zTU`a%@IVbHaC!^A*p7U+pyY#^S~4!h(%I)dSF&-ORpPYbTUhL{ILS+QG_|0mAvvK3 zDT80F!I#1{IMdN+CJRw5zS7a9n>PGaXEpBVjOcD1bzkc2)LkdI-MZC>%k4-FS^Qgw~0nCch&1|kh;ETSa&1T-4hM!ZX0#`y6e`&6n06H z&RhgryR*#Q*(txiw~xAqx*K$N3%F~G)94ZWb+;>|9~)|pJK~O`3f$$qSj95@Q$u=A z*IRGBH9d9AEgbCOLh!yO<3eIT{19V&f|prQQ%#T4jv+kgU0_A;5qO`#2Y99@RFa** zzxUWH76nh^s^03p&uAU!Z5aH^wyWhkcvj}(&TZ@%uicIRb3E8UdgtPa n-e~X?$^H?gepy2#2Zgu;yfef*n~kOQ6JG4?XU^fqzHR>kLjH=A diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 28ee29fbab75a68a935d9dd0ecd03821fac9e812..637e878bdf1613a7ae6efda9e1d9f13226bd10f2 100644 GIT binary patch delta 23700 zcmb81d3;aD`p2DfBt%5S5)vYo)>p_k2`Oq1vBtG86{#g?h14FmLM*9$Nsxo7+DmJ1 z5&E?x*4ukgTH0zaC8S>M?Y&e5r9tcWoS8Xi&Nr_!V}AWZPtHu{^SqzunP+CsIb`0b zkaMm=={Y{DmHnkptAVl6DHF!M6+Iy>Z9??uF=@Hqsb$*e``VY*1LAU&QF>7aci9nI zsZuGyV~6RJ^l*J*uktzVV@kgb_w*a>VgiSd#!m3RsUyaY)RS`~^abss>e64L_lH7r zMCPiQs~V*Er1++k8L|qxMm>tweL6&$<7dN9+M30UO((fOvX8b=l zyW?aPyDqd#Y!yf1W&Qq?s=0Fp{6zrYA0z-QpJ)KKN;CmeWu$sT zCo4z~6D>e`pAR@~um!l>4!BBAl>kmmB7hT<4wEG8FiZgW*)U7;x=qquC?ok#JLrbt z7AU>X2d$fIxV29*b*rnKuS5j@=|ccRM-af!5z7hSnYWw)QJ>OkBfaU{7GYmsmNo7- zWHehtCo7aSM_YvSKA&*QXoK+5Xmh^J5v%3)Nx4YU@%2;=%&jn}%zILeVSh+9^YNm1 zSd#h&>=61p76iS|hp0Zza$S+lb*{&9sw7+$$CGeX9IugZxhFXj>d9T)`j$!9Z<9>G z_%afi(EvJGQCc+F0;Ko(fB{nswboP2D7_nHI9SP1on&C$nZ@kB0j9S!4 z?={zunl+b7>9^*-eDSJM))uB_^DHiUpU-t{o+0+Xd1jaf!9aqIMQ-Z+5qL8Bbt4X4 zQdZyJH$=~0QnBh-Clx(vQKGqh+N>ANqwBo;Be9M-xQ!}qu|>6n&^qan&Bf=7tu#5u zL|tFXiISk@FCmjFe~CYtTt8+x2aVLi{@K=q4)(Lv!Ww=;hZ4|I(8-!*t(IG$^gbW- zf?zb!Yz*HNsNJ8?z6znZQg<%JsRzsz^kgmKAZ#;+Qip4)%@Ae@?JT(_3PaqYd0 z7uUe=y6c0sT5dj~7j84R-mc^2yqTvMKbPDWZ!Jgs+5oOC@_e{-kd5!@sRV4q zUIEzky#|>7Cocy(Xa_sULKCk%+d&b%wa1W^giF(dxs5)up>fiHy)|rRpNsKa4E<*&MO7RB#Fy2MxK!O za^r&oEH_8!u6)aQdY^Cno_s^%hkT*&Zyrx1uKwzzv#U}2Dw5b+pY(Gmkz@${?2Qd27zAH zHMiXNd1Rv8`Zs47*VSR>X)iAj(;vP1S{+*gml%?Of2;?6AENiZM$7fJlSHNAb&krU z>&d2yUqz}C?XFPK+sBSl4*|(4q)TsDIYRIA{amrY@N>HYp@U8qbS61cyU^Kmk|V1M ztsI%n?4KuN{}||G*+1h)%YJ&FYk$sd!~E#mLi6|CK2`yz$@~W#^YP*A$pg#$&`SEs z?*_ZWD|x&A+aRyRAyF<3oh;J}9$Kc;`%b3AW3nM&_OeG_lV3PGc^KC9cbVbI!>}8_ z8?Gt;*vmB~G;*^Ze?cNUx!Bn?_#pIivE`Ygm5jthajleS_X!#IY_q%P;#13hdf&-C zWJ}ujnPGqCv(a^J^Q?sZBm&zikrh4RIhkn*&!fo(RDZ#TQe!LYecDDUBUZOlULJ;(#JmrLW&=t&~#A_z$gEs9f+QXv#;pVjw>sg%5&e z`e2DYJ`x-&Y#eBmF9V?se31V_XR|teRoO~{@NZ#6`w~zhLY}o{l+HLBsJNVnVw^vw zSnn@E;ai181NAS@C};zp;wp4DPgk8#pPC9j5aVPcB-UK&n+@ z5;@)yZX}i<>6~Gw`wK=h_g1ulPdB$RlRoAx?K&wZjb{>?QANR1$paVU!4`U@ItLn` z=FpnzEIrCrwbH{KP*vzuLj1r^JTrt5(*{1V8j7=~aj5e0GV!1a3c9C+pl6{{3J|6p4v`bRUPX@jHD#%mUI6*`-t(1Wc+4u2m; z6jTS#;uvKFNhY6I5yiW)Z2VhneD_b{@kuPs+p&he#;|AuAL}-BHVdC0x*TsSe69-B zglMKTDGfg~rKJHb$a9`GEjYZSGE8oP!?vY`MA+iM5@QCT{pHk#XmCr#ZPq^8;tY5W zlIg29d8F8SNHbQZsX^YPicODn^qCn*pG#X zHaHU8>!-km5dE#cw~vGZct?oJ4v3Vd4Dj|*2^mk1fl4w-<+Fo?K5ChW z#~YI(V%N58;~9BF3lQ8Y18NphWlaqRQ3gz+ReKL(%O&gr7Hs0%_zo)Yq@nsD(>8vu?{f(hu+n);+Nya8m zmy$FNF;mP!{DjE4p3BLR;GcX~!4EExapC!EhBB2Tb=EA7FY#Kb%*LUKnJwYUsG2rc z{sO;fRx8@zb9KjM%xc=exB47(HuESk z45w}QP#8^+wx0AX#m5J)67T155OA`T*D*mWU4meRo!}w-qM0nTfln}P6(jhH5V*b- z6Ob~vBFvZxA?R3+5@ad-DBLB?xp&z-%>8B#9J=87O&AH+UO zJtz^G0y|f|LyU_yIC9}**Um$XE37tlrK@gj30D?`la$;1861!eF1R4?-_e;o9+z=4 zYnso3H6C&(!FhfY@TY942hw80S)AJeu#XGp(G$HnQ_=Y)AGyLd`O(C#!IZv1J9 z$egzuUH=R-nl|u_-VL3>=xb-hMkoD4=||?w*?)12CKasZSyo#HqQWyuk~^u6M4;oK zli_x9%&L3NcFZCz&Isq&W_&hQbIp@eBWbnqyiy6BY^7B5Y&x$TsEn7_)B+*kjRNej z@;AN1vZpRUmOOY}hnrR|{o^JJ3vF;>!u#6zTP%BP)kaY&)Ll#*fC0cQieFA9w7z}@;DMM$fJFfeutAd zcs2R;4koL4SAy(;o$TAYjEpvL$x!02Z2C1uD~gn)@Mf}P^DHis;7I`!tVp$gz<6kbBM&Ty))bIPiUz4L58 z9xUEFKlEdg1Bs+NNk%dbIvFuDmQ?F22YS<)(0FJ$++Q^wT4wvJUT+6W#LE*{UZwBQ zCIoWK$7Sz!AhZ4gwf?e<^`Dv6Z>h+vr#GFgHy)Mu3Q~flu%dI-66XkVw}5SxOS^4^>0ZoqBXez(pu| z92Q<*#JI9PcG=1L5`n4Sz!sQkE`~)L_*j2JX9!GW194#XHc;utI5d)DG=k@$M$I}F zDPeH7-QX#1W-x8w8~g`!Hsf%y0Vz#i!)PxJeRcy?QAvrnX#=UVWdB%$`vO0#Kg1;-T>DM~e!55yaPU>ay4aKxB z9Pi@FdAAF8ZjG)I&OOJR8-c#*%Cd$wI60R*^&QlW;g)TLz3U2SB;nn24GC`V1Uh}; zf^LM@_7HIe^u%1PdrEM%152!J$0PVf^GHJ*_+06|7}qSq6+TzY<%#I6ZXgBdR$mSQ zIpp^3hY>RSNgy1uBedwx5NHD*;W%`Lvhizw?+R2R*FED0sO0a)paFw;R^yGtxk1b& z?IX!V>KrK%>PFDXio(7`hCmzm2u%kw$+1MzH9=02WS2XMW*1ycC7-(F4dYPaSraoH zJ8jr-iO_7Zb5%=bT(p7DwH`V{Xue1mhvsi1=&Eg=JgT|z(JCud{I zd*#_0bp$^0nib-C46YEpHt;G0X1MbK9zArO1jBPX!`JH=18v|lys=)5GT#%mLUq=u zNv^oY-lfRVYtLzD0D{y7xENFgZzxagm&nmRkOLV9yd5{AiFbPbc|bjZ)6;ZZaTDyg zo}cj?hr$l2qs=-O7>hrn3O}MoyQ;)`GnJ4c=~mo?q#KM+nBbz2%#Ut|Md_A*7>DZa zVee2migX4`tQx-U2n!W$;D;*WD66RR8C&=gF`MV=QJQ~fz;O}9x#Mj7ui5zS@5SR2 z-{sk{_MKo@w1JP+^dysg#$;WkUXut}UMvZj`xFfsT>R#%3`JpQ)xGvFxE*7W^O{~X zrY^ewrc&Bd>74ovd0g<~D~^}YZ!WD1%DRMuop;GQc`G#aPTn?`)jK42I()+$4Mg>z}aWJF_`VqSBb%i%a=hXBa_JYEt|e&KBp~?KL71oH5KMw(iO4!*RQBo zi1}Z9FEqc+zp*>s`L}oOJ6fzZv*rFPSDC@I!O>v+gmEWyHp^6dRJ%Y;3hxYq34G*9 zyrz=BZEaSMY0Yr;$S&ko54?r`-wg~DQXl~|jRKJnTq$5gw8fFg_?u0r?@cU|dGr4v zWBijSsKqTg73{a;&>5or>n(A##}}%-@Xp)xRkh~WS9^cq`l{B?woPnvlD18n3qwNE zwiwl>i)4*x@3N>?7vh;bk|D(vv$(ax10W zAtRYZDUDrhLv-^ldlo`l_?RPqWttZ#=4Clef|+!WKIDOmYUDt*?12b#%|o0e(GMkZ zQG4AMzW=~4n#Xn8z~_4B5ms6ENSuo`e^(2=woB=+<6Qjh88;VksFoJv;g1$eK&0Ct zCO>5mw1E%t1Uj3A=rB4}4Ev>g7)(%zNYLkY zYs8aqk>#~b?A#J3On#uoJAq@+!~kZ&o5TWlvWx|tp_5g?;wms`+TaL{E7<4I*{opm ziDdmHQj%z8uoi*;(F;c*CD)FL;S2N$rOz~?9`Mr!{9)%=JTM-OnPITJhNC`91 zc%ibPibV353V2l;P*qLVk+Rt|6_CJIgtwX-00UClP|j5QA=|9 zx0Q(1M(V|3Ej0293@$=QdB|zQ^WyUkS}ZEx7IU>~E5X$UOtCWJA^f6Q9%zH3_b}JA zc8n{7aAnGHwP{PTV`3c5dbnsrvf~g~@A%ILBH&7f3OY1i0x8#y6x@*^(FQ)!I_L~4 z=R0~=yb?+7>E1~jP7MCM3(sI&gqn9{)uCNGt2($lwv&i|1az_@Q>z=ppbdPCt4G&z*A+$|<@M!UL+S!B29%8cYqcXCa?6fO-GFsZer>)wH$rdnK z*KIjjLL1PVPBOSyL%vbYA0VV{JP_x~@PQH;SvAfU%Ia@0INHF6+W?&*BQLxm&d45v zw11F?L5+q9t==>YkN4#;39FadtzIykSxp=GR{JMom6pk3tB)mX)yTJ1cSi}W9{v^{ zZ~0piRx9mozV7livzj*Wt-b)A!Pn2;7F(S$TJsRAd!!1jK9!2cyPqmy^}BYfcf7-_ zrVV_n-Q%#zo8!b*-x#NTUJmcl@}}{u#)r0qbUa>qy7zd!J9ur+JWta#`nd4L4BmLS z22RSr<899H_CksA$ae2b5Mdj!H)k?8&=yBG;EmXSp|g3;4L~uOT2lQ=@!nO|SrRGJ zwGhvdS=u48uUs@oi1Ty~#)-(3!08AESQWf5lhM!yN1Dd(Y1SvEb1{f(kqk)3cv8uR z&ZTu5F6fafb^#9wZ@RWGV6MA_72Q{46pvCoa^lKa$oOcBBOhKW0vBN~wp}FQMNN7S{eA!vum67H=jE7Q_|8VPH7n(Jt{dZ hIc;+C$kewcM~!(a?d_-ulSfC7nlRE6uuDrT{eNUk@16hv delta 25493 zcma)_d3;XC`oNuYA|xT9B9}$b(^UJO&v(N7lRb zv->yEGZJDVNgw3?2-w^t`@K2uH6BxTjQ^N&L*Ij%bH?6xpk7hQ^V|m^+bWqp0wC&{#*-h6ztF(cdqofR5%9iR|(UG^K4j@%c}y>9B8&GfnE%jwgPr&iaW zr&rPUcB`8EJpC=TzI`S|OGh_jko*0?lt`_no;ES0>NvY0f$V;&TYoYRSv+dI>E5$4 z1KQ6U;OFtw0OY=%HXUWx^a<4HC7codPfjN`!tjZP5r$9Hw9<{xxSXz})X+Okt7LBj z9W5|dCesGmo7%i(-@ew%8~Fewjs;UgMOy zewI^;L*Ux%moWLY*#Z6{^4r-0^5zQ$!+2l5z>N3U@)AxCg+kQHi3=$$xi6&sb|H=T z{(AAU2))nvie%{>B&Qbx7c4SjzF<*J;mUhuu@Jba-e(D#}p32DKtyj=s3Jc&SZg_x%Ps>0d>eE^)DIU2m z#M`nG;T5hl@sgaC<@Q~5BnbLEWJ5zGE4THALDrC+76^xmtA2gO7JF7b>W3bB{jC%= zFA%*yxQ?PHxq6%R#JxXk3&a5wzRd`r@NJojWyY|F^i>}T)JI=zt_N*L(CxOT^Ys&Z z7;DTuwEZh#?{jttdQZF3Qh%}o^&Yh|oqtd9>D|b-oq{;0{k)SpjocSHE&UTZ5$EU$ z+dZxYu%l9~*D1(Yay}(X&ZkR-eE;6%z&H9cs{J(5?mjQ0{R^J8=jW7_+!wMIeGaYp z?ruj{W$&(L%_Pj)`ulqwP{Q_6lz2Vc>v1PnkT7Hv6rywO**=Ow?h8>C>_>sIZ-07Z zX@MS90lVtx-b&~lMTdXqF3Y_pbXWQT0VAphZX7^bgTE|296#i_PJT(b$bBJK4=>U% z%j@W)C*EM8j{@=q<44nJNj}XL(G^iz)F*C_bvLgl;ixbuL>)Eh5CtOlg+LDuQI)S! zm9A7dmDqE!`IYp7oZJ_Z z-z-3`3_0%T%GJkvzhud~jYFU_jI@8_e+58MKg=|%#7QAI94Y^vOx;zPlfQ2U`W4Yj0u_Ao{@m4A<>_L_S3 ze^Ieo0eo;uZRU=6$?6`~C5Pz;g(&8h5{gOg+hUfK424GQecxh4=iaa1_n6y1PCa`b zOoKh2e_(OEPtUo19{OxaG66mOFMC_zS10{1YN~up68c zxi91hd_fI27##Ok@EZ}dT*NTgA)ngV&~b?A`7io`YYUY#2a1*L)>WNJg2k$0PYH@t z1x{Ds)|ArOR N7fqpXq(KA+#`!6f?!1NW2WL8O&9aKm)+0xiR$f4bLJ?dluh2A6 zD^yQ-k?O7&>S#-&lJQ{mD^`_o@qHfsa2P`;4MOyUYS_M$t0_+T##>TN zIcr@wIS(GKDPls~j-X9AW14F)EtFvz1BFo7g64lHQJ_vO#ci$zq(um|wHAgds-;-o zCfJaDJwI_816>6p-Tixg?T-J~Tid%Ya@dpy=ceOsdbEM;e5j z51_0Wx3$Aiw74R}B%vc^f zCg=b-IGTw1Ml(>-UN{OQ3e>I{+K zDB(GN9KtwAgOI~B6f0Ra)R`k_m{LB>a>O+(+>CTYO3wLKhNB}c5cj4cIO8&kh@4Ee zEPND>zd-o}b;oTdSi2`*psa*K)LWCMGfL86ONr*epHLPSX?6Z-HKnr>6#G~HDW?R* ze#Q)}Wb+KGDSec9Bi{6_RG0+#eU>03@cKP!Hb1*6FND*%TP+E@#Xuoyw;ovxi8R>S z4Mlk&l!bPCk>!jue~#kww#Om;HQxy-Bik@qwuEOsGBNr-iUI={uyTtu2r;fMz)Aua zI%6zfsOZ+o%3;)5BET?0`n@GAq?^@7n@Qlqd?nW1y0(OWYC<9EpV>>9e@KG}Y;6wa zip_E6+MA=4wI0iITnAQ)xZrzg42W5!xM2hgSta40)jUS%YKB1?L>OQllr_u5^UQb= zKR6rD+wC3Yw$Nd*YXo3;D(zUqRMx7){8g`xguncu5cSu}wG5Or2tlg=rZt&qb#<51 zir2`X_sJRwFIEZZ*KZKe8{t}MBaWQ7jS_Cn;%Wba51MZ|q(MlVwFxWPwaGa=qc=Mw z#K#|sIPk06lr31rhg&2#?(-ajwlWUVAmq3PW#JsCu+5oc#Wtmf&>xpR7I5Hb?6U)F zn72a$V@!k*e8yYn%R5;bBrQUY!#lB-J3E~@CVZju!cH&B{;4V z4*XL2<6h;aW`KXX?-i?+|lQV6UWITtX{YY-q{E1gU1zh+a1v9%q))(~GTfss|8 zv(+Q`AYJ{823uR9+Ih~;SjlHUJ7c*2e`8Y=e8x-`$3L&#Qk`##^%)hx_D?6YjL% z*+}LZBXKX38OazZgu)%Im~;z>+!S)(_yZd^_^z}2R^9bIE#Y`BlsNIE+{YTS?n}7u zIzhmTWvd6weWXE%kq2eX9iZA^{tLwu5!ukudppKHRIK~U9MRZEPDI6zFj1w)5<~;w zC}=B`y$@2k(0 zdDc@rj`xS>0$!tx?*0M;&wL>Pe3}DZ(@v#%gxt5|MQiGsV=7F!YwoI+;}14OW1lHQ zQGJd-m;~tHrwWcDaSi>2pGs%=YmM*>cY7K+#t7M3g+h2<;pKE=S(ToD#2YOlCQ#QO zL4n@>&Qyi|s?Sj*M->(*q8bsXq65|=fvV+zl|9QTnScs;d2KF`k2j=ZFl?R>FgQ^at$4T!Kl1kZEdd%(SJpYB^?OBjy5O zs|zQHadlMVNElxDeBjI;1B>c9f&N`rr8zeSWH(kl?v{-u{8k+b(Ue$Rk8zR)J5JC% zQl&rU7>Jd*hR7+yyu<1fUU=bCesjEI8wq%gGB61z=c5m418V)cMtpD*X5e^zLM}nosB6!cMABG0h~v zh6I7taGI*pnHlW{HX11Ks2$w5WDItS7z`A3W~qwYv@;ftgn5ZL5_Ts#GsPyUKD*K! z)5l!}OrWGIUOiG?k#I*`Q_kOIyD@*01|h;SC=1<^*UcHBU3YbpwOZy7F7^~5pdXci zloYHYD@B6i0MF5?7vmreLXJErYnGP}K|wdw)95kmi+=-UBjzT`0g%vLtpT3(RE=^B zUE~Ij301ro`lutUd2LO9MoSumv^57X+HqiuNA*Nx zz`h)4y{8ALN37K}hqGj`00&R37lW|_V^SrMw(v-|QyCIz5F(BDU?uB4&Vd*{#CO@} zFeZ!?VW4II=aE=L<<})Js<}DOoO+#MkOm<}uTfaZoKemg&qt{~dubd-TDlX)kLj#> z+2#hvyQ!(}op87g&Nr&$6+F|CF^q{c*fD`Azo>0M;#d`(y-XQvEnnD>xe2wxjhFLw zC?Ex^C#q;S?YD^%&eCEyXKkItz(|7~7|!3W3^t8AgOZ7=$JG_~ zRjMVm7|{0*m^JE7R*kQMA||Uz*4?y8v9KTC-L%cIcsK3NB2{!MU3r(93?3|G!}$uh5m52J}UN)_I$hI2PgT5++dW;ehUhKA}GWHl)w^-zZTZ`2t&<7KiSYw$zi{0-1 zV~JY9x;8Kg@Hj`*d(tx8`iQ-Qw$oH*0W-NEB6@DD>yqUX4&!usLT)vgv;eXq}mdU!FzI#t+X;G54y>MQM5 z)6McD1QhOr3vy^nNA=#vyVWMvU#v4tob$W1#Lj=7>*)OT`*6UW+GkCd)*eZA=mG~u zqdI#(^D}9%^>fjF=I6ICplg{kpt0z{;iFUphi|wSUevT6uCOtJ>Ry3;ae%M(V#Z@$ z3C6=bEGxK*Hj&j0$;S8msFRVinQ z=HS*enm_wifD2Y;Xk9_4Q+Oy7Pg#e;IxvQE_mq0a8nH|QT>eg^0+;5!&tMgE&sa^$ zI^br?+i>7GY|t@EyR*!sq`}UlpkAid5&RDnHs|Jdt-+LAYO1RcnSq;}0+l#;j-4aH z120wxQF|6TqJC9~QA-LXP}Mfv4Edypp^^qWR2)4q-(w|1zjt=o_3u^9Itds)D83-# zz?-Cle`Lm7*#;Zat;6w_YRorHDCEDSiwuf1*h0bI4}#-R7EXzK7bPr5m7ou_cV3cH zf)1(Nm$8x|mz^zl?Xue2`WC}kF8aE_aylyiw_e8@imppwRBOuxK+X+@K^kmrg)o9| zVkI4KI%6EYsrp$Leuly2{uOO;?%#Y{nER1`+TFrB$KH|vTfu|X`-Op#20JkH4nTMI z&Vb3cV3}M5`zbZz;P6rIhr>6{oZ&?^q4N&>CUD-`JNSiq$Q=nh?Pbnyp}#Xc(qM;& zC+<2ZYo@5qFXLGi(G_;)!07GvhgvM0#Ze^!938oAYl#tyB@#?Cd8VBEjEOV|nSvh} zvG|~rSbU(q=@+nO@NW2HH~2qqn@8$ptC#xy0~*5Ew+wkEz%rJsEzhvZ!e>^MtOH}o z>ib;%UeODy*08LMOlnQCW`9n!X0-<23fKImS@?ma2mVWF=aKBc!!pi z!0iGDM~k|u{tTBi*y6&Xt_|4WuhE}1yv1-MmO0~kyO+~^7BP-2B~V0$7qM>wnTfw= zI^7qYbs8n*VG|WCWP5`cDrvAoU0XpzyK+M+NSKoLkJhlzicNd(H8Nu&XM8S>Xs z8#QS!5j2NE-*Q?F@7Q4NvY+Lf9A;5&Rq(XOt3sVHO|XlAQ%rsp96Y~Pks$WKLDJya z63U24gPlb|NvKADZM5E?b$uX13&)R^1vq|ViolB+0hUbAssl|pZ6id1glpte5iF2q zfs%$AJ1B{mhkD^kOxCNBg=W^(d!kgSdOB3=Gb`tU6gx4jG znKmvCN0d7$P9mb3Kq2Z(cRYh44MM2>P!>WJ$4lh7CUMw*pC*tz2QTIeNu!bkq(*6; zgw+-$NzBg=c($Bm#zq>1Y{6Zyl8#-R9d@*fcHR1W8Rk;3v8NM8XbSUJ(|E&Q&Eh5e zRTTT?ZzG(jM~=kqeP^VEduQ;V-Ck#) zq(KOJ4$8u;^6YizD4jb>`zFv*iudUZ?eBY_H@`D3#m`O_mE!2Nc)A%*Ydhm}i4CYH zt}eCqOg8CZ&!|X-JsU+bynvrB+dl>-PZikJc#ph2l{xoTXZ#bhf=pPb{wgz&b5IC} z6e@IzrZG#C20Kfm_vrD^$}2LhR`wzF22a;6D5YCDDG^)w$V{P?@e(z72E$BEWSGMf zCG4F9h3L$Qf0JR720Kjr()SINH66T=X>~1?(~7+e$qX;Ui$m6&!Au6;%o2GSm$LV= zaAZf!u}&Y>0au^r6I!r)jz+)UA~$VGQRO;lE+c)+NZrq6NKK9S)5*Ab%)U-qQBC(X zlr`-enMA$nawSQ4H9ryCcXO6zeBFaCyl3WX_pB+3*$5n7Br-CNu@-M(Bae7X!pMW+ z2x&;wSj><~gRP+v@@6OtXV2Ni&a - Index — pyreadstat 1.1.6 documentation + Index — pyreadstat 1.1.7 documentation