diff --git a/CITATION.cff b/CITATION.cff index d4476e5..9391faa 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -5,7 +5,7 @@ authors: given-names: "Otto" orcid: "https://orcid.org/0000-0002-3363-9287" title: "Pyreadstat" -version: 1.3.5 +version: 1.3.6 doi: 10.5281/zenodo.6612282 date-released: 2018-09-24 url: "https://github.com/Roche/pyreadstat" diff --git a/change_log.md b/change_log.md index 684866c..b67de43 100644 --- a/change_log.md +++ b/change_log.md @@ -1,3 +1,6 @@ +# 1.3.6 (github, pypi and conda 2026.xx.xx) +* Fixing #328 + # 1.3.5 (github, pypi and conda 2026.05.19) * Readstat sources updated to commit 3add3a5eaac6df24d938beffb9148792e362d9ef * date, datetime and time formats are now used without precision, decreasing the diff --git a/docs/conf.py b/docs/conf.py index 6aae15a..78b57f4 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.3.5' +release = '1.3.6' # -- General configuration --------------------------------------------------- diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index a3ecd0e..e86b45f 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -22,7 +22,7 @@ from ._readstat_parser import ReadstatError, PyreadstatError from .pyfunctions import set_value_labels, set_catalog_to_sas -__version__ = "1.3.5" +__version__ = "1.3.6" __all__ = ( "read_sav", diff --git a/pyreadstat/_readstat_parser.c b/pyreadstat/_readstat_parser.c index dd4d4e2..b3ca69e 100644 --- a/pyreadstat/_readstat_parser.c +++ b/pyreadstat/_readstat_parser.c @@ -7598,7 +7598,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt int __pyx_v_dates_as_pandas; __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; PyObject *__pyx_v_result = 0; - char *__pyx_v_c_str_value; + char const *__pyx_v_c_str_value; PyObject *__pyx_v_py_str_value = 0; int8_t __pyx_v_c_int8_value; int16_t __pyx_v_c_int16_value; @@ -8380,14 +8380,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta int __pyx_v_obs_count; int __pyx_v_mr_len; struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_dc = 0; - char *__pyx_v_flabel_orig; - char *__pyx_v_fencoding_orig; + char const *__pyx_v_flabel_orig; + char const *__pyx_v_fencoding_orig; PyObject *__pyx_v_flabel = 0; PyObject *__pyx_v_fencoding = 0; CYTHON_UNUSED int __pyx_v_metaonly; - char *__pyx_v_table; + char const *__pyx_v_table; int __pyx_v_i; - mr_set_t *__pyx_v_mr_sets_orig; + mr_set_t const *__pyx_v_mr_sets_orig; PyObject *__pyx_v_mr_sets = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_variable_list = 0; @@ -8414,7 +8414,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta * cdef int var_count, obs_count, mr_len * cdef data_container dc = ctx # <<<<<<<<<<<<<< * #cdef object row - * cdef char * flabel_orig + * cdef const char * flabel_orig */ __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); @@ -8425,14 +8425,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta * cdef int ctime * cdef int mtime * cdef int i = 0 # <<<<<<<<<<<<<< - * cdef mr_set_t * mr_sets_orig + * cdef const mr_set_t * mr_sets_orig * cdef dict mr_sets = {} */ __pyx_v_i = 0; /* "pyreadstat/_readstat_parser.pyx":397 * cdef int i = 0 - * cdef mr_set_t * mr_sets_orig + * cdef const mr_set_t * mr_sets_orig * cdef dict mr_sets = {} # <<<<<<<<<<<<<< * cdef str name * cdef list variable_list = [] @@ -9163,9 +9163,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_index, readstat_variable_t *__pyx_v_variable, char *__pyx_v_val_labels, void *__pyx_v_ctx) { - char *__pyx_v_var_name; - char *__pyx_v_var_label; - char *__pyx_v_var_format; + char const *__pyx_v_var_name; + char const *__pyx_v_var_label; + char const *__pyx_v_var_format; PyObject *__pyx_v_col_name = 0; PyObject *__pyx_v_col_label = 0; PyObject *__pyx_v_label_name = 0; @@ -11807,7 +11807,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__pyx_v_val_labels, readstat_value_t __pyx_v_value, char *__pyx_v_label, void *__pyx_v_ctx) { struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_dc = 0; - char *__pyx_v_c_str_value; + char const *__pyx_v_c_str_value; PyObject *__pyx_v_py_str_value = 0; int8_t __pyx_v_c_int8_value; int16_t __pyx_v_c_int16_value; @@ -11841,7 +11841,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py * * cdef data_container dc = ctx # <<<<<<<<<<<<<< * - * cdef char * c_str_value + * cdef const char * c_str_value */ __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); @@ -13236,7 +13236,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_error_t __pyx_v_retcode) { - char *__pyx_v_err_readstat; + char const *__pyx_v_err_readstat; PyObject *__pyx_v_err_message = 0; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -13250,7 +13250,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __Pyx_RefNannySetupContext("check_exit_status", 0); /* "pyreadstat/_readstat_parser.pyx":910 - * cdef char * err_readstat + * cdef const char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< * err_readstat = readstat_error_message(retcode) @@ -13318,7 +13318,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __PYX_ERR(0, 913, __pyx_L1_error) /* "pyreadstat/_readstat_parser.pyx":910 - * cdef char * err_readstat + * cdef const char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< * err_readstat = readstat_error_message(retcode) @@ -13401,13 +13401,22 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ * metaonly = data.metaonly * ctx = data # <<<<<<<<<<<<<< * - * #readstat_error_t error = READSTAT_OK; + * error = READSTAT_OK; */ __pyx_v_ctx = ((void *)__pyx_v_data); + /* "pyreadstat/_readstat_parser.pyx":946 + * ctx = data + * + * error = READSTAT_OK; # <<<<<<<<<<<<<< + * parser = readstat_parser_init() + * metadata_handler = handle_metadata +*/ + __pyx_v_error = READSTAT_OK; + /* "pyreadstat/_readstat_parser.pyx":947 * - * #readstat_error_t error = READSTAT_OK; + * error = READSTAT_OK; * parser = readstat_parser_init() # <<<<<<<<<<<<<< * metadata_handler = handle_metadata * variable_handler = handle_variable @@ -13415,7 +13424,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_v_parser = readstat_parser_init(); /* "pyreadstat/_readstat_parser.pyx":948 - * #readstat_error_t error = READSTAT_OK; + * error = READSTAT_OK; * parser = readstat_parser_init() * metadata_handler = handle_metadata # <<<<<<<<<<<<<< * variable_handler = handle_variable diff --git a/pyreadstat/_readstat_writer.c b/pyreadstat/_readstat_writer.c index f899195..4c41274 100644 --- a/pyreadstat/_readstat_writer.c +++ b/pyreadstat/_readstat_writer.c @@ -1199,6 +1199,7 @@ static int __Pyx_init_co_variables(void) { #include "readstat.h" #include "readstat_io_unistd.h" #include "conditional_includes.h" +#include #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -2301,6 +2302,15 @@ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif +/* CIntToPyUnicode.proto */ +#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\ + ((format_char) == ('c')) ?\ + __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\ + __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\ + ) +static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char); +static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); + /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); @@ -2800,6 +2810,8 @@ static int __Pyx_State_RemoveModule(void*); /* Module declarations from "pyreadstat.readstat_api" */ +/* Module declarations from "libc.errno" */ + /* Module declarations from "pyreadstat._readstat_parser" */ static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_readstat_to_numpy_types = 0; #define __pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types (*__pyx_vp_10pyreadstat_16_readstat_parser_readstat_to_numpy_types) @@ -2911,7 +2923,7 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; PyObject *__pyx_tuple[2]; PyObject *__pyx_codeobj_tab[1]; - PyObject *__pyx_string_tab[219]; + PyObject *__pyx_string_tab[225]; PyObject *__pyx_number_tab[9]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ @@ -2953,225 +2965,231 @@ static __pyx_mstatetype __pyx_mstate_global_static = static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: constant_name_defines ### */ -#define __pyx_kp_u_ __pyx_string_tab[0] -#define __pyx_kp_u_Column_labels_must_be_strings __pyx_string_tab[1] +#define __pyx_kp_u_Column_labels_must_be_strings __pyx_string_tab[0] +#define __pyx_kp_u_Could_not_open_file __pyx_string_tab[1] #define __pyx_kp_u_Non_unique_column_names_detected __pyx_string_tab[2] #define __pyx_kp_u_None __pyx_string_tab[3] #define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[4] -#define __pyx_kp_u_Unknown_data_format_to_insert __pyx_string_tab[5] -#define __pyx_kp_u_Unknown_pywriter_variable_format __pyx_string_tab[6] -#define __pyx_kp_u_Version_not_supported __pyx_string_tab[7] -#define __pyx_kp_u__2 __pyx_string_tab[8] -#define __pyx_kp_u__3 __pyx_string_tab[9] -#define __pyx_kp_u__4 __pyx_string_tab[10] -#define __pyx_kp_u__6 __pyx_string_tab[11] -#define __pyx_kp_u_add_note __pyx_string_tab[12] -#define __pyx_kp_u_alignment_for_variable __pyx_string_tab[13] -#define __pyx_kp_u_and_it_must_be_str_not_starting __pyx_string_tab[14] -#define __pyx_kp_u_character_missing_ranges_value_g __pyx_string_tab[15] -#define __pyx_kp_u_column_labels_must_be_either_lis __pyx_string_tab[16] -#define __pyx_kp_u_compress_and_row_compress_cannot __pyx_string_tab[17] -#define __pyx_kp_u_dataframe_must_be_pandas_or_pola __pyx_string_tab[18] -#define __pyx_kp_u_dictionaries_in_missing_ranges_m __pyx_string_tab[19] -#define __pyx_kp_u_does_not_exist __pyx_string_tab[20] -#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[21] -#define __pyx_kp_u_in_variable __pyx_string_tab[22] -#define __pyx_kp_u_instead __pyx_string_tab[23] -#define __pyx_kp_u_is_of_type __pyx_string_tab[24] -#define __pyx_kp_u_length_of_column_labels_must_be __pyx_string_tab[25] -#define __pyx_kp_u_measure_for_variable __pyx_string_tab[26] -#define __pyx_kp_u_missing_ranges_hi_and_lo_values __pyx_string_tab[27] -#define __pyx_kp_u_missing_ranges_hi_and_lo_values_2 __pyx_string_tab[28] -#define __pyx_kp_u_missing_ranges_max_1_discrete_nu __pyx_string_tab[29] -#define __pyx_kp_u_missing_ranges_max_1_range_value __pyx_string_tab[30] -#define __pyx_kp_u_missing_ranges_max_3_discrete_nu __pyx_string_tab[31] -#define __pyx_kp_u_missing_ranges_max_3_string_valu __pyx_string_tab[32] -#define __pyx_kp_u_missing_ranges_string_values_len __pyx_string_tab[33] -#define __pyx_kp_u_missing_ranges_values_in_diction __pyx_string_tab[34] -#define __pyx_kp_u_missing_ranges_values_must_be_bo __pyx_string_tab[35] -#define __pyx_kp_u_missing_user_values_not_allowed __pyx_string_tab[36] -#define __pyx_kp_u_missing_user_values_supports_val __pyx_string_tab[37] -#define __pyx_kp_u_missing_user_values_values_in_di __pyx_string_tab[38] -#define __pyx_kp_u_must_be_boolean_or_be_1_or_0 __pyx_string_tab[39] -#define __pyx_kp_u_must_be_dict_got __pyx_string_tab[40] -#define __pyx_kp_u_must_be_either_nominal_ordinal __pyx_string_tab[41] -#define __pyx_kp_u_must_be_either_right_center_lef __pyx_string_tab[42] -#define __pyx_kp_u_must_be_int __pyx_string_tab[43] -#define __pyx_kp_u_must_be_numeric __pyx_string_tab[44] -#define __pyx_kp_u_must_be_string __pyx_string_tab[45] -#define __pyx_kp_u_must_match_the_type_of_the_colu __pyx_string_tab[46] -#define __pyx_kp_u_note_should_be_either_str_or_lis __pyx_string_tab[47] -#define __pyx_kp_u_numeric_missing_ranges_value_giv __pyx_string_tab[48] -#define __pyx_kp_u_ordinal_2 __pyx_string_tab[49] -#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[50] -#define __pyx_kp_u_pyreadstat__readstat_parser __pyx_string_tab[51] -#define __pyx_kp_u_pyreadstat__readstat_writer_pyx __pyx_string_tab[52] -#define __pyx_kp_u_pyreadstat_datetime __pyx_string_tab[53] -#define __pyx_kp_u_pyreadstat_narwhals_stable_v2 __pyx_string_tab[54] -#define __pyx_kp_u_pyreadstat_numpy __pyx_string_tab[55] -#define __pyx_kp_u_pyreadstat_os __pyx_string_tab[56] -#define __pyx_kp_u_pyreadstat_sys __pyx_string_tab[57] -#define __pyx_kp_u_pyreadstat_warnings __pyx_string_tab[58] -#define __pyx_kp_u_starts_with_an_illegal_non_alph __pyx_string_tab[59] -#define __pyx_kp_u_the_destination_folder __pyx_string_tab[60] -#define __pyx_kp_u_unknown_file_format __pyx_string_tab[61] -#define __pyx_kp_u_utf_8 __pyx_string_tab[62] -#define __pyx_kp_u_variable_name __pyx_string_tab[63] -#define __pyx_kp_u_variable_name_s_contains_a_space __pyx_string_tab[64] -#define __pyx_kp_u_variable_names_must_be_non_empty __pyx_string_tab[65] -#define __pyx_kp_u_variable_value_labels_type_of_La __pyx_string_tab[66] -#define __pyx_kp_u_variable_value_labels_type_of_Va __pyx_string_tab[67] -#define __pyx_kp_u_variable_value_labels_value_for __pyx_string_tab[68] -#define __pyx_kp_u_wrong_writer_format __pyx_string_tab[69] -#define __pyx_n_u_Boolean __pyx_string_tab[70] -#define __pyx_n_u_Categorical __pyx_string_tab[71] -#define __pyx_n_u_Date __pyx_string_tab[72] -#define __pyx_n_u_Datetime __pyx_string_tab[73] -#define __pyx_n_u_Decimal __pyx_string_tab[74] -#define __pyx_n_u_Enum __pyx_string_tab[75] -#define __pyx_n_u_Float32 __pyx_string_tab[76] -#define __pyx_n_u_Float64 __pyx_string_tab[77] -#define __pyx_n_u_Int128 __pyx_string_tab[78] -#define __pyx_n_u_Int16 __pyx_string_tab[79] -#define __pyx_n_u_Int32 __pyx_string_tab[80] -#define __pyx_n_u_Int64 __pyx_string_tab[81] -#define __pyx_n_u_Int8 __pyx_string_tab[82] -#define __pyx_n_u_Object __pyx_string_tab[83] -#define __pyx_n_u_PyreadstatError __pyx_string_tab[84] -#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[85] -#define __pyx_n_u_ReadstatError __pyx_string_tab[86] -#define __pyx_n_u_String __pyx_string_tab[87] -#define __pyx_n_u_Time __pyx_string_tab[88] -#define __pyx_n_u_UInt128 __pyx_string_tab[89] -#define __pyx_n_u_UInt16 __pyx_string_tab[90] -#define __pyx_n_u_UInt32 __pyx_string_tab[91] -#define __pyx_n_u_UInt64 __pyx_string_tab[92] -#define __pyx_n_u_UInt8 __pyx_string_tab[93] -#define __pyx_n_u__5 __pyx_string_tab[94] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[95] -#define __pyx_n_u_cast __pyx_string_tab[96] -#define __pyx_n_u_cat __pyx_string_tab[97] -#define __pyx_n_u_center __pyx_string_tab[98] -#define __pyx_n_u_class_getitem __pyx_string_tab[99] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[100] -#define __pyx_n_u_clone __pyx_string_tab[101] -#define __pyx_n_u_column_labels __pyx_string_tab[102] -#define __pyx_n_u_columns __pyx_string_tab[103] -#define __pyx_n_u_combine __pyx_string_tab[104] -#define __pyx_n_u_compress __pyx_string_tab[105] -#define __pyx_n_u_date __pyx_string_tab[106] -#define __pyx_n_u_datetime __pyx_string_tab[107] -#define __pyx_n_u_datetime64 __pyx_string_tab[108] -#define __pyx_n_u_days __pyx_string_tab[109] -#define __pyx_n_u_df __pyx_string_tab[110] -#define __pyx_n_u_dirname __pyx_string_tab[111] -#define __pyx_n_u_drop_nulls __pyx_string_tab[112] -#define __pyx_n_u_dst_path __pyx_string_tab[113] -#define __pyx_n_u_dta __pyx_string_tab[114] -#define __pyx_n_u_dtype __pyx_string_tab[115] -#define __pyx_n_u_eager_only __pyx_string_tab[116] -#define __pyx_n_u_encode __pyx_string_tab[117] -#define __pyx_n_u_expanduser __pyx_string_tab[118] -#define __pyx_n_u_file_format_version __pyx_string_tab[119] -#define __pyx_n_u_file_label __pyx_string_tab[120] -#define __pyx_n_u_filter __pyx_string_tab[121] -#define __pyx_n_u_from_native __pyx_string_tab[122] -#define __pyx_n_u_fsdecode __pyx_string_tab[123] -#define __pyx_n_u_fsencode __pyx_string_tab[124] -#define __pyx_n_u_func __pyx_string_tab[125] -#define __pyx_n_u_get __pyx_string_tab[126] -#define __pyx_n_u_get_categories __pyx_string_tab[127] -#define __pyx_n_u_get_native_namespace __pyx_string_tab[128] -#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[129] -#define __pyx_n_u_hi __pyx_string_tab[130] -#define __pyx_n_u_implementation __pyx_string_tab[131] -#define __pyx_n_u_is_coroutine __pyx_string_tab[132] -#define __pyx_n_u_is_in __pyx_string_tab[133] -#define __pyx_n_u_is_pandas __pyx_string_tab[134] -#define __pyx_n_u_is_polars __pyx_string_tab[135] -#define __pyx_n_u_isalpha __pyx_string_tab[136] -#define __pyx_n_u_isdir __pyx_string_tab[137] -#define __pyx_n_u_isna __pyx_string_tab[138] -#define __pyx_n_u_items __pyx_string_tab[139] -#define __pyx_n_u_iter_columns __pyx_string_tab[140] -#define __pyx_n_u_iter_rows __pyx_string_tab[141] -#define __pyx_n_u_keys __pyx_string_tab[142] -#define __pyx_n_u_left __pyx_string_tab[143] -#define __pyx_n_u_lo __pyx_string_tab[144] -#define __pyx_n_u_main __pyx_string_tab[145] -#define __pyx_n_u_min __pyx_string_tab[146] -#define __pyx_n_u_missing_ranges __pyx_string_tab[147] -#define __pyx_n_u_missing_user_values __pyx_string_tab[148] -#define __pyx_n_u_module __pyx_string_tab[149] -#define __pyx_n_u_ms __pyx_string_tab[150] -#define __pyx_n_u_name __pyx_string_tab[151] -#define __pyx_n_u_name_2 __pyx_string_tab[152] -#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[153] -#define __pyx_n_u_nominal __pyx_string_tab[154] -#define __pyx_n_u_note __pyx_string_tab[155] -#define __pyx_n_u_np __pyx_string_tab[156] -#define __pyx_n_u_ns __pyx_string_tab[157] -#define __pyx_n_u_nt __pyx_string_tab[158] -#define __pyx_n_u_nth __pyx_string_tab[159] -#define __pyx_n_u_null_count __pyx_string_tab[160] -#define __pyx_n_u_numpy __pyx_string_tab[161] -#define __pyx_n_u_nw __pyx_string_tab[162] -#define __pyx_n_u_ordinal __pyx_string_tab[163] -#define __pyx_n_u_os __pyx_string_tab[164] -#define __pyx_n_u_path __pyx_string_tab[165] -#define __pyx_n_u_pop __pyx_string_tab[166] -#define __pyx_n_u_por __pyx_string_tab[167] -#define __pyx_n_u_pyreadstat__readstat_writer __pyx_string_tab[168] -#define __pyx_n_u_pyx_capi __pyx_string_tab[169] -#define __pyx_n_u_qualname __pyx_string_tab[170] -#define __pyx_n_u_readstat_parser __pyx_string_tab[171] -#define __pyx_n_u_replace __pyx_string_tab[172] -#define __pyx_n_u_right __pyx_string_tab[173] -#define __pyx_n_u_round __pyx_string_tab[174] -#define __pyx_n_u_row_compress __pyx_string_tab[175] -#define __pyx_n_u_row_compression __pyx_string_tab[176] -#define __pyx_n_u_sav __pyx_string_tab[177] -#define __pyx_n_u_scale __pyx_string_tab[178] -#define __pyx_n_u_set_name __pyx_string_tab[179] -#define __pyx_n_u_setdefault __pyx_string_tab[180] -#define __pyx_n_u_stable __pyx_string_tab[181] -#define __pyx_n_u_surrogateescape __pyx_string_tab[182] -#define __pyx_n_u_sys __pyx_string_tab[183] -#define __pyx_n_u_table_name __pyx_string_tab[184] -#define __pyx_n_u_test __pyx_string_tab[185] -#define __pyx_n_u_then __pyx_string_tab[186] -#define __pyx_n_u_time __pyx_string_tab[187] -#define __pyx_n_u_time_unit __pyx_string_tab[188] -#define __pyx_n_u_timestamp __pyx_string_tab[189] -#define __pyx_n_u_timezone __pyx_string_tab[190] -#define __pyx_n_u_total_seconds __pyx_string_tab[191] -#define __pyx_n_u_tzinfo __pyx_string_tab[192] -#define __pyx_n_u_unknown __pyx_string_tab[193] -#define __pyx_n_u_upper __pyx_string_tab[194] -#define __pyx_n_u_us __pyx_string_tab[195] -#define __pyx_n_u_utc __pyx_string_tab[196] -#define __pyx_n_u_v2 __pyx_string_tab[197] -#define __pyx_n_u_values __pyx_string_tab[198] -#define __pyx_n_u_variable_alignment __pyx_string_tab[199] -#define __pyx_n_u_variable_display_width __pyx_string_tab[200] -#define __pyx_n_u_variable_format __pyx_string_tab[201] -#define __pyx_n_u_variable_measure __pyx_string_tab[202] -#define __pyx_n_u_variable_value_labels __pyx_string_tab[203] -#define __pyx_n_u_version __pyx_string_tab[204] -#define __pyx_n_u_warn __pyx_string_tab[205] -#define __pyx_n_u_warnings __pyx_string_tab[206] -#define __pyx_n_u_when __pyx_string_tab[207] -#define __pyx_n_u_with_columns __pyx_string_tab[208] -#define __pyx_n_u_writer_entry_point __pyx_string_tab[209] -#define __pyx_n_u_writer_file_format __pyx_string_tab[210] -#define __pyx_n_u_writer_format __pyx_string_tab[211] -#define __pyx_n_u_x __pyx_string_tab[212] -#define __pyx_n_u_xport __pyx_string_tab[213] -#define __pyx_n_u_zip __pyx_string_tab[214] -#define __pyx_kp_b_PyObject_PyObject_PyObject_PyObj __pyx_string_tab[215] -#define __pyx_kp_b_PyObject_readstat_to_numpy_types __pyx_string_tab[216] -#define __pyx_kp_b_iso88591_Q_22BBVVW_11K1_1_S_Q_a_9D_1_1_a __pyx_string_tab[217] -#define __pyx_kp_b_void_readstat_error_t_check_exit __pyx_string_tab[218] +#define __pyx_kp_u_The_file_may_be_locked_by_anoth __pyx_string_tab[5] +#define __pyx_kp_u_Unknown_data_format_to_insert __pyx_string_tab[6] +#define __pyx_kp_u_Unknown_pywriter_variable_format __pyx_string_tab[7] +#define __pyx_kp_u_Version_not_supported __pyx_string_tab[8] +#define __pyx_kp_u__2 __pyx_string_tab[9] +#define __pyx_kp_u__3 __pyx_string_tab[10] +#define __pyx_kp_u__4 __pyx_string_tab[11] +#define __pyx_kp_u__5 __pyx_string_tab[12] +#define __pyx_kp_u__6 __pyx_string_tab[13] +#define __pyx_kp_u_add_note __pyx_string_tab[14] +#define __pyx_kp_u_alignment_for_variable __pyx_string_tab[15] +#define __pyx_kp_u_and_it_must_be_str_not_starting __pyx_string_tab[16] +#define __pyx_kp_u_character_missing_ranges_value_g __pyx_string_tab[17] +#define __pyx_kp_u_column_labels_must_be_either_lis __pyx_string_tab[18] +#define __pyx_kp_u_compress_and_row_compress_cannot __pyx_string_tab[19] +#define __pyx_kp_u_dataframe_must_be_pandas_or_pola __pyx_string_tab[20] +#define __pyx_kp_u_dictionaries_in_missing_ranges_m __pyx_string_tab[21] +#define __pyx_kp_u_does_not_exist __pyx_string_tab[22] +#define __pyx_kp_u_errno __pyx_string_tab[23] +#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[24] +#define __pyx_kp_u_for_writing __pyx_string_tab[25] +#define __pyx_kp_u_in_variable __pyx_string_tab[26] +#define __pyx_kp_u_instead __pyx_string_tab[27] +#define __pyx_kp_u_is_of_type __pyx_string_tab[28] +#define __pyx_kp_u_length_of_column_labels_must_be __pyx_string_tab[29] +#define __pyx_kp_u_measure_for_variable __pyx_string_tab[30] +#define __pyx_kp_u_missing_ranges_hi_and_lo_values __pyx_string_tab[31] +#define __pyx_kp_u_missing_ranges_hi_and_lo_values_2 __pyx_string_tab[32] +#define __pyx_kp_u_missing_ranges_max_1_discrete_nu __pyx_string_tab[33] +#define __pyx_kp_u_missing_ranges_max_1_range_value __pyx_string_tab[34] +#define __pyx_kp_u_missing_ranges_max_3_discrete_nu __pyx_string_tab[35] +#define __pyx_kp_u_missing_ranges_max_3_string_valu __pyx_string_tab[36] +#define __pyx_kp_u_missing_ranges_string_values_len __pyx_string_tab[37] +#define __pyx_kp_u_missing_ranges_values_in_diction __pyx_string_tab[38] +#define __pyx_kp_u_missing_ranges_values_must_be_bo __pyx_string_tab[39] +#define __pyx_kp_u_missing_user_values_not_allowed __pyx_string_tab[40] +#define __pyx_kp_u_missing_user_values_supports_val __pyx_string_tab[41] +#define __pyx_kp_u_missing_user_values_values_in_di __pyx_string_tab[42] +#define __pyx_kp_u_must_be_boolean_or_be_1_or_0 __pyx_string_tab[43] +#define __pyx_kp_u_must_be_dict_got __pyx_string_tab[44] +#define __pyx_kp_u_must_be_either_nominal_ordinal __pyx_string_tab[45] +#define __pyx_kp_u_must_be_either_right_center_lef __pyx_string_tab[46] +#define __pyx_kp_u_must_be_int __pyx_string_tab[47] +#define __pyx_kp_u_must_be_numeric __pyx_string_tab[48] +#define __pyx_kp_u_must_be_string __pyx_string_tab[49] +#define __pyx_kp_u_must_match_the_type_of_the_colu __pyx_string_tab[50] +#define __pyx_kp_u_note_should_be_either_str_or_lis __pyx_string_tab[51] +#define __pyx_kp_u_numeric_missing_ranges_value_giv __pyx_string_tab[52] +#define __pyx_kp_u_ordinal_2 __pyx_string_tab[53] +#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[54] +#define __pyx_kp_u_pyreadstat__readstat_parser __pyx_string_tab[55] +#define __pyx_kp_u_pyreadstat__readstat_writer_pyx __pyx_string_tab[56] +#define __pyx_kp_u_pyreadstat_datetime __pyx_string_tab[57] +#define __pyx_kp_u_pyreadstat_narwhals_stable_v2 __pyx_string_tab[58] +#define __pyx_kp_u_pyreadstat_numpy __pyx_string_tab[59] +#define __pyx_kp_u_pyreadstat_os __pyx_string_tab[60] +#define __pyx_kp_u_pyreadstat_sys __pyx_string_tab[61] +#define __pyx_kp_u_pyreadstat_warnings __pyx_string_tab[62] +#define __pyx_kp_u_starts_with_an_illegal_neither __pyx_string_tab[63] +#define __pyx_kp_u_the_destination_folder __pyx_string_tab[64] +#define __pyx_kp_u_unknown_file_format __pyx_string_tab[65] +#define __pyx_kp_u_utf_8 __pyx_string_tab[66] +#define __pyx_kp_u_variable_name __pyx_string_tab[67] +#define __pyx_kp_u_variable_name_s_contains_a_space __pyx_string_tab[68] +#define __pyx_kp_u_variable_names_must_be_non_empty __pyx_string_tab[69] +#define __pyx_kp_u_variable_value_labels_type_of_La __pyx_string_tab[70] +#define __pyx_kp_u_variable_value_labels_type_of_Va __pyx_string_tab[71] +#define __pyx_kp_u_variable_value_labels_value_for __pyx_string_tab[72] +#define __pyx_kp_u_wrong_writer_format __pyx_string_tab[73] +#define __pyx_n_u_ __pyx_string_tab[74] +#define __pyx_n_u_Boolean __pyx_string_tab[75] +#define __pyx_n_u_Categorical __pyx_string_tab[76] +#define __pyx_n_u_Date __pyx_string_tab[77] +#define __pyx_n_u_Datetime __pyx_string_tab[78] +#define __pyx_n_u_Decimal __pyx_string_tab[79] +#define __pyx_n_u_Enum __pyx_string_tab[80] +#define __pyx_n_u_Float32 __pyx_string_tab[81] +#define __pyx_n_u_Float64 __pyx_string_tab[82] +#define __pyx_n_u_Int128 __pyx_string_tab[83] +#define __pyx_n_u_Int16 __pyx_string_tab[84] +#define __pyx_n_u_Int32 __pyx_string_tab[85] +#define __pyx_n_u_Int64 __pyx_string_tab[86] +#define __pyx_n_u_Int8 __pyx_string_tab[87] +#define __pyx_n_u_Object __pyx_string_tab[88] +#define __pyx_n_u_PyreadstatError __pyx_string_tab[89] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[90] +#define __pyx_n_u_ReadstatError __pyx_string_tab[91] +#define __pyx_n_u_String __pyx_string_tab[92] +#define __pyx_n_u_Time __pyx_string_tab[93] +#define __pyx_n_u_UInt128 __pyx_string_tab[94] +#define __pyx_n_u_UInt16 __pyx_string_tab[95] +#define __pyx_n_u_UInt32 __pyx_string_tab[96] +#define __pyx_n_u_UInt64 __pyx_string_tab[97] +#define __pyx_n_u_UInt8 __pyx_string_tab[98] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[99] +#define __pyx_n_u_cast __pyx_string_tab[100] +#define __pyx_n_u_cat __pyx_string_tab[101] +#define __pyx_n_u_center __pyx_string_tab[102] +#define __pyx_n_u_class_getitem __pyx_string_tab[103] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[104] +#define __pyx_n_u_clone __pyx_string_tab[105] +#define __pyx_n_u_column_labels __pyx_string_tab[106] +#define __pyx_n_u_columns __pyx_string_tab[107] +#define __pyx_n_u_combine __pyx_string_tab[108] +#define __pyx_n_u_compress __pyx_string_tab[109] +#define __pyx_n_u_d __pyx_string_tab[110] +#define __pyx_n_u_date __pyx_string_tab[111] +#define __pyx_n_u_datetime __pyx_string_tab[112] +#define __pyx_n_u_datetime64 __pyx_string_tab[113] +#define __pyx_n_u_days __pyx_string_tab[114] +#define __pyx_n_u_df __pyx_string_tab[115] +#define __pyx_n_u_dirname __pyx_string_tab[116] +#define __pyx_n_u_drop_nulls __pyx_string_tab[117] +#define __pyx_n_u_dst_path __pyx_string_tab[118] +#define __pyx_n_u_dta __pyx_string_tab[119] +#define __pyx_n_u_dtype __pyx_string_tab[120] +#define __pyx_n_u_eager_only __pyx_string_tab[121] +#define __pyx_n_u_encode __pyx_string_tab[122] +#define __pyx_n_u_expanduser __pyx_string_tab[123] +#define __pyx_n_u_file_format_version __pyx_string_tab[124] +#define __pyx_n_u_file_label __pyx_string_tab[125] +#define __pyx_n_u_filter __pyx_string_tab[126] +#define __pyx_n_u_from_native __pyx_string_tab[127] +#define __pyx_n_u_fsdecode __pyx_string_tab[128] +#define __pyx_n_u_fsencode __pyx_string_tab[129] +#define __pyx_n_u_func __pyx_string_tab[130] +#define __pyx_n_u_get __pyx_string_tab[131] +#define __pyx_n_u_get_categories __pyx_string_tab[132] +#define __pyx_n_u_get_native_namespace __pyx_string_tab[133] +#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[134] +#define __pyx_n_u_hi __pyx_string_tab[135] +#define __pyx_n_u_implementation __pyx_string_tab[136] +#define __pyx_n_u_is_coroutine __pyx_string_tab[137] +#define __pyx_n_u_is_in __pyx_string_tab[138] +#define __pyx_n_u_is_pandas __pyx_string_tab[139] +#define __pyx_n_u_is_polars __pyx_string_tab[140] +#define __pyx_n_u_isalpha __pyx_string_tab[141] +#define __pyx_n_u_isdir __pyx_string_tab[142] +#define __pyx_n_u_isna __pyx_string_tab[143] +#define __pyx_n_u_items __pyx_string_tab[144] +#define __pyx_n_u_iter_columns __pyx_string_tab[145] +#define __pyx_n_u_iter_rows __pyx_string_tab[146] +#define __pyx_n_u_keys __pyx_string_tab[147] +#define __pyx_n_u_left __pyx_string_tab[148] +#define __pyx_n_u_lo __pyx_string_tab[149] +#define __pyx_n_u_main __pyx_string_tab[150] +#define __pyx_n_u_min __pyx_string_tab[151] +#define __pyx_n_u_missing_ranges __pyx_string_tab[152] +#define __pyx_n_u_missing_user_values __pyx_string_tab[153] +#define __pyx_n_u_module __pyx_string_tab[154] +#define __pyx_n_u_ms __pyx_string_tab[155] +#define __pyx_n_u_name __pyx_string_tab[156] +#define __pyx_n_u_name_2 __pyx_string_tab[157] +#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[158] +#define __pyx_n_u_nominal __pyx_string_tab[159] +#define __pyx_n_u_note __pyx_string_tab[160] +#define __pyx_n_u_np __pyx_string_tab[161] +#define __pyx_n_u_ns __pyx_string_tab[162] +#define __pyx_n_u_nt __pyx_string_tab[163] +#define __pyx_n_u_nth __pyx_string_tab[164] +#define __pyx_n_u_null_count __pyx_string_tab[165] +#define __pyx_n_u_numpy __pyx_string_tab[166] +#define __pyx_n_u_nw __pyx_string_tab[167] +#define __pyx_n_u_ordinal __pyx_string_tab[168] +#define __pyx_n_u_os __pyx_string_tab[169] +#define __pyx_n_u_path __pyx_string_tab[170] +#define __pyx_n_u_pop __pyx_string_tab[171] +#define __pyx_n_u_por __pyx_string_tab[172] +#define __pyx_n_u_pyreadstat__readstat_writer __pyx_string_tab[173] +#define __pyx_n_u_pyx_capi __pyx_string_tab[174] +#define __pyx_n_u_qualname __pyx_string_tab[175] +#define __pyx_n_u_readstat_parser __pyx_string_tab[176] +#define __pyx_n_u_replace __pyx_string_tab[177] +#define __pyx_n_u_right __pyx_string_tab[178] +#define __pyx_n_u_round __pyx_string_tab[179] +#define __pyx_n_u_row_compress __pyx_string_tab[180] +#define __pyx_n_u_row_compression __pyx_string_tab[181] +#define __pyx_n_u_sav __pyx_string_tab[182] +#define __pyx_n_u_scale __pyx_string_tab[183] +#define __pyx_n_u_set_name __pyx_string_tab[184] +#define __pyx_n_u_setdefault __pyx_string_tab[185] +#define __pyx_n_u_stable __pyx_string_tab[186] +#define __pyx_n_u_strerror __pyx_string_tab[187] +#define __pyx_n_u_surrogateescape __pyx_string_tab[188] +#define __pyx_n_u_sys __pyx_string_tab[189] +#define __pyx_n_u_table_name __pyx_string_tab[190] +#define __pyx_n_u_test __pyx_string_tab[191] +#define __pyx_n_u_then __pyx_string_tab[192] +#define __pyx_n_u_time __pyx_string_tab[193] +#define __pyx_n_u_time_unit __pyx_string_tab[194] +#define __pyx_n_u_timestamp __pyx_string_tab[195] +#define __pyx_n_u_timezone __pyx_string_tab[196] +#define __pyx_n_u_total_seconds __pyx_string_tab[197] +#define __pyx_n_u_tzinfo __pyx_string_tab[198] +#define __pyx_n_u_unknown __pyx_string_tab[199] +#define __pyx_n_u_upper __pyx_string_tab[200] +#define __pyx_n_u_us __pyx_string_tab[201] +#define __pyx_n_u_utc __pyx_string_tab[202] +#define __pyx_n_u_v2 __pyx_string_tab[203] +#define __pyx_n_u_values __pyx_string_tab[204] +#define __pyx_n_u_variable_alignment __pyx_string_tab[205] +#define __pyx_n_u_variable_display_width __pyx_string_tab[206] +#define __pyx_n_u_variable_format __pyx_string_tab[207] +#define __pyx_n_u_variable_measure __pyx_string_tab[208] +#define __pyx_n_u_variable_value_labels __pyx_string_tab[209] +#define __pyx_n_u_version __pyx_string_tab[210] +#define __pyx_n_u_warn __pyx_string_tab[211] +#define __pyx_n_u_warnings __pyx_string_tab[212] +#define __pyx_n_u_when __pyx_string_tab[213] +#define __pyx_n_u_with_columns __pyx_string_tab[214] +#define __pyx_n_u_writer_entry_point __pyx_string_tab[215] +#define __pyx_n_u_writer_file_format __pyx_string_tab[216] +#define __pyx_n_u_writer_format __pyx_string_tab[217] +#define __pyx_n_u_x __pyx_string_tab[218] +#define __pyx_n_u_xport __pyx_string_tab[219] +#define __pyx_n_u_zip __pyx_string_tab[220] +#define __pyx_kp_b_PyObject_PyObject_PyObject_PyObj __pyx_string_tab[221] +#define __pyx_kp_b_PyObject_readstat_to_numpy_types __pyx_string_tab[222] +#define __pyx_kp_b_iso88591_Q_22BBVVW_11K1_1_S_Q_a_9D_1_1_a __pyx_string_tab[223] +#define __pyx_kp_b_void_readstat_error_t_check_exit __pyx_string_tab[224] #define __pyx_float_1e3 __pyx_number_tab[0] #define __pyx_float_1e6 __pyx_number_tab[1] #define __pyx_float_1e9 __pyx_number_tab[2] @@ -3198,7 +3216,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<219; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<225; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } for (int i=0; i<9; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_clear_contents ### */ /* CommonTypesMetaclass.module_state_clear */ @@ -3225,7 +3243,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<219; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<225; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } for (int i=0; i<9; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_traverse_contents ### */ /* CommonTypesMetaclass.module_state_traverse */ @@ -3240,7 +3258,7 @@ return 0; #endif /* #### Code section: module_code ### */ -/* "pyreadstat/_readstat_writer.pyx":62 +/* "pyreadstat/_readstat_writer.pyx":63 * cdef int dta_117_max_width = 2045 * * cdef object vectorized_convert_datetime_to_number(object df, dst_file_format file_format, list pywriter_types, list pywriter_timeunits, int col_count): # <<<<<<<<<<<<<< @@ -3283,7 +3301,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_RefNannySetupContext("vectorized_convert_datetime_to_number", 0); __Pyx_INCREF(__pyx_v_df); - /* "pyreadstat/_readstat_writer.pyx":68 + /* "pyreadstat/_readstat_writer.pyx":69 * cdef dict convfacs * cdef double offset_secs * cdef double mulfac = 1.0 # <<<<<<<<<<<<<< @@ -3292,7 +3310,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_mulfac = 1.0; - /* "pyreadstat/_readstat_writer.pyx":73 + /* "pyreadstat/_readstat_writer.pyx":74 * cdef double convfac * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -3303,7 +3321,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":74 + /* "pyreadstat/_readstat_writer.pyx":75 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * offset_secs = spss_offset_secs # <<<<<<<<<<<<<< @@ -3312,7 +3330,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_offset_secs = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs; - /* "pyreadstat/_readstat_writer.pyx":73 + /* "pyreadstat/_readstat_writer.pyx":74 * cdef double convfac * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -3322,7 +3340,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date break; default: - /* "pyreadstat/_readstat_writer.pyx":76 + /* "pyreadstat/_readstat_writer.pyx":77 * offset_secs = spss_offset_secs * else: * offset_secs = sas_offset_secs # <<<<<<<<<<<<<< @@ -3333,7 +3351,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date break; } - /* "pyreadstat/_readstat_writer.pyx":77 + /* "pyreadstat/_readstat_writer.pyx":78 * else: * offset_secs = sas_offset_secs * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -3343,7 +3361,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":79 + /* "pyreadstat/_readstat_writer.pyx":80 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds * mulfac = 1000.0 # <<<<<<<<<<<<<< @@ -3352,7 +3370,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_mulfac = 1000.0; - /* "pyreadstat/_readstat_writer.pyx":77 + /* "pyreadstat/_readstat_writer.pyx":78 * else: * offset_secs = sas_offset_secs * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -3361,34 +3379,34 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ } - /* "pyreadstat/_readstat_writer.pyx":80 + /* "pyreadstat/_readstat_writer.pyx":81 * # stata stores in milliseconds * mulfac = 1000.0 * convfacs = {'ns': 1e9, 'us': 1e6, 'ms': 1e3} # <<<<<<<<<<<<<< * * col_indxs = list() */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ns, __pyx_mstate_global->__pyx_float_1e9) < (0)) __PYX_ERR(0, 80, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_us, __pyx_mstate_global->__pyx_float_1e6) < (0)) __PYX_ERR(0, 80, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ms, __pyx_mstate_global->__pyx_float_1e3) < (0)) __PYX_ERR(0, 80, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ns, __pyx_mstate_global->__pyx_float_1e9) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_us, __pyx_mstate_global->__pyx_float_1e6) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ms, __pyx_mstate_global->__pyx_float_1e3) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_v_convfacs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":82 + /* "pyreadstat/_readstat_writer.pyx":83 * convfacs = {'ns': 1e9, 'us': 1e6, 'ms': 1e3} * * col_indxs = list() # <<<<<<<<<<<<<< * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_col_indxs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":83 + /* "pyreadstat/_readstat_writer.pyx":84 * * col_indxs = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -3400,7 +3418,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_col_indx = __pyx_t_5; - /* "pyreadstat/_readstat_writer.pyx":84 + /* "pyreadstat/_readstat_writer.pyx":85 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -3409,32 +3427,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ if (unlikely(__pyx_v_pywriter_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 84, __pyx_L1_error) + __PYX_ERR(0, 85, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":85 + /* "pyreadstat/_readstat_writer.pyx":86 * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: * col_indxs.append(col_indx) # <<<<<<<<<<<<<< * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) */ - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":84 + /* "pyreadstat/_readstat_writer.pyx":85 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -3444,7 +3462,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date } } - /* "pyreadstat/_readstat_writer.pyx":87 + /* "pyreadstat/_readstat_writer.pyx":88 * col_indxs.append(col_indx) * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) # <<<<<<<<<<<<<< @@ -3454,9 +3472,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_6 = __pyx_v_df; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; @@ -3476,14 +3494,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 87, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; @@ -3493,7 +3511,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_14 = 0; @@ -3502,13 +3520,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":88 + /* "pyreadstat/_readstat_writer.pyx":89 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -3521,19 +3539,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 88, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 89, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_col_indx = __pyx_t_3; - /* "pyreadstat/_readstat_writer.pyx":89 + /* "pyreadstat/_readstat_writer.pyx":90 * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: * convfac = convfacs[pywriter_timeunits[col_indx]] # <<<<<<<<<<<<<< @@ -3542,18 +3560,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ if (unlikely(__pyx_v_pywriter_timeunits == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 89, __pyx_L1_error) + __PYX_ERR(0, 90, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_timeunits, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_timeunits, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_convfacs, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_convfacs, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_16 = __Pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_convfac = __pyx_t_16; - /* "pyreadstat/_readstat_writer.pyx":90 + /* "pyreadstat/_readstat_writer.pyx":91 * for col_indx in col_indxs: * convfac = convfacs[pywriter_timeunits[col_indx]] * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) # <<<<<<<<<<<<<< @@ -3563,18 +3581,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_2 = __pyx_v_df; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_18 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -3594,10 +3612,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_20 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_20 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -3617,18 +3635,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 90, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); __pyx_t_20 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -3648,7 +3666,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 90, __pyx_L1_error) + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); } __pyx_t_14 = 0; @@ -3658,7 +3676,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 90, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_14 = 0; @@ -3667,13 +3685,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":91 + /* "pyreadstat/_readstat_writer.pyx":92 * convfac = convfacs[pywriter_timeunits[col_indx]] * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((((nw.nth(col_indx).cast(nw.Float64))/convfac) + offset_secs).round() * mulfac) # <<<<<<<<<<<<<< @@ -3683,12 +3701,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_10 = __pyx_v_df; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -3708,14 +3726,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_14 = 0; @@ -3725,18 +3743,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); } - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_convfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_convfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_t_17, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_t_17, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_offset_secs); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_offset_secs); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_17 = PyNumber_Add(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_17 = PyNumber_Add(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -3748,12 +3766,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_17 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_17 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_2, __pyx_t_17); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_2, __pyx_t_17); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; @@ -3763,13 +3781,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":88 + /* "pyreadstat/_readstat_writer.pyx":89 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -3779,7 +3797,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":92 + /* "pyreadstat/_readstat_writer.pyx":93 * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((((nw.nth(col_indx).cast(nw.Float64))/convfac) + offset_secs).round() * mulfac) * return df # <<<<<<<<<<<<<< @@ -3791,7 +3809,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_r = __pyx_v_df; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":62 + /* "pyreadstat/_readstat_writer.pyx":63 * cdef int dta_117_max_width = 2045 * * cdef object vectorized_convert_datetime_to_number(object df, dst_file_format file_format, list pywriter_types, list pywriter_timeunits, int col_count): # <<<<<<<<<<<<<< @@ -3824,7 +3842,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":95 +/* "pyreadstat/_readstat_writer.pyx":96 * * * cdef object vectorized_convert_date_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -3864,7 +3882,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_RefNannySetupContext("vectorized_convert_date_to_number", 0); __Pyx_INCREF(__pyx_v_df); - /* "pyreadstat/_readstat_writer.pyx":100 + /* "pyreadstat/_readstat_writer.pyx":101 * """ * cdef double offset_days * cdef double mulfac = 1.0 # <<<<<<<<<<<<<< @@ -3873,7 +3891,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_mulfac = 1.0; - /* "pyreadstat/_readstat_writer.pyx":104 + /* "pyreadstat/_readstat_writer.pyx":105 * cdef list col_indxs * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -3884,7 +3902,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":105 + /* "pyreadstat/_readstat_writer.pyx":106 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * offset_days = spss_offset_days # <<<<<<<<<<<<<< @@ -3893,7 +3911,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_offset_days = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days; - /* "pyreadstat/_readstat_writer.pyx":107 + /* "pyreadstat/_readstat_writer.pyx":108 * offset_days = spss_offset_days * # spss stores in seconds * mulfac = 86400 # <<<<<<<<<<<<<< @@ -3902,7 +3920,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ __pyx_v_mulfac = 86400.0; - /* "pyreadstat/_readstat_writer.pyx":104 + /* "pyreadstat/_readstat_writer.pyx":105 * cdef list col_indxs * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -3912,7 +3930,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date break; default: - /* "pyreadstat/_readstat_writer.pyx":109 + /* "pyreadstat/_readstat_writer.pyx":110 * mulfac = 86400 * else: * offset_days = sas_offset_days # <<<<<<<<<<<<<< @@ -3923,19 +3941,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date break; } - /* "pyreadstat/_readstat_writer.pyx":110 + /* "pyreadstat/_readstat_writer.pyx":111 * else: * offset_days = sas_offset_days * col_indxs = list() # <<<<<<<<<<<<<< * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_col_indxs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":111 + /* "pyreadstat/_readstat_writer.pyx":112 * offset_days = sas_offset_days * col_indxs = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -3947,7 +3965,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_col_indx = __pyx_t_4; - /* "pyreadstat/_readstat_writer.pyx":112 + /* "pyreadstat/_readstat_writer.pyx":113 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -3956,32 +3974,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date */ if (unlikely(__pyx_v_pywriter_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 112, __pyx_L1_error) + __PYX_ERR(0, 113, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { - /* "pyreadstat/_readstat_writer.pyx":113 + /* "pyreadstat/_readstat_writer.pyx":114 * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: * col_indxs.append(col_indx) # <<<<<<<<<<<<<< * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) */ - __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":112 + /* "pyreadstat/_readstat_writer.pyx":113 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -3991,7 +4009,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date } } - /* "pyreadstat/_readstat_writer.pyx":115 + /* "pyreadstat/_readstat_writer.pyx":116 * col_indxs.append(col_indx) * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) # <<<<<<<<<<<<<< @@ -4001,9 +4019,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_5 = __pyx_v_df; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; @@ -4023,14 +4041,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; @@ -4040,7 +4058,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_14 = 0; @@ -4049,13 +4067,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":116 + /* "pyreadstat/_readstat_writer.pyx":117 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -4068,19 +4086,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 116, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 117, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_col_indx = __pyx_t_2; - /* "pyreadstat/_readstat_writer.pyx":117 + /* "pyreadstat/_readstat_writer.pyx":118 * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) # <<<<<<<<<<<<<< @@ -4090,18 +4108,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_5 = __pyx_v_df; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_17 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4121,10 +4139,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4144,18 +4162,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); __pyx_t_19 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4175,7 +4193,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } __pyx_t_14 = 0; @@ -4185,7 +4203,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_14 = 0; @@ -4194,13 +4212,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":118 + /* "pyreadstat/_readstat_writer.pyx":119 * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64) + offset_days).round() * mulfac) # <<<<<<<<<<<<<< @@ -4210,12 +4228,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_10 = __pyx_v_df; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4235,14 +4253,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_14 = 0; @@ -4252,12 +4270,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_offset_days); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_offset_days); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_19 = PyNumber_Add(__pyx_t_16, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = PyNumber_Add(__pyx_t_16, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -4269,12 +4287,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_19 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_19 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_19); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_t_19); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; @@ -4284,13 +4302,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":116 + /* "pyreadstat/_readstat_writer.pyx":117 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -4300,7 +4318,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":119 + /* "pyreadstat/_readstat_writer.pyx":120 * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64) + offset_days).round() * mulfac) * return df # <<<<<<<<<<<<<< @@ -4312,7 +4330,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date __pyx_r = __pyx_v_df; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":95 + /* "pyreadstat/_readstat_writer.pyx":96 * * * cdef object vectorized_convert_date_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -4344,7 +4362,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":121 +/* "pyreadstat/_readstat_writer.pyx":122 * return df * * cdef object vectorized_convert_time_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -4383,7 +4401,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_RefNannySetupContext("vectorized_convert_time_to_number", 0); __Pyx_INCREF(__pyx_v_df); - /* "pyreadstat/_readstat_writer.pyx":125 + /* "pyreadstat/_readstat_writer.pyx":126 * transforms time64 columns in the dataframe to floats * """ * cdef double mulfac = 1.0 # <<<<<<<<<<<<<< @@ -4392,7 +4410,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ __pyx_v_mulfac = 1.0; - /* "pyreadstat/_readstat_writer.pyx":129 + /* "pyreadstat/_readstat_writer.pyx":130 * cdef list col_indxs * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -4402,7 +4420,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":131 + /* "pyreadstat/_readstat_writer.pyx":132 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds * mulfac = 1000.0 # <<<<<<<<<<<<<< @@ -4411,7 +4429,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ __pyx_v_mulfac = 1000.0; - /* "pyreadstat/_readstat_writer.pyx":129 + /* "pyreadstat/_readstat_writer.pyx":130 * cdef list col_indxs * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -4420,19 +4438,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ } - /* "pyreadstat/_readstat_writer.pyx":133 + /* "pyreadstat/_readstat_writer.pyx":134 * mulfac = 1000.0 * * col_indxs = list() # <<<<<<<<<<<<<< * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_col_indxs = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":134 + /* "pyreadstat/_readstat_writer.pyx":135 * * col_indxs = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -4444,7 +4462,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_col_indx = __pyx_t_5; - /* "pyreadstat/_readstat_writer.pyx":135 + /* "pyreadstat/_readstat_writer.pyx":136 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -4453,32 +4471,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time */ if (unlikely(__pyx_v_pywriter_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 135, __pyx_L1_error) + __PYX_ERR(0, 136, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":136 + /* "pyreadstat/_readstat_writer.pyx":137 * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: * col_indxs.append(col_indx) # <<<<<<<<<<<<<< * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) */ - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_col_indxs, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":135 + /* "pyreadstat/_readstat_writer.pyx":136 * col_indxs = list() * for col_indx in range(col_count): * if pywriter_types[col_indx] == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -4488,7 +4506,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time } } - /* "pyreadstat/_readstat_writer.pyx":138 + /* "pyreadstat/_readstat_writer.pyx":139 * col_indxs.append(col_indx) * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) # <<<<<<<<<<<<<< @@ -4498,9 +4516,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_6 = __pyx_v_df; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; @@ -4520,14 +4538,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = 0; @@ -4537,7 +4555,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_14 = 0; @@ -4546,13 +4564,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":139 + /* "pyreadstat/_readstat_writer.pyx":140 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -4565,19 +4583,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 140, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_7, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_col_indx = __pyx_t_3; - /* "pyreadstat/_readstat_writer.pyx":140 + /* "pyreadstat/_readstat_writer.pyx":141 * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) # <<<<<<<<<<<<<< @@ -4587,18 +4605,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_6 = __pyx_v_df; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_when); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_17 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4618,10 +4636,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_19 = PyObject_RichCompare(__pyx_t_12, __pyx_mstate_global->__pyx_int_neg_9223372036854775808, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4641,18 +4659,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); __pyx_t_19 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4672,7 +4690,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } __pyx_t_14 = 0; @@ -4682,7 +4700,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_14 = 0; @@ -4691,13 +4709,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":141 + /* "pyreadstat/_readstat_writer.pyx":142 * for col_indx in col_indxs: * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) # <<<<<<<<<<<<<< @@ -4707,12 +4725,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_10 = __pyx_v_df; __Pyx_INCREF(__pyx_t_10); __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_nth); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_From_int(__pyx_v_col_indx); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS @@ -4732,14 +4750,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); } __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_14 = 0; @@ -4749,10 +4767,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); } - __pyx_t_12 = __Pyx_PyFloat_DivideObjC(__pyx_t_16, __pyx_mstate_global->__pyx_float_1e9, 1e9, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyFloat_DivideObjC(__pyx_t_16, __pyx_mstate_global->__pyx_float_1e9, 1e9, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_9 = __pyx_t_12; @@ -4763,12 +4781,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_round, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_mulfac); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -4778,13 +4796,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":139 + /* "pyreadstat/_readstat_writer.pyx":140 * * df = df.with_columns(nw.nth(col_indxs).cast(nw.Int64)) * for col_indx in col_indxs: # <<<<<<<<<<<<<< @@ -4794,7 +4812,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":142 + /* "pyreadstat/_readstat_writer.pyx":143 * df = df.with_columns(nw.when(nw.nth(col_indx)!=-9223372036854775808).then(nw.nth(col_indx))) * df = df.with_columns((nw.nth(col_indx).cast(nw.Float64)/1e9).round() * mulfac) * return df # <<<<<<<<<<<<<< @@ -4806,7 +4824,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time __pyx_r = __pyx_v_df; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":121 + /* "pyreadstat/_readstat_writer.pyx":122 * return df * * cdef object vectorized_convert_time_to_number(object df, dst_file_format file_format, list pywriter_types, int col_count): # <<<<<<<<<<<<<< @@ -4838,7 +4856,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":144 +/* "pyreadstat/_readstat_writer.pyx":145 * return df * * cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter_variable_type curtype, object curval) except *: # <<<<<<<<<<<<<< @@ -4869,7 +4887,16 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __Pyx_RefNannySetupContext("convert_datetimelike_to_number", 0); /* "pyreadstat/_readstat_writer.pyx":151 - * cdef double offset_days, tstamp + * + * cdef double offset_days + * cdef double tstamp = 0 # <<<<<<<<<<<<<< + * + * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: +*/ + __pyx_v_tstamp = 0.0; + + /* "pyreadstat/_readstat_writer.pyx":153 + * cdef double tstamp = 0 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< * offset_days = spss_offset_days @@ -4879,7 +4906,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":152 + /* "pyreadstat/_readstat_writer.pyx":154 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * offset_days = spss_offset_days # <<<<<<<<<<<<<< @@ -4888,7 +4915,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_offset_days = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days; - /* "pyreadstat/_readstat_writer.pyx":153 + /* "pyreadstat/_readstat_writer.pyx":155 * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * offset_days = spss_offset_days * offset_secs = spss_offset_secs # <<<<<<<<<<<<<< @@ -4897,8 +4924,8 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_offset_secs = __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs; - /* "pyreadstat/_readstat_writer.pyx":151 - * cdef double offset_days, tstamp + /* "pyreadstat/_readstat_writer.pyx":153 + * cdef double tstamp = 0 * * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< * offset_days = spss_offset_days @@ -4907,7 +4934,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; default: - /* "pyreadstat/_readstat_writer.pyx":155 + /* "pyreadstat/_readstat_writer.pyx":157 * offset_secs = spss_offset_secs * else: * offset_days = sas_offset_days # <<<<<<<<<<<<<< @@ -4916,7 +4943,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_offset_days = __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_days; - /* "pyreadstat/_readstat_writer.pyx":156 + /* "pyreadstat/_readstat_writer.pyx":158 * else: * offset_days = sas_offset_days * offset_secs = sas_offset_secs # <<<<<<<<<<<<<< @@ -4927,7 +4954,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; } - /* "pyreadstat/_readstat_writer.pyx":158 + /* "pyreadstat/_readstat_writer.pyx":160 * offset_secs = sas_offset_secs * * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -4938,25 +4965,25 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64: - /* "pyreadstat/_readstat_writer.pyx":160 + /* "pyreadstat/_readstat_writer.pyx":162 * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * # get timestamp in seconds * if type(curval) == datetime.datetime: # <<<<<<<<<<<<<< * tstamp = curval.replace(tzinfo=timezone.utc).timestamp() # works only in python 3 * #tstamp = calendar.timegm(curval.replace(tzinfo=_timezone.utc).timetuple()) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":161 + /* "pyreadstat/_readstat_writer.pyx":163 * # get timestamp in seconds * if type(curval) == datetime.datetime: * tstamp = curval.replace(tzinfo=timezone.utc).timestamp() # works only in python 3 # <<<<<<<<<<<<<< @@ -4965,22 +4992,22 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_t_5 = __pyx_v_curval; __Pyx_INCREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, NULL}; - __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_7, __pyx_t_6, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 161, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_7, __pyx_t_6, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_replace, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = __pyx_t_4; @@ -4991,14 +5018,14 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_timestamp, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tstamp = __pyx_t_9; - /* "pyreadstat/_readstat_writer.pyx":160 + /* "pyreadstat/_readstat_writer.pyx":162 * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * # get timestamp in seconds * if type(curval) == datetime.datetime: # <<<<<<<<<<<<<< @@ -5007,7 +5034,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":164 + /* "pyreadstat/_readstat_writer.pyx":166 * #tstamp = calendar.timegm(curval.replace(tzinfo=_timezone.utc).timetuple()) * * tstamp += offset_secs # <<<<<<<<<<<<<< @@ -5016,7 +5043,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp + __pyx_v_offset_secs); - /* "pyreadstat/_readstat_writer.pyx":165 + /* "pyreadstat/_readstat_writer.pyx":167 * * tstamp += offset_secs * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5026,7 +5053,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_t_3 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":167 + /* "pyreadstat/_readstat_writer.pyx":169 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds * tstamp *= 1000 # <<<<<<<<<<<<<< @@ -5035,7 +5062,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp * 1000.0); - /* "pyreadstat/_readstat_writer.pyx":165 + /* "pyreadstat/_readstat_writer.pyx":167 * * tstamp += offset_secs * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5044,7 +5071,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":158 + /* "pyreadstat/_readstat_writer.pyx":160 * offset_secs = sas_offset_secs * * if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -5054,50 +5081,50 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE: - /* "pyreadstat/_readstat_writer.pyx":170 + /* "pyreadstat/_readstat_writer.pyx":172 * * elif curtype == PYWRITER_DATE: * if type(curval) == datetime.date: # <<<<<<<<<<<<<< * days = curval - date_0 * tstamp = days.days */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":171 + /* "pyreadstat/_readstat_writer.pyx":173 * elif curtype == PYWRITER_DATE: * if type(curval) == datetime.date: * days = curval - date_0 # <<<<<<<<<<<<<< * tstamp = days.days * tstamp += offset_days */ - __pyx_t_1 = PyNumber_Subtract(__pyx_v_curval, __pyx_v_10pyreadstat_16_readstat_writer_date_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_curval, __pyx_v_10pyreadstat_16_readstat_writer_date_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_days = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":172 + /* "pyreadstat/_readstat_writer.pyx":174 * if type(curval) == datetime.date: * days = curval - date_0 * tstamp = days.days # <<<<<<<<<<<<<< * tstamp += offset_days * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_days, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_days, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tstamp = __pyx_t_9; - /* "pyreadstat/_readstat_writer.pyx":173 + /* "pyreadstat/_readstat_writer.pyx":175 * days = curval - date_0 * tstamp = days.days * tstamp += offset_days # <<<<<<<<<<<<<< @@ -5106,7 +5133,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp + __pyx_v_offset_days); - /* "pyreadstat/_readstat_writer.pyx":174 + /* "pyreadstat/_readstat_writer.pyx":176 * tstamp = days.days * tstamp += offset_days * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -5117,7 +5144,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":176 + /* "pyreadstat/_readstat_writer.pyx":178 * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: * # spss stores in seconds * tstamp *= 86400 # <<<<<<<<<<<<<< @@ -5126,7 +5153,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp * 86400.0); - /* "pyreadstat/_readstat_writer.pyx":174 + /* "pyreadstat/_readstat_writer.pyx":176 * tstamp = days.days * tstamp += offset_days * if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -5137,7 +5164,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu default: break; } - /* "pyreadstat/_readstat_writer.pyx":170 + /* "pyreadstat/_readstat_writer.pyx":172 * * elif curtype == PYWRITER_DATE: * if type(curval) == datetime.date: # <<<<<<<<<<<<<< @@ -5146,7 +5173,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":169 + /* "pyreadstat/_readstat_writer.pyx":171 * tstamp *= 1000 * * elif curtype == PYWRITER_DATE: # <<<<<<<<<<<<<< @@ -5156,44 +5183,44 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME: - /* "pyreadstat/_readstat_writer.pyx":179 + /* "pyreadstat/_readstat_writer.pyx":181 * * elif curtype == PYWRITER_TIME: * if type(curval) == datetime.time: # <<<<<<<<<<<<<< * tdelta = datetime.datetime.combine(datetime.date.min, curval) - datetime.datetime.min * tstamp = tdelta.total_seconds() */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_curval)), __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":180 + /* "pyreadstat/_readstat_writer.pyx":182 * elif curtype == PYWRITER_TIME: * if type(curval) == datetime.time: * tdelta = datetime.datetime.combine(datetime.date.min, curval) - datetime.datetime.min # <<<<<<<<<<<<<< * tstamp = tdelta.total_seconds() * #tstamp += offset * 86400 */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; @@ -5203,25 +5230,25 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":181 + /* "pyreadstat/_readstat_writer.pyx":183 * if type(curval) == datetime.time: * tdelta = datetime.datetime.combine(datetime.date.min, curval) - datetime.datetime.min * tstamp = tdelta.total_seconds() # <<<<<<<<<<<<<< @@ -5235,14 +5262,14 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_total_seconds, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tstamp = __pyx_t_9; - /* "pyreadstat/_readstat_writer.pyx":183 + /* "pyreadstat/_readstat_writer.pyx":185 * tstamp = tdelta.total_seconds() * #tstamp += offset * 86400 * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5252,7 +5279,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_t_3 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":185 + /* "pyreadstat/_readstat_writer.pyx":187 * if file_format == FILE_FORMAT_DTA: * # stata stores in milliseconds * tstamp *= 1000 # <<<<<<<<<<<<<< @@ -5261,7 +5288,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ __pyx_v_tstamp = (__pyx_v_tstamp * 1000.0); - /* "pyreadstat/_readstat_writer.pyx":183 + /* "pyreadstat/_readstat_writer.pyx":185 * tstamp = tdelta.total_seconds() * #tstamp += offset * 86400 * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5270,7 +5297,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":179 + /* "pyreadstat/_readstat_writer.pyx":181 * * elif curtype == PYWRITER_TIME: * if type(curval) == datetime.time: # <<<<<<<<<<<<<< @@ -5279,7 +5306,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu */ } - /* "pyreadstat/_readstat_writer.pyx":178 + /* "pyreadstat/_readstat_writer.pyx":180 * tstamp *= 86400 * * elif curtype == PYWRITER_TIME: # <<<<<<<<<<<<<< @@ -5290,7 +5317,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu default: break; } - /* "pyreadstat/_readstat_writer.pyx":187 + /* "pyreadstat/_readstat_writer.pyx":189 * tstamp *= 1000 * * return tstamp # <<<<<<<<<<<<<< @@ -5300,7 +5327,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu __pyx_r = __pyx_v_tstamp; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":144 + /* "pyreadstat/_readstat_writer.pyx":145 * return df * * cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter_variable_type curtype, object curval) except *: # <<<<<<<<<<<<<< @@ -5325,7 +5352,7 @@ static double __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_nu return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":189 +/* "pyreadstat/_readstat_writer.pyx":191 * return tstamp * * cdef char * get_datetimelike_format_for_readstat(dst_file_format file_format, pywriter_variable_type curtype): # <<<<<<<<<<<<<< @@ -5346,7 +5373,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_datetimelike_format_for_readstat", 0); - /* "pyreadstat/_readstat_writer.pyx":194 + /* "pyreadstat/_readstat_writer.pyx":196 * """ * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -5357,7 +5384,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64: - /* "pyreadstat/_readstat_writer.pyx":195 + /* "pyreadstat/_readstat_writer.pyx":197 * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5367,7 +5394,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":196 + /* "pyreadstat/_readstat_writer.pyx":198 * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: * if file_format == FILE_FORMAT_DTA: * return "%td" # <<<<<<<<<<<<<< @@ -5377,7 +5404,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_r = ((char *)"%td"); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":195 + /* "pyreadstat/_readstat_writer.pyx":197 * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5386,7 +5413,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ } - /* "pyreadstat/_readstat_writer.pyx":200 + /* "pyreadstat/_readstat_writer.pyx":202 * # return "DATE11" * else: * return "DATE" # <<<<<<<<<<<<<< @@ -5398,7 +5425,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":194 + /* "pyreadstat/_readstat_writer.pyx":196 * """ * * if curtype == PYWRITER_DATE or curtype == PYWRITER_DATE64: # <<<<<<<<<<<<<< @@ -5408,7 +5435,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME: - /* "pyreadstat/_readstat_writer.pyx":201 + /* "pyreadstat/_readstat_writer.pyx":203 * else: * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -5417,7 +5444,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64: - /* "pyreadstat/_readstat_writer.pyx":202 + /* "pyreadstat/_readstat_writer.pyx":204 * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5427,7 +5454,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":203 + /* "pyreadstat/_readstat_writer.pyx":205 * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * if file_format == FILE_FORMAT_DTA: * return "%tc" # <<<<<<<<<<<<<< @@ -5437,7 +5464,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_r = ((char *)"%tc"); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":202 + /* "pyreadstat/_readstat_writer.pyx":204 * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5446,7 +5473,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ } - /* "pyreadstat/_readstat_writer.pyx":207 + /* "pyreadstat/_readstat_writer.pyx":209 * # return "DATETIME20" * else: * return "DATETIME" # <<<<<<<<<<<<<< @@ -5458,7 +5485,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":201 + /* "pyreadstat/_readstat_writer.pyx":203 * else: * return "DATE" * elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64: # <<<<<<<<<<<<<< @@ -5468,7 +5495,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME: - /* "pyreadstat/_readstat_writer.pyx":208 + /* "pyreadstat/_readstat_writer.pyx":210 * else: * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -5477,7 +5504,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64: - /* "pyreadstat/_readstat_writer.pyx":209 + /* "pyreadstat/_readstat_writer.pyx":211 * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5487,7 +5514,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":210 + /* "pyreadstat/_readstat_writer.pyx":212 * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: * if file_format == FILE_FORMAT_DTA: * return "%tcHH:MM:SS" # <<<<<<<<<<<<<< @@ -5497,7 +5524,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_r = ((char *)"%tcHH:MM:SS"); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":209 + /* "pyreadstat/_readstat_writer.pyx":211 * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -5506,7 +5533,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for */ } - /* "pyreadstat/_readstat_writer.pyx":212 + /* "pyreadstat/_readstat_writer.pyx":214 * return "%tcHH:MM:SS" * else: * return "TIME" # <<<<<<<<<<<<<< @@ -5518,7 +5545,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":208 + /* "pyreadstat/_readstat_writer.pyx":210 * else: * return "DATETIME" * elif curtype == PYWRITER_TIME or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -5528,7 +5555,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for break; default: - /* "pyreadstat/_readstat_writer.pyx":214 + /* "pyreadstat/_readstat_writer.pyx":216 * return "TIME" * else: * raise PyreadstatError("Unknown pywriter variable format") # <<<<<<<<<<<<<< @@ -5536,7 +5563,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for * cdef int get_narwhals_str_series_max_length(object series, dict value_labels, bint isobject): */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -5555,16 +5582,16 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 214, __pyx_L1_error) + __PYX_ERR(0, 216, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_writer.pyx":189 + /* "pyreadstat/_readstat_writer.pyx":191 * return tstamp * * cdef char * get_datetimelike_format_for_readstat(dst_file_format file_format, pywriter_variable_type curtype): # <<<<<<<<<<<<<< @@ -5584,7 +5611,7 @@ static char *__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":216 +/* "pyreadstat/_readstat_writer.pyx":218 * raise PyreadstatError("Unknown pywriter variable format") * * cdef int get_narwhals_str_series_max_length(object series, dict value_labels, bint isobject): # <<<<<<<<<<<<<< @@ -5614,7 +5641,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_narwhals_str_series_max_length", 0); - /* "pyreadstat/_readstat_writer.pyx":221 + /* "pyreadstat/_readstat_writer.pyx":223 * cdef object val * cdef bytes temp * cdef int max_length = 1 # <<<<<<<<<<<<<< @@ -5623,7 +5650,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ __pyx_v_max_length = 1; - /* "pyreadstat/_readstat_writer.pyx":224 + /* "pyreadstat/_readstat_writer.pyx":226 * cdef int curlen * cdef list labels * for val in series: # <<<<<<<<<<<<<< @@ -5635,9 +5662,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5645,7 +5672,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 226, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5655,7 +5682,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 226, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5666,13 +5693,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 226, __pyx_L1_error) PyErr_Clear(); } break; @@ -5682,7 +5709,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":225 + /* "pyreadstat/_readstat_writer.pyx":227 * cdef list labels * for val in series: * if isobject: # <<<<<<<<<<<<<< @@ -5691,19 +5718,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ if (__pyx_v_isobject) { - /* "pyreadstat/_readstat_writer.pyx":226 + /* "pyreadstat/_readstat_writer.pyx":228 * for val in series: * if isobject: * val = str(val) # <<<<<<<<<<<<<< * temp = val.encode("utf-8") * curlen = len(temp) */ - __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":225 + /* "pyreadstat/_readstat_writer.pyx":227 * cdef list labels * for val in series: * if isobject: # <<<<<<<<<<<<<< @@ -5712,7 +5739,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":227 + /* "pyreadstat/_readstat_writer.pyx":229 * if isobject: * val = str(val) * temp = val.encode("utf-8") # <<<<<<<<<<<<<< @@ -5726,14 +5753,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 227, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_temp, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":228 + /* "pyreadstat/_readstat_writer.pyx":230 * val = str(val) * temp = val.encode("utf-8") * curlen = len(temp) # <<<<<<<<<<<<<< @@ -5742,12 +5769,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ if (unlikely(__pyx_v_temp == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 228, __pyx_L1_error) + __PYX_ERR(0, 230, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_v_temp); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBytes_GET_SIZE(__pyx_v_temp); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_v_curlen = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":229 + /* "pyreadstat/_readstat_writer.pyx":231 * temp = val.encode("utf-8") * curlen = len(temp) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5757,7 +5784,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_t_8 = (__pyx_v_curlen > __pyx_v_max_length); if (__pyx_t_8) { - /* "pyreadstat/_readstat_writer.pyx":230 + /* "pyreadstat/_readstat_writer.pyx":232 * curlen = len(temp) * if curlen > max_length: * max_length = curlen # <<<<<<<<<<<<<< @@ -5766,7 +5793,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ __pyx_v_max_length = __pyx_v_curlen; - /* "pyreadstat/_readstat_writer.pyx":229 + /* "pyreadstat/_readstat_writer.pyx":231 * temp = val.encode("utf-8") * curlen = len(temp) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5775,7 +5802,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":224 + /* "pyreadstat/_readstat_writer.pyx":226 * cdef int curlen * cdef list labels * for val in series: # <<<<<<<<<<<<<< @@ -5785,17 +5812,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":231 + /* "pyreadstat/_readstat_writer.pyx":233 * if curlen > max_length: * max_length = curlen * if value_labels: # <<<<<<<<<<<<<< * labels = list(value_labels.keys()) * for lab in labels: */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) if (__pyx_t_8) { - /* "pyreadstat/_readstat_writer.pyx":232 + /* "pyreadstat/_readstat_writer.pyx":234 * max_length = curlen * if value_labels: * labels = list(value_labels.keys()) # <<<<<<<<<<<<<< @@ -5804,17 +5831,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ if (unlikely(__pyx_v_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 234, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_value_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_value_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_labels = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":233 + /* "pyreadstat/_readstat_writer.pyx":235 * if value_labels: * labels = list(value_labels.keys()) * for lab in labels: # <<<<<<<<<<<<<< @@ -5827,31 +5854,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 235, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_lab, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":234 + /* "pyreadstat/_readstat_writer.pyx":236 * labels = list(value_labels.keys()) * for lab in labels: * curlen = len(str(lab)) # <<<<<<<<<<<<<< * if curlen > max_length: * max_length = curlen */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_lab); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_lab); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_curlen = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":235 + /* "pyreadstat/_readstat_writer.pyx":237 * for lab in labels: * curlen = len(str(lab)) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5861,7 +5888,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_t_8 = (__pyx_v_curlen > __pyx_v_max_length); if (__pyx_t_8) { - /* "pyreadstat/_readstat_writer.pyx":236 + /* "pyreadstat/_readstat_writer.pyx":238 * curlen = len(str(lab)) * if curlen > max_length: * max_length = curlen # <<<<<<<<<<<<<< @@ -5870,7 +5897,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ __pyx_v_max_length = __pyx_v_curlen; - /* "pyreadstat/_readstat_writer.pyx":235 + /* "pyreadstat/_readstat_writer.pyx":237 * for lab in labels: * curlen = len(str(lab)) * if curlen > max_length: # <<<<<<<<<<<<<< @@ -5879,7 +5906,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":233 + /* "pyreadstat/_readstat_writer.pyx":235 * if value_labels: * labels = list(value_labels.keys()) * for lab in labels: # <<<<<<<<<<<<<< @@ -5889,7 +5916,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":231 + /* "pyreadstat/_readstat_writer.pyx":233 * if curlen > max_length: * max_length = curlen * if value_labels: # <<<<<<<<<<<<<< @@ -5898,7 +5925,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l */ } - /* "pyreadstat/_readstat_writer.pyx":238 + /* "pyreadstat/_readstat_writer.pyx":240 * max_length = curlen * * return max_length # <<<<<<<<<<<<<< @@ -5908,7 +5935,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l __pyx_r = __pyx_v_max_length; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":216 + /* "pyreadstat/_readstat_writer.pyx":218 * raise PyreadstatError("Unknown pywriter variable format") * * cdef int get_narwhals_str_series_max_length(object series, dict value_labels, bint isobject): # <<<<<<<<<<<<<< @@ -5932,7 +5959,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_l return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":241 +/* "pyreadstat/_readstat_writer.pyx":243 * * * cdef int check_series_all_same_types(object series, object type_to_check): # <<<<<<<<<<<<<< @@ -5954,7 +5981,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_series_all_same_types", 0); - /* "pyreadstat/_readstat_writer.pyx":245 + /* "pyreadstat/_readstat_writer.pyx":247 * 1 if all elements in a series are of type type_to_check, 0 otherwise * """ * for val in series: # <<<<<<<<<<<<<< @@ -5966,9 +5993,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5976,7 +6003,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 247, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5986,7 +6013,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 247, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5997,13 +6024,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 247, __pyx_L1_error) PyErr_Clear(); } break; @@ -6013,19 +6040,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":246 + /* "pyreadstat/_readstat_writer.pyx":248 * """ * for val in series: * if type(val) != type_to_check: # <<<<<<<<<<<<<< * return 0 * return 1 */ - __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), __pyx_v_type_to_check, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), __pyx_v_type_to_check, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "pyreadstat/_readstat_writer.pyx":247 + /* "pyreadstat/_readstat_writer.pyx":249 * for val in series: * if type(val) != type_to_check: * return 0 # <<<<<<<<<<<<<< @@ -6036,7 +6063,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":246 + /* "pyreadstat/_readstat_writer.pyx":248 * """ * for val in series: * if type(val) != type_to_check: # <<<<<<<<<<<<<< @@ -6045,7 +6072,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P */ } - /* "pyreadstat/_readstat_writer.pyx":245 + /* "pyreadstat/_readstat_writer.pyx":247 * 1 if all elements in a series are of type type_to_check, 0 otherwise * """ * for val in series: # <<<<<<<<<<<<<< @@ -6055,7 +6082,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":248 + /* "pyreadstat/_readstat_writer.pyx":250 * if type(val) != type_to_check: * return 0 * return 1 # <<<<<<<<<<<<<< @@ -6065,7 +6092,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P __pyx_r = 1; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":241 + /* "pyreadstat/_readstat_writer.pyx":243 * * * cdef int check_series_all_same_types(object series, object type_to_check): # <<<<<<<<<<<<<< @@ -6085,7 +6112,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(P return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":250 +/* "pyreadstat/_readstat_writer.pyx":252 * return 1 * * cdef list get_narwhals_column_types(object df, dict missing_user_values, dict variable_value_labels, int dta_str_max_len): # <<<<<<<<<<<<<< @@ -6128,19 +6155,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_RefNannySetupContext("get_narwhals_column_types", 0); __Pyx_INCREF(__pyx_v_variable_value_labels); - /* "pyreadstat/_readstat_writer.pyx":261 + /* "pyreadstat/_readstat_writer.pyx":263 * cdef int max_length, isobject * cdef bint has_missing * cdef list result = list() # <<<<<<<<<<<<<< * cdef int equal, is_missing * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":264 + /* "pyreadstat/_readstat_writer.pyx":266 * cdef int equal, is_missing * * if variable_value_labels is None: # <<<<<<<<<<<<<< @@ -6150,19 +6177,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (__pyx_v_variable_value_labels == ((PyObject*)Py_None)); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":265 + /* "pyreadstat/_readstat_writer.pyx":267 * * if variable_value_labels is None: * variable_value_labels = dict() # <<<<<<<<<<<<<< * * for curseries in df.iter_columns(): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_variable_value_labels, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":264 + /* "pyreadstat/_readstat_writer.pyx":266 * cdef int equal, is_missing * * if variable_value_labels is None: # <<<<<<<<<<<<<< @@ -6171,7 +6198,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":267 + /* "pyreadstat/_readstat_writer.pyx":269 * variable_value_labels = dict() * * for curseries in df.iter_columns(): # <<<<<<<<<<<<<< @@ -6185,7 +6212,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_iter_columns, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -6193,9 +6220,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -6204,7 +6231,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 269, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -6214,7 +6241,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 269, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -6225,13 +6252,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 269, __pyx_L1_error) PyErr_Clear(); } break; @@ -6241,56 +6268,56 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_XDECREF_SET(__pyx_v_curseries, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":268 + /* "pyreadstat/_readstat_writer.pyx":270 * * for curseries in df.iter_columns(): * col_name = curseries.name # <<<<<<<<<<<<<< * col_type = curseries.dtype * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_col_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":269 + /* "pyreadstat/_readstat_writer.pyx":271 * for curseries in df.iter_columns(): * col_name = curseries.name * col_type = curseries.dtype # <<<<<<<<<<<<<< * * # if categorical, let's use the type of the categories */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_col_type, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":272 + /* "pyreadstat/_readstat_writer.pyx":274 * * # if categorical, let's use the type of the categories * if col_type == nw.Categorical: # <<<<<<<<<<<<<< * col_type = curseries.cat.get_categories().dtype * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Categorical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Categorical); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":273 + /* "pyreadstat/_readstat_writer.pyx":275 * # if categorical, let's use the type of the categories * if col_type == nw.Categorical: * col_type = curseries.cat.get_categories().dtype # <<<<<<<<<<<<<< * * # we need to remove nulls for series inspection */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_cat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_curseries, __pyx_mstate_global->__pyx_n_u_cat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); @@ -6300,16 +6327,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_categories, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_col_type, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":272 + /* "pyreadstat/_readstat_writer.pyx":274 * * # if categorical, let's use the type of the categories * if col_type == nw.Categorical: # <<<<<<<<<<<<<< @@ -6318,7 +6345,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":276 + /* "pyreadstat/_readstat_writer.pyx":278 * * # we need to remove nulls for series inspection * has_missing = curseries.null_count()>0 # <<<<<<<<<<<<<< @@ -6332,14 +6359,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_null_count, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_has_missing = (__pyx_t_2 > 0); - /* "pyreadstat/_readstat_writer.pyx":277 + /* "pyreadstat/_readstat_writer.pyx":279 * # we need to remove nulls for series inspection * has_missing = curseries.null_count()>0 * if has_missing: # <<<<<<<<<<<<<< @@ -6348,7 +6375,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (__pyx_v_has_missing) { - /* "pyreadstat/_readstat_writer.pyx":278 + /* "pyreadstat/_readstat_writer.pyx":280 * has_missing = curseries.null_count()>0 * if has_missing: * curseries = curseries.drop_nulls() # <<<<<<<<<<<<<< @@ -6362,13 +6389,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_drop_nulls, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_curseries, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":277 + /* "pyreadstat/_readstat_writer.pyx":279 * # we need to remove nulls for series inspection * has_missing = curseries.null_count()>0 * if has_missing: # <<<<<<<<<<<<<< @@ -6377,7 +6404,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":285 + /* "pyreadstat/_readstat_writer.pyx":287 * # missing values and missing_user_values. * # we need to take out those before inspecting the object series futher * curuser_missing = None # <<<<<<<<<<<<<< @@ -6387,17 +6414,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":286 + /* "pyreadstat/_readstat_writer.pyx":288 * # we need to take out those before inspecting the object series futher * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":287 + /* "pyreadstat/_readstat_writer.pyx":289 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(col_name) # <<<<<<<<<<<<<< @@ -6406,14 +6433,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 287, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":286 + /* "pyreadstat/_readstat_writer.pyx":288 * # we need to take out those before inspecting the object series futher * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -6422,24 +6449,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":288 + /* "pyreadstat/_readstat_writer.pyx":290 * if missing_user_values: * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: # <<<<<<<<<<<<<< * if not df.implementation.is_pandas() and col_type == nw.Object: * curseries = [x for x in curseries if x not in curuser_missing] */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":289 + /* "pyreadstat/_readstat_writer.pyx":291 * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: * if not df.implementation.is_pandas() and col_type == nw.Object: # <<<<<<<<<<<<<< * curseries = [x for x in curseries if x not in curuser_missing] * else: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); @@ -6449,10 +6476,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_pandas, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = (!__pyx_t_9); if (__pyx_t_10) { @@ -6460,36 +6487,36 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = __pyx_t_10; goto __pyx_L11_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L11_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":290 + /* "pyreadstat/_readstat_writer.pyx":292 * if curuser_missing: * if not df.implementation.is_pandas() and col_type == nw.Object: * curseries = [x for x in curseries if x not in curuser_missing] # <<<<<<<<<<<<<< * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_v_curseries)) || PyTuple_CheckExact(__pyx_v_curseries)) { __pyx_t_7 = __pyx_v_curseries; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_curseries); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_curseries); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 292, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -6497,7 +6524,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -6507,7 +6534,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -6518,13 +6545,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 292, __pyx_L1_error) PyErr_Clear(); } break; @@ -6533,16 +6560,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_x, __pyx_v_curuser_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_x, __pyx_v_curuser_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) if (__pyx_t_2) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_v_x))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_v_x))) __PYX_ERR(0, 292, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_curseries, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":289 + /* "pyreadstat/_readstat_writer.pyx":291 * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: * if not df.implementation.is_pandas() and col_type == nw.Object: # <<<<<<<<<<<<<< @@ -6552,7 +6579,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L10; } - /* "pyreadstat/_readstat_writer.pyx":292 + /* "pyreadstat/_readstat_writer.pyx":294 * curseries = [x for x in curseries if x not in curuser_missing] * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) # <<<<<<<<<<<<<< @@ -6569,10 +6596,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_curuser_missing}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_in, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_13 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_13 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = 0; @@ -6581,7 +6608,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_filter, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF_SET(__pyx_v_curseries, __pyx_t_8); @@ -6589,44 +6616,44 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } __pyx_L10:; - /* "pyreadstat/_readstat_writer.pyx":293 + /* "pyreadstat/_readstat_writer.pyx":295 * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) * if not len(curseries): # <<<<<<<<<<<<<< * result.append((PYWRITER_DOUBLE, 0, 1, None)) * continue */ - __pyx_t_11 = PyObject_Length(__pyx_v_curseries); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_11 = PyObject_Length(__pyx_v_curseries); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_t_2 = (!(__pyx_t_11 != 0)); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":294 + /* "pyreadstat/_readstat_writer.pyx":296 * curseries = curseries.filter(~curseries.is_in(curuser_missing)) * if not len(curseries): * result.append((PYWRITER_DOUBLE, 0, 1, None)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 296, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 296, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 296, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 296, __pyx_L1_error); __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":295 + /* "pyreadstat/_readstat_writer.pyx":297 * if not len(curseries): * result.append((PYWRITER_DOUBLE, 0, 1, None)) * continue # <<<<<<<<<<<<<< @@ -6635,7 +6662,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":293 + /* "pyreadstat/_readstat_writer.pyx":295 * else: * curseries = curseries.filter(~curseries.is_in(curuser_missing)) * if not len(curseries): # <<<<<<<<<<<<<< @@ -6644,7 +6671,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":288 + /* "pyreadstat/_readstat_writer.pyx":290 * if missing_user_values: * curuser_missing = missing_user_values.get(col_name) * if curuser_missing: # <<<<<<<<<<<<<< @@ -6653,7 +6680,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":297 + /* "pyreadstat/_readstat_writer.pyx":299 * continue * * max_length = 0 # <<<<<<<<<<<<<< @@ -6662,7 +6689,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_max_length = 0; - /* "pyreadstat/_readstat_writer.pyx":298 + /* "pyreadstat/_readstat_writer.pyx":300 * * max_length = 0 * curtype = None # <<<<<<<<<<<<<< @@ -6672,7 +6699,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curtype, ((PyTypeObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":299 + /* "pyreadstat/_readstat_writer.pyx":301 * max_length = 0 * curtype = None * equal = True # <<<<<<<<<<<<<< @@ -6681,64 +6708,64 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_equal = 1; - /* "pyreadstat/_readstat_writer.pyx":301 + /* "pyreadstat/_readstat_writer.pyx":303 * equal = True * # let's deal first with object type, Enum could also be anything * if col_type == nw.Object or col_type==nw.Enum: # <<<<<<<<<<<<<< * curtype = type(curseries[0]) * equal = check_series_all_same_types(curseries, curtype) */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L19_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Enum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_Enum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L19_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":302 + /* "pyreadstat/_readstat_writer.pyx":304 * # let's deal first with object type, Enum could also be anything * if col_type == nw.Object or col_type==nw.Enum: * curtype = type(curseries[0]) # <<<<<<<<<<<<<< * equal = check_series_all_same_types(curseries, curtype) * # if all elements are equal, they could be a few we expect to be an object class */ - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_curseries, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_curseries, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_13))); __Pyx_DECREF_SET(__pyx_v_curtype, ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_t_13)))); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":303 + /* "pyreadstat/_readstat_writer.pyx":305 * if col_type == nw.Object or col_type==nw.Enum: * curtype = type(curseries[0]) * equal = check_series_all_same_types(curseries, curtype) # <<<<<<<<<<<<<< * # if all elements are equal, they could be a few we expect to be an object class * # or it could be that they are some other common types (numeric) after removing the missing_user_values */ - __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(__pyx_v_curseries, ((PyObject *)__pyx_v_curtype)); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types(__pyx_v_curseries, ((PyObject *)__pyx_v_curtype)); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L1_error) __pyx_v_equal = __pyx_t_15; - /* "pyreadstat/_readstat_writer.pyx":309 + /* "pyreadstat/_readstat_writer.pyx":311 * # if not all the elements of the series are from the same type, then we deal with it at the end * # as other types we don't know what to do with * if equal: # <<<<<<<<<<<<<< @@ -6748,53 +6775,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (__pyx_v_equal != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":311 + /* "pyreadstat/_readstat_writer.pyx":313 * if equal: * # types expected to be object * if curtype == datetime.date: # <<<<<<<<<<<<<< * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":312 + /* "pyreadstat/_readstat_writer.pyx":314 * # types expected to be object * if curtype == datetime.date: * result.append((PYWRITER_DATE, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif curtype == datetime.datetime: */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 314, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 314, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 314, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 312, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 314, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":313 + /* "pyreadstat/_readstat_writer.pyx":315 * if curtype == datetime.date: * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -6803,7 +6830,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":311 + /* "pyreadstat/_readstat_writer.pyx":313 * if equal: * # types expected to be object * if curtype == datetime.date: # <<<<<<<<<<<<<< @@ -6812,53 +6839,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":314 + /* "pyreadstat/_readstat_writer.pyx":316 * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue * elif curtype == datetime.datetime: # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":315 + /* "pyreadstat/_readstat_writer.pyx":317 * continue * elif curtype == datetime.datetime: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif curtype == datetime.time: */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 317, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 317, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 317, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 315, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 317, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":316 + /* "pyreadstat/_readstat_writer.pyx":318 * elif curtype == datetime.datetime: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -6867,7 +6894,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":314 + /* "pyreadstat/_readstat_writer.pyx":316 * result.append((PYWRITER_DATE, 0, has_missing, None)) * continue * elif curtype == datetime.datetime: # <<<<<<<<<<<<<< @@ -6876,53 +6903,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":317 + /* "pyreadstat/_readstat_writer.pyx":319 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif curtype == datetime.time: # <<<<<<<<<<<<<< * result.append((PYWRITER_TIME, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":318 + /* "pyreadstat/_readstat_writer.pyx":320 * continue * elif curtype == datetime.time: * result.append((PYWRITER_TIME, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 320, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 320, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 320, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 318, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 320, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":319 + /* "pyreadstat/_readstat_writer.pyx":321 * elif curtype == datetime.time: * result.append((PYWRITER_TIME, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -6931,7 +6958,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":317 + /* "pyreadstat/_readstat_writer.pyx":319 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif curtype == datetime.time: # <<<<<<<<<<<<<< @@ -6940,7 +6967,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":309 + /* "pyreadstat/_readstat_writer.pyx":311 * # if not all the elements of the series are from the same type, then we deal with it at the end * # as other types we don't know what to do with * if equal: # <<<<<<<<<<<<<< @@ -6949,7 +6976,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":301 + /* "pyreadstat/_readstat_writer.pyx":303 * equal = True * # let's deal first with object type, Enum could also be anything * if col_type == nw.Object or col_type==nw.Enum: # <<<<<<<<<<<<<< @@ -6958,7 +6985,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":322 + /* "pyreadstat/_readstat_writer.pyx":324 * * # numeric types: they could contain missing_user_values * if equal and (col_type in float_types or curtype == float): # <<<<<<<<<<<<<< @@ -6973,50 +7000,50 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_float_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 322, __pyx_L1_error) + __PYX_ERR(0, 324, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_float_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_float_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L24_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L24_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":323 + /* "pyreadstat/_readstat_writer.pyx":325 * # numeric types: they could contain missing_user_values * if equal and (col_type in float_types or curtype == float): * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif equal and (col_type in int_types or curtype == int): */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 325, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 325, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 325, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 323, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 325, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":324 + /* "pyreadstat/_readstat_writer.pyx":326 * if equal and (col_type in float_types or curtype == float): * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7025,7 +7052,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":322 + /* "pyreadstat/_readstat_writer.pyx":324 * * # numeric types: they could contain missing_user_values * if equal and (col_type in float_types or curtype == float): # <<<<<<<<<<<<<< @@ -7034,7 +7061,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":325 + /* "pyreadstat/_readstat_writer.pyx":327 * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) * continue * elif equal and (col_type in int_types or curtype == int): # <<<<<<<<<<<<<< @@ -7049,50 +7076,50 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_int_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 325, __pyx_L1_error) + __PYX_ERR(0, 327, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L27_bool_binop_done; } - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 325, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L27_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":326 + /* "pyreadstat/_readstat_writer.pyx":328 * continue * elif equal and (col_type in int_types or curtype == int): * result.append((PYWRITER_INTEGER, 0,has_missing, None)) # <<<<<<<<<<<<<< * continue * elif equal and (col_type == nw.Boolean or curtype == bool): */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 328, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 328, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 328, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 326, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, Py_None) != (0)) __PYX_ERR(0, 328, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":327 + /* "pyreadstat/_readstat_writer.pyx":329 * elif equal and (col_type in int_types or curtype == int): * result.append((PYWRITER_INTEGER, 0,has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7101,7 +7128,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":325 + /* "pyreadstat/_readstat_writer.pyx":327 * result.append((PYWRITER_DOUBLE, 0, has_missing, None)) * continue * elif equal and (col_type in int_types or curtype == int): # <<<<<<<<<<<<<< @@ -7110,7 +7137,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":328 + /* "pyreadstat/_readstat_writer.pyx":330 * result.append((PYWRITER_INTEGER, 0,has_missing, None)) * continue * elif equal and (col_type == nw.Boolean or curtype == bool): # <<<<<<<<<<<<<< @@ -7123,56 +7150,56 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = __pyx_t_10; goto __pyx_L30_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Boolean); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Boolean); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L30_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyBool_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyBool_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L30_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":329 + /* "pyreadstat/_readstat_writer.pyx":331 * continue * elif equal and (col_type == nw.Boolean or curtype == bool): * result.append((PYWRITER_LOGICAL, 0,has_missing, None)) # <<<<<<<<<<<<<< * continue * # these types here should not contain missing_user_values, */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 331, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 331, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 331, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 329, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 331, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":330 + /* "pyreadstat/_readstat_writer.pyx":332 * elif equal and (col_type == nw.Boolean or curtype == bool): * result.append((PYWRITER_LOGICAL, 0,has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7181,7 +7208,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":328 + /* "pyreadstat/_readstat_writer.pyx":330 * result.append((PYWRITER_INTEGER, 0,has_missing, None)) * continue * elif equal and (col_type == nw.Boolean or curtype == bool): # <<<<<<<<<<<<<< @@ -7190,35 +7217,35 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":333 + /* "pyreadstat/_readstat_writer.pyx":335 * # these types here should not contain missing_user_values, * # for string we still check, as later we will raise an error * elif col_type == nw.String or curtype == str: # <<<<<<<<<<<<<< * isobject = 0 * if not equal: */ - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_String); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_String); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L33_bool_binop_done; } - __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error) - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_curtype), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_2 = __pyx_t_10; __pyx_L33_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":334 + /* "pyreadstat/_readstat_writer.pyx":336 * # for string we still check, as later we will raise an error * elif col_type == nw.String or curtype == str: * isobject = 0 # <<<<<<<<<<<<<< @@ -7227,7 +7254,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_isobject = 0; - /* "pyreadstat/_readstat_writer.pyx":335 + /* "pyreadstat/_readstat_writer.pyx":337 * elif col_type == nw.String or curtype == str: * isobject = 0 * if not equal: # <<<<<<<<<<<<<< @@ -7237,7 +7264,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (!(__pyx_v_equal != 0)); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":336 + /* "pyreadstat/_readstat_writer.pyx":338 * isobject = 0 * if not equal: * isobject = 1 # <<<<<<<<<<<<<< @@ -7246,7 +7273,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ __pyx_v_isobject = 1; - /* "pyreadstat/_readstat_writer.pyx":335 + /* "pyreadstat/_readstat_writer.pyx":337 * elif col_type == nw.String or curtype == str: * isobject = 0 * if not equal: # <<<<<<<<<<<<<< @@ -7255,7 +7282,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":337 + /* "pyreadstat/_readstat_writer.pyx":339 * if not equal: * isobject = 1 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) # <<<<<<<<<<<<<< @@ -7264,16 +7291,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 337, __pyx_L1_error) + __PYX_ERR(0, 339, __pyx_L1_error) } - __pyx_t_13 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - if (!(likely(PyDict_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_13))) __PYX_ERR(0, 337, __pyx_L1_error) - __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_13), __pyx_v_isobject); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_13))) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_13), __pyx_v_isobject); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_max_length = __pyx_t_15; - /* "pyreadstat/_readstat_writer.pyx":338 + /* "pyreadstat/_readstat_writer.pyx":340 * isobject = 1 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7291,37 +7318,37 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_L37_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":339 + /* "pyreadstat/_readstat_writer.pyx":341 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) * if dta_str_max_len and max_length >= dta_str_max_len: * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 341, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 341, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 341, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 341, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":340 + /* "pyreadstat/_readstat_writer.pyx":342 * if dta_str_max_len and max_length >= dta_str_max_len: * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7330,7 +7357,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":338 + /* "pyreadstat/_readstat_writer.pyx":340 * isobject = 1 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), isobject) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7339,7 +7366,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":342 + /* "pyreadstat/_readstat_writer.pyx":344 * continue * else: * if isobject: # <<<<<<<<<<<<<< @@ -7350,37 +7377,37 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_t_2 = (__pyx_v_isobject != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":343 + /* "pyreadstat/_readstat_writer.pyx":345 * else: * if isobject: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) # <<<<<<<<<<<<<< * else: * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 343, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":342 + /* "pyreadstat/_readstat_writer.pyx":344 * continue * else: * if isobject: # <<<<<<<<<<<<<< @@ -7390,7 +7417,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L39; } - /* "pyreadstat/_readstat_writer.pyx":345 + /* "pyreadstat/_readstat_writer.pyx":347 * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) * else: * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) # <<<<<<<<<<<<<< @@ -7398,32 +7425,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ * elif col_type == nw.Datetime: */ /*else*/ { - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 345, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 347, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L39:; - /* "pyreadstat/_readstat_writer.pyx":346 + /* "pyreadstat/_readstat_writer.pyx":348 * else: * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7433,7 +7460,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L4_continue; } - /* "pyreadstat/_readstat_writer.pyx":333 + /* "pyreadstat/_readstat_writer.pyx":335 * # these types here should not contain missing_user_values, * # for string we still check, as later we will raise an error * elif col_type == nw.String or curtype == str: # <<<<<<<<<<<<<< @@ -7442,66 +7469,66 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":347 + /* "pyreadstat/_readstat_writer.pyx":349 * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) * continue * elif col_type == nw.Datetime: # <<<<<<<<<<<<<< * if col_type.time_unit == 'us': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":348 + /* "pyreadstat/_readstat_writer.pyx":350 * continue * elif col_type == nw.Datetime: * if col_type.time_unit == 'us': # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":349 + /* "pyreadstat/_readstat_writer.pyx":351 * elif col_type == nw.Datetime: * if col_type.time_unit == 'us': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) # <<<<<<<<<<<<<< * continue * elif col_type.time_unit == 'ns': */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 351, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 351, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 351, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_us); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_us); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_us) != (0)) __PYX_ERR(0, 349, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_us) != (0)) __PYX_ERR(0, 351, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":350 + /* "pyreadstat/_readstat_writer.pyx":352 * if col_type.time_unit == 'us': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue # <<<<<<<<<<<<<< @@ -7510,7 +7537,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":348 + /* "pyreadstat/_readstat_writer.pyx":350 * continue * elif col_type == nw.Datetime: * if col_type.time_unit == 'us': # <<<<<<<<<<<<<< @@ -7519,48 +7546,48 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":351 + /* "pyreadstat/_readstat_writer.pyx":353 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue * elif col_type.time_unit == 'ns': # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":352 + /* "pyreadstat/_readstat_writer.pyx":354 * continue * elif col_type.time_unit == 'ns': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) # <<<<<<<<<<<<<< * continue * elif col_type.time_unit == 'ms': */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 354, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 354, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 354, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ns); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_ns); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_n_u_ns) != (0)) __PYX_ERR(0, 352, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_n_u_ns) != (0)) __PYX_ERR(0, 354, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":353 + /* "pyreadstat/_readstat_writer.pyx":355 * elif col_type.time_unit == 'ns': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue # <<<<<<<<<<<<<< @@ -7569,7 +7596,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":351 + /* "pyreadstat/_readstat_writer.pyx":353 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'us')) * continue * elif col_type.time_unit == 'ns': # <<<<<<<<<<<<<< @@ -7578,48 +7605,48 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":354 + /* "pyreadstat/_readstat_writer.pyx":356 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue * elif col_type.time_unit == 'ms': # <<<<<<<<<<<<<< * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ms')) * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_col_type, __pyx_mstate_global->__pyx_n_u_time_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":355 + /* "pyreadstat/_readstat_writer.pyx":357 * continue * elif col_type.time_unit == 'ms': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ms')) # <<<<<<<<<<<<<< * continue * else: */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 357, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 357, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 357, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ms); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_ms); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_ms) != (0)) __PYX_ERR(0, 355, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_n_u_ms) != (0)) __PYX_ERR(0, 357, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":356 + /* "pyreadstat/_readstat_writer.pyx":358 * elif col_type.time_unit == 'ms': * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ms')) * continue # <<<<<<<<<<<<<< @@ -7628,7 +7655,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":354 + /* "pyreadstat/_readstat_writer.pyx":356 * result.append((PYWRITER_DATETIME64, 0,has_missing, 'ns')) * continue * elif col_type.time_unit == 'ms': # <<<<<<<<<<<<<< @@ -7637,7 +7664,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":358 + /* "pyreadstat/_readstat_writer.pyx":360 * continue * else: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) # <<<<<<<<<<<<<< @@ -7645,28 +7672,28 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ * elif col_type == nw.Date: */ /*else*/ { - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 360, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 360, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 360, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 360, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":359 + /* "pyreadstat/_readstat_writer.pyx":361 * else: * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7676,7 +7703,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L4_continue; } - /* "pyreadstat/_readstat_writer.pyx":347 + /* "pyreadstat/_readstat_writer.pyx":349 * result.append((PYWRITER_CHARACTER, max_length, has_missing, None)) * continue * elif col_type == nw.Datetime: # <<<<<<<<<<<<<< @@ -7685,53 +7712,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":360 + /* "pyreadstat/_readstat_writer.pyx":362 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif col_type == nw.Date: # <<<<<<<<<<<<<< * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":361 + /* "pyreadstat/_readstat_writer.pyx":363 * continue * elif col_type == nw.Date: * result.append((PYWRITER_DATE64, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * elif col_type == nw.Time: */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 363, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 363, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 363, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, Py_None) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, Py_None) != (0)) __PYX_ERR(0, 363, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":362 + /* "pyreadstat/_readstat_writer.pyx":364 * elif col_type == nw.Date: * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7740,7 +7767,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":360 + /* "pyreadstat/_readstat_writer.pyx":362 * result.append((PYWRITER_DATETIME, 0, has_missing, None)) * continue * elif col_type == nw.Date: # <<<<<<<<<<<<<< @@ -7749,53 +7776,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":363 + /* "pyreadstat/_readstat_writer.pyx":365 * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue * elif col_type == nw.Time: # <<<<<<<<<<<<<< * result.append((PYWRITER_TIME64, 0, has_missing, None)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":364 + /* "pyreadstat/_readstat_writer.pyx":366 * continue * elif col_type == nw.Time: * result.append((PYWRITER_TIME64, 0, has_missing, None)) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 366, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 366, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 366, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 364, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 366, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":365 + /* "pyreadstat/_readstat_writer.pyx":367 * elif col_type == nw.Time: * result.append((PYWRITER_TIME64, 0, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7804,7 +7831,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":363 + /* "pyreadstat/_readstat_writer.pyx":365 * result.append((PYWRITER_DATE64, 0, has_missing, None)) * continue * elif col_type == nw.Time: # <<<<<<<<<<<<<< @@ -7813,7 +7840,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ } - /* "pyreadstat/_readstat_writer.pyx":368 + /* "pyreadstat/_readstat_writer.pyx":370 * * # if the object was not captured by any of the previous cases, we transform it to string * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) # <<<<<<<<<<<<<< @@ -7822,16 +7849,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 368, __pyx_L1_error) + __PYX_ERR(0, 370, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_col_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 368, __pyx_L1_error) - __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_1), 1); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_15 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length(__pyx_v_curseries, ((PyObject*)__pyx_t_1), 1); if (unlikely(__pyx_t_15 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_max_length = __pyx_t_15; - /* "pyreadstat/_readstat_writer.pyx":369 + /* "pyreadstat/_readstat_writer.pyx":371 * # if the object was not captured by any of the previous cases, we transform it to string * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7849,37 +7876,37 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_L42_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":370 + /* "pyreadstat/_readstat_writer.pyx":372 * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) * if dta_str_max_len and max_length >= dta_str_max_len: * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) # <<<<<<<<<<<<<< * else: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, Py_None) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_13); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":369 + /* "pyreadstat/_readstat_writer.pyx":371 * # if the object was not captured by any of the previous cases, we transform it to string * max_length = get_narwhals_str_series_max_length(curseries, variable_value_labels.get(col_name), 1) * if dta_str_max_len and max_length >= dta_str_max_len: # <<<<<<<<<<<<<< @@ -7889,7 +7916,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ goto __pyx_L41; } - /* "pyreadstat/_readstat_writer.pyx":372 + /* "pyreadstat/_readstat_writer.pyx":374 * result.append((PYWRITER_DTA_STR_REF, max_length, has_missing, None)) * else: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) # <<<<<<<<<<<<<< @@ -7897,32 +7924,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ * */ /*else*/ { - __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_max_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_has_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 372, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None) != (0)) __PYX_ERR(0, 374, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L41:; - /* "pyreadstat/_readstat_writer.pyx":373 + /* "pyreadstat/_readstat_writer.pyx":375 * else: * result.append((PYWRITER_OBJECT, max_length, has_missing, None)) * continue # <<<<<<<<<<<<<< @@ -7931,7 +7958,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ */ goto __pyx_L4_continue; - /* "pyreadstat/_readstat_writer.pyx":267 + /* "pyreadstat/_readstat_writer.pyx":269 * variable_value_labels = dict() * * for curseries in df.iter_columns(): # <<<<<<<<<<<<<< @@ -7942,7 +7969,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":375 + /* "pyreadstat/_readstat_writer.pyx":377 * continue * * return result # <<<<<<<<<<<<<< @@ -7954,7 +7981,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":250 + /* "pyreadstat/_readstat_writer.pyx":252 * return 1 * * cdef list get_narwhals_column_types(object df, dict missing_user_values, dict variable_value_labels, int dta_str_max_len): # <<<<<<<<<<<<<< @@ -7985,7 +8012,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_typ return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":377 +/* "pyreadstat/_readstat_writer.pyx":379 * return result * * cdef readstat_label_set_t *set_value_label(readstat_writer_t *writer, dict value_labels, str labelset_name, # <<<<<<<<<<<<<< @@ -8029,7 +8056,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_value_label", 0); - /* "pyreadstat/_readstat_writer.pyx":388 + /* "pyreadstat/_readstat_writer.pyx":390 * cdef double double_val * * curtype = narwhals_to_readstat_types[curpytype] # <<<<<<<<<<<<<< @@ -8038,18 +8065,18 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 388, __pyx_L1_error) + __PYX_ERR(0, 390, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curpytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curpytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_3 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_curtype = __pyx_t_3; - /* "pyreadstat/_readstat_writer.pyx":389 + /* "pyreadstat/_readstat_writer.pyx":391 * * curtype = narwhals_to_readstat_types[curpytype] * label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) # <<<<<<<<<<<<<< @@ -8058,15 +8085,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_labelset_name == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 389, __pyx_L1_error) + __PYX_ERR(0, 391, __pyx_L1_error) } - __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_labelset_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_labelset_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_v_label_set = readstat_add_label_set(__pyx_v_writer, __pyx_v_curtype, __pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":391 + /* "pyreadstat/_readstat_writer.pyx":393 * label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) * * for value, label in value_labels.items(): # <<<<<<<<<<<<<< @@ -8075,18 +8102,18 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 391, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -8095,7 +8122,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 393, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8105,7 +8132,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 393, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8116,13 +8143,13 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 393, __pyx_L1_error) PyErr_Clear(); } break; @@ -8135,7 +8162,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 391, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8145,22 +8172,22 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -8168,7 +8195,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 391, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 393, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; @@ -8176,7 +8203,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 391, __pyx_L1_error) + __PYX_ERR(0, 393, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); @@ -8184,28 +8211,28 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":393 + /* "pyreadstat/_readstat_writer.pyx":395 * for value, label in value_labels.items(): * * if type(label) != str: # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_label)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_label)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":394 + /* "pyreadstat/_readstat_writer.pyx":396 * * if type(label) != str: * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_La; __pyx_t_12[1] = __pyx_t_2; @@ -8213,14 +8240,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_8; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_string; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 15, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":395 + /* "pyreadstat/_readstat_writer.pyx":397 * if type(label) != str: * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8228,7 +8255,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * if user_missing_tags and value in user_missing_tags: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8247,14 +8274,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 395, __pyx_L1_error) + __PYX_ERR(0, 397, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":393 + /* "pyreadstat/_readstat_writer.pyx":395 * for value, label in value_labels.items(): * * if type(label) != str: # <<<<<<<<<<<<<< @@ -8263,7 +8290,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":397 + /* "pyreadstat/_readstat_writer.pyx":399 * raise PyreadstatError(msg) * * if user_missing_tags and value in user_missing_tags: # <<<<<<<<<<<<<< @@ -8274,7 +8301,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l else { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_user_missing_tags); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 397, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 399, __pyx_L1_error) __pyx_t_14 = (__pyx_temp != 0); } @@ -8283,12 +8310,12 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_11 = __pyx_t_14; goto __pyx_L9_bool_binop_done; } - __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_user_missing_tags, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_user_missing_tags, Py_EQ)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 399, __pyx_L1_error) __pyx_t_11 = __pyx_t_14; __pyx_L9_bool_binop_done:; if (__pyx_t_11) { - /* "pyreadstat/_readstat_writer.pyx":398 + /* "pyreadstat/_readstat_writer.pyx":400 * * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8300,19 +8327,19 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF: - /* "pyreadstat/_readstat_writer.pyx":399 + /* "pyreadstat/_readstat_writer.pyx":401 * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * msg = "missing_user_values not allowed for character variable %s" % variable_name # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_not_allowed, __pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_not_allowed, __pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_msg = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":400 + /* "pyreadstat/_readstat_writer.pyx":402 * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * msg = "missing_user_values not allowed for character variable %s" % variable_name * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8320,7 +8347,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8339,14 +8366,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 400, __pyx_L1_error) + __PYX_ERR(0, 402, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":398 + /* "pyreadstat/_readstat_writer.pyx":400 * * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8357,14 +8384,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l default: break; } - /* "pyreadstat/_readstat_writer.pyx":402 + /* "pyreadstat/_readstat_writer.pyx":404 * raise PyreadstatError(msg) * * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_15 = __Pyx_PyObject_Ord(__pyx_v_value); if (unlikely(__pyx_t_15 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Ord(__pyx_v_value); if (unlikely(__pyx_t_15 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 404, __pyx_L1_error) __pyx_t_8 = __pyx_v_label; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0; @@ -8372,14 +8399,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L1_error) readstat_label_tagged_value(__pyx_v_label_set, __pyx_t_15, __pyx_t_16); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":403 + /* "pyreadstat/_readstat_writer.pyx":405 * * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) * continue # <<<<<<<<<<<<<< @@ -8388,7 +8415,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ goto __pyx_L3_continue; - /* "pyreadstat/_readstat_writer.pyx":397 + /* "pyreadstat/_readstat_writer.pyx":399 * raise PyreadstatError(msg) * * if user_missing_tags and value in user_missing_tags: # <<<<<<<<<<<<<< @@ -8397,7 +8424,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":406 + /* "pyreadstat/_readstat_writer.pyx":408 * * * if curpytype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -8407,38 +8434,38 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l switch (__pyx_v_curpytype) { case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE: - /* "pyreadstat/_readstat_writer.pyx":407 + /* "pyreadstat/_readstat_writer.pyx":409 * * if curpytype == PYWRITER_DOUBLE: * if type(value) != float and type(value) != int: # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyFloat_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyFloat_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L12_bool_binop_done; } - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = __pyx_t_14; __pyx_L12_bool_binop_done:; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":408 + /* "pyreadstat/_readstat_writer.pyx":410 * if curpytype == PYWRITER_DOUBLE: * if type(value) != float and type(value) != int: * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * readstat_label_double_value(label_set, value, label.encode("utf-8")) */ - __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_7; @@ -8446,14 +8473,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_8; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_numeric; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 16, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":409 + /* "pyreadstat/_readstat_writer.pyx":411 * if type(value) != float and type(value) != int: * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8461,7 +8488,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8480,14 +8507,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 411, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":407 + /* "pyreadstat/_readstat_writer.pyx":409 * * if curpytype == PYWRITER_DOUBLE: * if type(value) != float and type(value) != int: # <<<<<<<<<<<<<< @@ -8496,14 +8523,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":410 + /* "pyreadstat/_readstat_writer.pyx":412 * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_double_value(label_set, value, label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_INTEGER: */ - __pyx_t_17 = __Pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error) __pyx_t_7 = __pyx_v_label; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; @@ -8511,14 +8538,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error) readstat_label_double_value(__pyx_v_label_set, __pyx_t_17, __pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":406 + /* "pyreadstat/_readstat_writer.pyx":408 * * * if curpytype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -8528,28 +8555,28 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER: - /* "pyreadstat/_readstat_writer.pyx":413 + /* "pyreadstat/_readstat_writer.pyx":415 * * elif curpytype == PYWRITER_INTEGER: * if type(value) != int: # <<<<<<<<<<<<<< * #if type(value) not in int_types: * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyLong_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":415 + /* "pyreadstat/_readstat_writer.pyx":417 * if type(value) != int: * #if type(value) not in int_types: * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, value, label.encode("utf-8")) */ - __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_2; @@ -8557,14 +8584,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_7; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_int; __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 12, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 415, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":416 + /* "pyreadstat/_readstat_writer.pyx":418 * #if type(value) not in int_types: * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8572,7 +8599,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8591,14 +8618,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 416, __pyx_L1_error) + __PYX_ERR(0, 418, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":413 + /* "pyreadstat/_readstat_writer.pyx":415 * * elif curpytype == PYWRITER_INTEGER: * if type(value) != int: # <<<<<<<<<<<<<< @@ -8607,14 +8634,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":417 + /* "pyreadstat/_readstat_writer.pyx":419 * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, value, label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_LOGICAL: */ - __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_v_value); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_v_value); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L1_error) __pyx_t_2 = __pyx_v_label; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; @@ -8622,14 +8649,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 417, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L1_error) readstat_label_int32_value(__pyx_v_label_set, __pyx_t_19, __pyx_t_20); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":412 + /* "pyreadstat/_readstat_writer.pyx":414 * readstat_label_double_value(label_set, value, label.encode("utf-8")) * * elif curpytype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< @@ -8639,42 +8666,42 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL: - /* "pyreadstat/_readstat_writer.pyx":420 + /* "pyreadstat/_readstat_writer.pyx":422 * * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_8 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyBool_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject *)(&PyBool_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L16_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) if (__pyx_t_14) { } else { __pyx_t_11 = __pyx_t_14; goto __pyx_L16_bool_binop_done; } - __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_14 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) __pyx_t_11 = __pyx_t_14; __pyx_L16_bool_binop_done:; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":421 + /* "pyreadstat/_readstat_writer.pyx":423 * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) */ - __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_8; @@ -8682,14 +8709,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_2; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_be_boolean_or_be_1_or_0; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 29, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":422 + /* "pyreadstat/_readstat_writer.pyx":424 * if type(value) != bool and (value != 0 and value != 1): * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8697,7 +8724,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8716,14 +8743,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 422, __pyx_L1_error) + __PYX_ERR(0, 424, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":420 + /* "pyreadstat/_readstat_writer.pyx":422 * * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): # <<<<<<<<<<<<<< @@ -8732,16 +8759,16 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":423 + /* "pyreadstat/_readstat_writer.pyx":425 * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: */ - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __pyx_v_label; __Pyx_INCREF(__pyx_t_8); @@ -8750,14 +8777,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) readstat_label_int32_value(__pyx_v_label_set, __pyx_t_19, __pyx_t_20); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":419 + /* "pyreadstat/_readstat_writer.pyx":421 * readstat_label_int32_value(label_set, value, label.encode("utf-8")) * * elif curpytype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< @@ -8767,7 +8794,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER: - /* "pyreadstat/_readstat_writer.pyx":425 + /* "pyreadstat/_readstat_writer.pyx":427 * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8777,19 +8804,19 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF: - /* "pyreadstat/_readstat_writer.pyx":426 + /* "pyreadstat/_readstat_writer.pyx":428 * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * value = str(value) # <<<<<<<<<<<<<< * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * */ - __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":427 + /* "pyreadstat/_readstat_writer.pyx":429 * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: * value = str(value) * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) # <<<<<<<<<<<<<< @@ -8803,10 +8830,10 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_21 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) __pyx_t_2 = __pyx_v_label; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; @@ -8814,15 +8841,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) readstat_label_string_value(__pyx_v_label_set, __pyx_t_21, __pyx_t_22); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":425 + /* "pyreadstat/_readstat_writer.pyx":427 * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT or curpytype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -8832,7 +8859,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE: - /* "pyreadstat/_readstat_writer.pyx":429 + /* "pyreadstat/_readstat_writer.pyx":431 * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): # <<<<<<<<<<<<<< @@ -8845,7 +8872,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64: - /* "pyreadstat/_readstat_writer.pyx":430 + /* "pyreadstat/_readstat_writer.pyx":432 * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): * if type(value) not in nat_types: # <<<<<<<<<<<<<< @@ -8854,21 +8881,21 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_nat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 430, __pyx_L1_error) + __PYX_ERR(0, 432, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_nat_types, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_nat_types, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":431 + /* "pyreadstat/_readstat_writer.pyx":433 * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): * if type(value) not in nat_types: * msg = "variable_value_labels: type of Value %s in variable %s must match the type of the column in dataframe and be of type date, datetime or time" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * double_val = convert_datetimelike_to_number(file_format, curpytype, value) */ - __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_variable_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_type_of_Va; __pyx_t_12[1] = __pyx_t_8; @@ -8876,14 +8903,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_12[3] = __pyx_t_7; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_must_match_the_type_of_the_colu; __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 85, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":432 + /* "pyreadstat/_readstat_writer.pyx":434 * if type(value) not in nat_types: * msg = "variable_value_labels: type of Value %s in variable %s must match the type of the column in dataframe and be of type date, datetime or time" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -8891,7 +8918,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS @@ -8910,14 +8937,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 432, __pyx_L1_error) + __PYX_ERR(0, 434, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":430 + /* "pyreadstat/_readstat_writer.pyx":432 * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): * if type(value) not in nat_types: # <<<<<<<<<<<<<< @@ -8926,17 +8953,17 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":433 + /* "pyreadstat/_readstat_writer.pyx":435 * msg = "variable_value_labels: type of Value %s in variable %s must match the type of the column in dataframe and be of type date, datetime or time" % (str(value), variable_name) * raise PyreadstatError(msg) * double_val = convert_datetimelike_to_number(file_format, curpytype, value) # <<<<<<<<<<<<<< * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) * */ - __pyx_t_17 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curpytype, __pyx_v_value); if (unlikely(__pyx_t_17 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_17 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curpytype, __pyx_v_value); if (unlikely(__pyx_t_17 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error) __pyx_v_double_val = __pyx_t_17; - /* "pyreadstat/_readstat_writer.pyx":434 + /* "pyreadstat/_readstat_writer.pyx":436 * raise PyreadstatError(msg) * double_val = convert_datetimelike_to_number(file_format, curpytype, value) * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) # <<<<<<<<<<<<<< @@ -8950,14 +8977,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error) readstat_label_double_value(__pyx_v_label_set, __pyx_v_double_val, __pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":429 + /* "pyreadstat/_readstat_writer.pyx":431 * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64): # <<<<<<<<<<<<<< @@ -8968,7 +8995,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l default: break; } - /* "pyreadstat/_readstat_writer.pyx":391 + /* "pyreadstat/_readstat_writer.pyx":393 * label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) * * for value, label in value_labels.items(): # <<<<<<<<<<<<<< @@ -8979,7 +9006,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":436 + /* "pyreadstat/_readstat_writer.pyx":438 * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) * * return label_set # <<<<<<<<<<<<<< @@ -8989,7 +9016,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_r = __pyx_v_label_set; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":377 + /* "pyreadstat/_readstat_writer.pyx":379 * return result * * cdef readstat_label_set_t *set_value_label(readstat_writer_t *writer, dict value_labels, str labelset_name, # <<<<<<<<<<<<<< @@ -9014,7 +9041,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":438 +/* "pyreadstat/_readstat_writer.pyx":440 * return label_set * * cdef void add_missing_ranges(list cur_ranges, readstat_variable_t *variable, pywriter_variable_type vartype, str variablename) except *: # <<<<<<<<<<<<<< @@ -9049,7 +9076,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_missing_ranges", 0); - /* "pyreadstat/_readstat_writer.pyx":444 + /* "pyreadstat/_readstat_writer.pyx":446 * """ * * cdef int range_values = 0 # <<<<<<<<<<<<<< @@ -9058,7 +9085,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_range_values = 0; - /* "pyreadstat/_readstat_writer.pyx":445 + /* "pyreadstat/_readstat_writer.pyx":447 * * cdef int range_values = 0 * cdef int discrete_values = 0 # <<<<<<<<<<<<<< @@ -9067,7 +9094,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = 0; - /* "pyreadstat/_readstat_writer.pyx":446 + /* "pyreadstat/_readstat_writer.pyx":448 * cdef int range_values = 0 * cdef int discrete_values = 0 * cdef int discrete_strings = 0 # <<<<<<<<<<<<<< @@ -9076,7 +9103,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = 0; - /* "pyreadstat/_readstat_writer.pyx":448 + /* "pyreadstat/_readstat_writer.pyx":450 * cdef int discrete_strings = 0 * * for cur_range in cur_ranges: # <<<<<<<<<<<<<< @@ -9085,7 +9112,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ if (unlikely(__pyx_v_cur_ranges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 448, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } __pyx_t_1 = __pyx_v_cur_ranges; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -9093,18 +9120,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 448, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_cur_range, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":449 + /* "pyreadstat/_readstat_writer.pyx":451 * * for cur_range in cur_ranges: * if isinstance(cur_range, dict): # <<<<<<<<<<<<<< @@ -9114,7 +9141,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_4 = PyDict_Check(__pyx_v_cur_range); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":450 + /* "pyreadstat/_readstat_writer.pyx":452 * for cur_range in cur_ranges: * if isinstance(cur_range, dict): * hi = cur_range.get("hi") # <<<<<<<<<<<<<< @@ -9128,13 +9155,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hi}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_hi, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":451 + /* "pyreadstat/_readstat_writer.pyx":453 * if isinstance(cur_range, dict): * hi = cur_range.get("hi") * lo = cur_range.get("lo") # <<<<<<<<<<<<<< @@ -9148,13 +9175,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_lo}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_lo, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":452 + /* "pyreadstat/_readstat_writer.pyx":454 * hi = cur_range.get("hi") * lo = cur_range.get("lo") * if hi is None or lo is None: # <<<<<<<<<<<<<< @@ -9172,7 +9199,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":453 + /* "pyreadstat/_readstat_writer.pyx":455 * lo = cur_range.get("lo") * if hi is None or lo is None: * msg = "dictionaries in missing_ranges must have the keys hi and lo" # <<<<<<<<<<<<<< @@ -9182,7 +9209,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dictionaries_in_missing_ranges_m); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_dictionaries_in_missing_ranges_m; - /* "pyreadstat/_readstat_writer.pyx":454 + /* "pyreadstat/_readstat_writer.pyx":456 * if hi is None or lo is None: * msg = "dictionaries in missing_ranges must have the keys hi and lo" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9190,7 +9217,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if vartype not in pywriter_numeric_types: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9209,14 +9236,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 454, __pyx_L1_error) + __PYX_ERR(0, 456, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":452 + /* "pyreadstat/_readstat_writer.pyx":454 * hi = cur_range.get("hi") * lo = cur_range.get("lo") * if hi is None or lo is None: # <<<<<<<<<<<<<< @@ -9225,7 +9252,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":455 + /* "pyreadstat/_readstat_writer.pyx":457 * msg = "dictionaries in missing_ranges must have the keys hi and lo" * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): # <<<<<<<<<<<<<< @@ -9234,16 +9261,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_hi))); __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_hi)); - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L12_bool_binop_done; } - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_7 = __pyx_t_9; __pyx_L12_bool_binop_done:; @@ -9256,16 +9283,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_lo))); __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_lo)); - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_7) { } else { __pyx_t_9 = __pyx_t_7; goto __pyx_L14_bool_binop_done; } - __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = __pyx_t_7; __pyx_L14_bool_binop_done:; @@ -9275,36 +9302,36 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_L10_bool_binop_done:; if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":456 + /* "pyreadstat/_readstat_writer.pyx":458 * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) */ - __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); 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, 456, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":457 + /* "pyreadstat/_readstat_writer.pyx":459 * if type(hi) in (int, float) and type(lo) in (int, float): * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * if hi == lo: */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":458 + /* "pyreadstat/_readstat_writer.pyx":460 * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9312,7 +9339,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9331,14 +9358,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 458, __pyx_L1_error) + __PYX_ERR(0, 460, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":456 + /* "pyreadstat/_readstat_writer.pyx":458 * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -9347,29 +9374,29 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":459 + /* "pyreadstat/_readstat_writer.pyx":461 * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) * discrete_values += 1 */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":460 + /* "pyreadstat/_readstat_writer.pyx":462 * raise PyreadstatError(msg) * if hi == lo: * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) # <<<<<<<<<<<<<< * discrete_values += 1 * else: */ - __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":461 + /* "pyreadstat/_readstat_writer.pyx":463 * if hi == lo: * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) * discrete_values += 1 # <<<<<<<<<<<<<< @@ -9378,7 +9405,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = (__pyx_v_discrete_values + 1); - /* "pyreadstat/_readstat_writer.pyx":459 + /* "pyreadstat/_readstat_writer.pyx":461 * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< @@ -9388,7 +9415,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L17; } - /* "pyreadstat/_readstat_writer.pyx":463 + /* "pyreadstat/_readstat_writer.pyx":465 * discrete_values += 1 * else: * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) # <<<<<<<<<<<<<< @@ -9396,11 +9423,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * elif type(hi) == str and type(lo) == str: */ /*else*/ { - __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_lo); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_range(__pyx_v_variable, __pyx_t_10, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFloat_AsDouble(__pyx_v_lo); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_range(__pyx_v_variable, __pyx_t_10, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":464 + /* "pyreadstat/_readstat_writer.pyx":466 * else: * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 # <<<<<<<<<<<<<< @@ -9411,7 +9438,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_L17:; - /* "pyreadstat/_readstat_writer.pyx":455 + /* "pyreadstat/_readstat_writer.pyx":457 * msg = "dictionaries in missing_ranges must have the keys hi and lo" * raise PyreadstatError(msg) * if type(hi) in (int, float) and type(lo) in (int, float): # <<<<<<<<<<<<<< @@ -9421,29 +9448,29 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":465 + /* "pyreadstat/_readstat_writer.pyx":467 * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 * elif type(hi) == str and type(lo) == str: # <<<<<<<<<<<<<< * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_hi)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_hi)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { } else { __pyx_t_4 = __pyx_t_7; goto __pyx_L18_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_lo)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_lo)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_7; __pyx_L18_bool_binop_done:; if (likely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":466 + /* "pyreadstat/_readstat_writer.pyx":468 * range_values += 1 * elif type(hi) == str and type(lo) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9462,19 +9489,19 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":467 + /* "pyreadstat/_readstat_writer.pyx":469 * elif type(hi) == str and type(lo) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * if hi == lo: */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":468 + /* "pyreadstat/_readstat_writer.pyx":470 * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9482,7 +9509,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if len(hi) > 8: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9501,14 +9528,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 468, __pyx_L1_error) + __PYX_ERR(0, 470, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":466 + /* "pyreadstat/_readstat_writer.pyx":468 * range_values += 1 * elif type(hi) == str and type(lo) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT and vartype !=PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9517,30 +9544,30 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":469 + /* "pyreadstat/_readstat_writer.pyx":471 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":470 + /* "pyreadstat/_readstat_writer.pyx":472 * raise PyreadstatError(msg) * if hi == lo: * if len(hi) > 8: # <<<<<<<<<<<<<< * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) */ - __pyx_t_12 = PyObject_Length(__pyx_v_hi); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_hi); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 472, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 > 8); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":471 + /* "pyreadstat/_readstat_writer.pyx":473 * if hi == lo: * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" # <<<<<<<<<<<<<< @@ -9550,7 +9577,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len; - /* "pyreadstat/_readstat_writer.pyx":472 + /* "pyreadstat/_readstat_writer.pyx":474 * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9558,7 +9585,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * discrete_strings += 1 */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9577,14 +9604,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 472, __pyx_L1_error) + __PYX_ERR(0, 474, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":470 + /* "pyreadstat/_readstat_writer.pyx":472 * raise PyreadstatError(msg) * if hi == lo: * if len(hi) > 8: # <<<<<<<<<<<<<< @@ -9593,17 +9620,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":473 + /* "pyreadstat/_readstat_writer.pyx":475 * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, hi))#.encode("utf-8"))) # <<<<<<<<<<<<<< * discrete_strings += 1 * else: */ - __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_hi); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_hi); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":474 + /* "pyreadstat/_readstat_writer.pyx":476 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, hi))#.encode("utf-8"))) * discrete_strings += 1 # <<<<<<<<<<<<<< @@ -9612,7 +9639,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = (__pyx_v_discrete_strings + 1); - /* "pyreadstat/_readstat_writer.pyx":469 + /* "pyreadstat/_readstat_writer.pyx":471 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if hi == lo: # <<<<<<<<<<<<<< @@ -9622,7 +9649,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L21; } - /* "pyreadstat/_readstat_writer.pyx":477 + /* "pyreadstat/_readstat_writer.pyx":479 * else: * #check_exit_status(readstat_variable_add_missing_string_range(variable, lo, hi)) * msg = "missing_ranges: hi and lo values must be both the same for string type" # <<<<<<<<<<<<<< @@ -9633,7 +9660,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values; - /* "pyreadstat/_readstat_writer.pyx":478 + /* "pyreadstat/_readstat_writer.pyx":480 * #check_exit_status(readstat_variable_add_missing_string_range(variable, lo, hi)) * msg = "missing_ranges: hi and lo values must be both the same for string type" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9641,7 +9668,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: hi and lo values must be both either of numeric or string type" */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9660,16 +9687,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 478, __pyx_L1_error) + __PYX_ERR(0, 480, __pyx_L1_error) } __pyx_L21:; - /* "pyreadstat/_readstat_writer.pyx":465 + /* "pyreadstat/_readstat_writer.pyx":467 * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 * elif type(hi) == str and type(lo) == str: # <<<<<<<<<<<<<< @@ -9679,7 +9706,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":480 + /* "pyreadstat/_readstat_writer.pyx":482 * raise PyreadstatError(msg) * else: * msg = "missing_ranges: hi and lo values must be both either of numeric or string type" # <<<<<<<<<<<<<< @@ -9690,7 +9717,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values_2); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_hi_and_lo_values_2; - /* "pyreadstat/_readstat_writer.pyx":481 + /* "pyreadstat/_readstat_writer.pyx":483 * else: * msg = "missing_ranges: hi and lo values must be both either of numeric or string type" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9698,7 +9725,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if type(cur_range) in (int, float): */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9717,16 +9744,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 481, __pyx_L1_error) + __PYX_ERR(0, 483, __pyx_L1_error) } __pyx_L9:; - /* "pyreadstat/_readstat_writer.pyx":449 + /* "pyreadstat/_readstat_writer.pyx":451 * * for cur_range in cur_ranges: * if isinstance(cur_range, dict): # <<<<<<<<<<<<<< @@ -9736,7 +9763,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L5; } - /* "pyreadstat/_readstat_writer.pyx":483 + /* "pyreadstat/_readstat_writer.pyx":485 * raise PyreadstatError(msg) * else: * if type(cur_range) in (int, float): # <<<<<<<<<<<<<< @@ -9746,16 +9773,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject /*else*/ { __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_cur_range))); __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_cur_range)); - __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_7) { } else { __pyx_t_4 = __pyx_t_7; goto __pyx_L24_bool_binop_done; } - __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_3), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_7; __pyx_L24_bool_binop_done:; @@ -9763,36 +9790,36 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = __pyx_t_4; if (__pyx_t_7) { - /* "pyreadstat/_readstat_writer.pyx":484 + /* "pyreadstat/_readstat_writer.pyx":486 * else: * if type(cur_range) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) */ - __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_vartype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); 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, 484, __pyx_L1_error) + __PYX_ERR(0, 486, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":485 + /* "pyreadstat/_readstat_writer.pyx":487 * if type(cur_range) in (int, float): * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_numeric_missing_ranges_value_giv, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":486 + /* "pyreadstat/_readstat_writer.pyx":488 * if vartype not in pywriter_numeric_types: * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9800,7 +9827,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * discrete_values += 1 */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9819,14 +9846,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 486, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":484 + /* "pyreadstat/_readstat_writer.pyx":486 * else: * if type(cur_range) in (int, float): * if vartype not in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -9835,17 +9862,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":487 + /* "pyreadstat/_readstat_writer.pyx":489 * msg = "numeric missing_ranges value given for non numeric variable %s" %variablename * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) # <<<<<<<<<<<<<< * discrete_values += 1 * elif type(cur_range) == str: */ - __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_cur_range); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFloat_AsDouble(__pyx_v_cur_range); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_11)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 489, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":488 + /* "pyreadstat/_readstat_writer.pyx":490 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 # <<<<<<<<<<<<<< @@ -9854,7 +9881,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = (__pyx_v_discrete_values + 1); - /* "pyreadstat/_readstat_writer.pyx":483 + /* "pyreadstat/_readstat_writer.pyx":485 * raise PyreadstatError(msg) * else: * if type(cur_range) in (int, float): # <<<<<<<<<<<<<< @@ -9864,19 +9891,19 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L23; } - /* "pyreadstat/_readstat_writer.pyx":489 + /* "pyreadstat/_readstat_writer.pyx":491 * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 * elif type(cur_range) == str: # <<<<<<<<<<<<<< * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_cur_range)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_cur_range)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":490 + /* "pyreadstat/_readstat_writer.pyx":492 * discrete_values += 1 * elif type(cur_range) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9902,19 +9929,19 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_L28_bool_binop_done:; if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":491 + /* "pyreadstat/_readstat_writer.pyx":493 * elif type(cur_range) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * if len(cur_range) > 8: */ - __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_character_missing_ranges_value_g, __pyx_v_variablename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":492 + /* "pyreadstat/_readstat_writer.pyx":494 * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9922,7 +9949,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: string values length must not be larger than 8" */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -9941,14 +9968,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 492, __pyx_L1_error) + __PYX_ERR(0, 494, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":490 + /* "pyreadstat/_readstat_writer.pyx":492 * discrete_values += 1 * elif type(cur_range) == str: * if vartype != PYWRITER_CHARACTER and vartype != PYWRITER_OBJECT or vartype==PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -9957,18 +9984,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":493 + /* "pyreadstat/_readstat_writer.pyx":495 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if len(cur_range) > 8: # <<<<<<<<<<<<<< * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) */ - __pyx_t_12 = PyObject_Length(__pyx_v_cur_range); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_12 = PyObject_Length(__pyx_v_cur_range); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 495, __pyx_L1_error) __pyx_t_7 = (__pyx_t_12 > 8); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":494 + /* "pyreadstat/_readstat_writer.pyx":496 * raise PyreadstatError(msg) * if len(cur_range) > 8: * msg = "missing_ranges: string values length must not be larger than 8" # <<<<<<<<<<<<<< @@ -9978,7 +10005,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_string_values_len; - /* "pyreadstat/_readstat_writer.pyx":495 + /* "pyreadstat/_readstat_writer.pyx":497 * if len(cur_range) > 8: * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -9986,7 +10013,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * discrete_strings += 1 */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10005,14 +10032,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 495, __pyx_L1_error) + __PYX_ERR(0, 497, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":493 + /* "pyreadstat/_readstat_writer.pyx":495 * msg = "character missing_ranges value given for non character variable %s" %variablename * raise PyreadstatError(msg) * if len(cur_range) > 8: # <<<<<<<<<<<<<< @@ -10021,17 +10048,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":496 + /* "pyreadstat/_readstat_writer.pyx":498 * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, cur_range))#.encode("utf-8"))) # <<<<<<<<<<<<<< * discrete_strings += 1 * else: */ - __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_cur_range); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_cur_range); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 498, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":497 + /* "pyreadstat/_readstat_writer.pyx":499 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, cur_range))#.encode("utf-8"))) * discrete_strings += 1 # <<<<<<<<<<<<<< @@ -10040,7 +10067,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = (__pyx_v_discrete_strings + 1); - /* "pyreadstat/_readstat_writer.pyx":489 + /* "pyreadstat/_readstat_writer.pyx":491 * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 * elif type(cur_range) == str: # <<<<<<<<<<<<<< @@ -10050,7 +10077,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L23; } - /* "pyreadstat/_readstat_writer.pyx":499 + /* "pyreadstat/_readstat_writer.pyx":501 * discrete_strings += 1 * else: * msg = "missing_ranges: values must be both either of numeric or string type" # <<<<<<<<<<<<<< @@ -10061,7 +10088,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_values_must_be_bo); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_values_must_be_bo; - /* "pyreadstat/_readstat_writer.pyx":500 + /* "pyreadstat/_readstat_writer.pyx":502 * else: * msg = "missing_ranges: values must be both either of numeric or string type" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10069,7 +10096,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if discrete_strings > 3: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10088,18 +10115,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 500, __pyx_L1_error) + __PYX_ERR(0, 502, __pyx_L1_error) } __pyx_L23:; } __pyx_L5:; - /* "pyreadstat/_readstat_writer.pyx":502 + /* "pyreadstat/_readstat_writer.pyx":504 * raise PyreadstatError(msg) * * if discrete_strings > 3: # <<<<<<<<<<<<<< @@ -10109,7 +10136,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_discrete_strings > 3); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":503 + /* "pyreadstat/_readstat_writer.pyx":505 * * if discrete_strings > 3: * msg = "missing_ranges: max 3 string values per variable allowed" # <<<<<<<<<<<<<< @@ -10119,7 +10146,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_string_valu); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_string_valu; - /* "pyreadstat/_readstat_writer.pyx":504 + /* "pyreadstat/_readstat_writer.pyx":506 * if discrete_strings > 3: * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10127,7 +10154,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * if range_values > 1: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10146,14 +10173,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 504, __pyx_L1_error) + __PYX_ERR(0, 506, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":502 + /* "pyreadstat/_readstat_writer.pyx":504 * raise PyreadstatError(msg) * * if discrete_strings > 3: # <<<<<<<<<<<<<< @@ -10162,7 +10189,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":505 + /* "pyreadstat/_readstat_writer.pyx":507 * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) * if range_values: # <<<<<<<<<<<<<< @@ -10172,7 +10199,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_range_values != 0); if (__pyx_t_7) { - /* "pyreadstat/_readstat_writer.pyx":506 + /* "pyreadstat/_readstat_writer.pyx":508 * raise PyreadstatError(msg) * if range_values: * if range_values > 1: # <<<<<<<<<<<<<< @@ -10182,7 +10209,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_range_values > 1); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":507 + /* "pyreadstat/_readstat_writer.pyx":509 * if range_values: * if range_values > 1: * msg = "missing_ranges: max 1 range value per variable allowed" # <<<<<<<<<<<<<< @@ -10192,7 +10219,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_range_value); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_range_value; - /* "pyreadstat/_readstat_writer.pyx":508 + /* "pyreadstat/_readstat_writer.pyx":510 * if range_values > 1: * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10200,7 +10227,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10219,14 +10246,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 508, __pyx_L1_error) + __PYX_ERR(0, 510, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":506 + /* "pyreadstat/_readstat_writer.pyx":508 * raise PyreadstatError(msg) * if range_values: * if range_values > 1: # <<<<<<<<<<<<<< @@ -10235,7 +10262,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":509 + /* "pyreadstat/_readstat_writer.pyx":511 * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values > 1: # <<<<<<<<<<<<<< @@ -10245,7 +10272,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_discrete_values > 1); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":510 + /* "pyreadstat/_readstat_writer.pyx":512 * raise PyreadstatError(msg) * if discrete_values > 1: * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" # <<<<<<<<<<<<<< @@ -10255,7 +10282,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_discrete_nu); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_1_discrete_nu; - /* "pyreadstat/_readstat_writer.pyx":511 + /* "pyreadstat/_readstat_writer.pyx":513 * if discrete_values > 1: * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10263,7 +10290,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * msg = "missing_ranges: max 3 discrete numeric values per variable allowed" */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 511, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10282,14 +10309,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 511, __pyx_L1_error) + __PYX_ERR(0, 513, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":509 + /* "pyreadstat/_readstat_writer.pyx":511 * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values > 1: # <<<<<<<<<<<<<< @@ -10298,7 +10325,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":505 + /* "pyreadstat/_readstat_writer.pyx":507 * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) * if range_values: # <<<<<<<<<<<<<< @@ -10307,7 +10334,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":512 + /* "pyreadstat/_readstat_writer.pyx":514 * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values >3: # <<<<<<<<<<<<<< @@ -10317,7 +10344,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_7 = (__pyx_v_discrete_values > 3); if (unlikely(__pyx_t_7)) { - /* "pyreadstat/_readstat_writer.pyx":513 + /* "pyreadstat/_readstat_writer.pyx":515 * raise PyreadstatError(msg) * if discrete_values >3: * msg = "missing_ranges: max 3 discrete numeric values per variable allowed" # <<<<<<<<<<<<<< @@ -10327,7 +10354,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_discrete_nu); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_max_3_discrete_nu; - /* "pyreadstat/_readstat_writer.pyx":514 + /* "pyreadstat/_readstat_writer.pyx":516 * if discrete_values >3: * msg = "missing_ranges: max 3 discrete numeric values per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10335,7 +10362,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10354,14 +10381,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 514, __pyx_L1_error) + __PYX_ERR(0, 516, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":512 + /* "pyreadstat/_readstat_writer.pyx":514 * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values >3: # <<<<<<<<<<<<<< @@ -10370,7 +10397,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":448 + /* "pyreadstat/_readstat_writer.pyx":450 * cdef int discrete_strings = 0 * * for cur_range in cur_ranges: # <<<<<<<<<<<<<< @@ -10380,7 +10407,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":438 + /* "pyreadstat/_readstat_writer.pyx":440 * return label_set * * cdef void add_missing_ranges(list cur_ranges, readstat_variable_t *variable, pywriter_variable_type vartype, str variablename) except *: # <<<<<<<<<<<<<< @@ -10404,7 +10431,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":516 +/* "pyreadstat/_readstat_writer.pyx":518 * raise PyreadstatError(msg) * * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10427,17 +10454,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_variable_alignment", 0); - /* "pyreadstat/_readstat_writer.pyx":523 + /* "pyreadstat/_readstat_writer.pyx":525 * cdef readstat_alignment_t alignment * * if alignment_str == "right": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 525, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":524 + /* "pyreadstat/_readstat_writer.pyx":526 * * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT # <<<<<<<<<<<<<< @@ -10446,7 +10473,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_RIGHT; - /* "pyreadstat/_readstat_writer.pyx":523 + /* "pyreadstat/_readstat_writer.pyx":525 * cdef readstat_alignment_t alignment * * if alignment_str == "right": # <<<<<<<<<<<<<< @@ -10456,17 +10483,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":525 + /* "pyreadstat/_readstat_writer.pyx":527 * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":526 + /* "pyreadstat/_readstat_writer.pyx":528 * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT # <<<<<<<<<<<<<< @@ -10475,7 +10502,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_LEFT; - /* "pyreadstat/_readstat_writer.pyx":525 + /* "pyreadstat/_readstat_writer.pyx":527 * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": # <<<<<<<<<<<<<< @@ -10485,17 +10512,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":527 + /* "pyreadstat/_readstat_writer.pyx":529 * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_center, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_center, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 529, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":528 + /* "pyreadstat/_readstat_writer.pyx":530 * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER # <<<<<<<<<<<<<< @@ -10504,7 +10531,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_CENTER; - /* "pyreadstat/_readstat_writer.pyx":527 + /* "pyreadstat/_readstat_writer.pyx":529 * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": # <<<<<<<<<<<<<< @@ -10514,17 +10541,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":529 + /* "pyreadstat/_readstat_writer.pyx":531 * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_UNKNOWN * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_alignment_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":530 + /* "pyreadstat/_readstat_writer.pyx":532 * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": * alignment = READSTAT_ALIGNMENT_UNKNOWN # <<<<<<<<<<<<<< @@ -10533,7 +10560,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_UNKNOWN; - /* "pyreadstat/_readstat_writer.pyx":529 + /* "pyreadstat/_readstat_writer.pyx":531 * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": # <<<<<<<<<<<<<< @@ -10543,7 +10570,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":532 + /* "pyreadstat/_readstat_writer.pyx":534 * alignment = READSTAT_ALIGNMENT_UNKNOWN * else: * msg = "alignment for variable %s must be either right, center, left or unknown got %s instead" % (var_name, alignment_str) # <<<<<<<<<<<<<< @@ -10551,9 +10578,9 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads * */ /*else*/ { - __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_alignment_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_alignment_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_alignment_for_variable; __pyx_t_4[1] = __pyx_t_2; @@ -10561,14 +10588,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __pyx_t_4[3] = __pyx_t_3; __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_instead; __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 51 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":533 + /* "pyreadstat/_readstat_writer.pyx":535 * else: * msg = "alignment for variable %s must be either right, center, left or unknown got %s instead" % (var_name, alignment_str) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10576,7 +10603,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads * readstat_variable_set_alignment(variable, alignment) */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10595,16 +10622,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 533, __pyx_L1_error) + __PYX_ERR(0, 535, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":535 + /* "pyreadstat/_readstat_writer.pyx":537 * raise PyreadstatError(msg) * * readstat_variable_set_alignment(variable, alignment) # <<<<<<<<<<<<<< @@ -10613,7 +10640,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ readstat_variable_set_alignment(__pyx_v_variable, __pyx_v_alignment); - /* "pyreadstat/_readstat_writer.pyx":516 + /* "pyreadstat/_readstat_writer.pyx":518 * raise PyreadstatError(msg) * * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10633,7 +10660,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":537 +/* "pyreadstat/_readstat_writer.pyx":539 * readstat_variable_set_alignment(variable, alignment) * * cdef void set_variable_display_width(readstat_variable_t *variable, int display_width, str var_name) except *: # <<<<<<<<<<<<<< @@ -10643,7 +10670,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(readstat_variable_t *__pyx_v_variable, int __pyx_v_display_width, CYTHON_UNUSED PyObject *__pyx_v_var_name) { - /* "pyreadstat/_readstat_writer.pyx":542 + /* "pyreadstat/_readstat_writer.pyx":544 * """ * * readstat_variable_set_display_width(variable, display_width) # <<<<<<<<<<<<<< @@ -10652,7 +10679,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(r */ readstat_variable_set_display_width(__pyx_v_variable, __pyx_v_display_width); - /* "pyreadstat/_readstat_writer.pyx":537 + /* "pyreadstat/_readstat_writer.pyx":539 * readstat_variable_set_alignment(variable, alignment) * * cdef void set_variable_display_width(readstat_variable_t *variable, int display_width, str var_name) except *: # <<<<<<<<<<<<<< @@ -10663,7 +10690,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(r /* function exit code */ } -/* "pyreadstat/_readstat_writer.pyx":544 +/* "pyreadstat/_readstat_writer.pyx":546 * readstat_variable_set_display_width(variable, display_width) * * cdef void set_variable_measure(readstat_variable_t *variable, str measure_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10686,17 +10713,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_variable_measure", 0); - /* "pyreadstat/_readstat_writer.pyx":551 + /* "pyreadstat/_readstat_writer.pyx":553 * cdef readstat_measure_t measure * * if measure_str == "nominal": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_nominal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_nominal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 553, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":552 + /* "pyreadstat/_readstat_writer.pyx":554 * * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL # <<<<<<<<<<<<<< @@ -10705,7 +10732,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_NOMINAL; - /* "pyreadstat/_readstat_writer.pyx":551 + /* "pyreadstat/_readstat_writer.pyx":553 * cdef readstat_measure_t measure * * if measure_str == "nominal": # <<<<<<<<<<<<<< @@ -10715,17 +10742,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":553 + /* "pyreadstat/_readstat_writer.pyx":555 * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_ordinal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_ordinal, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 555, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":554 + /* "pyreadstat/_readstat_writer.pyx":556 * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL # <<<<<<<<<<<<<< @@ -10734,7 +10761,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_ORDINAL; - /* "pyreadstat/_readstat_writer.pyx":553 + /* "pyreadstat/_readstat_writer.pyx":555 * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": # <<<<<<<<<<<<<< @@ -10744,17 +10771,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":555 + /* "pyreadstat/_readstat_writer.pyx":557 * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_scale, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_scale, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":556 + /* "pyreadstat/_readstat_writer.pyx":558 * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE # <<<<<<<<<<<<<< @@ -10763,7 +10790,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_SCALE; - /* "pyreadstat/_readstat_writer.pyx":555 + /* "pyreadstat/_readstat_writer.pyx":557 * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": # <<<<<<<<<<<<<< @@ -10773,17 +10800,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":557 + /* "pyreadstat/_readstat_writer.pyx":559 * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_UNKNOWN * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_measure_str, __pyx_mstate_global->__pyx_n_u_unknown, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 559, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":558 + /* "pyreadstat/_readstat_writer.pyx":560 * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": * measure = READSTAT_MEASURE_UNKNOWN # <<<<<<<<<<<<<< @@ -10792,7 +10819,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_UNKNOWN; - /* "pyreadstat/_readstat_writer.pyx":557 + /* "pyreadstat/_readstat_writer.pyx":559 * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": # <<<<<<<<<<<<<< @@ -10802,7 +10829,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":560 + /* "pyreadstat/_readstat_writer.pyx":562 * measure = READSTAT_MEASURE_UNKNOWN * else: * msg = "measure for variable %s must be either nominal, ordinal, scale or unknown got %s instead" % (var_name, measure_str) # <<<<<<<<<<<<<< @@ -10810,9 +10837,9 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta * */ /*else*/ { - __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_var_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_measure_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_measure_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_measure_for_variable; __pyx_t_4[1] = __pyx_t_2; @@ -10820,14 +10847,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __pyx_t_4[3] = __pyx_t_3; __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_instead; __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 55 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":561 + /* "pyreadstat/_readstat_writer.pyx":563 * else: * msg = "measure for variable %s must be either nominal, ordinal, scale or unknown got %s instead" % (var_name, measure_str) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -10835,7 +10862,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta * readstat_variable_set_measure(variable, measure); */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10854,16 +10881,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 561, __pyx_L1_error) + __PYX_ERR(0, 563, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":563 + /* "pyreadstat/_readstat_writer.pyx":565 * raise PyreadstatError(msg) * * readstat_variable_set_measure(variable, measure); # <<<<<<<<<<<<<< @@ -10872,7 +10899,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ readstat_variable_set_measure(__pyx_v_variable, __pyx_v_measure); - /* "pyreadstat/_readstat_writer.pyx":544 + /* "pyreadstat/_readstat_writer.pyx":546 * readstat_variable_set_display_width(variable, display_width) * * cdef void set_variable_measure(readstat_variable_t *variable, str measure_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -10892,7 +10919,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":566 +/* "pyreadstat/_readstat_writer.pyx":568 * * * cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx) noexcept: # <<<<<<<<<<<<<< @@ -10912,7 +10939,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_bytes", 0); - /* "pyreadstat/_readstat_writer.pyx":571 + /* "pyreadstat/_readstat_writer.pyx":573 * """ * cdef int fd * fd = (ctx)[0] # <<<<<<<<<<<<<< @@ -10921,23 +10948,23 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const */ __pyx_v_fd = (((int *)__pyx_v_ctx)[0]); - /* "pyreadstat/_readstat_writer.pyx":572 + /* "pyreadstat/_readstat_writer.pyx":574 * cdef int fd * fd = (ctx)[0] * if os.name=='nt': # <<<<<<<<<<<<<< * return _write(fd, data, _len) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":573 + /* "pyreadstat/_readstat_writer.pyx":575 * fd = (ctx)[0] * if os.name=='nt': * return _write(fd, data, _len) # <<<<<<<<<<<<<< @@ -10947,7 +10974,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const __pyx_r = _write(__pyx_v_fd, __pyx_v_data, __pyx_v__len); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":572 + /* "pyreadstat/_readstat_writer.pyx":574 * cdef int fd * fd = (ctx)[0] * if os.name=='nt': # <<<<<<<<<<<<<< @@ -10956,19 +10983,19 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const */ } - /* "pyreadstat/_readstat_writer.pyx":575 + /* "pyreadstat/_readstat_writer.pyx":577 * return _write(fd, data, _len) * else: * return write(fd, data, _len) # <<<<<<<<<<<<<< * - * cdef void _check_exit_status(readstat_error_t retcode) except *: + * cdef int open_file(bytes filename_bytes): */ /*else*/ { __pyx_r = write(__pyx_v_fd, __pyx_v_data, __pyx_v__len); goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":566 + /* "pyreadstat/_readstat_writer.pyx":568 * * * cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx) noexcept: # <<<<<<<<<<<<<< @@ -10987,128 +11014,9 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":577 - * return write(fd, data, _len) - * - * cdef void _check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< - * """ - * transforms a readstat exit status to a python error if status is not READSTAT OK -*/ - -static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_error_t __pyx_v_retcode) { - char *__pyx_v_err_readstat; - PyObject *__pyx_v_err_message = 0; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_check_exit_status", 0); - - /* "pyreadstat/_readstat_writer.pyx":584 - * cdef char * err_readstat - * cdef str err_message - * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat -*/ - __pyx_t_1 = (__pyx_v_retcode != READSTAT_OK); - if (unlikely(__pyx_t_1)) { - - /* "pyreadstat/_readstat_writer.pyx":585 - * cdef str err_message - * if retcode != READSTAT_OK: - * err_readstat = readstat_error_message(retcode) # <<<<<<<<<<<<<< - * err_message = err_readstat - * raise ReadstatError(err_message) -*/ - __pyx_v_err_readstat = readstat_error_message(__pyx_v_retcode); - - /* "pyreadstat/_readstat_writer.pyx":586 - * if retcode != READSTAT_OK: - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat # <<<<<<<<<<<<<< - * raise ReadstatError(err_message) - * -*/ - __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_err_message = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/_readstat_writer.pyx":587 - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat - * raise ReadstatError(err_message) # <<<<<<<<<<<<<< - * - * cdef int open_file(bytes filename_bytes): -*/ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_err_message}; - __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 587, __pyx_L1_error) - - /* "pyreadstat/_readstat_writer.pyx":584 - * cdef char * err_readstat - * cdef str err_message - * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< - * err_readstat = readstat_error_message(retcode) - * err_message = err_readstat -*/ - } - - /* "pyreadstat/_readstat_writer.pyx":577 +/* "pyreadstat/_readstat_writer.pyx":579 * return write(fd, data, _len) * - * cdef void _check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< - * """ - * transforms a readstat exit status to a python error if status is not READSTAT OK -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("pyreadstat._readstat_writer._check_exit_status", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_err_message); - __Pyx_RefNannyFinishContext(); -} - -/* "pyreadstat/_readstat_writer.pyx":589 - * raise ReadstatError(err_message) - * * cdef int open_file(bytes filename_bytes): # <<<<<<<<<<<<<< * * cdef int fd @@ -11136,23 +11044,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open_file", 0); - /* "pyreadstat/_readstat_writer.pyx":597 + /* "pyreadstat/_readstat_writer.pyx":587 * cdef char *path * * if os.name == "nt": # <<<<<<<<<<<<<< * filename_str = os.fsdecode(filename_bytes) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":598 + /* "pyreadstat/_readstat_writer.pyx":588 * * if os.name == "nt": * filename_str = os.fsdecode(filename_bytes) # <<<<<<<<<<<<<< @@ -11160,9 +11068,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = 1; @@ -11182,23 +11090,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_filename_str = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":599 + /* "pyreadstat/_readstat_writer.pyx":589 * if os.name == "nt": * filename_str = os.fsdecode(filename_bytes) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) # <<<<<<<<<<<<<< * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) */ - __pyx_t_7 = PyUnicode_AsWideCharString(__pyx_v_filename_str, (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_7 = PyUnicode_AsWideCharString(__pyx_v_filename_str, (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(0, 589, __pyx_L1_error) __pyx_v_u16_path = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":600 + /* "pyreadstat/_readstat_writer.pyx":590 * filename_str = os.fsdecode(filename_bytes) * u16_path = PyUnicode_AsWideCharString(filename_str, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC # <<<<<<<<<<<<<< @@ -11207,7 +11115,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_flags = (((_O_WRONLY | _O_CREAT) | _O_BINARY) | _O_TRUNC); - /* "pyreadstat/_readstat_writer.pyx":601 + /* "pyreadstat/_readstat_writer.pyx":591 * u16_path = PyUnicode_AsWideCharString(filename_str, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) # <<<<<<<<<<<<<< @@ -11216,7 +11124,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_fd = _wsopen(__pyx_v_u16_path, __pyx_v_flags, _SH_DENYRW, (_S_IREAD | _S_IWRITE)); - /* "pyreadstat/_readstat_writer.pyx":597 + /* "pyreadstat/_readstat_writer.pyx":587 * cdef char *path * * if os.name == "nt": # <<<<<<<<<<<<<< @@ -11226,7 +11134,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":603 + /* "pyreadstat/_readstat_writer.pyx":593 * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) * else: * path = filename_bytes # <<<<<<<<<<<<<< @@ -11236,12 +11144,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f /*else*/ { if (unlikely(__pyx_v_filename_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 603, __pyx_L1_error) + __PYX_ERR(0, 593, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L1_error) __pyx_v_path = ((char *)__pyx_t_8); - /* "pyreadstat/_readstat_writer.pyx":604 + /* "pyreadstat/_readstat_writer.pyx":594 * else: * path = filename_bytes * flags = O_WRONLY | O_CREAT | O_TRUNC # <<<<<<<<<<<<<< @@ -11250,7 +11158,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_flags = ((O_WRONLY | O_CREAT) | O_TRUNC); - /* "pyreadstat/_readstat_writer.pyx":605 + /* "pyreadstat/_readstat_writer.pyx":595 * path = filename_bytes * flags = O_WRONLY | O_CREAT | O_TRUNC * fd = open(path, flags, 0644) # <<<<<<<<<<<<<< @@ -11261,7 +11169,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":607 + /* "pyreadstat/_readstat_writer.pyx":597 * fd = open(path, flags, 0644) * * return fd # <<<<<<<<<<<<<< @@ -11271,8 +11179,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f __pyx_r = __pyx_v_fd; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":589 - * raise ReadstatError(err_message) + /* "pyreadstat/_readstat_writer.pyx":579 + * return write(fd, data, _len) * * cdef int open_file(bytes filename_bytes): # <<<<<<<<<<<<<< * @@ -11293,43 +11201,72 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":609 +/* "pyreadstat/_readstat_writer.pyx":599 * return fd * * cdef int close_file(int fd): # <<<<<<<<<<<<<< - * if os.name == "nt": - * return _close(fd) + * if fd == -1: + * return -1 */ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close_file", 0); - /* "pyreadstat/_readstat_writer.pyx":610 + /* "pyreadstat/_readstat_writer.pyx":600 + * + * cdef int close_file(int fd): + * if fd == -1: # <<<<<<<<<<<<<< + * return -1 + * if os.name == "nt": +*/ + __pyx_t_1 = (__pyx_v_fd == -1L); + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_writer.pyx":601 + * cdef int close_file(int fd): + * if fd == -1: + * return -1 # <<<<<<<<<<<<<< + * if os.name == "nt": + * return _close(fd) +*/ + __pyx_r = -1; + goto __pyx_L0; + + /* "pyreadstat/_readstat_writer.pyx":600 * * cdef int close_file(int fd): + * if fd == -1: # <<<<<<<<<<<<<< + * return -1 + * if os.name == "nt": +*/ + } + + /* "pyreadstat/_readstat_writer.pyx":602 + * if fd == -1: + * return -1 * if os.name == "nt": # <<<<<<<<<<<<<< * return _close(fd) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":611 - * cdef int close_file(int fd): + /* "pyreadstat/_readstat_writer.pyx":603 + * return -1 * if os.name == "nt": * return _close(fd) # <<<<<<<<<<<<<< * else: @@ -11338,16 +11275,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { __pyx_r = _close(__pyx_v_fd); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":610 - * - * cdef int close_file(int fd): + /* "pyreadstat/_readstat_writer.pyx":602 + * if fd == -1: + * return -1 * if os.name == "nt": # <<<<<<<<<<<<<< * return _close(fd) * else: */ } - /* "pyreadstat/_readstat_writer.pyx":613 + /* "pyreadstat/_readstat_writer.pyx":605 * return _close(fd) * else: * return close(fd) # <<<<<<<<<<<<<< @@ -11359,18 +11296,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":609 + /* "pyreadstat/_readstat_writer.pyx":599 * return fd * * cdef int close_file(int fd): # <<<<<<<<<<<<<< - * if os.name == "nt": - * return _close(fd) + * if fd == -1: + * return -1 */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyreadstat._readstat_writer.close_file", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -11378,7 +11315,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":615 +/* "pyreadstat/_readstat_writer.pyx":607 * return close(fd) * * cdef void initial_checks(bint is_pandas, bint is_polars, dict variable_value_labels, dict missing_user_values, # <<<<<<<<<<<<<< @@ -11424,7 +11361,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i int __pyx_clineno = 0; __Pyx_RefNannySetupContext("initial_checks", 0); - /* "pyreadstat/_readstat_writer.pyx":621 + /* "pyreadstat/_readstat_writer.pyx":613 * """ * * if not is_pandas and not is_polars: # <<<<<<<<<<<<<< @@ -11442,7 +11379,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":622 + /* "pyreadstat/_readstat_writer.pyx":614 * * if not is_pandas and not is_polars: * msg = "dataframe must be pandas or polars dataframe" # <<<<<<<<<<<<<< @@ -11452,7 +11389,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_dataframe_must_be_pandas_or_pola); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_dataframe_must_be_pandas_or_pola; - /* "pyreadstat/_readstat_writer.pyx":623 + /* "pyreadstat/_readstat_writer.pyx":615 * if not is_pandas and not is_polars: * msg = "dataframe must be pandas or polars dataframe" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -11460,7 +11397,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * if variable_value_labels: */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -11479,14 +11416,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 623, __pyx_L1_error) + __PYX_ERR(0, 615, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":621 + /* "pyreadstat/_readstat_writer.pyx":613 * """ * * if not is_pandas and not is_polars: # <<<<<<<<<<<<<< @@ -11495,17 +11432,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":625 + /* "pyreadstat/_readstat_writer.pyx":617 * raise PyreadstatError(msg) * * if variable_value_labels: # <<<<<<<<<<<<<< * for k,v in variable_value_labels.items(): * if type(v) != dict: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 625, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 617, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":626 + /* "pyreadstat/_readstat_writer.pyx":618 * * if variable_value_labels: * for k,v in variable_value_labels.items(): # <<<<<<<<<<<<<< @@ -11514,18 +11451,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_variable_value_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_variable_value_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11534,7 +11471,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 618, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11544,7 +11481,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 618, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11555,13 +11492,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 618, __pyx_L1_error) PyErr_Clear(); } break; @@ -11574,7 +11511,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11584,22 +11521,22 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -11607,7 +11544,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 626, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L10_unpacking_done; @@ -11615,7 +11552,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4); @@ -11623,42 +11560,42 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":627 + /* "pyreadstat/_readstat_writer.pyx":619 * if variable_value_labels: * for k,v in variable_value_labels.items(): * if type(v) != dict: # <<<<<<<<<<<<<< * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) * raise PyreadstatError(msg) */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":628 + /* "pyreadstat/_readstat_writer.pyx":620 * for k,v in variable_value_labels.items(): * if type(v) != dict: * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_k), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_k), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_v))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_v))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_variable_value_labels_value_for; __pyx_t_12[1] = __pyx_t_3; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_must_be_dict_got; __pyx_t_12[3] = __pyx_t_9; __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_12, 4, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":629 + /* "pyreadstat/_readstat_writer.pyx":621 * if type(v) != dict: * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -11666,7 +11603,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * cdef list valid_user_missing */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -11685,14 +11622,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 629, __pyx_L1_error) + __PYX_ERR(0, 621, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":627 + /* "pyreadstat/_readstat_writer.pyx":619 * if variable_value_labels: * for k,v in variable_value_labels.items(): * if type(v) != dict: # <<<<<<<<<<<<<< @@ -11701,7 +11638,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":626 + /* "pyreadstat/_readstat_writer.pyx":618 * * if variable_value_labels: * for k,v in variable_value_labels.items(): # <<<<<<<<<<<<<< @@ -11711,7 +11648,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":625 + /* "pyreadstat/_readstat_writer.pyx":617 * raise PyreadstatError(msg) * * if variable_value_labels: # <<<<<<<<<<<<<< @@ -11720,17 +11657,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":632 + /* "pyreadstat/_readstat_writer.pyx":624 * * cdef list valid_user_missing * if missing_user_values: # <<<<<<<<<<<<<< * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 624, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":633 + /* "pyreadstat/_readstat_writer.pyx":625 * cdef list valid_user_missing * if missing_user_values: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -11740,7 +11677,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA: - /* "pyreadstat/_readstat_writer.pyx":634 + /* "pyreadstat/_readstat_writer.pyx":626 * if missing_user_values: * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata # <<<<<<<<<<<<<< @@ -11749,11 +11686,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ __pyx_t_5 = __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata; __Pyx_INCREF(__pyx_t_5); - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 634, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 626, __pyx_L1_error) __pyx_v_valid_user_missing = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":633 + /* "pyreadstat/_readstat_writer.pyx":625 * cdef list valid_user_missing * if missing_user_values: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -11763,7 +11700,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BDAT: - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":627 * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata * elif file_format == FILE_FORMAT_SAS7BDAT or file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -11772,7 +11709,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BCAT: - /* "pyreadstat/_readstat_writer.pyx":636 + /* "pyreadstat/_readstat_writer.pyx":628 * valid_user_missing = valid_user_missing_stata * elif file_format == FILE_FORMAT_SAS7BDAT or file_format == FILE_FORMAT_SAS7BCAT: * valid_user_missing = valid_user_missing_sas # <<<<<<<<<<<<<< @@ -11781,11 +11718,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ __pyx_t_5 = __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas; __Pyx_INCREF(__pyx_t_5); - if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 636, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_5))) __PYX_ERR(0, 628, __pyx_L1_error) __pyx_v_valid_user_missing = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":627 * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata * elif file_format == FILE_FORMAT_SAS7BDAT or file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -11796,7 +11733,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i default: break; } - /* "pyreadstat/_readstat_writer.pyx":638 + /* "pyreadstat/_readstat_writer.pyx":630 * valid_user_missing = valid_user_missing_sas * * for key, missing_values in missing_user_values.items(): # <<<<<<<<<<<<<< @@ -11805,18 +11742,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 630, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyDict_Items(__pyx_v_missing_user_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_Items(__pyx_v_missing_user_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -11825,7 +11762,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 630, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11835,7 +11772,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 630, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11846,13 +11783,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 630, __pyx_L1_error) PyErr_Clear(); } break; @@ -11865,7 +11802,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 630, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11875,22 +11812,22 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -11898,7 +11835,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 638, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 630, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L17_unpacking_done; @@ -11906,7 +11843,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 638, __pyx_L1_error) + __PYX_ERR(0, 630, __pyx_L1_error) __pyx_L17_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); @@ -11914,7 +11851,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF_SET(__pyx_v_missing_values, __pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":639 + /* "pyreadstat/_readstat_writer.pyx":631 * * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): # <<<<<<<<<<<<<< @@ -11925,7 +11862,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":640 + /* "pyreadstat/_readstat_writer.pyx":632 * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): * msg = "missing_user_values: values in dictionary must be list" # <<<<<<<<<<<<<< @@ -11935,7 +11872,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_user_values_values_in_di); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_user_values_values_in_di; - /* "pyreadstat/_readstat_writer.pyx":641 + /* "pyreadstat/_readstat_writer.pyx":633 * if not isinstance(missing_values, list): * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -11943,7 +11880,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * if val not in valid_user_missing: */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -11962,14 +11899,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 641, __pyx_L1_error) + __PYX_ERR(0, 633, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":639 + /* "pyreadstat/_readstat_writer.pyx":631 * * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): # <<<<<<<<<<<<<< @@ -11978,7 +11915,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":642 + /* "pyreadstat/_readstat_writer.pyx":634 * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) * for val in missing_values: # <<<<<<<<<<<<<< @@ -11990,9 +11927,9 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_missing_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_missing_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 634, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_14)) { @@ -12000,7 +11937,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -12010,7 +11947,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } @@ -12021,13 +11958,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 634, __pyx_L1_error) PyErr_Clear(); } break; @@ -12037,33 +11974,33 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":643 + /* "pyreadstat/_readstat_writer.pyx":635 * raise PyreadstatError(msg) * for val in missing_values: * if val not in valid_user_missing: # <<<<<<<<<<<<<< * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) * raise PyreadstatError(msg) */ - if (unlikely(!__pyx_v_valid_user_missing)) { __Pyx_RaiseUnboundLocalError("valid_user_missing"); __PYX_ERR(0, 643, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_val, __pyx_v_valid_user_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 643, __pyx_L1_error) + if (unlikely(!__pyx_v_valid_user_missing)) { __Pyx_RaiseUnboundLocalError("valid_user_missing"); __PYX_ERR(0, 635, __pyx_L1_error) } + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_val, __pyx_v_valid_user_missing, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 635, __pyx_L1_error) if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":644 + /* "pyreadstat/_readstat_writer.pyx":636 * for val in missing_values: * if val not in valid_user_missing: * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_supports_val, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_9 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_missing_user_values_supports_val, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":645 + /* "pyreadstat/_readstat_writer.pyx":637 * if val not in valid_user_missing: * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -12071,7 +12008,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * if len(col_names) != len(set(col_names)): */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12090,14 +12027,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 645, __pyx_L1_error) + __PYX_ERR(0, 637, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":643 + /* "pyreadstat/_readstat_writer.pyx":635 * raise PyreadstatError(msg) * for val in missing_values: * if val not in valid_user_missing: # <<<<<<<<<<<<<< @@ -12106,7 +12043,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":642 + /* "pyreadstat/_readstat_writer.pyx":634 * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) * for val in missing_values: # <<<<<<<<<<<<<< @@ -12116,7 +12053,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":638 + /* "pyreadstat/_readstat_writer.pyx":630 * valid_user_missing = valid_user_missing_sas * * for key, missing_values in missing_user_values.items(): # <<<<<<<<<<<<<< @@ -12126,7 +12063,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":632 + /* "pyreadstat/_readstat_writer.pyx":624 * * cdef list valid_user_missing * if missing_user_values: # <<<<<<<<<<<<<< @@ -12135,7 +12072,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":647 + /* "pyreadstat/_readstat_writer.pyx":639 * raise PyreadstatError(msg) * * if len(col_names) != len(set(col_names)): # <<<<<<<<<<<<<< @@ -12144,17 +12081,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 647, __pyx_L1_error) + __PYX_ERR(0, 639, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 647, __pyx_L1_error) - __pyx_t_4 = PySet_New(__pyx_v_col_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_4 = PySet_New(__pyx_v_col_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = __Pyx_PySet_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_13 = __Pyx_PySet_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__pyx_t_7 != __pyx_t_13); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":648 + /* "pyreadstat/_readstat_writer.pyx":640 * * if len(col_names) != len(set(col_names)): * msg = "Non unique column names detected in the dataframe!" # <<<<<<<<<<<<<< @@ -12164,7 +12101,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Non_unique_column_names_detected); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_Non_unique_column_names_detected; - /* "pyreadstat/_readstat_writer.pyx":649 + /* "pyreadstat/_readstat_writer.pyx":641 * if len(col_names) != len(set(col_names)): * msg = "Non unique column names detected in the dataframe!" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< @@ -12172,7 +12109,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * for variable_name in col_names: */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12191,14 +12128,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 649, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":647 + /* "pyreadstat/_readstat_writer.pyx":639 * raise PyreadstatError(msg) * * if len(col_names) != len(set(col_names)): # <<<<<<<<<<<<<< @@ -12207,7 +12144,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":651 + /* "pyreadstat/_readstat_writer.pyx":643 * raise PyreadstatError(msg) * * for variable_name in col_names: # <<<<<<<<<<<<<< @@ -12216,7 +12153,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 651, __pyx_L1_error) + __PYX_ERR(0, 643, __pyx_L1_error) } __pyx_t_4 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; @@ -12224,30 +12161,30 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 651, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 643, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 651, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":652 + /* "pyreadstat/_readstat_writer.pyx":644 * * 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 len(variable_name) == 0: */ - __pyx_t_9 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 652, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":653 + /* "pyreadstat/_readstat_writer.pyx":645 * 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)))) # <<<<<<<<<<<<<< @@ -12255,11 +12192,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 653, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16[0] = __pyx_mstate_global->__pyx_kp_u_variable_name; __pyx_t_16[1] = __pyx_t_3; @@ -12267,7 +12204,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_16[3] = __pyx_t_15; __pyx_t_16[4] = __pyx_mstate_global->__pyx_kp_u_and_it_must_be_str_not_starting; __pyx_t_17 = __Pyx_PyUnicode_Join(__pyx_t_16, 5, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 48, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15)); - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -12289,14 +12226,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 653, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 653, __pyx_L1_error) + __PYX_ERR(0, 645, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":652 + /* "pyreadstat/_readstat_writer.pyx":644 * * for variable_name in col_names: * if type(variable_name) != str: # <<<<<<<<<<<<<< @@ -12305,26 +12242,26 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":654 + /* "pyreadstat/_readstat_writer.pyx":646 * 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 len(variable_name) == 0: # <<<<<<<<<<<<<< * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * if not variable_name[0].isalpha(): + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): */ - __pyx_t_7 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 646, __pyx_L1_error) __pyx_t_2 = (__pyx_t_7 == 0); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":655 + /* "pyreadstat/_readstat_writer.pyx":647 * 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 len(variable_name) == 0: * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") # <<<<<<<<<<<<<< - * 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 not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) */ __pyx_t_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12343,30 +12280,30 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 655, __pyx_L1_error) + __PYX_ERR(0, 647, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":654 + /* "pyreadstat/_readstat_writer.pyx":646 * 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 len(variable_name) == 0: # <<<<<<<<<<<<<< * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * if not variable_name[0].isalpha(): + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): */ } - /* "pyreadstat/_readstat_writer.pyx":656 + /* "pyreadstat/_readstat_writer.pyx":648 * if len(variable_name) == 0: * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * 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 not (variable_name[0].isalpha() or variable_name[0] == "_"): # <<<<<<<<<<<<<< + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_17 = __pyx_t_10; __Pyx_INCREF(__pyx_t_17); @@ -12376,46 +12313,57 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isalpha, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L30_bool_binop_done; + } + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 648, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __pyx_t_1; + __pyx_L30_bool_binop_done:; __pyx_t_1 = (!__pyx_t_2); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":657 + /* "pyreadstat/_readstat_writer.pyx":649 * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * 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 not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) 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_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_variable_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_15), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_15), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_18 = __Pyx_PyObject_Ord(__pyx_t_15); if (unlikely(__pyx_t_18 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_Ord(__pyx_t_15); if (unlikely(__pyx_t_18 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyUnicode_From_long(__pyx_t_18, 0, ' ', 'd'); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyUnicode_From_long(__pyx_t_18, 0, ' ', 'd'); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_19[0] = __pyx_mstate_global->__pyx_kp_u_variable_name; __pyx_t_19[1] = __pyx_t_5; - __pyx_t_19[2] = __pyx_mstate_global->__pyx_kp_u_starts_with_an_illegal_non_alph; + __pyx_t_19[2] = __pyx_mstate_global->__pyx_kp_u_starts_with_an_illegal_neither; __pyx_t_19[3] = __pyx_t_3; __pyx_t_19[4] = __pyx_mstate_global->__pyx_kp_u_ordinal_2; __pyx_t_19[5] = __pyx_t_15; - __pyx_t_19[6] = __pyx_mstate_global->__pyx_kp_u_; - __pyx_t_20 = __Pyx_PyUnicode_Join(__pyx_t_19, 7, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 54 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); - if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_19[6] = __pyx_mstate_global->__pyx_kp_u__2; + __pyx_t_20 = __Pyx_PyUnicode_Join(__pyx_t_19, 7, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 76 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3)); + if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12438,43 +12386,43 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 657, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 657, __pyx_L1_error) + __PYX_ERR(0, 649, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":656 + /* "pyreadstat/_readstat_writer.pyx":648 * if len(variable_name) == 0: * raise PyreadstatError("variable names must be non-empty strings, not starting with numbers") - * 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 not (variable_name[0].isalpha() or variable_name[0] == "_"): # <<<<<<<<<<<<<< + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: */ } - /* "pyreadstat/_readstat_writer.pyx":658 - * 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]))) + /* "pyreadstat/_readstat_writer.pyx":650 + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) 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_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__2, __pyx_v_variable_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__3, __pyx_v_variable_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 650, __pyx_L1_error) if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":659 - * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) + /* "pyreadstat/_readstat_writer.pyx":651 + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) 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) # <<<<<<<<<<<<<< * * dirname = os.path.dirname(filename_bytes) */ __pyx_t_17 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -12494,23 +12442,23 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 659, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 659, __pyx_L1_error) + __PYX_ERR(0, 651, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":658 - * 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]))) + /* "pyreadstat/_readstat_writer.pyx":650 + * if not (variable_name[0].isalpha() or variable_name[0] == "_"): + * raise PyreadstatError("variable name '%s' starts with an illegal (neither alphabetic nor an underscore) 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) * */ } - /* "pyreadstat/_readstat_writer.pyx":651 + /* "pyreadstat/_readstat_writer.pyx":643 * raise PyreadstatError(msg) * * for variable_name in col_names: # <<<<<<<<<<<<<< @@ -12520,16 +12468,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":661 + /* "pyreadstat/_readstat_writer.pyx":653 * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * * dirname = os.path.dirname(filename_bytes) # <<<<<<<<<<<<<< * if dirname and not os.path.isdir(dirname): * raise PyreadstatError(f"the destination folder {dirname} does not exist!") */ - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 661, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __pyx_t_9 = __pyx_t_10; @@ -12540,28 +12488,28 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dirname, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_dirname = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":662 + /* "pyreadstat/_readstat_writer.pyx":654 * * dirname = os.path.dirname(filename_bytes) * if dirname and not os.path.isdir(dirname): # <<<<<<<<<<<<<< * raise PyreadstatError(f"the destination folder {dirname} does not exist!") * */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dirname); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dirname); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L33_bool_binop_done; + goto __pyx_L35_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = __pyx_t_20; @@ -12572,17 +12520,17 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isdir, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_21 = (!__pyx_t_2); __pyx_t_1 = __pyx_t_21; - __pyx_L33_bool_binop_done:; + __pyx_L35_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":663 + /* "pyreadstat/_readstat_writer.pyx":655 * dirname = os.path.dirname(filename_bytes) * if dirname and not os.path.isdir(dirname): * raise PyreadstatError(f"the destination folder {dirname} does not exist!") # <<<<<<<<<<<<<< @@ -12590,15 +12538,15 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i * cdef bytes filepath_to_bytes(object filename_path): */ __pyx_t_20 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_dirname, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_dirname, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_22[0] = __pyx_mstate_global->__pyx_kp_u_the_destination_folder; __pyx_t_22[1] = __pyx_t_9; __pyx_t_22[2] = __pyx_mstate_global->__pyx_kp_u_does_not_exist; __pyx_t_17 = __Pyx_PyUnicode_Join(__pyx_t_22, 3, 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 16, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 663, __pyx_L1_error) + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = 1; @@ -12619,14 +12567,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 663, __pyx_L1_error) + __PYX_ERR(0, 655, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":662 + /* "pyreadstat/_readstat_writer.pyx":654 * * dirname = os.path.dirname(filename_bytes) * if dirname and not os.path.isdir(dirname): # <<<<<<<<<<<<<< @@ -12635,7 +12583,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i */ } - /* "pyreadstat/_readstat_writer.pyx":615 + /* "pyreadstat/_readstat_writer.pyx":607 * return close(fd) * * cdef void initial_checks(bint is_pandas, bint is_polars, dict variable_value_labels, dict missing_user_values, # <<<<<<<<<<<<<< @@ -12668,7 +12616,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int __pyx_v_i __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":665 +/* "pyreadstat/_readstat_writer.pyx":657 * raise PyreadstatError(f"the destination folder {dirname} does not exist!") * * cdef bytes filepath_to_bytes(object filename_path): # <<<<<<<<<<<<<< @@ -12701,20 +12649,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filepath_to_bytes", 0); - /* "pyreadstat/_readstat_writer.pyx":669 + /* "pyreadstat/_readstat_writer.pyx":661 * transforms an object with the path to the filename to bytes * """ * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_bytes = os.fsencode(filename_path) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":670 + /* "pyreadstat/_readstat_writer.pyx":662 * """ * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -12730,7 +12678,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { - /* "pyreadstat/_readstat_writer.pyx":671 + /* "pyreadstat/_readstat_writer.pyx":663 * if hasattr(os, 'fsencode'): * try: * filename_bytes = os.fsencode(filename_path) # <<<<<<<<<<<<<< @@ -12738,9 +12686,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * 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_t_6 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L4_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 663, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L4_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 663, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; @@ -12760,13 +12708,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L4_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_filename_bytes = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":670 + /* "pyreadstat/_readstat_writer.pyx":662 * """ * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -12784,7 +12732,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":672 + /* "pyreadstat/_readstat_writer.pyx":664 * try: * filename_bytes = os.fsencode(filename_path) * except UnicodeError: # <<<<<<<<<<<<<< @@ -12794,12 +12742,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_UnicodeError)))); if (__pyx_t_10) { __Pyx_AddTraceback("pyreadstat._readstat_writer.filepath_to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 672, __pyx_L6_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 664, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); - /* "pyreadstat/_readstat_writer.pyx":673 + /* "pyreadstat/_readstat_writer.pyx":665 * 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()) # <<<<<<<<<<<<<< @@ -12807,15 +12755,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * else: */ __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 665, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 665, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 665, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_9 = 1; @@ -12835,10 +12783,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 673, __pyx_L6_except_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 665, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_12); } - __pyx_t_16 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 673, __pyx_L6_except_error) + __pyx_t_16 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 665, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = 1; @@ -12859,12 +12807,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 673, __pyx_L6_except_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 665, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":674 + /* "pyreadstat/_readstat_writer.pyx":666 * 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") # <<<<<<<<<<<<<< @@ -12872,9 +12820,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * if type(filename_path) == str: */ __pyx_t_13 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 666, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_9 = 1; @@ -12894,13 +12842,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L6_except_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L6_except_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 666, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_filename_bytes, __pyx_t_7); @@ -12912,7 +12860,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj } goto __pyx_L6_except_error; - /* "pyreadstat/_readstat_writer.pyx":670 + /* "pyreadstat/_readstat_writer.pyx":662 * """ * if hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -12933,7 +12881,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_L9_try_end:; } - /* "pyreadstat/_readstat_writer.pyx":669 + /* "pyreadstat/_readstat_writer.pyx":661 * transforms an object with the path to the filename to bytes * """ * if hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< @@ -12943,7 +12891,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":668 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -12951,12 +12899,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj * elif type(filename_path) == bytes: */ /*else*/ { - __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":677 + /* "pyreadstat/_readstat_writer.pyx":669 * else: * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -12970,13 +12918,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_v_filename_bytes = __pyx_t_6; __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":668 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -12986,19 +12934,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj goto __pyx_L12; } - /* "pyreadstat/_readstat_writer.pyx":678 + /* "pyreadstat/_readstat_writer.pyx":670 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(__pyx_t_2)) { - /* "pyreadstat/_readstat_writer.pyx":679 + /* "pyreadstat/_readstat_writer.pyx":671 * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: * filename_bytes = filename_path # <<<<<<<<<<<<<< @@ -13008,7 +12956,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_INCREF(__pyx_v_filename_path); __pyx_v_filename_bytes = __pyx_v_filename_path; - /* "pyreadstat/_readstat_writer.pyx":678 + /* "pyreadstat/_readstat_writer.pyx":670 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< @@ -13018,7 +12966,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj goto __pyx_L12; } - /* "pyreadstat/_readstat_writer.pyx":681 + /* "pyreadstat/_readstat_writer.pyx":673 * filename_bytes = filename_path * else: * raise PyreadstatError("path must be either str or bytes") # <<<<<<<<<<<<<< @@ -13027,7 +12975,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj */ /*else*/ { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -13046,18 +12994,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 681, __pyx_L1_error) + __PYX_ERR(0, 673, __pyx_L1_error) } __pyx_L12:; } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":682 + /* "pyreadstat/_readstat_writer.pyx":674 * else: * raise PyreadstatError("path must be either str or bytes") * return filename_bytes # <<<<<<<<<<<<<< @@ -13067,12 +13015,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_v_filename_bytes; __Pyx_INCREF(__pyx_t_6); - if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_6))) __PYX_ERR(0, 682, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_6))) __PYX_ERR(0, 674, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":665 + /* "pyreadstat/_readstat_writer.pyx":657 * raise PyreadstatError(f"the destination folder {dirname} does not exist!") * * cdef bytes filepath_to_bytes(object filename_path): # <<<<<<<<<<<<<< @@ -13101,7 +13049,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObj return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":685 +/* "pyreadstat/_readstat_writer.pyx":677 * * * cdef int run_write(df, object filename_path, dst_file_format file_format, str file_label, object column_labels, # <<<<<<<<<<<<<< @@ -13185,30 +13133,32 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_14[7]; PyObject *__pyx_t_15 = NULL; - char *__pyx_t_16; - char const *__pyx_t_17; - int __pyx_t_18; - int __pyx_t_19; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + char *__pyx_t_18; + char const *__pyx_t_19; int __pyx_t_20; int __pyx_t_21; - __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type __pyx_t_22; + int __pyx_t_22; int __pyx_t_23; - char const *__pyx_t_24; - readstat_type_t __pyx_t_25; + __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type __pyx_t_24; + int __pyx_t_25; char const *__pyx_t_26; - char const *__pyx_t_27; + readstat_type_t __pyx_t_27; char const *__pyx_t_28; - readstat_label_set_t *__pyx_t_29; - long __pyx_t_30; - double __pyx_t_31; - int32_t __pyx_t_32; - char const *__pyx_t_33; - char const *__pyx_t_34; - PyObject *__pyx_t_35 = NULL; - PyObject *__pyx_t_36 = NULL; + char const *__pyx_t_29; + char const *__pyx_t_30; + readstat_label_set_t *__pyx_t_31; + long __pyx_t_32; + double __pyx_t_33; + int32_t __pyx_t_34; + char const *__pyx_t_35; + char const *__pyx_t_36; PyObject *__pyx_t_37 = NULL; + PyObject *__pyx_t_38 = NULL; + PyObject *__pyx_t_39 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -13217,7 +13167,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_column_labels); __Pyx_INCREF(__pyx_v_note); - /* "pyreadstat/_readstat_writer.pyx":696 + /* "pyreadstat/_readstat_writer.pyx":688 * * cdef object natnamespace * cdef object pd = None # <<<<<<<<<<<<<< @@ -13227,28 +13177,28 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __pyx_v_pd = Py_None; - /* "pyreadstat/_readstat_writer.pyx":701 + /* "pyreadstat/_readstat_writer.pyx":693 * cdef list col_names * * filename_bytes = filepath_to_bytes(filename_path) # <<<<<<<<<<<<<< * filename_bytes = os.path.expanduser(filename_bytes) * */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(__pyx_v_filename_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(__pyx_v_filename_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_filename_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":702 + /* "pyreadstat/_readstat_writer.pyx":694 * * filename_bytes = filepath_to_bytes(filename_path) * filename_bytes = os.path.expanduser(filename_bytes) # <<<<<<<<<<<<<< * * df = nw.from_native(df, eager_only=True) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; @@ -13259,14 +13209,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_expanduser, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 702, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":704 + /* "pyreadstat/_readstat_writer.pyx":696 * filename_bytes = os.path.expanduser(filename_bytes) * * df = nw.from_native(df, eager_only=True) # <<<<<<<<<<<<<< @@ -13274,9 +13224,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * is_pandas = df.implementation.is_pandas() */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_from_native); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_from_native); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 1; @@ -13293,20 +13243,20 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_df}; - __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eager_only, Py_True, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 704, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_eager_only, Py_True, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 696, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":705 + /* "pyreadstat/_readstat_writer.pyx":697 * * df = nw.from_native(df, eager_only=True) * natnamespace = nw.get_native_namespace(df) # <<<<<<<<<<<<<< @@ -13314,9 +13264,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * is_polars = df.implementation.is_polars() */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = 1; @@ -13336,20 +13286,20 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_natnamespace = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":706 + /* "pyreadstat/_readstat_writer.pyx":698 * df = nw.from_native(df, eager_only=True) * natnamespace = nw.get_native_namespace(df) * is_pandas = df.implementation.is_pandas() # <<<<<<<<<<<<<< * is_polars = df.implementation.is_polars() * col_names = df.columns */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); @@ -13359,21 +13309,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_pandas, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __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, 706, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_is_pandas = __pyx_t_6; - /* "pyreadstat/_readstat_writer.pyx":707 + /* "pyreadstat/_readstat_writer.pyx":699 * natnamespace = nw.get_native_namespace(df) * is_pandas = df.implementation.is_pandas() * is_polars = df.implementation.is_polars() # <<<<<<<<<<<<<< * col_names = df.columns * if is_pandas: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); @@ -13383,27 +13333,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_polars, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_is_polars = __pyx_t_6; - /* "pyreadstat/_readstat_writer.pyx":708 + /* "pyreadstat/_readstat_writer.pyx":700 * is_pandas = df.implementation.is_pandas() * is_polars = df.implementation.is_polars() * col_names = df.columns # <<<<<<<<<<<<<< * if is_pandas: * pd = natnamespace */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 708, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 700, __pyx_L1_error) __pyx_v_col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":709 + /* "pyreadstat/_readstat_writer.pyx":701 * is_polars = df.implementation.is_polars() * col_names = df.columns * if is_pandas: # <<<<<<<<<<<<<< @@ -13412,7 +13362,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (__pyx_v_is_pandas) { - /* "pyreadstat/_readstat_writer.pyx":710 + /* "pyreadstat/_readstat_writer.pyx":702 * col_names = df.columns * if is_pandas: * pd = natnamespace # <<<<<<<<<<<<<< @@ -13422,7 +13372,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_natnamespace); __Pyx_DECREF_SET(__pyx_v_pd, __pyx_v_natnamespace); - /* "pyreadstat/_readstat_writer.pyx":709 + /* "pyreadstat/_readstat_writer.pyx":701 * is_polars = df.implementation.is_polars() * col_names = df.columns * if is_pandas: # <<<<<<<<<<<<<< @@ -13431,16 +13381,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":712 + /* "pyreadstat/_readstat_writer.pyx":704 * pd = natnamespace * * initial_checks(is_pandas, is_polars, variable_value_labels, missing_user_values, file_format, # <<<<<<<<<<<<<< * col_names, filename_bytes) * */ - __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(__pyx_v_is_pandas, __pyx_v_is_polars, __pyx_v_variable_value_labels, __pyx_v_missing_user_values, __pyx_v_file_format, __pyx_v_col_names, __pyx_v_filename_bytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(__pyx_v_is_pandas, __pyx_v_is_polars, __pyx_v_variable_value_labels, __pyx_v_missing_user_values, __pyx_v_file_format, __pyx_v_col_names, __pyx_v_filename_bytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":723 + /* "pyreadstat/_readstat_writer.pyx":715 * cdef bytes file_label_bytes * cdef char *file_labl * cdef int dta_str_max_len = 0 # <<<<<<<<<<<<<< @@ -13449,7 +13399,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_dta_str_max_len = 0; - /* "pyreadstat/_readstat_writer.pyx":726 + /* "pyreadstat/_readstat_writer.pyx":718 * * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -13459,18 +13409,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":727 + /* "pyreadstat/_readstat_writer.pyx":719 * * if file_format == FILE_FORMAT_POR: * col_names = [x.upper() for x in col_names] # <<<<<<<<<<<<<< * * if file_format == FILE_FORMAT_DTA: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 727, __pyx_L1_error) + __PYX_ERR(0, 719, __pyx_L1_error) } __pyx_t_4 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; @@ -13478,13 +13428,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; @@ -13495,17 +13445,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 727, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_col_names, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":726 + /* "pyreadstat/_readstat_writer.pyx":718 * * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -13514,7 +13464,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":729 + /* "pyreadstat/_readstat_writer.pyx":721 * col_names = [x.upper() for x in col_names] * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -13524,7 +13474,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":730 + /* "pyreadstat/_readstat_writer.pyx":722 * * if file_format == FILE_FORMAT_DTA: * if file_format_version >= 117: # <<<<<<<<<<<<<< @@ -13534,7 +13484,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format_version >= 0x75); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":731 + /* "pyreadstat/_readstat_writer.pyx":723 * if file_format == FILE_FORMAT_DTA: * if file_format_version >= 117: * dta_str_max_len = dta_117_max_width # <<<<<<<<<<<<<< @@ -13543,7 +13493,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_dta_str_max_len = __pyx_v_10pyreadstat_16_readstat_writer_dta_117_max_width; - /* "pyreadstat/_readstat_writer.pyx":730 + /* "pyreadstat/_readstat_writer.pyx":722 * * if file_format == FILE_FORMAT_DTA: * if file_format_version >= 117: # <<<<<<<<<<<<<< @@ -13553,7 +13503,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":732 + /* "pyreadstat/_readstat_writer.pyx":724 * if file_format_version >= 117: * dta_str_max_len = dta_117_max_width * elif file_format_version >= 111: # <<<<<<<<<<<<<< @@ -13563,7 +13513,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format_version >= 0x6F); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":733 + /* "pyreadstat/_readstat_writer.pyx":725 * dta_str_max_len = dta_117_max_width * elif file_format_version >= 111: * dta_str_max_len = dta_111_max_width # <<<<<<<<<<<<<< @@ -13572,7 +13522,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_dta_str_max_len = __pyx_v_10pyreadstat_16_readstat_writer_dta_111_max_width; - /* "pyreadstat/_readstat_writer.pyx":732 + /* "pyreadstat/_readstat_writer.pyx":724 * if file_format_version >= 117: * dta_str_max_len = dta_117_max_width * elif file_format_version >= 111: # <<<<<<<<<<<<<< @@ -13582,7 +13532,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":735 + /* "pyreadstat/_readstat_writer.pyx":727 * dta_str_max_len = dta_111_max_width * else: * dta_str_max_len = dta_old_max_width # <<<<<<<<<<<<<< @@ -13594,7 +13544,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_L9:; - /* "pyreadstat/_readstat_writer.pyx":729 + /* "pyreadstat/_readstat_writer.pyx":721 * col_names = [x.upper() for x in col_names] * * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -13603,29 +13553,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":737 + /* "pyreadstat/_readstat_writer.pyx":729 * dta_str_max_len = dta_old_max_width * * cdef list col_types = get_narwhals_column_types(df, missing_user_values, variable_value_labels, dta_str_max_len) # <<<<<<<<<<<<<< * cdef int row_count = len(df) * cdef int col_count = len(col_names) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_types(__pyx_v_df, __pyx_v_missing_user_values, __pyx_v_variable_value_labels, __pyx_v_dta_str_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_types(__pyx_v_df, __pyx_v_missing_user_values, __pyx_v_variable_value_labels, __pyx_v_dta_str_max_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_col_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":738 + /* "pyreadstat/_readstat_writer.pyx":730 * * cdef list col_types = get_narwhals_column_types(df, missing_user_values, variable_value_labels, dta_str_max_len) * 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_7 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 730, __pyx_L1_error) __pyx_v_row_count = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":739 + /* "pyreadstat/_readstat_writer.pyx":731 * cdef list col_types = get_narwhals_column_types(df, missing_user_values, variable_value_labels, dta_str_max_len) * cdef int row_count = len(df) * cdef int col_count = len(col_names) # <<<<<<<<<<<<<< @@ -13634,12 +13584,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, 739, __pyx_L1_error) + __PYX_ERR(0, 731, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 731, __pyx_L1_error) __pyx_v_col_count = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":740 + /* "pyreadstat/_readstat_writer.pyx":732 * 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)} # <<<<<<<<<<<<<< @@ -13647,7 +13597,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * cdef readstat_variable_t *variable */ { /* enter inner scope */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_5 = 1; @@ -13655,7 +13605,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_col_names, __pyx_v_col_types}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -13663,9 +13613,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 732, __pyx_L12_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -13674,7 +13624,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 732, __pyx_L12_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -13684,7 +13634,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 732, __pyx_L12_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -13695,13 +13645,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L12_error) } else { __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 732, __pyx_L12_error) PyErr_Clear(); } break; @@ -13714,7 +13664,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, 740, __pyx_L12_error) + __PYX_ERR(0, 732, __pyx_L12_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -13724,22 +13674,22 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); @@ -13747,7 +13697,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 740, __pyx_L12_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 732, __pyx_L12_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L16_unpacking_done; @@ -13755,16 +13705,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 740, __pyx_L12_error) + __PYX_ERR(0, 732, __pyx_L12_error) __pyx_L16_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L12_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 740, __pyx_L12_error) + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 732, __pyx_L12_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -13780,7 +13730,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_v_col_names_to_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":749 + /* "pyreadstat/_readstat_writer.pyx":741 * cdef int col_indx * cdef bytes cur_col_label * cdef int col_label_count = 0 # <<<<<<<<<<<<<< @@ -13789,7 +13739,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":758 + /* "pyreadstat/_readstat_writer.pyx":750 * cdef object values * cdef dict value_labels * cdef int lblset_cnt = 0 # <<<<<<<<<<<<<< @@ -13798,38 +13748,148 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_lblset_cnt = 0; - /* "pyreadstat/_readstat_writer.pyx":766 + /* "pyreadstat/_readstat_writer.pyx":758 * cdef float mulfac, conv2secs * cdef readstat_string_ref_t* strref * cdef dict strref_map = dict() # <<<<<<<<<<<<<< * cdef int strref_cnt * cdef object strref_indx */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_strref_map = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":771 + /* "pyreadstat/_readstat_writer.pyx":763 * * * cdef int fd = open_file(filename_bytes) # <<<<<<<<<<<<<< + * if fd == -1: + * raise PyreadstatError( +*/ + __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_open_file(__pyx_v_filename_bytes); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_v_fd = __pyx_t_12; + + /* "pyreadstat/_readstat_writer.pyx":764 + * + * cdef int fd = open_file(filename_bytes) + * if fd == -1: # <<<<<<<<<<<<<< + * raise PyreadstatError( + * "Could not open file '%s' for writing: %s (errno %d). " +*/ + __pyx_t_6 = (__pyx_v_fd == -1L); + if (unlikely(__pyx_t_6)) { + + /* "pyreadstat/_readstat_writer.pyx":765 + * cdef int fd = open_file(filename_bytes) + * if fd == -1: + * raise PyreadstatError( # <<<<<<<<<<<<<< + * "Could not open file '%s' for writing: %s (errno %d). " + * "The file may be locked by another process or you may not have write permission." +*/ + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "pyreadstat/_readstat_writer.pyx":768 + * "Could not open file '%s' for writing: %s (errno %d). " + * "The file may be locked by another process or you may not have write permission." + * % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) # <<<<<<<<<<<<<< * writer = readstat_writer_init() * */ - __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_open_file(__pyx_v_filename_bytes); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error) - __pyx_v_fd = __pyx_t_12; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename_bytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_9), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_strerror); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyLong_From_int(errno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_13), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyUnicode_From_int(errno, 0, ' ', 'd'); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_Could_not_open_file; + __pyx_t_14[1] = __pyx_t_2; + __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_for_writing; + __pyx_t_14[3] = __pyx_t_9; + __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u_errno; + __pyx_t_14[5] = __pyx_t_13; + __pyx_t_14[6] = __pyx_mstate_global->__pyx_kp_u_The_file_may_be_locked_by_anoth; + + /* "pyreadstat/_readstat_writer.pyx":766 + * if fd == -1: + * raise PyreadstatError( + * "Could not open file '%s' for writing: %s (errno %d). " # <<<<<<<<<<<<<< + * "The file may be locked by another process or you may not have write permission." + * % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) +*/ + __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_14, 7, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 82, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9)); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 765, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":772 + /* "pyreadstat/_readstat_writer.pyx":764 * * cdef int fd = open_file(filename_bytes) + * if fd == -1: # <<<<<<<<<<<<<< + * raise PyreadstatError( + * "Could not open file '%s' for writing: %s (errno %d). " +*/ + } + + /* "pyreadstat/_readstat_writer.pyx":769 + * "The file may be locked by another process or you may not have write permission." + * % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) * writer = readstat_writer_init() # <<<<<<<<<<<<<< * * try: */ __pyx_v_writer = readstat_writer_init(); - /* "pyreadstat/_readstat_writer.pyx":774 + /* "pyreadstat/_readstat_writer.pyx":771 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -13840,22 +13900,22 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); + __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { - /* "pyreadstat/_readstat_writer.pyx":776 + /* "pyreadstat/_readstat_writer.pyx":773 * 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, 776, __pyx_L22_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, 773, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":778 + /* "pyreadstat/_readstat_writer.pyx":775 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) * * if file_label: # <<<<<<<<<<<<<< @@ -13866,13 +13926,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_file_label); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 778, __pyx_L22_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 775, __pyx_L23_error) __pyx_t_6 = (__pyx_temp != 0); } if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":779 + /* "pyreadstat/_readstat_writer.pyx":776 * * if file_label: * file_label_bytes = file_label.encode("utf-8") # <<<<<<<<<<<<<< @@ -13881,33 +13941,33 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_file_label == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 779, __pyx_L22_error) + __PYX_ERR(0, 776, __pyx_L23_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_file_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_file_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_file_label_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":780 + /* "pyreadstat/_readstat_writer.pyx":777 * 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_16 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L22_error) - __pyx_v_file_labl = ((char *)__pyx_t_16); + __pyx_t_18 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L23_error) + __pyx_v_file_labl = ((char *)__pyx_t_18); - /* "pyreadstat/_readstat_writer.pyx":781 + /* "pyreadstat/_readstat_writer.pyx":778 * 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, 781, __pyx_L22_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, 778, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":778 + /* "pyreadstat/_readstat_writer.pyx":775 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) * * if file_label: # <<<<<<<<<<<<<< @@ -13916,44 +13976,44 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":783 + /* "pyreadstat/_readstat_writer.pyx":780 * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) * * if note: # <<<<<<<<<<<<<< * if type(note) == str: * note = [note] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 783, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 780, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":784 + /* "pyreadstat/_readstat_writer.pyx":781 * * if note: * if type(note) == str: # <<<<<<<<<<<<<< * note = [note] * if type(note) == list: */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L22_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 784, __pyx_L22_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L23_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 781, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":785 + /* "pyreadstat/_readstat_writer.pyx":782 * if note: * if type(note) == str: * note = [note] # <<<<<<<<<<<<<< * if type(note) == list: * for line in note: */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L22_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_note); __Pyx_GIVEREF(__pyx_v_note); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_note) != (0)) __PYX_ERR(0, 785, __pyx_L22_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_note) != (0)) __PYX_ERR(0, 782, __pyx_L23_error); __Pyx_DECREF_SET(__pyx_v_note, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":784 + /* "pyreadstat/_readstat_writer.pyx":781 * * if note: * if type(note) == str: # <<<<<<<<<<<<<< @@ -13962,19 +14022,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":786 + /* "pyreadstat/_readstat_writer.pyx":783 * if type(note) == str: * note = [note] * if type(note) == list: # <<<<<<<<<<<<<< * for line in note: * readstat_add_note(writer, line.encode("utf-8")) */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L22_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 786, __pyx_L22_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_note)), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L23_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 783, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_6)) { - /* "pyreadstat/_readstat_writer.pyx":787 + /* "pyreadstat/_readstat_writer.pyx":784 * note = [note] * if type(note) == list: * for line in note: # <<<<<<<<<<<<<< @@ -13986,9 +14046,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L22_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 787, __pyx_L22_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 784, __pyx_L23_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -13996,65 +14056,65 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 784, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 784, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L23_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_4 = __pyx_t_8(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 787, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 784, __pyx_L23_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_4); + __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":788 + /* "pyreadstat/_readstat_writer.pyx":785 * if type(note) == list: * for line in note: * readstat_add_note(writer, line.encode("utf-8")) # <<<<<<<<<<<<<< * else: * raise PyreadstatError(f"note should be either str or list, got {type(note)}") */ - __pyx_t_4 = __pyx_v_line; - __Pyx_INCREF(__pyx_t_4); + __pyx_t_10 = __pyx_v_line; + __Pyx_INCREF(__pyx_t_10); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_utf_8}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_utf_8}; + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_17 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L22_error) - readstat_add_note(__pyx_v_writer, __pyx_t_17); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L23_error) + readstat_add_note(__pyx_v_writer, __pyx_t_19); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":787 + /* "pyreadstat/_readstat_writer.pyx":784 * note = [note] * if type(note) == list: * for line in note: # <<<<<<<<<<<<<< @@ -14064,17 +14124,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":786 + /* "pyreadstat/_readstat_writer.pyx":783 * if type(note) == str: * note = [note] * if type(note) == list: # <<<<<<<<<<<<<< * for line in note: * readstat_add_note(writer, line.encode("utf-8")) */ - goto __pyx_L31; + goto __pyx_L32; } - /* "pyreadstat/_readstat_writer.pyx":790 + /* "pyreadstat/_readstat_writer.pyx":787 * readstat_add_note(writer, line.encode("utf-8")) * else: * raise PyreadstatError(f"note should be either str or list, got {type(note)}") # <<<<<<<<<<<<<< @@ -14082,42 +14142,42 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if file_format_version > -1: */ /*else*/ { - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_note)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 790, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_note_should_be_either_str_or_lis, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 787, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_note)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_note_should_be_either_str_or_lis, __pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 787, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 790, __pyx_L22_error) + __PYX_ERR(0, 787, __pyx_L23_error) } - __pyx_L31:; + __pyx_L32:; - /* "pyreadstat/_readstat_writer.pyx":783 + /* "pyreadstat/_readstat_writer.pyx":780 * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) * * if note: # <<<<<<<<<<<<<< @@ -14126,7 +14186,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":792 + /* "pyreadstat/_readstat_writer.pyx":789 * raise PyreadstatError(f"note should be either str or list, got {type(note)}") * * if file_format_version > -1: # <<<<<<<<<<<<<< @@ -14136,16 +14196,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_file_format_version > -1L); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":793 + /* "pyreadstat/_readstat_writer.pyx":790 * * 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, 793, __pyx_L22_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, 790, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":792 + /* "pyreadstat/_readstat_writer.pyx":789 * raise PyreadstatError(f"note should be either str or list, got {type(note)}") * * if file_format_version > -1: # <<<<<<<<<<<<<< @@ -14154,7 +14214,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":795 + /* "pyreadstat/_readstat_writer.pyx":792 * check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) * * if row_compression: # <<<<<<<<<<<<<< @@ -14163,16 +14223,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (__pyx_v_row_compression) { - /* "pyreadstat/_readstat_writer.pyx":796 + /* "pyreadstat/_readstat_writer.pyx":793 * * 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, 796, __pyx_L22_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, 793, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":795 + /* "pyreadstat/_readstat_writer.pyx":792 * check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) * * if row_compression: # <<<<<<<<<<<<<< @@ -14181,7 +14241,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":799 + /* "pyreadstat/_readstat_writer.pyx":796 * * # table name is used only for xpt files * if table_name: # <<<<<<<<<<<<<< @@ -14192,13 +14252,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_table_name); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 799, __pyx_L22_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 796, __pyx_L23_error) __pyx_t_6 = (__pyx_temp != 0); } if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":800 + /* "pyreadstat/_readstat_writer.pyx":797 * # table name is used only for xpt files * if table_name: * table_name_bytes = table_name.encode("utf-8") # <<<<<<<<<<<<<< @@ -14207,33 +14267,33 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_table_name == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 800, __pyx_L22_error) + __PYX_ERR(0, 797, __pyx_L23_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_table_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_table_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_table_name_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":801 + /* "pyreadstat/_readstat_writer.pyx":798 * 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_16 = __Pyx_PyBytes_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 801, __pyx_L22_error) - __pyx_v_tab_name = ((char *)__pyx_t_16); + __pyx_t_18 = __Pyx_PyBytes_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L23_error) + __pyx_v_tab_name = ((char *)__pyx_t_18); - /* "pyreadstat/_readstat_writer.pyx":802 + /* "pyreadstat/_readstat_writer.pyx":799 * 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, 802, __pyx_L22_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, 799, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":799 + /* "pyreadstat/_readstat_writer.pyx":796 * * # table name is used only for xpt files * if table_name: # <<<<<<<<<<<<<< @@ -14242,73 +14302,73 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":805 + /* "pyreadstat/_readstat_writer.pyx":802 * * # 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_column_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 805, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_column_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 802, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":806 + /* "pyreadstat/_readstat_writer.pyx":803 * # 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, 806, __pyx_L22_error) - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 806, __pyx_L22_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, 803, __pyx_L23_error) + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 803, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_18) { + if (__pyx_t_20) { } else { - __pyx_t_6 = __pyx_t_18; - goto __pyx_L40_bool_binop_done; + __pyx_t_6 = __pyx_t_20; + goto __pyx_L41_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, 806, __pyx_L22_error) - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 806, __pyx_L22_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, 803, __pyx_L23_error) + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 803, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_t_18; - __pyx_L40_bool_binop_done:; + __pyx_t_6 = __pyx_t_20; + __pyx_L41_bool_binop_done:; if (unlikely(__pyx_t_6)) { - /* "pyreadstat/_readstat_writer.pyx":807 + /* "pyreadstat/_readstat_writer.pyx":804 * 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_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 804, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13); + assert(__pyx_t_10); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_column_labels_must_be_either_lis}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_column_labels_must_be_either_lis}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 807, __pyx_L22_error) + __PYX_ERR(0, 804, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":806 + /* "pyreadstat/_readstat_writer.pyx":803 * # add variables * if column_labels: * if type(column_labels) != list and type(column_labels) != dict: # <<<<<<<<<<<<<< @@ -14317,31 +14377,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":808 + /* "pyreadstat/_readstat_writer.pyx":805 * 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, 808, __pyx_L22_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 808, __pyx_L22_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, 805, __pyx_L23_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 805, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":809 + /* "pyreadstat/_readstat_writer.pyx":806 * 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, 809, __pyx_L22_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_col_label_temp = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":810 + /* "pyreadstat/_readstat_writer.pyx":807 * if type(column_labels) == dict: * col_label_temp = list() * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -14349,11 +14409,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * if variable_name in column_labels.keys(): */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":811 + /* "pyreadstat/_readstat_writer.pyx":808 * col_label_temp = list() * for col_indx in range(col_count): * variable_name = col_names[col_indx] # <<<<<<<<<<<<<< @@ -14362,57 +14422,57 @@ 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, 811, __pyx_L22_error) + __PYX_ERR(0, 808, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":812 + /* "pyreadstat/_readstat_writer.pyx":809 * 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_2 = __pyx_v_column_labels; - __Pyx_INCREF(__pyx_t_2); + __pyx_t_13 = __pyx_v_column_labels; + __Pyx_INCREF(__pyx_t_13); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_keys, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 812, __pyx_L22_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 809, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":813 + /* "pyreadstat/_readstat_writer.pyx":810 * 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, 813, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_column_labels, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_col_label_temp, __pyx_t_1); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 813, __pyx_L22_error) + __pyx_t_23 = __Pyx_PyList_Append(__pyx_v_col_label_temp, __pyx_t_1); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 810, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":812 + /* "pyreadstat/_readstat_writer.pyx":809 * 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_L45; + goto __pyx_L46; } - /* "pyreadstat/_readstat_writer.pyx":815 + /* "pyreadstat/_readstat_writer.pyx":812 * col_label_temp.append(column_labels[variable_name]) * else: * col_label_temp.append(None) # <<<<<<<<<<<<<< @@ -14420,12 +14480,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * */ /*else*/ { - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_col_label_temp, Py_None); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 815, __pyx_L22_error) + __pyx_t_23 = __Pyx_PyList_Append(__pyx_v_col_label_temp, Py_None); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 812, __pyx_L23_error) } - __pyx_L45:; + __pyx_L46:; } - /* "pyreadstat/_readstat_writer.pyx":816 + /* "pyreadstat/_readstat_writer.pyx":813 * else: * col_label_temp.append(None) * column_labels = col_label_temp # <<<<<<<<<<<<<< @@ -14435,7 +14495,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":808 + /* "pyreadstat/_readstat_writer.pyx":805 * 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: # <<<<<<<<<<<<<< @@ -14444,17 +14504,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":818 + /* "pyreadstat/_readstat_writer.pyx":815 * 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_7 = PyObject_Length(__pyx_v_column_labels); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 818, __pyx_L22_error) + __pyx_t_7 = PyObject_Length(__pyx_v_column_labels); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 815, __pyx_L23_error) __pyx_v_col_label_count = __pyx_t_7; - /* "pyreadstat/_readstat_writer.pyx":819 + /* "pyreadstat/_readstat_writer.pyx":816 * * col_label_count = len(column_labels) * if col_label_count != col_count: # <<<<<<<<<<<<<< @@ -14464,41 +14524,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_col_label_count != __pyx_v_col_count); if (unlikely(__pyx_t_6)) { - /* "pyreadstat/_readstat_writer.pyx":820 + /* "pyreadstat/_readstat_writer.pyx":817 * 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") # <<<<<<<<<<<<<< * * strref_cnt = 0 */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10); + assert(__pyx_t_13); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_length_of_column_labels_must_be}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_length_of_column_labels_must_be}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 820, __pyx_L22_error) + __PYX_ERR(0, 817, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":819 + /* "pyreadstat/_readstat_writer.pyx":816 * * col_label_count = len(column_labels) * if col_label_count != col_count: # <<<<<<<<<<<<<< @@ -14507,7 +14567,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":805 + /* "pyreadstat/_readstat_writer.pyx":802 * * # add variables * if column_labels: # <<<<<<<<<<<<<< @@ -14516,7 +14576,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":822 + /* "pyreadstat/_readstat_writer.pyx":819 * raise PyreadstatError("length of column labels must be the same as number of columns") * * strref_cnt = 0 # <<<<<<<<<<<<<< @@ -14525,7 +14585,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_strref_cnt = 0; - /* "pyreadstat/_readstat_writer.pyx":823 + /* "pyreadstat/_readstat_writer.pyx":820 * * strref_cnt = 0 * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -14533,11 +14593,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * variable_name = col_names[col_indx] */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":824 + /* "pyreadstat/_readstat_writer.pyx":821 * strref_cnt = 0 * for col_indx in range(col_count): * curtype, max_length, _,_ = col_types[col_indx] # <<<<<<<<<<<<<< @@ -14546,9 +14606,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, 824, __pyx_L22_error) + __PYX_ERR(0, 821, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -14556,38 +14616,38 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 824, __pyx_L22_error) + __PYX_ERR(0, 821, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_13); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_3); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); - __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L22_error) + __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 821, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 821, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L22_error) + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_XGOTREF(__pyx_t_9); } #else { Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_2,&__pyx_t_3,&__pyx_t_9}; + PyObject** temps[4] = {&__pyx_t_10,&__pyx_t_13,&__pyx_t_4,&__pyx_t_3}; for (i=0; i < 4; i++) { - PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 824, __pyx_L22_error) + PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 821, __pyx_L23_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -14596,39 +14656,39 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_2,&__pyx_t_3,&__pyx_t_9}; - __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_10); + PyObject** temps[4] = {&__pyx_t_10,&__pyx_t_13,&__pyx_t_4,&__pyx_t_3}; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 821, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L49_unpacking_failed; + PyObject* item = __pyx_t_11(__pyx_t_9); if (unlikely(!item)) goto __pyx_L50_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 4) < (0)) __PYX_ERR(0, 824, __pyx_L22_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 4) < (0)) __PYX_ERR(0, 821, __pyx_L23_error) __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L50_unpacking_done; - __pyx_L49_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L51_unpacking_done; + __pyx_L50_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 824, __pyx_L22_error) - __pyx_L50_unpacking_done:; + __PYX_ERR(0, 821, __pyx_L23_error) + __pyx_L51_unpacking_done:; } - __pyx_t_22 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_23 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_curtype = __pyx_t_22; - __pyx_v_max_length = __pyx_t_23; - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3); + __pyx_t_24 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_t_13); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_curtype = __pyx_t_24; + __pyx_v_max_length = __pyx_t_25; + __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v__, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v__, __pyx_t_9); - __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":825 + /* "pyreadstat/_readstat_writer.pyx":822 * for col_indx in range(col_count): * curtype, max_length, _,_ = col_types[col_indx] * variable_name = col_names[col_indx] # <<<<<<<<<<<<<< @@ -14637,56 +14697,56 @@ 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, 825, __pyx_L22_error) + __PYX_ERR(0, 822, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":827 + /* "pyreadstat/_readstat_writer.pyx":824 * variable_name = col_names[col_indx] * # add variable * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), narwhals_to_readstat_types[curtype], max_length) # <<<<<<<<<<<<<< * # add format * if variable_format: */ - __pyx_t_9 = __pyx_v_variable_name; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_3 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_24 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_24) && PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L22_error) + __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L23_error) if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 827, __pyx_L22_error) + __PYX_ERR(0, 824, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 827, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L22_error) + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_25 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L22_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_variable = readstat_add_variable(__pyx_v_writer, __pyx_t_24, __pyx_t_25, __pyx_v_max_length); + __pyx_t_27 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_variable = readstat_add_variable(__pyx_v_writer, __pyx_t_26, __pyx_t_27, __pyx_v_max_length); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":829 + /* "pyreadstat/_readstat_writer.pyx":826 * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), narwhals_to_readstat_types[curtype], max_length) * # add format * if variable_format: # <<<<<<<<<<<<<< * tempformat = variable_format.get(variable_name) * if tempformat: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_format); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 829, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_format); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 826, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":830 + /* "pyreadstat/_readstat_writer.pyx":827 * # add format * if variable_format: * tempformat = variable_format.get(variable_name) # <<<<<<<<<<<<<< @@ -14695,15 +14755,15 @@ 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, 830, __pyx_L22_error) + __PYX_ERR(0, 827, __pyx_L23_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, 830, __pyx_L22_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, 827, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 830, __pyx_L22_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 827, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_v_tempformat, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":831 + /* "pyreadstat/_readstat_writer.pyx":828 * if variable_format: * tempformat = variable_format.get(variable_name) * if tempformat: # <<<<<<<<<<<<<< @@ -14714,13 +14774,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d else { Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_tempformat); - if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 831, __pyx_L22_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 828, __pyx_L23_error) __pyx_t_6 = (__pyx_temp != 0); } if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":832 + /* "pyreadstat/_readstat_writer.pyx":829 * tempformat = variable_format.get(variable_name) * if tempformat: * readstat_variable_set_format(variable, tempformat.encode("utf-8")) # <<<<<<<<<<<<<< @@ -14729,15 +14789,15 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_tempformat == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 832, __pyx_L22_error) + __PYX_ERR(0, 829, __pyx_L23_error) } - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_tempformat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_tempformat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L22_error) - readstat_variable_set_format(__pyx_v_variable, __pyx_t_26); + __pyx_t_28 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_28) && PyErr_Occurred())) __PYX_ERR(0, 829, __pyx_L23_error) + readstat_variable_set_format(__pyx_v_variable, __pyx_t_28); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":831 + /* "pyreadstat/_readstat_writer.pyx":828 * if variable_format: * tempformat = variable_format.get(variable_name) * if tempformat: # <<<<<<<<<<<<<< @@ -14746,7 +14806,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":829 + /* "pyreadstat/_readstat_writer.pyx":826 * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), narwhals_to_readstat_types[curtype], max_length) * # add format * if variable_format: # <<<<<<<<<<<<<< @@ -14755,55 +14815,55 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":833 + /* "pyreadstat/_readstat_writer.pyx":830 * 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_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L23_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, 833, __pyx_L22_error) + __PYX_ERR(0, 830, __pyx_L23_error) } - __pyx_t_18 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 830, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_18) { + if (__pyx_t_20) { } else { - __pyx_t_6 = __pyx_t_18; - goto __pyx_L54_bool_binop_done; + __pyx_t_6 = __pyx_t_20; + goto __pyx_L55_bool_binop_done; } - __pyx_t_18 = (__pyx_v_variable_format == ((PyObject*)Py_None)); - if (!__pyx_t_18) { + __pyx_t_20 = (__pyx_v_variable_format == ((PyObject*)Py_None)); + if (!__pyx_t_20) { } else { - __pyx_t_6 = __pyx_t_18; - goto __pyx_L54_bool_binop_done; + __pyx_t_6 = __pyx_t_20; + goto __pyx_L55_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, 833, __pyx_L22_error) + __PYX_ERR(0, 830, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_variable_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_variable_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 833, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable_name, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 830, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __pyx_t_18; - __pyx_L54_bool_binop_done:; + __pyx_t_6 = __pyx_t_20; + __pyx_L55_bool_binop_done:; if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":834 + /* "pyreadstat/_readstat_writer.pyx":831 * 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) * # prepare string_ref */ - __pyx_t_16 = __pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat(__pyx_v_file_format, __pyx_v_curtype); if (unlikely(__pyx_t_16 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L22_error) - __pyx_v_curformat = __pyx_t_16; + __pyx_t_18 = __pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat(__pyx_v_file_format, __pyx_v_curtype); if (unlikely(__pyx_t_18 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 831, __pyx_L23_error) + __pyx_v_curformat = __pyx_t_18; - /* "pyreadstat/_readstat_writer.pyx":835 + /* "pyreadstat/_readstat_writer.pyx":832 * 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) # <<<<<<<<<<<<<< @@ -14812,7 +14872,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":833 + /* "pyreadstat/_readstat_writer.pyx":830 * 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()): # <<<<<<<<<<<<<< @@ -14821,7 +14881,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":838 + /* "pyreadstat/_readstat_writer.pyx":835 * # prepare string_ref * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -14831,59 +14891,59 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":839 + /* "pyreadstat/_readstat_writer.pyx":836 * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: # <<<<<<<<<<<<<< * if curval not in strref_map: * curvalstr = str(curval) */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_df, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_df, __pyx_v_variable_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 839, __pyx_L22_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 836, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 836, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 836, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L23_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_3); + __pyx_t_1 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 839, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 836, __pyx_L23_error) PyErr_Clear(); } break; @@ -14893,54 +14953,54 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_curval, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":840 + /* "pyreadstat/_readstat_writer.pyx":837 * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: * if curval not in strref_map: # <<<<<<<<<<<<<< * curvalstr = str(curval) * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) */ - __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_curval, __pyx_v_strref_map, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 840, __pyx_L22_error) + __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_curval, __pyx_v_strref_map, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 837, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":841 + /* "pyreadstat/_readstat_writer.pyx":838 * for curval in df[variable_name]: * if curval not in strref_map: * curvalstr = str(curval) # <<<<<<<<<<<<<< * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) * strref_map[curvalstr] = strref_cnt */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":842 + /* "pyreadstat/_readstat_writer.pyx":839 * if curval not in strref_map: * curvalstr = str(curval) * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) # <<<<<<<<<<<<<< * strref_map[curvalstr] = strref_cnt * strref_cnt += 1 */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_27 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_27) && PyErr_Occurred())) __PYX_ERR(0, 842, __pyx_L22_error) - __pyx_v_strref = readstat_add_string_ref(__pyx_v_writer, __pyx_t_27); + __pyx_t_29 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_29) && PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L23_error) + __pyx_v_strref = readstat_add_string_ref(__pyx_v_writer, __pyx_t_29); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":843 + /* "pyreadstat/_readstat_writer.pyx":840 * curvalstr = str(curval) * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) * strref_map[curvalstr] = strref_cnt # <<<<<<<<<<<<<< * strref_cnt += 1 * # labels */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_strref_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_strref_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_strref_map, __pyx_v_curvalstr, __pyx_t_1) < 0))) __PYX_ERR(0, 843, __pyx_L22_error) + if (unlikely((PyDict_SetItem(__pyx_v_strref_map, __pyx_v_curvalstr, __pyx_t_1) < 0))) __PYX_ERR(0, 840, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":844 + /* "pyreadstat/_readstat_writer.pyx":841 * strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) * strref_map[curvalstr] = strref_cnt * strref_cnt += 1 # <<<<<<<<<<<<<< @@ -14949,7 +15009,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_strref_cnt = (__pyx_v_strref_cnt + 1); - /* "pyreadstat/_readstat_writer.pyx":840 + /* "pyreadstat/_readstat_writer.pyx":837 * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: * if curval not in strref_map: # <<<<<<<<<<<<<< @@ -14958,7 +15018,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":839 + /* "pyreadstat/_readstat_writer.pyx":836 * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: * for curval in df[variable_name]: # <<<<<<<<<<<<<< @@ -14966,9 +15026,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * curvalstr = str(curval) */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":838 + /* "pyreadstat/_readstat_writer.pyx":835 * # prepare string_ref * # for STRING_REF we have to add to a dict here before start writing * if curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< @@ -14977,7 +15037,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":846 + /* "pyreadstat/_readstat_writer.pyx":843 * strref_cnt += 1 * # labels * if col_label_count: # <<<<<<<<<<<<<< @@ -14987,69 +15047,69 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_6 = (__pyx_v_col_label_count != 0); if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":847 + /* "pyreadstat/_readstat_writer.pyx":844 * # labels * 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_3 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = (__pyx_t_3 != Py_None); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = (__pyx_t_4 != Py_None); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":848 + /* "pyreadstat/_readstat_writer.pyx":845 * 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_3 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_3)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 848, __pyx_L22_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_4)), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 845, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_6)) { - /* "pyreadstat/_readstat_writer.pyx":849 + /* "pyreadstat/_readstat_writer.pyx":846 * 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_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 849, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Column_labels_must_be_strings}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Column_labels_must_be_strings}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __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, 846, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 849, __pyx_L22_error) + __PYX_ERR(0, 846, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":848 + /* "pyreadstat/_readstat_writer.pyx":845 * if col_label_count: * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: # <<<<<<<<<<<<<< @@ -15058,31 +15118,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":850 + /* "pyreadstat/_readstat_writer.pyx":847 * 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_3 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 850, __pyx_L22_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 847, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_v_cur_col_label, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":851 + /* "pyreadstat/_readstat_writer.pyx":848 * 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) # <<<<<<<<<<<<<< @@ -15091,12 +15151,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, 851, __pyx_L22_error) + __PYX_ERR(0, 848, __pyx_L23_error) } - __pyx_t_28 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_28) && PyErr_Occurred())) __PYX_ERR(0, 851, __pyx_L22_error) - readstat_variable_set_label(__pyx_v_variable, __pyx_t_28); + __pyx_t_30 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_30) && PyErr_Occurred())) __PYX_ERR(0, 848, __pyx_L23_error) + readstat_variable_set_label(__pyx_v_variable, __pyx_t_30); - /* "pyreadstat/_readstat_writer.pyx":847 + /* "pyreadstat/_readstat_writer.pyx":844 * # labels * if col_label_count: * if column_labels[col_indx] is not None: # <<<<<<<<<<<<<< @@ -15105,7 +15165,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":846 + /* "pyreadstat/_readstat_writer.pyx":843 * strref_cnt += 1 * # labels * if col_label_count: # <<<<<<<<<<<<<< @@ -15114,17 +15174,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":852 + /* "pyreadstat/_readstat_writer.pyx":849 * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 852, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 849, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":853 + /* "pyreadstat/_readstat_writer.pyx":850 * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) # <<<<<<<<<<<<<< @@ -15133,43 +15193,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, 853, __pyx_L22_error) + __PYX_ERR(0, 850, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 853, __pyx_L22_error) + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 850, __pyx_L23_error) __Pyx_XDECREF_SET(__pyx_v_value_labels, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":854 + /* "pyreadstat/_readstat_writer.pyx":851 * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 854, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 851, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":855 + /* "pyreadstat/_readstat_writer.pyx":852 * 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_1 = __Pyx_PyLong_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L22_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_labelset_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":856 + /* "pyreadstat/_readstat_writer.pyx":853 * if value_labels: * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 # <<<<<<<<<<<<<< @@ -15178,7 +15238,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":857 + /* "pyreadstat/_readstat_writer.pyx":854 * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 * curuser_missing = None # <<<<<<<<<<<<<< @@ -15188,17 +15248,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":858 + /* "pyreadstat/_readstat_writer.pyx":855 * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 858, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 855, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":859 + /* "pyreadstat/_readstat_writer.pyx":856 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) # <<<<<<<<<<<<<< @@ -15207,14 +15267,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, 859, __pyx_L22_error) + __PYX_ERR(0, 856, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":858 + /* "pyreadstat/_readstat_writer.pyx":855 * lblset_cnt += 1 * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -15223,7 +15283,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":860 + /* "pyreadstat/_readstat_writer.pyx":857 * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, # <<<<<<<<<<<<<< @@ -15232,40 +15292,40 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_t_1 = __pyx_v_labelset_name; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 860, __pyx_L22_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 857, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":861 + /* "pyreadstat/_readstat_writer.pyx":858 * 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) * # missing ranges */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_22 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_v_variable_name; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_24 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_4); + if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 858, __pyx_L23_error) + __pyx_t_3 = __pyx_v_curuser_missing; __Pyx_INCREF(__pyx_t_3); - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 861, __pyx_L22_error) - __pyx_t_9 = __pyx_v_curuser_missing; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyList_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_9))) __PYX_ERR(0, 861, __pyx_L22_error) + if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_3))) __PYX_ERR(0, 858, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":860 + /* "pyreadstat/_readstat_writer.pyx":857 * 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_29 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_t_1), __pyx_t_22, __pyx_v_file_format, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_9)); if (unlikely(__pyx_t_29 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L22_error) + __pyx_t_31 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_t_1), __pyx_t_24, __pyx_v_file_format, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_3)); if (unlikely(__pyx_t_31 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 857, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_label_set = __pyx_t_29; + __pyx_v_label_set = __pyx_t_31; - /* "pyreadstat/_readstat_writer.pyx":862 + /* "pyreadstat/_readstat_writer.pyx":859 * 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) # <<<<<<<<<<<<<< @@ -15274,7 +15334,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":854 + /* "pyreadstat/_readstat_writer.pyx":851 * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) * if value_labels: # <<<<<<<<<<<<<< @@ -15283,7 +15343,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":852 + /* "pyreadstat/_readstat_writer.pyx":849 * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: # <<<<<<<<<<<<<< @@ -15292,17 +15352,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":864 + /* "pyreadstat/_readstat_writer.pyx":861 * readstat_variable_set_label_set(variable, label_set) * # missing ranges * if missing_ranges: # <<<<<<<<<<<<<< * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 864, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 861, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":865 + /* "pyreadstat/_readstat_writer.pyx":862 * # missing ranges * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) # <<<<<<<<<<<<<< @@ -15311,24 +15371,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, 865, __pyx_L22_error) + __PYX_ERR(0, 862, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_cur_ranges, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur_ranges, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":866 + /* "pyreadstat/_readstat_writer.pyx":863 * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 866, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 863, __pyx_L23_error) if (__pyx_t_6) { - /* "pyreadstat/_readstat_writer.pyx":867 + /* "pyreadstat/_readstat_writer.pyx":864 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -15336,10 +15396,10 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * raise PyreadstatError(msg) */ __pyx_t_6 = PyList_Check(__pyx_v_cur_ranges); - __pyx_t_18 = (!__pyx_t_6); - if (unlikely(__pyx_t_18)) { + __pyx_t_20 = (!__pyx_t_6); + if (unlikely(__pyx_t_20)) { - /* "pyreadstat/_readstat_writer.pyx":868 + /* "pyreadstat/_readstat_writer.pyx":865 * if cur_ranges: * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" # <<<<<<<<<<<<<< @@ -15349,41 +15409,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_missing_ranges_values_in_diction); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_missing_ranges_values_in_diction; - /* "pyreadstat/_readstat_writer.pyx":869 + /* "pyreadstat/_readstat_writer.pyx":866 * 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_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L22_error) + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_3); + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_msg}; - __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_msg}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_Raise(__pyx_t_9, 0, 0, 0); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __PYX_ERR(0, 869, __pyx_L22_error) + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 866, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":867 + /* "pyreadstat/_readstat_writer.pyx":864 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -15392,24 +15452,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":870 + /* "pyreadstat/_readstat_writer.pyx":867 * 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 */ - __pyx_t_9 = __pyx_v_cur_ranges; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyList_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_9))) __PYX_ERR(0, 870, __pyx_L22_error) + __pyx_t_3 = __pyx_v_cur_ranges; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_3))) __PYX_ERR(0, 867, __pyx_L23_error) __pyx_t_1 = __pyx_v_variable_name; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 870, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_t_9), __pyx_v_variable, __pyx_v_curtype, ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 870, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 867, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_t_3), __pyx_v_variable, __pyx_v_curtype, ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 867, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":866 + /* "pyreadstat/_readstat_writer.pyx":863 * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: # <<<<<<<<<<<<<< @@ -15418,7 +15478,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":864 + /* "pyreadstat/_readstat_writer.pyx":861 * readstat_variable_set_label_set(variable, label_set) * # missing ranges * if missing_ranges: # <<<<<<<<<<<<<< @@ -15427,17 +15487,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":871 + /* "pyreadstat/_readstat_writer.pyx":868 * 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_18 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 871, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 868, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":874 + /* "pyreadstat/_readstat_writer.pyx":871 * # 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) # <<<<<<<<<<<<<< @@ -15446,24 +15506,24 @@ 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, 874, __pyx_L22_error) + __PYX_ERR(0, 871, __pyx_L23_error) } - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cur_alignment, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":875 + /* "pyreadstat/_readstat_writer.pyx":872 * # 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_18 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 875, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 872, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":876 + /* "pyreadstat/_readstat_writer.pyx":873 * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) # <<<<<<<<<<<<<< @@ -15472,15 +15532,15 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_t_1 = __pyx_v_cur_alignment; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 876, __pyx_L22_error) - __pyx_t_9 = __pyx_v_variable_name; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 876, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_9)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 876, __pyx_L22_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 873, __pyx_L23_error) + __pyx_t_3 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 873, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":875 + /* "pyreadstat/_readstat_writer.pyx":872 * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: # <<<<<<<<<<<<<< @@ -15489,7 +15549,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":871 + /* "pyreadstat/_readstat_writer.pyx":868 * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable, curtype, variable_name) * if variable_alignment: # <<<<<<<<<<<<<< @@ -15498,17 +15558,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":877 + /* "pyreadstat/_readstat_writer.pyx":874 * 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_18 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 877, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 874, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":878 + /* "pyreadstat/_readstat_writer.pyx":875 * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) # <<<<<<<<<<<<<< @@ -15517,38 +15577,38 @@ 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, 878, __pyx_L22_error) + __PYX_ERR(0, 875, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 878, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_cur_display_width, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur_display_width, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":879 + /* "pyreadstat/_readstat_writer.pyx":876 * 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_18 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 879, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 876, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":880 + /* "pyreadstat/_readstat_writer.pyx":877 * 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_23 = __Pyx_PyLong_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L22_error) - __pyx_t_9 = __pyx_v_variable_name; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 880, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_23, ((PyObject*)__pyx_t_9)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L23_error) + __pyx_t_3 = __pyx_v_variable_name; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 877, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_25, ((PyObject*)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":879 + /* "pyreadstat/_readstat_writer.pyx":876 * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: # <<<<<<<<<<<<<< @@ -15557,7 +15617,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":877 + /* "pyreadstat/_readstat_writer.pyx":874 * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: # <<<<<<<<<<<<<< @@ -15566,17 +15626,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":881 + /* "pyreadstat/_readstat_writer.pyx":878 * 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_18 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 881, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 878, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":882 + /* "pyreadstat/_readstat_writer.pyx":879 * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: * cur_measure = variable_measure.get(variable_name) # <<<<<<<<<<<<<< @@ -15585,41 +15645,41 @@ 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, 882, __pyx_L22_error) + __PYX_ERR(0, 879, __pyx_L23_error) } - __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_cur_measure, __pyx_t_9); - __pyx_t_9 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_cur_measure, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":883 + /* "pyreadstat/_readstat_writer.pyx":880 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< * set_variable_measure(variable, cur_measure, variable_name) * */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 883, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 880, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":884 + /* "pyreadstat/_readstat_writer.pyx":881 * cur_measure = variable_measure.get(variable_name) * if cur_measure: * set_variable_measure(variable, cur_measure, variable_name) # <<<<<<<<<<<<<< * * # start writing */ - __pyx_t_9 = __pyx_v_cur_measure; - __Pyx_INCREF(__pyx_t_9); - if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 884, __pyx_L22_error) + __pyx_t_3 = __pyx_v_cur_measure; + __Pyx_INCREF(__pyx_t_3); + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 881, __pyx_L23_error) __pyx_t_1 = __pyx_v_variable_name; __Pyx_INCREF(__pyx_t_1); - if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 884, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_t_9), ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 881, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":883 + /* "pyreadstat/_readstat_writer.pyx":880 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< @@ -15628,7 +15688,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":881 + /* "pyreadstat/_readstat_writer.pyx":878 * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: # <<<<<<<<<<<<<< @@ -15638,7 +15698,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } } - /* "pyreadstat/_readstat_writer.pyx":887 + /* "pyreadstat/_readstat_writer.pyx":884 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -15648,16 +15708,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":888 + /* "pyreadstat/_readstat_writer.pyx":885 * # 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, 888, __pyx_L22_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, 885, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":887 + /* "pyreadstat/_readstat_writer.pyx":884 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -15667,16 +15727,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":890 + /* "pyreadstat/_readstat_writer.pyx":887 * 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, 890, __pyx_L22_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, 887, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":889 + /* "pyreadstat/_readstat_writer.pyx":886 * if file_format == FILE_FORMAT_SAS7BCAT: * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) * elif file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -15686,16 +15746,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":892 + /* "pyreadstat/_readstat_writer.pyx":889 * 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, 892, __pyx_L22_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, 889, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":891 + /* "pyreadstat/_readstat_writer.pyx":888 * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAV: # <<<<<<<<<<<<<< @@ -15705,16 +15765,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":894 + /* "pyreadstat/_readstat_writer.pyx":891 * 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, 894, __pyx_L22_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, 891, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":893 + /* "pyreadstat/_readstat_writer.pyx":890 * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -15724,16 +15784,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":896 + /* "pyreadstat/_readstat_writer.pyx":893 * 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, 896, __pyx_L22_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, 893, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":895 + /* "pyreadstat/_readstat_writer.pyx":892 * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAS7BDAT: # <<<<<<<<<<<<<< @@ -15743,16 +15803,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":898 + /* "pyreadstat/_readstat_writer.pyx":895 * 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, 898, __pyx_L22_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, 895, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":897 + /* "pyreadstat/_readstat_writer.pyx":894 * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_XPORT: # <<<<<<<<<<<<<< @@ -15762,52 +15822,52 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; default: - /* "pyreadstat/_readstat_writer.pyx":900 + /* "pyreadstat/_readstat_writer.pyx":897 * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) * else: * raise PyreadstatError("unknown file format") # <<<<<<<<<<<<<< * * # validation */ - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_unknown_file_format}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_unknown_file_format}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 900, __pyx_L22_error) + __PYX_ERR(0, 897, __pyx_L23_error) break; } - /* "pyreadstat/_readstat_writer.pyx":903 + /* "pyreadstat/_readstat_writer.pyx":900 * * # 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, 903, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_metadata(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 900, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":904 + /* "pyreadstat/_readstat_writer.pyx":901 * # validation * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -15815,11 +15875,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_validate_variable(writer, tempvar)) */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":905 + /* "pyreadstat/_readstat_writer.pyx":902 * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -15828,138 +15888,138 @@ 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":906 + /* "pyreadstat/_readstat_writer.pyx":903 * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) * check_exit_status(readstat_validate_variable(writer, tempvar)) # <<<<<<<<<<<<<< * * # vectorized transform of datetime64ns columns */ - __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, 906, __pyx_L22_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, 903, __pyx_L23_error) } - /* "pyreadstat/_readstat_writer.pyx":909 + /* "pyreadstat/_readstat_writer.pyx":906 * * # vectorized transform of datetime64ns columns * pywriter_types = [x[0] for x in col_types] # <<<<<<<<<<<<<< * pywriter_timeunits = [x[3] for x in col_types] * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L22_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 909, __pyx_L22_error) + __PYX_ERR(0, 906, __pyx_L23_error) } - __pyx_t_3 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 909, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 906, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 909, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 909, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 909, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 906, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pywriter_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":910 + /* "pyreadstat/_readstat_writer.pyx":907 * # vectorized transform of datetime64ns columns * pywriter_types = [x[0] for x in col_types] * pywriter_timeunits = [x[3] for x in col_types] # <<<<<<<<<<<<<< * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types * hasdate64 = PYWRITER_DATE64 in pywriter_types */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L22_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 910, __pyx_L22_error) + __PYX_ERR(0, 907, __pyx_L23_error) } - __pyx_t_3 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_col_types; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 910, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 907, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 910, __pyx_L22_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 907, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pywriter_timeunits = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":911 + /* "pyreadstat/_readstat_writer.pyx":908 * pywriter_types = [x[0] for x in col_types] * pywriter_timeunits = [x[3] for x in col_types] * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types # <<<<<<<<<<<<<< * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 911, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 908, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_hasdatetime64 = __pyx_t_18; + __pyx_v_hasdatetime64 = __pyx_t_20; - /* "pyreadstat/_readstat_writer.pyx":912 + /* "pyreadstat/_readstat_writer.pyx":909 * pywriter_timeunits = [x[3] for x in col_types] * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types * hasdate64 = PYWRITER_DATE64 in pywriter_types # <<<<<<<<<<<<<< * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 912, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 909, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hasdate64 = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":913 + /* "pyreadstat/_readstat_writer.pyx":910 * hasdatetime64 = PYWRITER_DATETIME64 in pywriter_types * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types # <<<<<<<<<<<<<< * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() */ - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 913, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_pywriter_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 910, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hastime64 = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":914 + /* "pyreadstat/_readstat_writer.pyx":911 * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: # <<<<<<<<<<<<<< @@ -15968,41 +16028,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (!__pyx_v_hasdatetime64) { } else { - __pyx_t_18 = __pyx_v_hasdatetime64; - goto __pyx_L86_bool_binop_done; + __pyx_t_20 = __pyx_v_hasdatetime64; + goto __pyx_L87_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 914, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 911, __pyx_L23_error) if (!__pyx_t_6) { } else { - __pyx_t_18 = __pyx_t_6; - goto __pyx_L86_bool_binop_done; + __pyx_t_20 = __pyx_t_6; + goto __pyx_L87_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 914, __pyx_L22_error) - __pyx_t_18 = __pyx_t_6; - __pyx_L86_bool_binop_done:; - if (__pyx_t_18) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 911, __pyx_L23_error) + __pyx_t_20 = __pyx_t_6; + __pyx_L87_bool_binop_done:; + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":915 + /* "pyreadstat/_readstat_writer.pyx":912 * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() # <<<<<<<<<<<<<< * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) */ - __pyx_t_3 = __pyx_v_df; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_df; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clone, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_df2 = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":916 + /* "pyreadstat/_readstat_writer.pyx":913 * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() * if hasdatetime64: # <<<<<<<<<<<<<< @@ -16011,19 +16071,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (__pyx_v_hasdatetime64) { - /* "pyreadstat/_readstat_writer.pyx":917 + /* "pyreadstat/_readstat_writer.pyx":914 * df2 = df.clone() * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) # <<<<<<<<<<<<<< * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_pywriter_timeunits, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L22_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_pywriter_timeunits, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_df2, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":916 + /* "pyreadstat/_readstat_writer.pyx":913 * if hasdatetime64 or hasdate64 or hastime64: * df2 = df.clone() * if hasdatetime64: # <<<<<<<<<<<<<< @@ -16032,29 +16092,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":918 + /* "pyreadstat/_readstat_writer.pyx":915 * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) * if hasdate64: # <<<<<<<<<<<<<< * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 918, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_hasdate64); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 915, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":919 + /* "pyreadstat/_readstat_writer.pyx":916 * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) # <<<<<<<<<<<<<< * if hastime64: * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L22_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_df2, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":918 + /* "pyreadstat/_readstat_writer.pyx":915 * if hasdatetime64: * df2 = vectorized_convert_datetime_to_number(df2, file_format, pywriter_types, pywriter_timeunits, col_count) * if hasdate64: # <<<<<<<<<<<<<< @@ -16063,29 +16123,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":920 + /* "pyreadstat/_readstat_writer.pyx":917 * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: # <<<<<<<<<<<<<< * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) * else: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 920, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_hastime64); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 917, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":921 + /* "pyreadstat/_readstat_writer.pyx":918 * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) # <<<<<<<<<<<<<< * else: * df2 = df */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L22_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time_to_number(__pyx_v_df2, __pyx_v_file_format, __pyx_v_pywriter_types, __pyx_v_col_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_df2, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":920 + /* "pyreadstat/_readstat_writer.pyx":917 * if hasdate64: * df2 = vectorized_convert_date_to_number(df2, file_format, pywriter_types, col_count) * if hastime64: # <<<<<<<<<<<<<< @@ -16094,17 +16154,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":914 + /* "pyreadstat/_readstat_writer.pyx":911 * hasdate64 = PYWRITER_DATE64 in pywriter_types * hastime64 = PYWRITER_TIME64 in pywriter_types * if hasdatetime64 or hasdate64 or hastime64: # <<<<<<<<<<<<<< * df2 = df.clone() * if hasdatetime64: */ - goto __pyx_L85; + goto __pyx_L86; } - /* "pyreadstat/_readstat_writer.pyx":923 + /* "pyreadstat/_readstat_writer.pyx":920 * df2 = vectorized_convert_time_to_number(df2, file_format, pywriter_types, col_count) * else: * df2 = df # <<<<<<<<<<<<<< @@ -16115,9 +16175,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_df); __pyx_v_df2 = __pyx_v_df; } - __pyx_L85:; + __pyx_L86:; - /* "pyreadstat/_readstat_writer.pyx":927 + /* "pyreadstat/_readstat_writer.pyx":924 * * # inserting * rowcnt = 0 # <<<<<<<<<<<<<< @@ -16127,67 +16187,67 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_rowcnt = __pyx_mstate_global->__pyx_int_0; - /* "pyreadstat/_readstat_writer.pyx":929 + /* "pyreadstat/_readstat_writer.pyx":926 * rowcnt = 0 * * for row in df2.iter_rows(): # <<<<<<<<<<<<<< * check_exit_status(readstat_begin_row(writer)) * */ - __pyx_t_3 = __pyx_v_df2; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_df2; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_iter_rows, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 929, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 929, __pyx_L22_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 926, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 926, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + __pyx_t_1 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 926, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L23_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_3); + __pyx_t_1 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 929, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 926, __pyx_L23_error) PyErr_Clear(); } break; @@ -16197,16 +16257,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":930 + /* "pyreadstat/_readstat_writer.pyx":927 * * for row in df2.iter_rows(): * 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, 930, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 927, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":932 + /* "pyreadstat/_readstat_writer.pyx":929 * check_exit_status(readstat_begin_row(writer)) * * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -16214,11 +16274,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * tempvar = readstat_get_variable(writer, col_indx) */ __pyx_t_12 = __pyx_v_col_count; - __pyx_t_19 = __pyx_t_12; - for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { - __pyx_v_col_indx = __pyx_t_20; + __pyx_t_21 = __pyx_t_12; + for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { + __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":934 + /* "pyreadstat/_readstat_writer.pyx":931 * for col_indx in range(col_count): * * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -16227,32 +16287,32 @@ 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":935 + /* "pyreadstat/_readstat_writer.pyx":932 * * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] # <<<<<<<<<<<<<< * curtype = pywriter_types[col_indx] * is_missing = col_types[col_indx][2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curval, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":936 + /* "pyreadstat/_readstat_writer.pyx":933 * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] * curtype = pywriter_types[col_indx] # <<<<<<<<<<<<<< * is_missing = col_types[col_indx][2] * curuser_missing = None */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pywriter_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_22 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 936, __pyx_L22_error) + __pyx_t_24 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 933, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_curtype = __pyx_t_22; + __pyx_v_curtype = __pyx_t_24; - /* "pyreadstat/_readstat_writer.pyx":937 + /* "pyreadstat/_readstat_writer.pyx":934 * curval = row[col_indx] * curtype = pywriter_types[col_indx] * is_missing = col_types[col_indx][2] # <<<<<<<<<<<<<< @@ -16261,17 +16321,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, 937, __pyx_L22_error) + __PYX_ERR(0, 934, __pyx_L23_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L22_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 937, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 934, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_is_missing, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_is_missing, __pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":938 + /* "pyreadstat/_readstat_writer.pyx":935 * curtype = pywriter_types[col_indx] * is_missing = col_types[col_indx][2] * curuser_missing = None # <<<<<<<<<<<<<< @@ -16281,17 +16341,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":939 + /* "pyreadstat/_readstat_writer.pyx":936 * 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_18 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 939, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 936, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":940 + /* "pyreadstat/_readstat_writer.pyx":937 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(col_names[col_indx]) # <<<<<<<<<<<<<< @@ -16300,21 +16360,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, 940, __pyx_L22_error) + __PYX_ERR(0, 937, __pyx_L23_error) } if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 940, __pyx_L22_error) + __PYX_ERR(0, 937, __pyx_L23_error) } - __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 940, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_9, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L22_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":939 + /* "pyreadstat/_readstat_writer.pyx":936 * is_missing = col_types[col_indx][2] * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -16323,17 +16383,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":942 + /* "pyreadstat/_readstat_writer.pyx":939 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 942, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 939, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":944 + /* "pyreadstat/_readstat_writer.pyx":941 * if is_missing: * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: # <<<<<<<<<<<<<< @@ -16342,37 +16402,37 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (__pyx_v_is_pandas) { - /* "pyreadstat/_readstat_writer.pyx":945 + /* "pyreadstat/_readstat_writer.pyx":942 * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: * check_if_missing = pd.isna(curval) # <<<<<<<<<<<<<< * # for other libraries the value would be None * else: */ - __pyx_t_9 = __pyx_v_pd; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_3 = __pyx_v_pd; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_curval}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_curval}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isna, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_check_if_missing, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":944 + /* "pyreadstat/_readstat_writer.pyx":941 * if is_missing: * # For pandas we need isna because values can be Nan, NA, NAT, None * if is_pandas: # <<<<<<<<<<<<<< * check_if_missing = pd.isna(curval) * # for other libraries the value would be None */ - goto __pyx_L98; + goto __pyx_L99; } - /* "pyreadstat/_readstat_writer.pyx":948 + /* "pyreadstat/_readstat_writer.pyx":945 * # for other libraries the value would be None * else: * check_if_missing = curval is None # <<<<<<<<<<<<<< @@ -16380,43 +16440,43 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_insert_missing_value(writer, tempvar)) */ /*else*/ { - __pyx_t_18 = (__pyx_v_curval == Py_None); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_18); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L22_error) + __pyx_t_20 = (__pyx_v_curval == Py_None); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_check_if_missing, __pyx_t_1); __pyx_t_1 = 0; } - __pyx_L98:; + __pyx_L99:; - /* "pyreadstat/_readstat_writer.pyx":949 + /* "pyreadstat/_readstat_writer.pyx":946 * else: * check_if_missing = curval is None * if check_if_missing: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_check_if_missing); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 949, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_v_check_if_missing); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 946, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":950 + /* "pyreadstat/_readstat_writer.pyx":947 * check_if_missing = curval is None * if check_if_missing: * 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, 950, __pyx_L22_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, 947, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":951 + /* "pyreadstat/_readstat_writer.pyx":948 * if check_if_missing: * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue # <<<<<<<<<<<<<< * * if curuser_missing and curtype in pywriter_numeric_types: */ - goto __pyx_L94_continue; + goto __pyx_L95_continue; - /* "pyreadstat/_readstat_writer.pyx":949 + /* "pyreadstat/_readstat_writer.pyx":946 * else: * check_if_missing = curval is None * if check_if_missing: # <<<<<<<<<<<<<< @@ -16425,7 +16485,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":942 + /* "pyreadstat/_readstat_writer.pyx":939 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< @@ -16434,61 +16494,61 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":953 + /* "pyreadstat/_readstat_writer.pyx":950 * 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_6 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 953, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 950, __pyx_L23_error) if (__pyx_t_6) { } else { - __pyx_t_18 = __pyx_t_6; - goto __pyx_L101_bool_binop_done; + __pyx_t_20 = __pyx_t_6; + goto __pyx_L102_bool_binop_done; } - __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L23_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, 953, __pyx_L22_error) + __PYX_ERR(0, 950, __pyx_L23_error) } - __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 953, __pyx_L22_error) + __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 950, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_18 = __pyx_t_6; - __pyx_L101_bool_binop_done:; - if (__pyx_t_18) { + __pyx_t_20 = __pyx_t_6; + __pyx_L102_bool_binop_done:; + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":954 + /* "pyreadstat/_readstat_writer.pyx":951 * * 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_18 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 954, __pyx_L22_error) - if (__pyx_t_18) { + __pyx_t_20 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 951, __pyx_L23_error) + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":955 + /* "pyreadstat/_readstat_writer.pyx":952 * 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_30 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_30 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 955, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_30)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L22_error) + __pyx_t_32 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_32 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 952, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_32)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 952, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":956 + /* "pyreadstat/_readstat_writer.pyx":953 * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) * continue # <<<<<<<<<<<<<< * * if curtype == PYWRITER_DOUBLE: */ - goto __pyx_L94_continue; + goto __pyx_L95_continue; - /* "pyreadstat/_readstat_writer.pyx":954 + /* "pyreadstat/_readstat_writer.pyx":951 * * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: # <<<<<<<<<<<<<< @@ -16497,7 +16557,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":953 + /* "pyreadstat/_readstat_writer.pyx":950 * continue * * if curuser_missing and curtype in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -16506,246 +16566,246 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":958 + /* "pyreadstat/_readstat_writer.pyx":955 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":959 + /* "pyreadstat/_readstat_writer.pyx":956 * * 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_31 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_31 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_31))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L22_error) + __pyx_t_33 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_33 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_33))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":958 + /* "pyreadstat/_readstat_writer.pyx":955 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: */ - goto __pyx_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":960 + /* "pyreadstat/_readstat_writer.pyx":957 * 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: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":961 + /* "pyreadstat/_readstat_writer.pyx":958 * 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_32 = __Pyx_PyLong_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_32 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_32)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 961, __pyx_L22_error) + __pyx_t_34 = __Pyx_PyLong_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_34 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_34)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":960 + /* "pyreadstat/_readstat_writer.pyx":957 * 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_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":962 + /* "pyreadstat/_readstat_writer.pyx":959 * 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: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":963 + /* "pyreadstat/_readstat_writer.pyx":960 * 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_23 = __Pyx_PyLong_As_int(__pyx_v_curval); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_23))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L22_error) + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_v_curval); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_25))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":962 + /* "pyreadstat/_readstat_writer.pyx":959 * 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_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":964 + /* "pyreadstat/_readstat_writer.pyx":961 * 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: */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":965 + /* "pyreadstat/_readstat_writer.pyx":962 * 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_9 = __pyx_v_curval; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_3 = __pyx_v_curval; + __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L22_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_33 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_33) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_33)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L22_error) + __pyx_t_35 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_35) && PyErr_Occurred())) __PYX_ERR(0, 962, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_35)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 962, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":964 + /* "pyreadstat/_readstat_writer.pyx":961 * 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_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":966 + /* "pyreadstat/_readstat_writer.pyx":963 * 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"))) */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":967 + /* "pyreadstat/_readstat_writer.pyx":964 * 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 == PYWRITER_DTA_STR_REF: */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":968 + /* "pyreadstat/_readstat_writer.pyx":965 * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_DTA_STR_REF: * curvalstr = str(curval) */ - __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L22_error) + __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_33 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_33) && PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_33)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L22_error) + __pyx_t_35 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_35) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_35)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":966 + /* "pyreadstat/_readstat_writer.pyx":963 * 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_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":969 + /* "pyreadstat/_readstat_writer.pyx":966 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] */ - __pyx_t_18 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); - if (__pyx_t_18) { + __pyx_t_20 = (__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":970 + /* "pyreadstat/_readstat_writer.pyx":967 * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype == PYWRITER_DTA_STR_REF: * curvalstr = str(curval) # <<<<<<<<<<<<<< * strref_indx = strref_map[curvalstr] * strref = readstat_get_string_ref(writer, strref_indx) */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_curval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":971 + /* "pyreadstat/_readstat_writer.pyx":968 * elif curtype == PYWRITER_DTA_STR_REF: * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] # <<<<<<<<<<<<<< * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_strref_map, __pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_strref_map, __pyx_v_curvalstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_strref_indx, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":972 + /* "pyreadstat/_readstat_writer.pyx":969 * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] * strref = readstat_get_string_ref(writer, strref_indx) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: */ - __pyx_t_23 = __Pyx_PyLong_As_int(__pyx_v_strref_indx); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L22_error) - __pyx_v_strref = readstat_get_string_ref(__pyx_v_writer, __pyx_t_23); + __pyx_t_25 = __Pyx_PyLong_As_int(__pyx_v_strref_indx); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L23_error) + __pyx_v_strref = readstat_get_string_ref(__pyx_v_writer, __pyx_t_25); - /* "pyreadstat/_readstat_writer.pyx":973 + /* "pyreadstat/_readstat_writer.pyx":970 * strref_indx = strref_map[curvalstr] * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_ref(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_strref)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_ref(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_strref)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":969 + /* "pyreadstat/_readstat_writer.pyx":966 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype == PYWRITER_DTA_STR_REF: # <<<<<<<<<<<<<< * curvalstr = str(curval) * strref_indx = strref_map[curvalstr] */ - goto __pyx_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":974 + /* "pyreadstat/_readstat_writer.pyx":971 * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< @@ -16756,81 +16816,81 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64: - __pyx_t_18 = 1; + __pyx_t_20 = 1; break; default: - __pyx_t_18 = 0; + __pyx_t_20 = 0; break; } - if (__pyx_t_18) { + if (__pyx_t_20) { - /* "pyreadstat/_readstat_writer.pyx":975 + /* "pyreadstat/_readstat_writer.pyx":972 * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) */ - __pyx_t_31 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_31 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L22_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_31))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L22_error) + __pyx_t_33 = __Pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_33 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L23_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_33))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":974 + /* "pyreadstat/_readstat_writer.pyx":971 * strref = readstat_get_string_ref(writer, strref_indx) * check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype in pyrwriter_datetimelike_types: */ - goto __pyx_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":976 + /* "pyreadstat/_readstat_writer.pyx":973 * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * 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_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L23_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, 976, __pyx_L22_error) + __PYX_ERR(0, 973, __pyx_L23_error) } - __pyx_t_18 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 976, __pyx_L22_error) + __pyx_t_20 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 973, __pyx_L23_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(__pyx_t_18)) { + if (likely(__pyx_t_20)) { - /* "pyreadstat/_readstat_writer.pyx":977 + /* "pyreadstat/_readstat_writer.pyx":974 * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * 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_31 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_31 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L22_error) - __pyx_v_dtimelikeval = __pyx_t_31; + __pyx_t_33 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_33 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 974, __pyx_L23_error) + __pyx_v_dtimelikeval = __pyx_t_33; - /* "pyreadstat/_readstat_writer.pyx":978 + /* "pyreadstat/_readstat_writer.pyx":975 * 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, 978, __pyx_L22_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, 975, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":976 + /* "pyreadstat/_readstat_writer.pyx":973 * elif curtype == PYWRITER_DATETIME64 or curtype == PYWRITER_DATE64 or curtype == PYWRITER_TIME64: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * 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_L104; + goto __pyx_L105; } - /* "pyreadstat/_readstat_writer.pyx":980 + /* "pyreadstat/_readstat_writer.pyx":977 * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) * else: * raise PyreadstatError("Unknown data format to insert") # <<<<<<<<<<<<<< @@ -16838,59 +16898,59 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_end_row(writer)) */ /*else*/ { - __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L22_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 977, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_9); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_13, __pyx__function); __pyx_t_5 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Unknown_data_format_to_insert}; - __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L22_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Unknown_data_format_to_insert}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 980, __pyx_L22_error) + __PYX_ERR(0, 977, __pyx_L23_error) } - __pyx_L104:; - __pyx_L94_continue:; + __pyx_L105:; + __pyx_L95_continue:; } - /* "pyreadstat/_readstat_writer.pyx":982 + /* "pyreadstat/_readstat_writer.pyx":979 * raise PyreadstatError("Unknown data format to insert") * * check_exit_status(readstat_end_row(writer)) # <<<<<<<<<<<<<< * rowcnt += 1 * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 979, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":983 + /* "pyreadstat/_readstat_writer.pyx":980 * * check_exit_status(readstat_end_row(writer)) * rowcnt += 1 # <<<<<<<<<<<<<< * * check_exit_status(readstat_end_writing(writer)) */ - __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_rowcnt, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyLong_AddObjC(__pyx_v_rowcnt, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_rowcnt, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":929 + /* "pyreadstat/_readstat_writer.pyx":926 * rowcnt = 0 * * for row in df2.iter_rows(): # <<<<<<<<<<<<<< @@ -16898,18 +16958,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":985 + /* "pyreadstat/_readstat_writer.pyx":982 * rowcnt += 1 * * 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, 985, __pyx_L22_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_writing(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L23_error) - /* "pyreadstat/_readstat_writer.pyx":774 + /* "pyreadstat/_readstat_writer.pyx":771 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -16917,19 +16977,20 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_set_data_writer(writer, write_bytes)) */ } - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - goto __pyx_L27_try_end; - __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L28_try_end; + __pyx_L23_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":987 + /* "pyreadstat/_readstat_writer.pyx":984 * check_exit_status(readstat_end_writing(writer)) * * except: # <<<<<<<<<<<<<< @@ -16938,44 +16999,44 @@ 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_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 987, __pyx_L24_except_error) - __Pyx_XGOTREF(__pyx_t_3); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 984, __pyx_L25_except_error) + __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_13); - /* "pyreadstat/_readstat_writer.pyx":988 + /* "pyreadstat/_readstat_writer.pyx":985 * * except: * raise # <<<<<<<<<<<<<< * finally: * readstat_writer_free(writer) */ - __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_2); - __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; - __PYX_ERR(0, 988, __pyx_L24_except_error) + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_1, __pyx_t_13); + __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_13 = 0; + __PYX_ERR(0, 985, __pyx_L25_except_error) } - /* "pyreadstat/_readstat_writer.pyx":774 + /* "pyreadstat/_readstat_writer.pyx":771 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< * * check_exit_status(readstat_set_data_writer(writer, write_bytes)) */ - __pyx_L24_except_error:; - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); + __pyx_L25_except_error:; __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); - goto __pyx_L20_error; - __pyx_L27_try_end:; + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + goto __pyx_L21_error; + __pyx_L28_try_end:; } } - /* "pyreadstat/_readstat_writer.pyx":990 + /* "pyreadstat/_readstat_writer.pyx":987 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -16986,39 +17047,40 @@ 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":991 + /* "pyreadstat/_readstat_writer.pyx":988 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< * * return 0 */ - __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) - goto __pyx_L21; + __pyx_t_12 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_12 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L1_error) + goto __pyx_L22; } - __pyx_L20_error:; + __pyx_L21_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; + __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_ExceptionSwap(&__pyx_t_35, &__pyx_t_36, &__pyx_t_37); - if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + __Pyx_ExceptionSwap(&__pyx_t_37, &__pyx_t_38, &__pyx_t_39); + if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_35); - __Pyx_XGOTREF(__pyx_t_36); __Pyx_XGOTREF(__pyx_t_37); - __pyx_t_12 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_34 = __pyx_filename; + __Pyx_XGOTREF(__pyx_t_38); + __Pyx_XGOTREF(__pyx_t_39); + __pyx_t_12 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_36 = __pyx_filename; { - /* "pyreadstat/_readstat_writer.pyx":990 + /* "pyreadstat/_readstat_writer.pyx":987 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -17027,41 +17089,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_writer_free(__pyx_v_writer); - /* "pyreadstat/_readstat_writer.pyx":991 + /* "pyreadstat/_readstat_writer.pyx":988 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< * * return 0 */ - __pyx_t_20 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_20 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L109_error) + __pyx_t_22 = __pyx_f_10pyreadstat_16_readstat_writer_close_file(__pyx_v_fd); if (unlikely(__pyx_t_22 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L110_error) } - __Pyx_XGIVEREF(__pyx_t_35); - __Pyx_XGIVEREF(__pyx_t_36); __Pyx_XGIVEREF(__pyx_t_37); - __Pyx_ExceptionReset(__pyx_t_35, __pyx_t_36, __pyx_t_37); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_ErrRestore(__pyx_t_15, __pyx_t_14, __pyx_t_13); - __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; - __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_34; + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_16, __pyx_t_15); + __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0; + __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_36; goto __pyx_L1_error; - __pyx_L109_error:; - __Pyx_XGIVEREF(__pyx_t_35); - __Pyx_XGIVEREF(__pyx_t_36); + __pyx_L110_error:; __Pyx_XGIVEREF(__pyx_t_37); - __Pyx_ExceptionReset(__pyx_t_35, __pyx_t_36, __pyx_t_37); + __Pyx_XGIVEREF(__pyx_t_38); + __Pyx_XGIVEREF(__pyx_t_39); + __Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39); + __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; - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; + __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0; goto __pyx_L1_error; } - __pyx_L21:; + __pyx_L22:; } - /* "pyreadstat/_readstat_writer.pyx":993 + /* "pyreadstat/_readstat_writer.pyx":990 * close_file(fd) * * return 0 # <<<<<<<<<<<<<< @@ -17071,7 +17133,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":685 + /* "pyreadstat/_readstat_writer.pyx":677 * * * cdef int run_write(df, object filename_path, dst_file_format file_format, str file_label, object column_labels, # <<<<<<<<<<<<<< @@ -17087,6 +17149,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pyreadstat._readstat_writer.run_write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; @@ -17135,7 +17198,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":995 +/* "pyreadstat/_readstat_writer.pyx":992 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -17198,86 +17261,86 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_df,&__pyx_mstate_global->__pyx_n_u_dst_path,&__pyx_mstate_global->__pyx_n_u_writer_format,&__pyx_mstate_global->__pyx_n_u_file_label,&__pyx_mstate_global->__pyx_n_u_version,&__pyx_mstate_global->__pyx_n_u_table_name,&__pyx_mstate_global->__pyx_n_u_column_labels,&__pyx_mstate_global->__pyx_n_u_compress,&__pyx_mstate_global->__pyx_n_u_row_compress,&__pyx_mstate_global->__pyx_n_u_note,&__pyx_mstate_global->__pyx_n_u_variable_value_labels,&__pyx_mstate_global->__pyx_n_u_missing_ranges,&__pyx_mstate_global->__pyx_n_u_variable_display_width,&__pyx_mstate_global->__pyx_n_u_variable_measure,&__pyx_mstate_global->__pyx_n_u_missing_user_values,&__pyx_mstate_global->__pyx_n_u_variable_format,&__pyx_mstate_global->__pyx_n_u_variable_alignment,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 995, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 992, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 17: values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 13: values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 12: values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 11: values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 10: values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writer_entry_point", 0) < (0)) __PYX_ERR(0, 995, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writer_entry_point", 0) < (0)) __PYX_ERR(0, 992, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__3))); + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__4))); - /* "pyreadstat/_readstat_writer.pyx":997 + /* "pyreadstat/_readstat_writer.pyx":994 * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", * int version=0, * str table_name=None, # <<<<<<<<<<<<<< @@ -17286,7 +17349,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":998 + /* "pyreadstat/_readstat_writer.pyx":995 * int version=0, * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, # <<<<<<<<<<<<<< @@ -17298,7 +17361,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":999 + /* "pyreadstat/_readstat_writer.pyx":996 * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, # <<<<<<<<<<<<<< @@ -17309,7 +17372,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1000 + /* "pyreadstat/_readstat_writer.pyx":997 * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, # <<<<<<<<<<<<<< @@ -17318,7 +17381,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1001 + /* "pyreadstat/_readstat_writer.pyx":998 * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, * dict missing_user_values=None, # <<<<<<<<<<<<<< @@ -17327,7 +17390,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1002 + /* "pyreadstat/_readstat_writer.pyx":999 * dict variable_measure=None, * dict missing_user_values=None, * dict variable_format=None, # <<<<<<<<<<<<<< @@ -17336,7 +17399,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1003 + /* "pyreadstat/_readstat_writer.pyx":1000 * dict missing_user_values=None, * dict variable_format=None, * dict variable_alignment = None, # <<<<<<<<<<<<<< @@ -17345,80 +17408,80 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[16]) values[16] = __Pyx_NewRef(((PyObject*)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 17, i); __PYX_ERR(0, 995, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 17, i); __PYX_ERR(0, 992, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 17: values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 15: values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 14: values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 13: values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 12: values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 11: values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 10: values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 9: values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 992, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 992, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 992, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } - /* "pyreadstat/_readstat_writer.pyx":995 + /* "pyreadstat/_readstat_writer.pyx":992 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -17426,9 +17489,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * str table_name=None, */ if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__3))); + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u__4))); - /* "pyreadstat/_readstat_writer.pyx":997 + /* "pyreadstat/_readstat_writer.pyx":994 * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", * int version=0, * str table_name=None, # <<<<<<<<<<<<<< @@ -17437,7 +17500,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":998 + /* "pyreadstat/_readstat_writer.pyx":995 * int version=0, * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, # <<<<<<<<<<<<<< @@ -17449,7 +17512,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":999 + /* "pyreadstat/_readstat_writer.pyx":996 * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, # <<<<<<<<<<<<<< @@ -17460,7 +17523,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1000 + /* "pyreadstat/_readstat_writer.pyx":997 * object column_labels=None, compress=False, row_compress=False, object note=None, * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, # <<<<<<<<<<<<<< @@ -17469,7 +17532,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1001 + /* "pyreadstat/_readstat_writer.pyx":998 * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, * dict variable_measure=None, * dict missing_user_values=None, # <<<<<<<<<<<<<< @@ -17478,7 +17541,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1002 + /* "pyreadstat/_readstat_writer.pyx":999 * dict variable_measure=None, * dict missing_user_values=None, * dict variable_format=None, # <<<<<<<<<<<<<< @@ -17487,7 +17550,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds */ if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_writer.pyx":1003 + /* "pyreadstat/_readstat_writer.pyx":1000 * dict missing_user_values=None, * dict variable_format=None, * dict variable_alignment = None, # <<<<<<<<<<<<<< @@ -17501,7 +17564,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_writer_format = ((PyObject*)values[2]); __pyx_v_file_label = ((PyObject*)values[3]); if (values[4]) { - __pyx_v_version = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_version == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 996, __pyx_L3_error) + __pyx_v_version = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_version == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 993, __pyx_L3_error) } else { __pyx_v_version = ((int)((int)0)); } @@ -17520,7 +17583,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 17, __pyx_nargs); __PYX_ERR(0, 995, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("writer_entry_point", 0, 2, 17, __pyx_nargs); __PYX_ERR(0, 992, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17531,19 +17594,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer_format), (&PyUnicode_Type), 1, "writer_format", 1))) __PYX_ERR(0, 995, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 995, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table_name), (&PyUnicode_Type), 1, "table_name", 1))) __PYX_ERR(0, 997, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_value_labels), (&PyDict_Type), 1, "variable_value_labels", 1))) __PYX_ERR(0, 999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_ranges), (&PyDict_Type), 1, "missing_ranges", 1))) __PYX_ERR(0, 999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_display_width), (&PyDict_Type), 1, "variable_display_width", 1))) __PYX_ERR(0, 999, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_measure), (&PyDict_Type), 1, "variable_measure", 1))) __PYX_ERR(0, 1000, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_user_values), (&PyDict_Type), 1, "missing_user_values", 1))) __PYX_ERR(0, 1001, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 1002, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_alignment), (&PyDict_Type), 1, "variable_alignment", 1))) __PYX_ERR(0, 1003, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer_format), (&PyUnicode_Type), 1, "writer_format", 1))) __PYX_ERR(0, 992, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 992, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table_name), (&PyUnicode_Type), 1, "table_name", 1))) __PYX_ERR(0, 994, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_value_labels), (&PyDict_Type), 1, "variable_value_labels", 1))) __PYX_ERR(0, 996, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_ranges), (&PyDict_Type), 1, "missing_ranges", 1))) __PYX_ERR(0, 996, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_display_width), (&PyDict_Type), 1, "variable_display_width", 1))) __PYX_ERR(0, 996, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_measure), (&PyDict_Type), 1, "variable_measure", 1))) __PYX_ERR(0, 997, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_user_values), (&PyDict_Type), 1, "missing_user_values", 1))) __PYX_ERR(0, 998, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_alignment), (&PyDict_Type), 1, "variable_alignment", 1))) __PYX_ERR(0, 1000, __pyx_L1_error) __pyx_r = __pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(__pyx_self, __pyx_v_df, __pyx_v_dst_path, __pyx_v_writer_format, __pyx_v_file_label, __pyx_v_version, __pyx_v_table_name, __pyx_v_column_labels, __pyx_v_compress, __pyx_v_row_compress, __pyx_v_note, __pyx_v_variable_value_labels, __pyx_v_missing_ranges, __pyx_v_variable_display_width, __pyx_v_variable_measure, __pyx_v_missing_user_values, __pyx_v_variable_format, __pyx_v_variable_alignment); - /* "pyreadstat/_readstat_writer.pyx":995 + /* "pyreadstat/_readstat_writer.pyx":992 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -17587,7 +17650,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __Pyx_RefNannySetupContext("writer_entry_point", 0); __Pyx_INCREF(__pyx_v_note); - /* "pyreadstat/_readstat_writer.pyx":1007 + /* "pyreadstat/_readstat_writer.pyx":1004 * * * cdef int file_format_version = 0 # <<<<<<<<<<<<<< @@ -17596,7 +17659,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0; - /* "pyreadstat/_readstat_writer.pyx":1008 + /* "pyreadstat/_readstat_writer.pyx":1005 * * cdef int file_format_version = 0 * cdef bint row_compression = 0 # <<<<<<<<<<<<<< @@ -17605,17 +17668,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_row_compression = 0; - /* "pyreadstat/_readstat_writer.pyx":1012 + /* "pyreadstat/_readstat_writer.pyx":1009 * cdef dst_file_format writer_file_format * * if writer_format == "sav": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_sav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_sav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1013 + /* "pyreadstat/_readstat_writer.pyx":1010 * * if writer_format == "sav": * writer_file_format = FILE_FORMAT_SAV # <<<<<<<<<<<<<< @@ -17624,7 +17687,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV; - /* "pyreadstat/_readstat_writer.pyx":1014 + /* "pyreadstat/_readstat_writer.pyx":1011 * if writer_format == "sav": * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 # <<<<<<<<<<<<<< @@ -17633,25 +17696,25 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 2; - /* "pyreadstat/_readstat_writer.pyx":1015 + /* "pyreadstat/_readstat_writer.pyx":1012 * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 * if compress and row_compress: # <<<<<<<<<<<<<< * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1012, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":1016 + /* "pyreadstat/_readstat_writer.pyx":1013 * file_format_version = 2 * if compress and row_compress: * raise PyreadstatError("compress and row_compress cannot be both True") # <<<<<<<<<<<<<< @@ -17659,7 +17722,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT * file_format_version = 3 */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -17678,14 +17741,14 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1016, __pyx_L1_error) + __PYX_ERR(0, 1013, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":1015 + /* "pyreadstat/_readstat_writer.pyx":1012 * writer_file_format = FILE_FORMAT_SAV * file_format_version = 2 * if compress and row_compress: # <<<<<<<<<<<<<< @@ -17694,17 +17757,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ } - /* "pyreadstat/_readstat_writer.pyx":1017 + /* "pyreadstat/_readstat_writer.pyx":1014 * if compress and row_compress: * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: # <<<<<<<<<<<<<< * file_format_version = 3 * if row_compress: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1014, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1018 + /* "pyreadstat/_readstat_writer.pyx":1015 * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: * file_format_version = 3 # <<<<<<<<<<<<<< @@ -17713,7 +17776,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 3; - /* "pyreadstat/_readstat_writer.pyx":1017 + /* "pyreadstat/_readstat_writer.pyx":1014 * if compress and row_compress: * raise PyreadstatError("compress and row_compress cannot be both True") * if compress: # <<<<<<<<<<<<<< @@ -17722,17 +17785,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ } - /* "pyreadstat/_readstat_writer.pyx":1019 + /* "pyreadstat/_readstat_writer.pyx":1016 * if compress: * file_format_version = 3 * if row_compress: # <<<<<<<<<<<<<< * row_compression = 1 * elif writer_format == "dta": */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1019, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1016, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1020 + /* "pyreadstat/_readstat_writer.pyx":1017 * file_format_version = 3 * if row_compress: * row_compression = 1 # <<<<<<<<<<<<<< @@ -17741,7 +17804,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_row_compression = 1; - /* "pyreadstat/_readstat_writer.pyx":1019 + /* "pyreadstat/_readstat_writer.pyx":1016 * if compress: * file_format_version = 3 * if row_compress: # <<<<<<<<<<<<<< @@ -17750,7 +17813,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ } - /* "pyreadstat/_readstat_writer.pyx":1012 + /* "pyreadstat/_readstat_writer.pyx":1009 * cdef dst_file_format writer_file_format * * if writer_format == "sav": # <<<<<<<<<<<<<< @@ -17760,17 +17823,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1021 + /* "pyreadstat/_readstat_writer.pyx":1018 * if row_compress: * row_compression = 1 * elif writer_format == "dta": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_DTA * if version == 15: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1018, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1022 + /* "pyreadstat/_readstat_writer.pyx":1019 * row_compression = 1 * elif writer_format == "dta": * writer_file_format = FILE_FORMAT_DTA # <<<<<<<<<<<<<< @@ -17779,7 +17842,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA; - /* "pyreadstat/_readstat_writer.pyx":1023 + /* "pyreadstat/_readstat_writer.pyx":1020 * elif writer_format == "dta": * writer_file_format = FILE_FORMAT_DTA * if version == 15: # <<<<<<<<<<<<<< @@ -17789,7 +17852,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT switch (__pyx_v_version) { case 15: - /* "pyreadstat/_readstat_writer.pyx":1024 + /* "pyreadstat/_readstat_writer.pyx":1021 * writer_file_format = FILE_FORMAT_DTA * if version == 15: * file_format_version = 119 # <<<<<<<<<<<<<< @@ -17798,7 +17861,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x77; - /* "pyreadstat/_readstat_writer.pyx":1023 + /* "pyreadstat/_readstat_writer.pyx":1020 * elif writer_format == "dta": * writer_file_format = FILE_FORMAT_DTA * if version == 15: # <<<<<<<<<<<<<< @@ -17808,7 +17871,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 14: - /* "pyreadstat/_readstat_writer.pyx":1026 + /* "pyreadstat/_readstat_writer.pyx":1023 * file_format_version = 119 * elif version == 14: * file_format_version = 118 # <<<<<<<<<<<<<< @@ -17817,7 +17880,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x76; - /* "pyreadstat/_readstat_writer.pyx":1025 + /* "pyreadstat/_readstat_writer.pyx":1022 * if version == 15: * file_format_version = 119 * elif version == 14: # <<<<<<<<<<<<<< @@ -17827,7 +17890,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 13: - /* "pyreadstat/_readstat_writer.pyx":1028 + /* "pyreadstat/_readstat_writer.pyx":1025 * file_format_version = 118 * elif version == 13: * file_format_version = 117 # <<<<<<<<<<<<<< @@ -17836,7 +17899,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x75; - /* "pyreadstat/_readstat_writer.pyx":1027 + /* "pyreadstat/_readstat_writer.pyx":1024 * elif version == 14: * file_format_version = 118 * elif version == 13: # <<<<<<<<<<<<<< @@ -17846,7 +17909,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 12: - /* "pyreadstat/_readstat_writer.pyx":1030 + /* "pyreadstat/_readstat_writer.pyx":1027 * file_format_version = 117 * elif version == 12: * file_format_version = 115 # <<<<<<<<<<<<<< @@ -17855,7 +17918,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x73; - /* "pyreadstat/_readstat_writer.pyx":1029 + /* "pyreadstat/_readstat_writer.pyx":1026 * elif version == 13: * file_format_version = 117 * elif version == 12: # <<<<<<<<<<<<<< @@ -17865,7 +17928,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 10: - /* "pyreadstat/_readstat_writer.pyx":1031 + /* "pyreadstat/_readstat_writer.pyx":1028 * elif version == 12: * file_format_version = 115 * elif version in {10, 11}: # <<<<<<<<<<<<<< @@ -17874,7 +17937,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ case 11: - /* "pyreadstat/_readstat_writer.pyx":1032 + /* "pyreadstat/_readstat_writer.pyx":1029 * file_format_version = 115 * elif version in {10, 11}: * file_format_version = 114 # <<<<<<<<<<<<<< @@ -17883,7 +17946,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x72; - /* "pyreadstat/_readstat_writer.pyx":1031 + /* "pyreadstat/_readstat_writer.pyx":1028 * elif version == 12: * file_format_version = 115 * elif version in {10, 11}: # <<<<<<<<<<<<<< @@ -17893,7 +17956,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; case 8: - /* "pyreadstat/_readstat_writer.pyx":1033 + /* "pyreadstat/_readstat_writer.pyx":1030 * elif version in {10, 11}: * file_format_version = 114 * elif version in {8, 9}: # <<<<<<<<<<<<<< @@ -17902,7 +17965,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ case 9: - /* "pyreadstat/_readstat_writer.pyx":1034 + /* "pyreadstat/_readstat_writer.pyx":1031 * file_format_version = 114 * elif version in {8, 9}: * file_format_version = 113 # <<<<<<<<<<<<<< @@ -17911,7 +17974,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = 0x71; - /* "pyreadstat/_readstat_writer.pyx":1033 + /* "pyreadstat/_readstat_writer.pyx":1030 * elif version in {10, 11}: * file_format_version = 114 * elif version in {8, 9}: # <<<<<<<<<<<<<< @@ -17921,7 +17984,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT break; default: - /* "pyreadstat/_readstat_writer.pyx":1036 + /* "pyreadstat/_readstat_writer.pyx":1033 * file_format_version = 113 * else: * raise PyreadstatError("Version not supported") # <<<<<<<<<<<<<< @@ -17929,7 +17992,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT * elif writer_format == "xport": */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1036, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -17948,26 +18011,26 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1036, __pyx_L1_error) + __PYX_ERR(0, 1033, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_writer.pyx":1037 + /* "pyreadstat/_readstat_writer.pyx":1034 * else: * raise PyreadstatError("Version not supported") * note = "" # <<<<<<<<<<<<<< * elif writer_format == "xport": * writer_file_format = FILE_FORMAT_XPORT */ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__3); - __Pyx_DECREF_SET(__pyx_v_note, __pyx_mstate_global->__pyx_kp_u__3); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__4); + __Pyx_DECREF_SET(__pyx_v_note, __pyx_mstate_global->__pyx_kp_u__4); - /* "pyreadstat/_readstat_writer.pyx":1021 + /* "pyreadstat/_readstat_writer.pyx":1018 * if row_compress: * row_compression = 1 * elif writer_format == "dta": # <<<<<<<<<<<<<< @@ -17977,17 +18040,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1038 + /* "pyreadstat/_readstat_writer.pyx":1035 * raise PyreadstatError("Version not supported") * note = "" * elif writer_format == "xport": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":1039 + /* "pyreadstat/_readstat_writer.pyx":1036 * note = "" * elif writer_format == "xport": * writer_file_format = FILE_FORMAT_XPORT # <<<<<<<<<<<<<< @@ -17996,7 +18059,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT; - /* "pyreadstat/_readstat_writer.pyx":1040 + /* "pyreadstat/_readstat_writer.pyx":1037 * elif writer_format == "xport": * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version # <<<<<<<<<<<<<< @@ -18005,7 +18068,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_file_format_version = __pyx_v_version; - /* "pyreadstat/_readstat_writer.pyx":1038 + /* "pyreadstat/_readstat_writer.pyx":1035 * raise PyreadstatError("Version not supported") * note = "" * elif writer_format == "xport": # <<<<<<<<<<<<<< @@ -18015,17 +18078,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1041 + /* "pyreadstat/_readstat_writer.pyx":1038 * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version * elif writer_format == "por": # <<<<<<<<<<<<<< * writer_file_format = FILE_FORMAT_POR * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_writer_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":1042 + /* "pyreadstat/_readstat_writer.pyx":1039 * file_format_version = version * elif writer_format == "por": * writer_file_format = FILE_FORMAT_POR # <<<<<<<<<<<<<< @@ -18034,7 +18097,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR; - /* "pyreadstat/_readstat_writer.pyx":1041 + /* "pyreadstat/_readstat_writer.pyx":1038 * writer_file_format = FILE_FORMAT_XPORT * file_format_version = version * elif writer_format == "por": # <<<<<<<<<<<<<< @@ -18044,7 +18107,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":1044 + /* "pyreadstat/_readstat_writer.pyx":1041 * writer_file_format = FILE_FORMAT_POR * else: * raise PyreadstatError("wrong writer format") # <<<<<<<<<<<<<< @@ -18053,7 +18116,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT */ /*else*/ { __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -18072,25 +18135,25 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYT __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 1044, __pyx_L1_error) + __PYX_ERR(0, 1041, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":1046 + /* "pyreadstat/_readstat_writer.pyx":1043 * raise PyreadstatError("wrong writer format") * * run_write(df, dst_path, writer_file_format, file_label, column_labels, # <<<<<<<<<<<<<< * file_format_version, note, table_name, variable_value_labels, missing_ranges, missing_user_values, * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_v_writer_file_format, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_file_format_version, __pyx_v_note, __pyx_v_table_name, __pyx_v_variable_value_labels, __pyx_v_missing_ranges, __pyx_v_missing_user_values, __pyx_v_variable_alignment, __pyx_v_variable_display_width, __pyx_v_variable_measure, __pyx_v_variable_format, __pyx_v_row_compression); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_v_writer_file_format, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_file_format_version, __pyx_v_note, __pyx_v_table_name, __pyx_v_variable_value_labels, __pyx_v_missing_ranges, __pyx_v_missing_user_values, __pyx_v_variable_alignment, __pyx_v_variable_display_width, __pyx_v_variable_measure, __pyx_v_variable_format, __pyx_v_row_compression); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1043, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":995 + /* "pyreadstat/_readstat_writer.pyx":992 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< @@ -18699,426 +18762,426 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nw, __pyx_t_2) < (0)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":31 - * + /* "pyreadstat/_readstat_writer.pyx":32 * from readstat_api cimport * + * from libc.errno cimport errno * from _readstat_parser import ReadstatError, PyreadstatError # <<<<<<<<<<<<<< * from _readstat_parser cimport check_exit_status * */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ReadstatError,__pyx_mstate_global->__pyx_n_u_PyreadstatError}; - __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_readstat_parser, __pyx_imported_names, 2, __pyx_mstate_global->__pyx_kp_u_pyreadstat__readstat_parser, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_readstat_parser, __pyx_imported_names, 2, __pyx_mstate_global->__pyx_kp_u_pyreadstat__readstat_parser, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) } __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ReadstatError,__pyx_mstate_global->__pyx_n_u_PyreadstatError}; for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) { - __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 31, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":34 + /* "pyreadstat/_readstat_writer.pyx":35 * from _readstat_parser cimport check_exit_status * * cdef set int_types = {nw.Int32, nw.Int16, nw.Int8, nw.UInt16, nw.UInt8, } # <<<<<<<<<<<<<< * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 34, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_int_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_int_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":35 + /* "pyreadstat/_readstat_writer.pyx":36 * * cdef set int_types = {nw.Int32, nw.Int16, nw.Int8, nw.UInt16, nw.UInt8, } * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} # <<<<<<<<<<<<<< * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int128); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int128); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt128); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt128); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_9) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_8) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_6) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_float_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_float_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":36 + /* "pyreadstat/_readstat_writer.pyx":37 * cdef set int_types = {nw.Int32, nw.Int16, nw.Int8, nw.UInt16, nw.UInt8, } * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, # <<<<<<<<<<<<<< * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_12) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_11) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_10) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 36, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_t_4) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_nat_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_nat_types, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":37 + /* "pyreadstat/_readstat_writer.pyx":38 * cdef set float_types = {nw.Float64, nw.Float32, nw.Decimal, nw.Int128, nw.Int64, nw.UInt128, nw.UInt64, nw.UInt32} * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} # <<<<<<<<<<<<<< * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } */ - __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_t_2) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_2) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_4) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_4) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_10) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_10) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_11) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_11) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_12) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_12) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_7, __pyx_t_6) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_6) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, ((PyObject*)__pyx_t_7)); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":38 + /* "pyreadstat/_readstat_writer.pyx":39 * cdef set nat_types = {datetime.datetime, np.datetime64, datetime.time, datetime.date} #pd._libs.tslibs.timestamps.Timestamp, * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, # <<<<<<<<<<<<<< * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, */ - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "pyreadstat/_readstat_writer.pyx":39 + /* "pyreadstat/_readstat_writer.pyx":40 * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64} * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } # <<<<<<<<<<<<<< * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, */ - __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = PySet_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_13 = PySet_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - if (PySet_Add(__pyx_t_13, __pyx_t_7) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_7) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_6) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_6) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_12) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_12) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_11) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_11) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_10) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_10) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_4) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_4) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_2) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_2) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_8) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_8) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_13, __pyx_t_9) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_9) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, ((PyObject*)__pyx_t_13)); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":40 + /* "pyreadstat/_readstat_writer.pyx":41 * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, # <<<<<<<<<<<<<< * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, */ - __pyx_t_13 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":41 + /* "pyreadstat/_readstat_writer.pyx":42 * PYWRITER_DATETIME64, PYWRITER_DATE64, PYWRITER_TIME64 } * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, # <<<<<<<<<<<<<< * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, */ - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":42 + /* "pyreadstat/_readstat_writer.pyx":43 * cdef dict narwhals_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, # <<<<<<<<<<<<<< * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, */ - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":43 + /* "pyreadstat/_readstat_writer.pyx":44 * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, # <<<<<<<<<<<<<< * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":44 + /* "pyreadstat/_readstat_writer.pyx":45 * PYWRITER_DTA_STR_REF: READSTAT_TYPE_STRING_REF, * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, # <<<<<<<<<<<<<< * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":45 + /* "pyreadstat/_readstat_writer.pyx":46 * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, # <<<<<<<<<<<<<< * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } * */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_9, __pyx_t_8) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":46 + /* "pyreadstat/_readstat_writer.pyx":47 * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME64: READSTAT_TYPE_DOUBLE, PYWRITER_DATE64: READSTAT_TYPE_DOUBLE, * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } # <<<<<<<<<<<<<< * * cdef double spss_offset_secs = 12219379200 */ - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_13, __pyx_t_8, __pyx_t_9) < (0)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types); @@ -19126,7 +19189,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":48 + /* "pyreadstat/_readstat_writer.pyx":49 * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } * * cdef double spss_offset_secs = 12219379200 # <<<<<<<<<<<<<< @@ -19135,7 +19198,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs = 12219379200.0; - /* "pyreadstat/_readstat_writer.pyx":49 + /* "pyreadstat/_readstat_writer.pyx":50 * * cdef double spss_offset_secs = 12219379200 * cdef double sas_offset_secs = 315619200 # <<<<<<<<<<<<<< @@ -19144,7 +19207,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_secs = 315619200.0; - /* "pyreadstat/_readstat_writer.pyx":50 + /* "pyreadstat/_readstat_writer.pyx":51 * cdef double spss_offset_secs = 12219379200 * cdef double sas_offset_secs = 315619200 * cdef double spss_offset_days = 141428 # <<<<<<<<<<<<<< @@ -19153,7 +19216,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days = 141428.0; - /* "pyreadstat/_readstat_writer.pyx":51 + /* "pyreadstat/_readstat_writer.pyx":52 * cdef double sas_offset_secs = 315619200 * cdef double spss_offset_days = 141428 * cdef double sas_offset_days = 3653 # <<<<<<<<<<<<<< @@ -19162,19 +19225,19 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_days = 3653.0; - /* "pyreadstat/_readstat_writer.pyx":52 + /* "pyreadstat/_readstat_writer.pyx":53 * cdef double spss_offset_days = 141428 * cdef double sas_offset_days = 3653 * cdef object date_0 = datetime.datetime(1970,1,1).date() # <<<<<<<<<<<<<< * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_8; @@ -19185,7 +19248,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_date, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 52, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_date_0); @@ -19193,17 +19256,17 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; - /* "pyreadstat/_readstat_writer.pyx":54 + /* "pyreadstat/_readstat_writer.pyx":55 * cdef object date_0 = datetime.datetime(1970,1,1).date() * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] # <<<<<<<<<<<<<< * cdef valid_user_missing_stata = [chr(x) for x in range(ord("a"), ord("z")+1)] * */ - __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_9 = NULL; - __pyx_t_2 = __Pyx_PyLong_From_long((90 + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_long((90 + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = 1; { @@ -19211,12 +19274,12 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { { @@ -19224,28 +19287,28 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 55, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_8) < (0)) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_8) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_8 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyNumber_Add(__pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -19254,17 +19317,17 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":55 + /* "pyreadstat/_readstat_writer.pyx":56 * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] * cdef valid_user_missing_stata = [chr(x) for x in range(ord("a"), ord("z")+1)] # <<<<<<<<<<<<<< * * # max lenght of a string in dta before it has to use string_ref */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = NULL; - __pyx_t_9 = __Pyx_PyLong_From_long((0x7A + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyLong_From_long((0x7A + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = 1; { @@ -19272,12 +19335,12 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { { @@ -19285,22 +19348,22 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 56, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_2) < (0)) __PYX_ERR(0, 55, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_2) < (0)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -19309,7 +19372,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":58 + /* "pyreadstat/_readstat_writer.pyx":59 * * # max lenght of a string in dta before it has to use string_ref * cdef int dta_old_max_width = 128 # <<<<<<<<<<<<<< @@ -19318,7 +19381,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_dta_old_max_width = 0x80; - /* "pyreadstat/_readstat_writer.pyx":59 + /* "pyreadstat/_readstat_writer.pyx":60 * # max lenght of a string in dta before it has to use string_ref * cdef int dta_old_max_width = 128 * cdef int dta_111_max_width = 244 # <<<<<<<<<<<<<< @@ -19327,7 +19390,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_dta_111_max_width = 0xF4; - /* "pyreadstat/_readstat_writer.pyx":60 + /* "pyreadstat/_readstat_writer.pyx":61 * cdef int dta_old_max_width = 128 * cdef int dta_111_max_width = 244 * cdef int dta_117_max_width = 2045 # <<<<<<<<<<<<<< @@ -19336,34 +19399,34 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); */ __pyx_v_10pyreadstat_16_readstat_writer_dta_117_max_width = 0x7FD; - /* "pyreadstat/_readstat_writer.pyx":996 + /* "pyreadstat/_readstat_writer.pyx":993 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", * int version=0, # <<<<<<<<<<<<<< * str table_name=None, * object column_labels=None, compress=False, row_compress=False, object note=None, */ - __pyx_t_8 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "pyreadstat/_readstat_writer.pyx":995 + /* "pyreadstat/_readstat_writer.pyx":992 * return 0 * * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< * int version=0, * str table_name=None, */ - __pyx_t_9 = PyTuple_Pack(15, Py_None, ((PyObject*)__pyx_mstate_global->__pyx_kp_u__3), __pyx_t_8, Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_9 = PyTuple_Pack(15, Py_None, ((PyObject*)__pyx_mstate_global->__pyx_kp_u__4), __pyx_t_8, Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_writer_1writer_entry_point, 0, __pyx_mstate_global->__pyx_n_u_writer_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_writer, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_writer_1writer_entry_point, 0, __pyx_mstate_global->__pyx_n_u_writer_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_writer, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_writer_entry_point, __pyx_t_8) < (0)) __PYX_ERR(0, 995, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_writer_entry_point, __pyx_t_8) < (0)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyreadstat/_readstat_writer.pyx":1 @@ -19421,7 +19484,7 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 732, __pyx_L1_error) /* Cached unbound methods */ __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; @@ -19445,25 +19508,25 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "pyreadstat/_readstat_writer.pyx":674 + /* "pyreadstat/_readstat_writer.pyx":666 * 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 type(filename_path) == str: */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_surrogateescape); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_surrogateescape); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "pyreadstat/_readstat_writer.pyx":52 + /* "pyreadstat/_readstat_writer.pyx":53 * cdef double spss_offset_days = 141428 * cdef double sas_offset_days = 3653 * cdef object date_0 = datetime.datetime(1970,1,1).date() # <<<<<<<<<<<<<< * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] */ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1970, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1970, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); #if CYTHON_IMMORTAL_CONSTANTS @@ -19496,34 +19559,34 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - const struct { const unsigned int length: 11; } index[] = {{1},{29},{50},{4},{179},{29},{32},{21},{1},{0},{1},{1},{8},{23},{48},{66},{42},{45},{44},{59},{16},{149},{13},{8},{13},{61},{21},{70},{78},{96},{54},{66},{56},{62},{49},{68},{57},{93},{54},{29},{19},{55},{51},{12},{16},{15},{85},{39},{62},{11},{32},{27},{31},{19},{29},{16},{13},{14},{19},{54},{23},{19},{5},{15},{57},{67},{37},{37},{37},{19},{7},{11},{4},{8},{7},{4},{7},{7},{6},{5},{5},{5},{4},{6},{15},{20},{13},{6},{4},{7},{6},{6},{6},{5},{1},{18},{4},{3},{6},{17},{18},{5},{13},{7},{7},{8},{4},{8},{10},{4},{2},{7},{10},{8},{3},{5},{10},{6},{10},{19},{10},{6},{11},{8},{8},{8},{3},{14},{20},{21},{2},{14},{13},{5},{9},{9},{7},{5},{4},{5},{12},{9},{4},{4},{2},{8},{3},{14},{19},{10},{2},{4},{8},{18},{7},{4},{2},{2},{2},{3},{10},{5},{2},{7},{2},{4},{3},{3},{27},{12},{12},{16},{7},{5},{5},{12},{15},{3},{5},{12},{10},{6},{15},{3},{10},{8},{4},{4},{9},{9},{8},{13},{6},{7},{5},{2},{3},{2},{6},{18},{22},{15},{16},{21},{7},{4},{8},{4},{12},{18},{18},{13},{1},{5},{3},{1370},{310},{306},{41}}; - #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2357 bytes) */ -const char* const cstring = "BZh91AY&SYk=(\314\000\001\\\377\377\346o\376\307v\367\375v\277-\377\320\277\377\377\361@@@@@\000@@\000@@@@\000@\000`\n\017\225\224\366sXt\005\022P(\240\350\006 \252\256BQ&!O\3254\236iOQ\352<\231OH\000\r7\252d\006\236\240\007\250\364\207\250=O\3256\247\250`\322~T\022H\000Bjz#I\224\003@\000\000\032\000\000\000\001\240\036\240\007\000\003A\241\240\320\001\246A\241\2204\320\000\001\220\001\220\031\000\006\236\245\010\200d\000h\r4\321\2402\000\000\310\000\000\000\000\000p\0004\032\032\r\000\032d\032\031\003M\000\000\031\000\031\001\220\000H\210M\002\023L\247\224\364\231M\244\323$\321\204hi\243j\032\000\000\000hhh\036\246\227\224\274\361\234q#\024\305\216\210\212\006\214B\214MC\356\240\252\013\023\025\253\300\207\r4\350|\244\004\264\035mn\007,\n\372a\034*B.v\00733\302\212\256k\274\344b\226\017\211\340\016P\217}\3107\373~/\007\2654\024\270`\003\217\222\327\205q\317\317=\016d\340&\221+\237#\204\276K\000X\362\345n\276\352m\310\331\n\312!\005Dm\022\215i]6\317\226\326l\276\377\213u\313d\362\210yE\014=\037c\256\246#P\377\251\245\016\377\253I@h\267.N\r\"1\035:\304b=S\216\\\320\225R\236\234\215\n\341\321\032Sq\001\242\261\200\234{2\214\327\254\330.\335C\343&\233\327,\342Y\277{\247H\312\261\263\010\271Ks\031VV\267RO:\323\007M\013\024\3067\276\346X\302\370\232K\251II\343\370X\337\n\032\271\313\177s\226\313y\356a\237\301\351^\362\245\231\245\340\210Y\335(\377\273\251\"\243\2000i\264\332'2\362\355\r\246\364\245&\003\010\"\026\374\375m\250\312\346\257\005\347\212\030\240\357B\216\331\371\261\336\005:\215\361c\034\262\335W\324\005\212\032\333\205\202:\341c\004m\006\031\n\265\254\002\360\r\037\333b\014z\tP`\330\236\372\264\177\247\205\373,\220\022Cquq\233.\230\342O'\310\215\005\353\320\362\367\340;\2178^F \261\325a\220\210\210\rp2\320h8+$\266z\031dq\314\005\227\215M\307\232\240\262\361\263Tk8`\263\241\277\0358%\010\370t\361\226\276&\036\2469\025\243\332\315)\003c\243\253\027G4\033\033 \263\304\031\247\3370\266\016\243\030A\264G\372i#|\321T\327\277U\246f\237\330\220V\346\211\357\353\266T\246\345\256ri\2037$\241=Z\355\252\326$\272\022\323\201<\016\002H\245\327|\373\233B\3337\202\305\252\232\214fS\245\356\216o\310'V\341\243\234\355f\240\300%\255A\226\210\301(3fu\365\366\221H\014n5\303\026v\260\214\343\305xNK4\245\216\307>1K\343\324\207\033\267\343\224f\2503&\241'\231\325*\260>\362\333\\\372\272UuF\254\217\343\004\314\352[\256\341a\353\337}\370\010\253bc\022mW\2740\310)D\222\215 \245a\n\370\256\274.Wb2\031B\021)`\0071\211\263\211\332\020J\035Z\010L\226\224\2508\311\223\201\364Xl\001N\350J\035\r\347\216ao\014\2443h\271\203<\211*>\2333_\361\2407\355X\"_\036\033y\266\353\247a\007}7z\215\0248\322|\010\010\345#\317\303\246\273\024\241\213\335c\347\303]\032\032\333\236\252\341\247JX\251\246\310\330\200\336{\214""\310\212\232a\001v\220\331\320Y\245\231e\304\261%\300H%\271r\230%QB\344\231\031!\267\023\031\034\035\2614\376#\356a!\260\274AI\202Rl`P\364_\\\361\316\205\356\3642\031\245CJ\005X\241\222\267{e\212f&]1\2468\210\271y@\266$R\373`\253\246\230nH\321\2000\233%S\021Y\264\320\300ombF]\325\314\351\245\004\3452TSf\340\036V-\013\305\256\221KY\027\234SF\342D\225Kp\224\342\304\024\360Q\225pM+R\215\224\211\232\222\342\370\321\0276\316Km\010\301\373\014\203\010/\331\232Z$M\241\331\262\354\201\2446\010\224\223EV%\244~\206\233\2672\230\027\367\331\342k\255\250dg\256\357(\247\034\367\303:L\222\321F#\312\"\222\271>=P[\311\247\300\303h\207~\\\363\016O.v7\264\307\244@\231\330\007WMDe\347\016\013\313\251\177\240\320Y\234\306\207\257\006\370\002vP\301Y2\030\366/\0311/>)\262+d\241\000\010\006B\205\005\314\026\227\206\213\222\301!jb\332\332t\3007\211\265\2037\263pxy\361\317\253X\251(\320W\024{\\y\367\034:\374\354\205\333\024\315\"\325\0162\036\256\243\213\341\335\263,_VKO\036\254\2721CC\335\\\375]jW\362\001\256\251\035;z\370f\0358u%-\2661\251\"\023]D\020\332i6\230\322M\314@\242\201\31033B\255\226\023\264A\333\007\341b4\335\213\342\217\t\216f\250\023KM\223$\336!Q\006=\311\004\211(\262\313m{%a\201\217\032\354\246m\351\352\221\243cM\212\2206\375\2164\240\263 \032C\361<\315wO\026\276\026\035\315\214\243\305\304A\030\336J2l\346\362w\355v\304i4\324y\343\014b\271R\215\221I\231)3=f\375\021\243\373\312\231Z4+\313\253\343\206\333)nC\215KX\315@\311\317@Df\263v\363\204y\263\206\225\322\220\2343\216\250{\351g\230\347L\303\234M\000\354\332\332!\020fO\342\227h[\232\031\250\210\014\321k\334\242\235\250\244\310(\30127nM\374\327\266\313\\\177Mm\256\360\301\032\366!\007]jn\306\222\300m\264\017\010N\221/\224*\331\341\\\025\332\253\032<\225\255+T\020\r\215\203T\362uM@`R\327\250\335$NA\221\235% \220\353\200\307:\t\007\302\3213\005\016\030\342\312\224%\205I\2469U\025,\335\235\001\335\304@\007\016+[\244ffq\300\311\326\00729\211\340\233_Q\242\364K<\255\272\231\"\315\266\331\202m\276\234s\335\241\251\205\252\2538""\340\351T\270\260()\304\036\311l\307\t\317\024\213\344i;Yf\331\263\004fn\205\t\274\361\353\364\311\021\232E\030\227\232\205.]\222QHe-e{\262q\033\216\031m\020\267@\221X\322S:\306\260\026 \322lk\315\t\034\375\2352\313\213\2718\034\267\370\016\324\325\255\274)\351\277\232\373\327$\307\013`\254\3132#\0213\355\016\227\201,\307\017!;\003\306`3]\321\030fs\211\217pH(\374W\2454\246j\340\020#\006\005\356\354\216\305\354\325\036\242\022rP\224\222\257\235\001\366\247w6\256r\376\212\267\320\311\221:\373j\223\234\324\336\301\302\234\nq%\233\237\023G\020\242q\373|\330i\252\276|\330j\315\342\311\213p\324(\177\310\345N\306\255*fp\357Z\2722 \243\255\221^j\366\371K\305\257o\376.\344\212p\241 \326zQ\230"; - PyObject *data = __Pyx_DecompressString(cstring, 2357, 2); + const struct { const unsigned int length: 11; } index[] = {{29},{21},{50},{4},{179},{82},{29},{32},{21},{1},{1},{0},{1},{1},{8},{23},{48},{66},{42},{45},{44},{59},{16},{8},{149},{15},{13},{8},{13},{61},{21},{70},{78},{96},{54},{66},{56},{62},{49},{68},{57},{93},{54},{29},{19},{55},{51},{12},{16},{15},{85},{39},{62},{11},{32},{27},{31},{19},{29},{16},{13},{14},{19},{76},{23},{19},{5},{15},{57},{67},{37},{37},{37},{19},{1},{7},{11},{4},{8},{7},{4},{7},{7},{6},{5},{5},{5},{4},{6},{15},{20},{13},{6},{4},{7},{6},{6},{6},{5},{18},{4},{3},{6},{17},{18},{5},{13},{7},{7},{8},{1},{4},{8},{10},{4},{2},{7},{10},{8},{3},{5},{10},{6},{10},{19},{10},{6},{11},{8},{8},{8},{3},{14},{20},{21},{2},{14},{13},{5},{9},{9},{7},{5},{4},{5},{12},{9},{4},{4},{2},{8},{3},{14},{19},{10},{2},{4},{8},{18},{7},{4},{2},{2},{2},{3},{10},{5},{2},{7},{2},{4},{3},{3},{27},{12},{12},{16},{7},{5},{5},{12},{15},{3},{5},{12},{10},{6},{8},{15},{3},{10},{8},{4},{4},{9},{9},{8},{13},{6},{7},{5},{2},{3},{2},{6},{18},{22},{15},{16},{21},{7},{4},{8},{4},{12},{18},{18},{13},{1},{5},{3},{1370},{310},{306},{41}}; + #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2436 bytes) */ +const char* const cstring = "BZh91AY&SY\223\264k\203\000\001\342\377\377\346o\376\307v\367\375v\277-\377\320\277\377\377\361@@@@@\000@@\000@@@@\000@\000`\no\275\267\241\357^\014\340#\254\321M\000P\nL\314\2009\341)\251M\220\247\250M\223MG\243j'\246\240\365\032\0035\001\243OP\003\324dd\036\247\352\233S\3243F\223\312\014SI\243*~\247\224\311Ce?T\000\3204\000\000\320\000\000\000\000\000\002)\242yL\206\236\240\032L\000L\000\020\300\000LL\230M0\021\223\020\300\t\t\023D\324\321=H\375S\365C@\362\217Sj\006\200\000\000\000\000\000\000\r\003\200\001\240\320\320h\000\323 \320\310\032h\000\000\310\000\310\014\200\002D\200\215\010\230F\2044\022yF\2312\001\240\365\000\000\000\00044\r\rTj\300w5&r/n\321H\240\210s\024^\211\217\272\004\201Rr\211bc\223&M\017\374@I\240\342\326\360r`S\341\204r\241\010\271\336\035\014\035\250\242\350\271N\006\211a\357\363_\000\354\340\251\320>\211\364\375\374:\325aS\214\000\355+\367\317c\232\304q\341\271C\335p\006\314\035+\341$\006\350\222\314\nY\025\373\357\331\341m\311q?0\225\010\321\242l\206\211\243iR\272\357\227\013Y\262\334\177\227U\312\346\363\210y\304\313}O\255\310`\200\010\303E\370\005<\016LlO\362\2150\010\202R\221\250\210\302\220\004\004\002\266\001\214\0161\004\221\024\251t\253\273G;\342(:\332\t\216\211\343\001\037\005\353\357\316\267_e\352h\372\022\245]\244\272\355C7\214(\265\215r\214\345\266S\314\255\373\006Q\224\246jD\253\331ZI\317\005I\313)p~FLv/\221\244\234\313\326\262%\3133\224\356n\210\\\272Ny\226u\tK\253\022:\212\326_\207\225\367m\273\006\305\354\264Y\254Q\234jD\212\361\207IV\314\340\006k\244#0\256\017P\312\247HOU\232\347j\235\371@\352\023\303\336bt!\302\220\313\317\323\253\243\305ccM\006\330\306\370\340Ez\313\243 \021\327\305\336\006&\222H$@E\313\332\230\025\257\226p\371\331o\257Lcww{\215\265\204F(\nD:\002\254\251\222Z\002\353\202\330\017\004\0046\247\377\031e\037m\261\266\324\304\315\235\245zM\320\320\203S\315\030\207wu\351M\026\201b\265f\032\257\303^K9z\332:\234\351\346$\265T\326\257\257\026\2211\035\311\267\272\021/\344\352u\005\022\261\n\235{u*0\3015\370\310""\352\343\3546\373\304\204\206HI\222\022HgU\205\23565\026\303\373\322\032\363\203\255'\025)\327\257^\314\323\222\273>\213\357w\021\307\036\222\220`\273H\250\274\324\351Zw\213f\336\264M\t\203TFdM\232\240m\247K\234\376\214\031l\364:\353\314V\311\232\347\t\026\271\245?\316KP\254\340\030i\264\332+S:yF\323|V\265@\304$[\265\347\344F\314\315\257\013\253,h\203\225\nx\245\355G\224\t\365\034\"\246Y\347\276\217\250\n\2235\257*\204q\205\224\021\270\030f*R\220\013\230\321\375vA\227h\224\306\r\211\362\311\323\375\3101\374\332@U\017\244e\246\315w\323J\310\267\004n\027\330\271\034p\036\036\360\274\254AS}FB\" 4\261|6\320qUIk\356N\n\243\226\000Y\370)d<)\212\376\014\325\032\312\326X\231\352\313NIB\017(\310`6\332m#&\206\026\224{\355\035\236\3758\314\243\003To\310f@\241\207\265\241\276Io\277\305_\035\360\3559\010^Q\027G\211\220\317\200H!\024i\"\211x\307P7\275I;>\224\311Z\247\014\212\361=<\2241\267c4\322[\224|\370\300]\254\327\025e\0359\243\244\235[\247\221J\373\362\230j\346\032\206e\224\265\243\261J\233\242\211\371\341\317\312VW\313\016\376\031\340\254\336\346k8\033\034\335\030\273\234\24666AW\200f>\351j\331\320c\0104\021\376ZH\341)\252\032\355\3575\240\257\354\022\004t\205KSR\312F-\224\337VV\200\226\020}\270)\254\016\026\n\235\351o\346[B\000\252/\205\353\224`\345\031\362~\3233\311;\263b\376)E6\226\241;6\341\213\244\2673P`\022kPeb,\224\030\254\036\356\230\276~\316\362V\200\276\006\271\350\317#\010\332\234\264\320hkv5W\r;\247R\206\233F\302\016\007\311fdQih\013\264\206\316\341`\014I\325s*Ms\022\n\357]c\320\256B\226\n\264j\207\274\260\321\3168\226R\350\245\203D6&0\274A9A$\233\030\023=w\327\031be\356\3643\031\245\003I\205\030\241\222[\375\322*O\002e\323\032c\210\213\227\222\005\262D\362\335\005\034\364\266\364\2140\006\022eR\241\220\252\332h`7\272\261!\227yC\213%5\n\305n\254\3370\3674\316x\243\323D\214\261\204iz'M\004\212\252\025\345%X\224\020O\256l\273\205Z\367*\321\222U\\\2473\331dfrV\305\255\211\207\3372\030\205\373\360\226\211\022+\016\255\227}\316CHm\010\232I\242\2532\322\037\255\246\353\332N\305r\372\014\\Z0\310\306\273\357\350\024\363\323\2043\272R$\3216#\320\"r]\217\237\010+\347\327\351\260\336!\337\263\246\003\233\317\245N/\223 z\304\t\226}\340p\356\330E=!\315{\033\027\371M\005Y\250\320\365\344\343\324\340S\226\336\304\355\316*'\347\3724\337\351\337\033\315`\206\333\033hi\320\207\341.\230\363\032\256\305t\20537\224-\347u\303D\233\013\263\2037\203\355:s\323\257]\245RH\324W\024{}}<\207>^\246B\361\304\360\221R\210\353\220y\365\034^\336M\263\311\360\315i\345\325\227E\262D!\357\256=\032\320\247\342\002\372\244w\3718\362\300w\362\352Rhm\2661\252$\006\267\020\215\246\223M1\244\233\251\005,\034\003\006\020\251Ug-\302\017$\037}\210\323~ONh\3551\241\262\004\322\326\262\221+\304)\240\313\301\010\220\222\234\252f\363\215\326\361H2\310\317\2356\236\215\232\372\010mc\032v\202pm\367\373\355aj@i\017\266z\233wV\366\275V\035\303c,\364rb\212\322\250\263+'Y\321\314_1\244\323\\\225\325\254i2\223\336\220s\331\230=\231\263\014*E[w\021\222VR\"[\013\332\031\026jB\362\034\"%!B\361\221\314@\026$\224\226\332\327\331\247G\3265\271\366\276\226^C5\322c<\3452 \260\2026y\356B&\332\227D\274f}\223\331P@l\214\361\202\352\331\335VP\202\354,p\322\221\313\263\025\332\267\037\316[\251\300,\215{\320\203\215(o\322\324\300m\264\017\0222ZP\370E|\235\261\205\233WcG5\257k\335""\004\006\306\301\226\346\335W\001\240\266Y\334n\324'@\311\255\251 \220q\200\313\023\022\017\256\321)A3\226Y1\320\231\014(Jy\347DP\253ut\007w\021\000\034\271\255n\221\203\007;\031\272@\345!\312%\3116\275\346\213\315\024k\031\333|\363E\233m\266\027|\257\323m\373\216\243=\027R\315\301\316-\231\240\265\024\325\250\022`qg;[$\213\340\326Z2\255\263k#\006\370P\233\306\\\017\206DF\022&\304\275SW\301\206\222\242CU\352\305\236\032\202\230 k\215\003>\361#*^\266;\216\251\213 i65\351\204\216\236\336\231\347\315\334\225\216\316\035m\370\323U\257\000\237\303\177M\370.\026 \\C+\031\264R\202r\226o\305 +\261\004\211\226\314$6\006\313\311\021n\332h>\331\322=\321 \243\361Vs\326z\005\300 E\230\027\273\2522^\315\025X\213\362D\244\231w\350\017\266N\034\023\3415\261\345\343c\203\201\2667\023\\4\333\212\317#bG+h\352|\214|\242\033\233\333\347\273\223.\206\034\027r\340\333\337\275\274g\224C\350V\270\350\226D`x\377b|c\234D\237\006\006\314\303\311\330\0174\207\223\270\273\222)\302\204\204\235\243\\\030"; + PyObject *data = __Pyx_DecompressString(cstring, 2436, 2); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif - #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2150 bytes) */ -const char* const cstring = "x\332\305WKo\033\307\035g\200\024P\021\247M\372@zp\213QQAR \313\246,\010\252\321\242\260-\033\010Z\270rl\313E/\203\341\356\220\234jwf\2753Kju(z\324QG\035\365\021z\314G\350\221G\035\375\021\372\021\372\373\317\354\213\014%\307F\203\010\324\356<\376\357\367n>6I\221j\226\210\201L,K\013\353\330@2\353r\245G\366\231\321\254\320\352M!Y\024\340\264H\245e\261t2r2fJ37\226,\026N\014s\\\255\002C>3N\342X8\366\270tc\220P\204\221\250\201\314\205\223I\351\251\003=' \315\016\237\034\336\331\335\337eB\307,\227\377\000a\313l1\210\022a-x\231!\033\024*q\304\252\314\244\335f_\rYi\n\246%\004p\206e\200\353\"@ \315\254t^\262u\241\265q\302)\2439\320\241\324:\213U\016&j\"\t\373\251H\254\334~\245\217\265\231j\257\010\033\232<\205\360\270T\332\312\334\325\227Y9\315\025\211=\021\271\022\203DV\220G2\267\240\317\300\010rd\231\311\3114\333\177\022q\314q&E\242F:\225\332\021|\213\354\025V\256ks\266\341i8\221C\335\021\233*7f\272Ha8\273\272\031\215E.\274\331Re-\356y.\364\010\nOD\002\007\215\240\220\366\0344di\201\033~k6\370\220/\370Z\202\013\340\022\205-\260c\270f52i\226K\330\325;\305Lys\020y\203\022\336\300@\272\227y!\033\3577$3\240\tK\3242\223\210\334\266\001B\324a+\310\004\301\341\322\005U<\201\261 \327\300y\307\262\264l\254\274\020\211a\261\001\0041\227'\220uu\250\022\342\004!\"S$1\253\304\222:21\354\357\215\267f\331t\254\2421\205 \205\004\204B\350\344\314\226\326\3114\300\202\375\026syI\026\207\317\003>9\006\300\205\033\336\331\337f\207\211\024Vz\n\313\320!@N!\225\224\333\244S\353a\304\017\334\037\257\023{\3041\305/K\244\036A2l\243\245\251G\212[2&\330\007\337\267\2606\205\034E.\347\003i\336\206\017:\026\363\221\321\222\366\036k\350\023\215\220\347^\260\367\243R\005\r$\203\214\022\351\314n\246\226\212\023\326Gl\331(G\355h\220B\350*\322/\035(]\273\255\317<^u\235u\243X$\211\231\312x9\375\017\301\272\177\215T\366=(T\212\277\007\336\225\215\177(\221\257A\370 \027\026\250\201\274\"@\302U\032\371\370YZf\226!Vu\321\326\222\010J\265SO\343\205\243\242K""\261\366\220\016\377\356\227<\\=|\261\305F\340\271f\353\\ZB\374;\330\243\243\271A.kR\025\273>\275\3575\227\204\034\370-\026GmR\245E\262\005\3708,l$\240,\320\213\252;,C\313\325h\014\212\021j\277\314\267\340\346\241\273\026E\351V\312\332!\363\3558l\321p\242\220\305\276\234PY\0317\355Y\351\266\324z;\016dSxp!\267\374\323\251\324\213NojP\314\216}\005m\005\247^dBO\010\006i$zw\353i\263\250\211\210u\266Q\031.\024\354\0053U\334\006\245\2236+sx\031-\320m\363z\3053\364\020\231\267Ww\333\253\320\222\267\263\362\244\203Y+\3319BHL\307\350\365\333\330A\250\355\311N\367\262H\263\262\2637]1P\354;\273\251\3105\215F\353\241M\333P\260\020Q*I\344\010\n\242\205\353;\"\311\306(\353NE\233m\216<`\353~X\222\026\335\335\217$\260Y\022\3136 |K\013C\205\357<\215\ti\354b\353\013[\262kd\264\023H\r$\224\315D\004\0077\375\256\223\253s\210m\031 Ie\232\271\262\236\367\266\330\265\363GM\"\344\\5C=\367\360\270\277\203\207?\334\377\353\200f\315\303\306\265O\362\334\344\234\037\226'\370?@)\340\317\344\211\373Z\016\277\356\002\274\360\226z\t\216\257\002e\377\332{\345i\277\362\304\351\271\317\205-u\244\3146f\003S\300\234\022\025\303\272\010\331\353\253\001\347~^\345#H\217Y\202\266\200\341\nc*\242E\016Dt\034%\030\246\347f\266j\n\250\232e=\223Q\264\327\021_\277\367vcQ\332x\210Y\227|\036\347&\343\272H\022\013M8\345`\354DL~\221\002m\206\033\235\224a\360\221'4\274Qu\245`\344\301\364|\022F\\\177\344E\301\nJ\014s\223r\n\345\211\034\332X\022\376\320\006:\234\017\013\035q\322\017?\036U^\223\226v\001\205\373h\244\250\305\031\221\016cU=U\215\225J\263\204\366\325\374\256,o\214\211\265\322x\204I\223\026~\320T\326g\236\262\320[Y-\310\264\226b\210W\246\363k\014\264\226fK\252\307\211\341\2446\274\2347\n\373\1776\315f\217\200\250\246sg\270\037k{\241\355\205.Q\325\031\357n\333\233\000\007\235\361T\3068\327(O\216\327]\234\320\303\374u\035\324\315\020\0134\274\026\035yj6\211:n:=^\215\332\275Ey<`K\317dR{{ get\214\342N\r\036E\033u\236zC\320//t\260\337\274\r0r\326\010\370\210\346\341\023\270\207\231\307\312@\023\375\335)\264\014O\333\266\326\355-\3745N\n\202ee\305\327\212 JP,\354\275\311\026\017\274\225\272\207\260\342Hi\277\234\277\313\354\002I:\230\247Y\237|\033\261\246J\353\371[\372\000\236\247\353O\346\t7GKpk\322~\323\275\237\365\326fk\177\374\346\371\325\027\277\362\277\235\331\316\243\331\243\243\331\321\353\253\317\372\263\376\237\377\323\277\372\354\363\346\367\337\225\336\217~w\331\277\372\230]~D\353\225\177\375\363\374\305\305GW+\277\276x~\265\362\233\013q\265\362\311\331\357\317\017pt\353g\347w/?\277\\\245\223\376\325\255\3376+\202\372\361\027\347\366b\265B\373\344l\377\374\376\271\0100\237\376\322\023|\327\372\345\305/\200\332\356~~\361\320\357\336\266l\177z\366f\236\317\002\343\267+?93\027\317/\304\333\217?={~\026\237\1779\273}\357\337\267\276yH\267G\227\177\230\335}:{\352\r\261r{v{w""\266\213\355\353\331\353\277\205\222\321\304\224\364\037\005n\263\212py\242\034\247\213\302\376\01719\275\302"; - PyObject *data = __Pyx_DecompressString(cstring, 2150, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2241 bytes) */ +const char* const cstring = "x\332\305X\313n\034\307\025\035\003\016\300\300rb\347\001g\241\004\305 \002I\203\032i(\202`\204\004\201\236\200\221@\241\254W\220M\241\246\273f\246\302\356\252VU5\207\315E\220%\227\\r\251O\310\322\237\220\345,\271\324'\344\023rnUwO\317xHYB\014\023dw\275\356\243\356=\367\321|`\2622\327,\023C\2319\226\227\316\263\241d\316[\245\307\356\201)\263\224i\343\231)\244f#\225I\266\361\304hVj\365\272\224,\211\304Z\344\322\261Tz\231x\2312\245\231\237H\226\n/F\026[\353\240\220O\214\227X\026\236=\250\374\004,\024Qdj(\255\3602\253\202H\220[:\244\331\301\243\203\233\273\373\273L\350\224Y\371\0170v\314\225\303$\023\316A\226\031\261a\2512O\242\252B\272>\373j\304*S2-\241\2007\254\300\271.\001\024\322\314I\0374\333\020\032w\022^\031\315A\216\233n\260TY\010QG\222\250\037\213\314\311\376V\237=\307\351p\353\\Td\227\314$\207\0200\254\240\230\001+\313\nk\022\tY\306\006\371t\216\3545\021\3404\265\n\227.\244\315\225s\020\326\177\241\017\265\231\352`\032626\2079 Ni'\255o6\213*\320Yv$\254\022C\010\217'_JKL\002{W\026\205\2610\366\026\353\377I\244)\307\242\024\231\032\353\\jO\004s\352`C\345\273\276e\233\201\211\027\026\026\034\263\251\362\023\246\313\034\276p\353[\311DX\021<\021\324\326cn\205\036\303\206G\"\203\317\307\260\221\016\0224\224\231\037n\345\335p\021\026|\tSR\005\203e\nSP\247\360\366zb\362\302\222\371\202\237\315\224\267\013I\360\021\321\rah\366\334\226\262\005T\313\262\000\231\010\266/L&\254\233c\216\270\303X\320\t\212\003%KW\t\014\202\217\010\017\207\262rl\242\202\022\231a\251\301\t\022.\217\241\353:\333\224\326j\023qP\010(\223\264aA\327\322\211I\201\211`\304\033\216M'*\231\020\272\tmP\016\250\260\314U\316\313<\236\205\032\333\314\333\212,\017\347Gzr\020\016\227~ts\277\317\0162)\234\014\034V\221C\001Kh\315\252\376F\360\004\001\006\353w\031]u\356x\340\n\250H7H\033D\014E\n\313\244\036CQL\223\225\221O\366pdch\023!1?\353r\250UZ\271\210\257E\323\336\355\0302\000f\316:8\262\345OT\272\361\342\200""\005\272z\273\350\202[d\231\231\312t5\377\017\241\272s\211V\356=8\324\027\177\017\272E\212\032\023\301\3025\252\021M\343&\027\357/S\327d\300Z\033fU\353\037\212\357K\010>\310\205%r#\257\031\220r\365\215\002~Vf\237U\204u\276t\215&\202\"\357$\360x\346)\031\023\326\356\321\342\337\303\220\307\255{\317\266\331\0302o\270&\226V0\377\016\366\350\334\334 \2645]\025\263\001\275o\267\233D\034\345-\347Lmr\245E\266\215\363i\034\270D\340\262 /\353\252\261\212\314\252\361\004\034\023\224\004i\267\341\346\221\277\224D\351\271\226\215C\026\273\2018E!Jb\024\207tBie\3226\002J\3173p\260\343P\266\211\007\033r;<\275\312\203\352\364\246\272\305\334$$\324\271\342T\242L,\025\321 \255F\357\256H\363(j\021\261\3016k\303\305\374\275d\246Z\332\260\362\322\025\225\205\227Q\031}\2377#^\240\264H;\337\2725\337\212\245\272_T\307\035\312\346\222\235%@b:AW\321\307\014J\365\217v\272\233e^T\235\271\351\252\201\334\337\231M\205\325\324\231m\304\352\355b\302\002\242T\226\3111.\270\251\353[\211\254\230 \265{\230B\343v\202\232\266\024\005\036\265Cn\315#\347.\333\010\315\232t\250 \241%\202%3\034la\022\352^lAByj\rKm\037\333X\232\222\265\023\243\275@\300 \314\\!\022\270\275-\212\235\010^ \234'\007\370\360\246\314\013_5M\3506\273\264YiX\304H\254\033\216\273-2\377Bs\366\216C/\003\206.9\024\001F\320B\217\2002kH\201\330\235E\213\360\3731\242\037\300\345c\003\334\211\354!\206\017k\004<\224\211\312E\366\010\372>\316\214\360wv\302ko\367+\355\007;\373\364\334\303\343\316\016\036aq\377\257Cjv\017Z\217?\262\326X\316\017\252c\374=D\206\340O\344\261\377Z\216\276\356\036x\026L\365\034\022_D\316\341\265\367\"\360~\021\230\323s_\270J'\312\364\001\002S\302\234\022y\304\371\0041\035r\004\347\241_\346c(\217\206\203\2468\303\025\332d\240E\016Er\230dh\346\027\032\274\2727\250Kh\323\300\245\024\004M 4\357\275\335TT.\035\241\331&\247\247\326\024\\\227Y\346p\023N\241\231z\221\222c\244@\365\341FgUl\217\3441\265z\224t\t\215\274\266\375Q\354\210\303R\320\005#\334bdM\316\t\313Gr\344RI\364#\027\371p>*u\302\351\202\370\345I\3555\351h\026Ix""\200#\301\026k\304:6_M\3575Q*/2\232\327\037\020\312\361\326\232\030+\215G\354Ki\020\332R\345B0*\207{+\247\005\331\326\021\210xm\2730F\373\353\250\023\2454\235\031\316s\204\020\236J/&\275\025\025\010\247LZ\302\010\336\006\331A\022\364\321\220Z3\206#\t\313E\360V\010\344H\205\224\356\361\304\327\037\341\217\3768\276]=\rp\016i\006\203\023 \332\343{0\203\014\244.(}\242\364\310\324\371\017\235\203\264\245+}r\264\023\315\335\346\212\366\203\253]A/\207[V|\252R?iW#\\\333i\335E\257L95\244)\3157\251~\n\345)\3515`\251\315\016\261\266\002\300P\270\353\225Nh4+ar|L\275\317\211*\016\252\230]\330\227\233\363\341Vo\345\3626\273l\014\201\227\322D0x>\270=G\014\037\354}\0133\024\357\035u\177@aA\000$p\000\357Dr\3176\217\214J\251\204\271\260\037W\267YX\205\261\250pB\217\017\226\375]\t\233\377\002\360\026&\224\027\267z\251)\251f\376P\nt\215\267\325\243\246q\363\212\205+O/\372\341\373@\316\345\233\337\3078 \351\312;\316O\204Q\200\324f\320\363Je\377\317\246\331\352\321!\312\355\334\033\036\272\336^,\177\261Z\324y&\270\333\365\216@\203\ny\"S\254k\244'\317\233jN\344\261\021\273\354\324\325'\226x\204[t\364i\304d\352\260\255\370x\265\327\356-\353\023\016\316\371\321\277,\203=\020\26329Dr\247B\217\244\215^\344\033V\026\031\267K+h\033\326a\322\335\237\365n\314n\374\361\233\247\027_\374*\374\356\314v\356\317\356\277\234\275|u\361\331`6\370\363\177\006\027\237}\336\376\376w\255\367\243\337\275\031\\|\314\336|D\343\265\177\375\363\354\331\371G\027k\277>\177z\261\366\233sq\261\366\311\351\357""\317\036b\351\332\317\316n\275\371\374\315:\255\014.\256\375\266\035\321\251\037\177q\346\316\327k\262ON\367\317\356\234\211x\346\323_\006\206\357\032\077\077\377\005H\347\263\237\237\337\013\263\267s\261?=}\275(gI\360\333\265\237\234\232\363\247\347\342\355\307\237\236>=M\317\276\234]\277\375\357k\337\334\243\335\227o\3760\273\365x\3668\030b\355\372\354\372\356l\027\323W\263W\177\213)\243\305Th\200\270\337\252\021.\217\225\347\264Q\272\377\001\225c\3662"; + PyObject *data = __Pyx_DecompressString(cstring, 2241, 1); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif - #else /* compression: none (5946 bytes) */ -const char* const bytes = ")Column labels must be stringsNon unique column names detected in the dataframe!NoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Unknown data format to insertUnknown pywriter variable formatVersion not supported .?add_notealignment for variable and it must be str (not starting with numbers!)character missing_ranges value given for non character variable %scolumn_labels must be either list or dict!compress and row_compress cannot be both Truedataframe must be pandas or polars dataframedictionaries in missing_ranges must have the keys hi and lo does not exist!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. in variable instead' is of type length of column labels must be the same as number of columnsmeasure for variable missing_ranges: hi and lo values must be both the same for string typemissing_ranges: hi and lo values must be both either of numeric or string typemissing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowedmissing_ranges: max 1 range value per variable allowedmissing_ranges: max 3 discrete numeric values per variable allowedmissing_ranges: max 3 string values per variable allowedmissing_ranges: string values length must not be larger than 8missing_ranges: values in dictionary must be listmissing_ranges: values must be both either of numeric or string typemissing_user_values not allowed for character variable %smissing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s insteadmissing_user_values: values in dictionary must be list must be boolean or be 1 or 0 must be dict, got must be either nominal, ordinal, scale or unknown got must be either right, center, left or unknown got must be int must be numeric must be string must match the type of the column i""n dataframe and be of type date, datetime or timenote should be either str or list, got numeric missing_ranges value given for non numeric variable %s' (ordinal path must be either str or bytespyreadstat._readstat_parserpyreadstat/_readstat_writer.pyxpyreadstat.datetimepyreadstat.narwhals.stable.v2pyreadstat.numpypyreadstat.ospyreadstat.syspyreadstat.warnings' starts with an illegal (non-alphabetic) character: 'the destination folder unknown file formatutf-8variable name 'variable name '%s' contains a space, which is not allowedvariable names must be non-empty strings, not starting with numbersvariable_value_labels: type of Label variable_value_labels: type of Value variable_value_labels: value for key wrong writer formatBooleanCategoricalDateDatetimeDecimalEnumFloat32Float64Int128Int16Int32Int64Int8ObjectPyreadstatError__Pyx_PyDict_NextRefReadstatErrorStringTimeUInt128UInt16UInt32UInt64UInt8_asyncio.coroutinescastcatcenter__class_getitem__cline_in_tracebackclonecolumn_labelscolumnscombinecompressdatedatetimedatetime64daysdfdirnamedrop_nullsdst_pathdtadtypeeager_onlyencodeexpanduserfile_format_versionfile_labelfilterfrom_nativefsdecodefsencode__func__getget_categoriesget_native_namespacegetfilesystemencodinghiimplementation_is_coroutineis_inis_pandasis_polarsisalphaisdirisnaitemsiter_columnsiter_rowskeysleftlo__main__minmissing_rangesmissing_user_values__module__msname__name__narwhals.stable.v2nominalnotenpnsntnthnull_countnumpynwordinalospathpopporpyreadstat._readstat_writer__pyx_capi____qualname___readstat_parserreplacerightroundrow_compressrow_compressionsavscale__set_name__setdefaultstablesurrogateescapesystable_name__test__thentimetime_unittimestamptimezonetotal_secondstzinfounknownupperusutcv2valuesvariable_alignmentvariable_display_widthvariable_formatvariable_measurevariable_value_labelsversionwarnwarningswhenwith_columnswriter_entry_pointwriter_file_formatwriter_formatxxportzipPyObject *(PyObject *)\000PyObject *(PyObject *, PyObject *, PyObject *, int)""\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int)\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)\000\000Py_ssize_t (void const *, size_t, void *)\000char *(__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)\000double (__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *)\000int (PyObject *)\000int (PyObject *, PyObject *)\000int (PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int)\000int (PyObject *, PyObject *, int)\000int (int)\000void (int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *)\000filepath_to_bytes\000get_narwhals_column_types\000vectorized_convert_datetime_to_number\000vectorized_convert_date_to_number\000vectorized_convert_time_to_number\000write_bytes\000get_datetimelike_format_for_readstat\000convert_datetimelike_to_number\000open_file\000check_series_all_same_types\000run_write\000get_narwhals_str_series_max_length\000close_file\000initial_checksPyObject *\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000readstat_to_numpy_types\000sas_all_formats\000sas_date_formats\000sas_datetime_formats\000sas_origin\000sas_time_formats\000spss_all_formats\000spss_date_formats\000spss_datetime_formats\000spss_origin\000spss_time_formats\000stata_all_formats\000stata_date_formats\000stata_datetime_formats\000stata_origin\000stata_time_formats\320\000%\320%=\270Q\330\027\030\330\027\030\330\0272\3202B\320BV\320VW\330\0201\3201K\3101\330\020\021\330\020\021\330\020\021\330\020\021\360\010\000\005$\2401\330\004 \240\001\360\010\000\005\010\200~\220S\230\001\330""\010\035\230Q\330\010\036\230a\330\010\013\2109\220D\230\001\330\014\022\220/\240\021\240!\330\010\013\2101\330\014\"\240!\330\010\013\2101\330\014\036\230a\330\t\027\220s\230!\330\010\035\230Q\330\010\013\2108\2203\220a\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220T\230\024\230Q\330\014\"\240!\330\r\025\220T\230\023\230A\330\014\"\240!\340\014\022\220/\240\021\240!\330\010\017\210q\330\t\027\220s\230!\330\010\035\230Q\330\010\036\230a\330\t\027\220s\230!\330\010\035\230Q\340\010\016\210o\230Q\230a\340\004\r\210Q\210d\220*\320\0340\260\014\270A\330\010\035\230V\240<\320/F\320FV\320VW\330\010\034\320\0344\3204F\320FW\320WXvoid (readstat_error_t)\000check_exit_status"; + #else /* compression: none (6103 bytes) */ +const char* const bytes = "Column labels must be stringsCould not open file 'Non unique column names detected in the dataframe!NoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.). The file may be locked by another process or you may not have write permission.Unknown data format to insertUnknown pywriter variable formatVersion not supported) .?add_notealignment for variable and it must be str (not starting with numbers!)character missing_ranges value given for non character variable %scolumn_labels must be either list or dict!compress and row_compress cannot be both Truedataframe must be pandas or polars dataframedictionaries in missing_ranges must have the keys hi and lo does not exist! (errno 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.' for writing: in variable instead' is of type length of column labels must be the same as number of columnsmeasure for variable missing_ranges: hi and lo values must be both the same for string typemissing_ranges: hi and lo values must be both either of numeric or string typemissing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowedmissing_ranges: max 1 range value per variable allowedmissing_ranges: max 3 discrete numeric values per variable allowedmissing_ranges: max 3 string values per variable allowedmissing_ranges: string values length must not be larger than 8missing_ranges: values in dictionary must be listmissing_ranges: values must be both either of numeric or string typemissing_user_values not allowed for character variable %smissing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s insteadmissing_user_values: values in dictionary must be list must be boolean or be 1 or 0 must be dict, got must be either nominal, ordinal, scale or unknown got mus""t be either right, center, left or unknown got must be int must be numeric must be string must match the type of the column in dataframe and be of type date, datetime or timenote should be either str or list, got numeric missing_ranges value given for non numeric variable %s' (ordinal path must be either str or bytespyreadstat._readstat_parserpyreadstat/_readstat_writer.pyxpyreadstat.datetimepyreadstat.narwhals.stable.v2pyreadstat.numpypyreadstat.ospyreadstat.syspyreadstat.warnings' starts with an illegal (neither alphabetic nor an underscore) character: 'the destination folder unknown file formatutf-8variable name 'variable name '%s' contains a space, which is not allowedvariable names must be non-empty strings, not starting with numbersvariable_value_labels: type of Label variable_value_labels: type of Value variable_value_labels: value for key wrong writer format_BooleanCategoricalDateDatetimeDecimalEnumFloat32Float64Int128Int16Int32Int64Int8ObjectPyreadstatError__Pyx_PyDict_NextRefReadstatErrorStringTimeUInt128UInt16UInt32UInt64UInt8asyncio.coroutinescastcatcenter__class_getitem__cline_in_tracebackclonecolumn_labelscolumnscombinecompressddatedatetimedatetime64daysdfdirnamedrop_nullsdst_pathdtadtypeeager_onlyencodeexpanduserfile_format_versionfile_labelfilterfrom_nativefsdecodefsencode__func__getget_categoriesget_native_namespacegetfilesystemencodinghiimplementation_is_coroutineis_inis_pandasis_polarsisalphaisdirisnaitemsiter_columnsiter_rowskeysleftlo__main__minmissing_rangesmissing_user_values__module__msname__name__narwhals.stable.v2nominalnotenpnsntnthnull_countnumpynwordinalospathpopporpyreadstat._readstat_writer__pyx_capi____qualname___readstat_parserreplacerightroundrow_compressrow_compressionsavscale__set_name__setdefaultstablestrerrorsurrogateescapesystable_name__test__thentimetime_unittimestamptimezonetotal_secondstzinfounknownupperusutcv2valuesvariable_alignmentvariable_display_widthvariable_formatvariable_measurevariable_value_labelsversionwarnwarnin""gswhenwith_columnswriter_entry_pointwriter_file_formatwriter_formatxxportzipPyObject *(PyObject *)\000PyObject *(PyObject *, PyObject *, PyObject *, int)\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int)\000PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)\000\000Py_ssize_t (void const *, size_t, void *)\000char *(__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)\000double (__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *)\000int (PyObject *)\000int (PyObject *, PyObject *)\000int (PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int)\000int (PyObject *, PyObject *, int)\000int (int)\000void (int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *)\000filepath_to_bytes\000get_narwhals_column_types\000vectorized_convert_datetime_to_number\000vectorized_convert_date_to_number\000vectorized_convert_time_to_number\000write_bytes\000get_datetimelike_format_for_readstat\000convert_datetimelike_to_number\000open_file\000check_series_all_same_types\000run_write\000get_narwhals_str_series_max_length\000close_file\000initial_checksPyObject *\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000readstat_to_numpy_types\000sas_all_formats\000sas_date_formats\000sas_datetime_formats\000sas_origin\000sas_time_formats\000spss_all_formats\000spss_date_formats\000spss_datetime_formats\000spss_origin\000spss_time_formats\000stata_all_formats\000stata_date_formats\000stata_datetime_formats\000stata_origin\000stata_time_formats\320\000%\320%=\270Q\330\027\030\330\027\030\330\0272\3202B\320BV\320V""W\330\0201\3201K\3101\330\020\021\330\020\021\330\020\021\330\020\021\360\010\000\005$\2401\330\004 \240\001\360\010\000\005\010\200~\220S\230\001\330\010\035\230Q\330\010\036\230a\330\010\013\2109\220D\230\001\330\014\022\220/\240\021\240!\330\010\013\2101\330\014\"\240!\330\010\013\2101\330\014\036\230a\330\t\027\220s\230!\330\010\035\230Q\330\010\013\2108\2203\220a\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220S\230\001\330\014\"\240!\330\r\025\220T\230\024\230Q\330\014\"\240!\330\r\025\220T\230\023\230A\330\014\"\240!\340\014\022\220/\240\021\240!\330\010\017\210q\330\t\027\220s\230!\330\010\035\230Q\330\010\036\230a\330\t\027\220s\230!\330\010\035\230Q\340\010\016\210o\230Q\230a\340\004\r\210Q\210d\220*\320\0340\260\014\270A\330\010\035\230V\240<\320/F\320FV\320VW\330\010\034\320\0344\3204F\320FW\320WXvoid (readstat_error_t)\000check_exit_status"; PyObject *data = NULL; CYTHON_UNUSED_VAR(__Pyx_DecompressString); #endif PyObject **stringtab = __pyx_mstate->__pyx_string_tab; Py_ssize_t pos = 0; - for (int i = 0; i < 215; i++) { + for (int i = 0; i < 221; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); - if (likely(string) && i >= 70) PyUnicode_InternInPlace(&string); + if (likely(string) && i >= 74) PyUnicode_InternInPlace(&string); if (unlikely(!string)) { Py_XDECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) @@ -19531,7 +19594,7 @@ const char* const bytes = ")Column labels must be stringsNon unique column names stringtab[i] = string; pos += bytes_length; } - for (int i = 215; i < 219; i++) { + for (int i = 221; i < 225; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; @@ -19542,14 +19605,14 @@ const char* const bytes = ")Column labels must be stringsNon unique column names } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 219; i++) { + for (Py_ssize_t i = 0; i < 225; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { - PyObject **table = stringtab + 215; + PyObject **table = stringtab + 221; for (Py_ssize_t i=0; i<4; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #if PY_VERSION_HEX < 0x030E0000 @@ -19641,7 +19704,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {17, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 995}; + const __Pyx_PyCode_New_function_description descr = {17, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 992}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_dst_path, __pyx_mstate->__pyx_n_u_writer_format, __pyx_mstate->__pyx_n_u_file_label, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_table_name, __pyx_mstate->__pyx_n_u_column_labels, __pyx_mstate->__pyx_n_u_compress, __pyx_mstate->__pyx_n_u_row_compress, __pyx_mstate->__pyx_n_u_note, __pyx_mstate->__pyx_n_u_variable_value_labels, __pyx_mstate->__pyx_n_u_missing_ranges, __pyx_mstate->__pyx_n_u_variable_display_width, __pyx_mstate->__pyx_n_u_variable_measure, __pyx_mstate->__pyx_n_u_missing_user_values, __pyx_mstate->__pyx_n_u_variable_format, __pyx_mstate->__pyx_n_u_variable_alignment, __pyx_mstate->__pyx_n_u_file_format_version, __pyx_mstate->__pyx_n_u_row_compression, __pyx_mstate->__pyx_n_u_writer_file_format}; __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_writer_pyx, __pyx_mstate->__pyx_n_u_writer_entry_point, __pyx_mstate->__pyx_kp_b_iso88591_Q_22BBVVW_11K1_1_S_Q_a_9D_1_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } @@ -21646,6 +21709,99 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif } +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (unlikely(!(is_unsigned || value == 0 || value > 0) || + !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { + PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); + return NULL; + } + if (width <= 1) { + return PyUnicode_FromOrdinal((int) value); + } + return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); +} +static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(int)*3+2]; + char *dpos, *end = digits + sizeof(int)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + int remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; + } + remaining = value; + last_one_off = 0; + dpos = end; + do { + int digit_pos; + switch (format_char) { + case 'o': + digit_pos = abs((int)(remaining % (8*8))); + remaining = (int) (remaining / (8*8)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); + last_one_off = (digit_pos < 8); + break; + case 'd': + digit_pos = abs((int)(remaining % (10*10))); + remaining = (int) (remaining / (10*10)); + dpos -= 2; + memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); + last_one_off = (digit_pos < 10); + break; + case 'x': + *(--dpos) = hex_digits[abs((int)(remaining % 16))]; + remaining = (int) (remaining / 16); + break; + default: + assert(0); + break; + } + } while (unlikely(remaining != 0)); + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; + ulength = length; + prepend_sign = 0; + if (!is_unsigned && value <= neg_one) { + if (padding_char == ' ' || width <= length + 1) { + *(--dpos) = '-'; + ++length; + } else { + prepend_sign = 1; + } + ++ulength; + } + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +} + /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { @@ -22813,7 +22969,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__4); + module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } diff --git a/pyreadstat/_readstat_writer.pyx b/pyreadstat/_readstat_writer.pyx index 4ab18db..06156c8 100644 --- a/pyreadstat/_readstat_writer.pyx +++ b/pyreadstat/_readstat_writer.pyx @@ -28,6 +28,7 @@ import numpy as np import narwhals.stable.v2 as nw from readstat_api cimport * +from libc.errno cimport errno from _readstat_parser import ReadstatError, PyreadstatError from _readstat_parser cimport check_exit_status @@ -596,6 +597,8 @@ cdef int open_file(bytes filename_bytes): return fd cdef int close_file(int fd): + if fd == -1: + return -1 if os.name == "nt": return _close(fd) else: @@ -758,6 +761,11 @@ cdef int run_write(df, object filename_path, dst_file_format file_format, str fi cdef int fd = open_file(filename_bytes) + if fd == -1: + raise PyreadstatError( + "Could not open file '%s' for writing: %s (errno %d). " + "The file may be locked by another process or you may not have write permission." + % (os.fsdecode(filename_bytes), os.strerror(errno), errno)) writer = readstat_writer_init() try: diff --git a/setup.py b/setup.py index bc9434a..bc9ec8e 100644 --- a/setup.py +++ b/setup.py @@ -129,7 +129,7 @@ def is_conda(): setup( name='pyreadstat', - version='1.3.5', + version='1.3.6', description=short_description, author="Otto Fajardo", author_email="pleasecontactviagithub@notvalid.com", diff --git a/tests/test_narwhalified.py b/tests/test_narwhalified.py index 3d9ec46..c8b0ef4 100644 --- a/tests/test_narwhalified.py +++ b/tests/test_narwhalified.py @@ -1361,6 +1361,37 @@ def test_sav_write_mixed_types(self): df2, meta = pyreadstat.read_sav(path, output_format=self.backend) self.assertTrue(df_ori.to_native().equals(df2)) + def test_write_sav_locked_file(self): + """Test that writing to a locked or unwritable file raises PyreadstatError, not a crash (issue #328).""" + from pyreadstat._readstat_parser import PyreadstatError + import stat + + df = nw.from_native(self.df_pandas).to_native() + path = os.path.join(self.write_folder, "locked_write_test.sav") + + if os.name == "nt": + import msvcrt + pyreadstat.write_sav(df, path) + f = open(path, "r+b") + msvcrt.locking(f.fileno(), msvcrt.LK_NBLCK, 1) + try: + with self.assertRaises(PyreadstatError): + pyreadstat.write_sav(df, path) + finally: + msvcrt.locking(f.fileno(), msvcrt.LK_UNLCK, 1) + f.close() + os.remove(path) + else: + pyreadstat.write_sav(df, path) + os.chmod(path, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) + try: + if os.getuid() != 0: + with self.assertRaises(PyreadstatError): + pyreadstat.write_sav(df, path) + finally: + os.chmod(path, stat.S_IRWXU) + os.remove(path) + def test_read_sav_file_handle(self): """Test reading SAV file from file-like object (e.g., zip archive)""" sav_file = os.path.join(self.basic_data_folder, "sample.sav")