From 2cdebd11523cea5efb322dc4612b8efedd204a8a Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Tue, 3 Feb 2026 17:08:36 +0100 Subject: [PATCH 01/10] refactored pyreadstat.pyx to pyreadstat.py --- CITATION.cff | 2 +- change_log.md | 3 + docs/conf.py | 2 +- pyreadstat/__init__.py | 6 +- pyreadstat/_readstat_parser.c | 5835 +++-- pyreadstat/_readstat_parser.pyx | 55 + pyreadstat/_readstat_writer.c | 11455 ++++++--- pyreadstat/_readstat_writer.pyx | 55 + pyreadstat/_readstat_writer_pandas.pyx | 903 - pyreadstat/pyreadstat.c | 21836 ----------------- pyreadstat/pyreadstat.pxd | 18 - pyreadstat/{pyreadstat.pyx => pyreadstat.py} | 333 +- setup.py | 11 +- 13 files changed, 11206 insertions(+), 29308 deletions(-) delete mode 100644 pyreadstat/_readstat_writer_pandas.pyx delete mode 100644 pyreadstat/pyreadstat.c delete mode 100644 pyreadstat/pyreadstat.pxd rename pyreadstat/{pyreadstat.pyx => pyreadstat.py} (77%) diff --git a/CITATION.cff b/CITATION.cff index 3472b2c..ef8b5e1 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.3 +version: 1.3.4 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 b1b6182..49eb29e 100644 --- a/change_log.md +++ b/change_log.md @@ -1,3 +1,6 @@ +# 1.3.4 (github, pypi and conda 2026.xx.xx) +* Refactored pyreadstat.pyx to pyreadstat.py solves #299 + # 1.3.3 (github, pypi and conda 2026.01.23) * bumped narwhals requirement version to 2.10.1 * Added reading from file handles, solves #308 diff --git a/docs/conf.py b/docs/conf.py index b2207a8..0295c93 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.3' +release = '1.3.4' # -- General configuration --------------------------------------------------- diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index cda3853..10ddff5 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -14,13 +14,11 @@ # limitations under the License. # ############################################################################# -from .pyreadstat import read_sas7bdat, read_xport, read_dta, read_sav, read_por, read_sas7bcat +from .pyreadstat import read_sav, read_sas7bdat, read_xport, read_dta, read_sav, read_por, read_sas7bcat from .pyreadstat import write_sav, write_dta, write_xport, write_por -#from .pyreadstat import set_value_labels, set_catalog_to_sas -#from .pyreadstat import set_catalog_to_sas from .pyreadstat import read_file_in_chunks, read_file_multiprocessing from ._readstat_parser import ReadstatError, metadata_container from .pyfunctions import set_value_labels, set_catalog_to_sas -__version__ = "1.3.3" +__version__ = "1.3.4" diff --git a/pyreadstat/_readstat_parser.c b/pyreadstat/_readstat_parser.c index 8a7dbbc..85d745b 100644 --- a/pyreadstat/_readstat_parser.c +++ b/pyreadstat/_readstat_parser.c @@ -1719,7 +1719,7 @@ enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; -/* "pyreadstat/_readstat_parser.pyx":929 +/* "pyreadstat/_readstat_parser.pyx":931 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -2471,6 +2471,12 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { #endif } +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 @@ -2724,6 +2730,9 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_readstat_type_t(readstat_type_t value); +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value); @@ -2736,9 +2745,6 @@ static CYTHON_INLINE __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); - /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_char(char value); @@ -2940,6 +2946,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *, static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObject *, struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/ +static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format, __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension, PyObject *, int, int, PyObject *, int, int, long, long, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(readstat_value_t, int, struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *, void *); /*proto*/ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(char const *, void *); /*proto*/ @@ -2985,10 +2992,12 @@ static const char __pyx_k_all[] = "all"; static const char __pyx_k_col[] = "col"; static const char __pyx_k_d_2[] = "%d"; static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_dta[] = "dta"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_loc[] = "loc"; static const char __pyx_k_nan[] = "nan"; static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_por[] = "por"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_DATE[] = "DATE"; @@ -3040,6 +3049,7 @@ static const char __pyx_k_range[] = "range"; static const char __pyx_k_right[] = "right"; static const char __pyx_k_scale[] = "scale"; static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_xport[] = "xport"; static const char __pyx_k_ADATE8[] = "ADATE8"; static const char __pyx_k_DATE11[] = "DATE11"; static const char __pyx_k_DATE12[] = "DATE12"; @@ -3110,6 +3120,8 @@ static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_tcHH_MM[] = "%tcHH:MM"; static const char __pyx_k_tdD_m_Y[] = "%tdD_m_Y"; static const char __pyx_k_unknown[] = "unknown"; +static const char __pyx_k_usecols[] = "usecols"; +static const char __pyx_k_usernan[] = "usernan"; static const char __pyx_k_DATEAMPM[] = "DATEAMPM"; static const char __pyx_k_DATETIME[] = "DATETIME"; static const char __pyx_k_DDMMYYN6[] = "DDMMYYN6"; @@ -3128,13 +3140,20 @@ static const char __pyx_k_YMDHMS16[] = "YMDHMS16"; static const char __pyx_k_YMDHMS19[] = "YMDHMS19"; static const char __pyx_k_YMDHMS20[] = "YMDHMS20"; static const char __pyx_k_YYMMDD10[] = "YYMMDD10"; +static const char __pyx_k_add_note[] = "add_note"; static const char __pyx_k_datetime[] = "datetime"; +static const char __pyx_k_encoding[] = "encoding"; static const char __pyx_k_fsdecode[] = "fsdecode"; static const char __pyx_k_fsencode[] = "fsencode"; static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_metadata[] = "metadata"; +static const char __pyx_k_metaonly[] = "metaonly"; static const char __pyx_k_narwhals[] = "narwhals"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_sas7bcat[] = "sas7bcat"; +static const char __pyx_k_sas7bdat[] = "sas7bdat"; +static const char __pyx_k_sav_zsav[] = "sav/zsav"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_warnings[] = "warnings"; @@ -3156,6 +3175,7 @@ static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_row_limit[] = "row_limit"; static const char __pyx_k_time_unit[] = "time_unit"; static const char __pyx_k_to_native[] = "to_native"; static const char __pyx_k_DATETIME17[] = "DATETIME17"; @@ -3165,15 +3185,18 @@ static const char __pyx_k_DATETIME20[] = "DATETIME20"; static const char __pyx_k_DATETIME21[] = "DATETIME21"; static const char __pyx_k_DATETIME22[] = "DATETIME22"; static const char __pyx_k_YMDHMS19_2[] = "YMDHMS19.2"; +static const char __pyx_k_data_frame[] = "data_frame"; static const char __pyx_k_duplicated[] = "_duplicated"; static const char __pyx_k_expanduser[] = "expanduser"; static const char __pyx_k_file_label[] = "file_label"; static const char __pyx_k_from_epoch[] = "from_epoch"; +static const char __pyx_k_row_offset[] = "row_offset"; static const char __pyx_k_sas_origin[] = "sas_origin"; static const char __pyx_k_table_name[] = "table_name"; static const char __pyx_k_tcHH_MM_SS[] = "%tcHH:MM:SS"; static const char __pyx_k_OrderedDict[] = "OrderedDict"; static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_file_format[] = "file_format"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_number_rows[] = "number_rows"; static const char __pyx_k_spss_origin[] = "spss_origin"; @@ -3184,10 +3207,12 @@ static const char __pyx_k_column_names[] = "column_names"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_is_dichotomy[] = "is_dichotomy"; +static const char __pyx_k_metadataonly[] = "metadataonly"; static const char __pyx_k_stata_origin[] = "stata_origin"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_tdCCYY_NN_DD[] = "%tdCCYY-NN-DD"; static const char __pyx_k_undetermined[] = "undetermined"; +static const char __pyx_k_user_missing[] = "user_missing"; static const char __pyx_k_value_labels[] = "value_labels"; static const char __pyx_k_with_columns[] = "with_columns"; static const char __pyx_k_ReadstatError[] = "ReadstatError"; @@ -3196,15 +3221,19 @@ static const char __pyx_k_column_labels[] = "column_labels"; static const char __pyx_k_counted_value[] = "counted_value"; static const char __pyx_k_creation_time[] = "creation_time"; static const char __pyx_k_file_encoding[] = "file_encoding"; +static const char __pyx_k_filename_path[] = "filename_path"; static const char __pyx_k_fromtimestamp[] = "fromtimestamp"; static const char __pyx_k_output_format[] = "output_format"; +static const char __pyx_k_parser_format[] = "parser_format"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_variable_list[] = "variable_list"; static const char __pyx_k_data_container[] = "data_container"; +static const char __pyx_k_file_extension[] = "file_extension"; static const char __pyx_k_missing_ranges[] = "missing_ranges"; static const char __pyx_k_number_columns[] = "number_columns"; static const char __pyx_k_PyreadstatError[] = "PyreadstatError"; static const char __pyx_k_allowed_formats[] = "allowed_formats"; +static const char __pyx_k_dates_as_pandas[] = "dates_as_pandas"; static const char __pyx_k_sas_all_formats[] = "sas_all_formats"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_surrogateescape[] = "surrogateescape"; @@ -3220,13 +3249,18 @@ static const char __pyx_k_stata_all_formats[] = "stata_all_formats"; static const char __pyx_k_variable_to_label[] = "variable_to_label"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_extra_date_formats[] = "extra_date_formats"; +static const char __pyx_k_extra_time_formats[] = "extra_time_formats"; static const char __pyx_k_metadata_container[] = "metadata_container"; static const char __pyx_k_narwhals_stable_v2[] = "narwhals.stable.v2"; +static const char __pyx_k_parser_entry_point[] = "parser_entry_point"; static const char __pyx_k_stata_date_formats[] = "stata_date_formats"; static const char __pyx_k_stata_time_formats[] = "stata_time_formats"; static const char __pyx_k_variable_alignment[] = "variable_alignment"; static const char __pyx_k_Unknown_file_format[] = "Unknown file format"; +static const char __pyx_k_formats_as_category[] = "formats_as_category"; static const char __pyx_k_missing_user_values[] = "missing_user_values"; +static const char __pyx_k_wrong_parser_format[] = "wrong parser format"; static const char __pyx_k_get_native_namespace[] = "get_native_namespace"; static const char __pyx_k_sas_datetime_formats[] = "sas_datetime_formats"; static const char __pyx_k_File_0_does_not_exist[] = "File {0} does not exist!"; @@ -3235,22 +3269,29 @@ static const char __pyx_k_spss_datetime_formats[] = "spss_datetime_formats"; static const char __pyx_k_variable_value_labels[] = "variable_value_labels"; static const char __pyx_k_STRING_type_with_value[] = "STRING type with value '"; static const char __pyx_k_column_names_to_labels[] = "column_names_to_labels"; +static const char __pyx_k_extra_datetime_formats[] = "extra_datetime_formats"; +static const char __pyx_k_no_datetime_conversion[] = "no_datetime_conversion"; static const char __pyx_k_stata_datetime_formats[] = "stata_datetime_formats"; static const char __pyx_k_variable_display_width[] = "variable_display_width"; static const char __pyx_k_variable_storage_width[] = "variable_storage_width"; static const char __pyx_k_original_variable_types[] = "original_variable_types"; static const char __pyx_k_readstat_to_numpy_types[] = "readstat_to_numpy_types"; static const char __pyx_k_readstat_variable_types[] = "readstat_variable_types"; +static const char __pyx_k_dates_as_pandas_datetime[] = "dates_as_pandas_datetime"; static const char __pyx_k_with_date_type_in_column[] = "' with date type in column '"; static const char __pyx_k_metadata_container___init[] = "metadata_container.__init__"; +static const char __pyx_k_disable_datetime_conversion[] = "disable_datetime_conversion"; +static const char __pyx_k_formats_as_ordered_category[] = "formats_as_ordered_category"; static const char __pyx_k_pyreadstat__readstat_parser[] = "pyreadstat._readstat_parser"; static const char __pyx_k_A_Q_a_O1_Q_M_1_1_N_q_a_A_Q_O1[] = "\200A\330\010\014\320\014 \240\001\330\010\014\320\014!\240\021\330\010\014\320\014*\250!\330\010\014\320\014\035\230Q\330\010\014\320\014\036\230a\330\010\014\210O\2301\330\010\014\320\014)\250\021\330\010\014\320\014 \240\001\330\010\014\320\014%\240Q\330\010\014\210M\230\021\330\010\014\320\014+\2501\330\010\014\320\014+\2501\330\010\014\210N\230!\330\010\014\320\014\"\240!\330\010\014\320\014'\240q\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014&\240a\330\010\014\320\014$\240A\330\010\014\320\014\035\230Q\330\010\014\320\014!\240\021\330\010\014\210O\2301"; +static const char __pyx_k_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a[] = "\320\000&\240a\330\027+\2501\330\r'\320'J\320J]\320]p\320pq\330\r0\3200A\320AS\320Sk\320kl\330\r+\2501\360\014\000\005\010\200~\220S\230\001\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\340\010\016\210o\230Q\230a\340\004\031\230\021\330\004\007\200q\330\010\023\2201\340\004 \240\001\330\004\007\200q\330\010\032\230!\340\004\030\230\001\330\004\007\200q\330\010\022\220!\340\004'\240q\330\004\007\200q\330\010!\240\021\340\004\020\220\013\230>\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\340\004\013\210<\220q"; static const char __pyx_k_data_container___reduce_cython[] = "data_container.__reduce_cython__"; static const char __pyx_k_Just_defining_a_custom_exceptio[] = "\n Just defining a custom exception to raise when readstat gives an error return code.\n "; static const char __pyx_k_This_class_holds_metadata_we_wa[] = "\n This class holds metadata we want to give back to python\n "; static const char __pyx_k_pyreadstat__readstat_parser_pyx[] = "pyreadstat/_readstat_parser.pyx"; static const char __pyx_k_Failed_convert_C_to_python_value[] = "Failed convert C to python value"; static const char __pyx_k_Failed_to_read_number_of_variabl[] = "Failed to read number of variables"; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note 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."; static const char __pyx_k_You_requested_pandas_as_output_f[] = "You requested pandas as output_format but cannot import pandas"; static const char __pyx_k_You_requested_polars_as_output_f[] = "You requested polars as output_format but cannot import polars"; static const char __pyx_k_column_0_is_duplicated_renamed_t[] = "column '{0}' is duplicated, renamed to '{1}'"; @@ -3266,6 +3307,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_18metadata_container___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_parser_format, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, CYTHON_UNUSED PyObject *__pyx_v_formats_as_category, CYTHON_UNUSED PyObject *__pyx_v_formats_as_ordered_category, PyObject *__pyx_v_encoding, PyObject *__pyx_v_usecols, PyObject *__pyx_v_user_missing, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats); /* proto */ static PyObject *__pyx_tp_new_10pyreadstat_16_readstat_parser_data_container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ @@ -3319,8 +3361,8 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[2]; - PyObject *__pyx_codeobj_tab[3]; - PyObject *__pyx_string_tab[298]; + PyObject *__pyx_codeobj_tab[4]; + PyObject *__pyx_string_tab[331]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_100000; @@ -3434,231 +3476,264 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_MMDDYYS __pyx_string_tab[70] #define __pyx_n_u_MMDDYYS10 __pyx_string_tab[71] #define __pyx_kp_u_None __pyx_string_tab[72] -#define __pyx_n_u_Object __pyx_string_tab[73] -#define __pyx_n_u_OrderedDict __pyx_string_tab[74] -#define __pyx_n_u_PyreadstatError __pyx_string_tab[75] -#define __pyx_n_u_ReadstatError __pyx_string_tab[76] -#define __pyx_n_u_SDATE __pyx_string_tab[77] -#define __pyx_n_u_SDATE10 __pyx_string_tab[78] -#define __pyx_n_u_SDATE8 __pyx_string_tab[79] -#define __pyx_kp_u_STRING_type_with_value __pyx_string_tab[80] -#define __pyx_n_u_TIME __pyx_string_tab[81] -#define __pyx_kp_u_TIME11_2 __pyx_string_tab[82] -#define __pyx_n_u_TIME20 __pyx_string_tab[83] -#define __pyx_kp_u_TIME20_3 __pyx_string_tab[84] -#define __pyx_n_u_TIME5 __pyx_string_tab[85] -#define __pyx_n_u_TIME8 __pyx_string_tab[86] -#define __pyx_n_u_TIMEAMPM __pyx_string_tab[87] -#define __pyx_n_u_TOD __pyx_string_tab[88] -#define __pyx_kp_u_This_class_holds_metadata_we_wa __pyx_string_tab[89] -#define __pyx_n_u_TypeError __pyx_string_tab[90] -#define __pyx_n_u_UnicodeError __pyx_string_tab[91] -#define __pyx_kp_u_Unknown_file_format __pyx_string_tab[92] -#define __pyx_kp_u_Unkown_data_type __pyx_string_tab[93] -#define __pyx_n_u_WEEKDATE __pyx_string_tab[94] -#define __pyx_n_u_WEEKDATX __pyx_string_tab[95] -#define __pyx_n_u_YMDHMS16 __pyx_string_tab[96] -#define __pyx_n_u_YMDHMS19 __pyx_string_tab[97] -#define __pyx_kp_u_YMDHMS19_2 __pyx_string_tab[98] -#define __pyx_n_u_YMDHMS20 __pyx_string_tab[99] -#define __pyx_n_u_YYMMDD __pyx_string_tab[100] -#define __pyx_n_u_YYMMDD10 __pyx_string_tab[101] -#define __pyx_n_u_YYMMDDB __pyx_string_tab[102] -#define __pyx_n_u_YYMMDDD __pyx_string_tab[103] -#define __pyx_n_u_YYMMDDN __pyx_string_tab[104] -#define __pyx_n_u_YYMMDDP __pyx_string_tab[105] -#define __pyx_n_u_YYMMDDS __pyx_string_tab[106] -#define __pyx_kp_u_You_requested_pandas_as_output_f __pyx_string_tab[107] -#define __pyx_kp_u_You_requested_polars_as_output_f __pyx_string_tab[108] -#define __pyx_kp_u__2 __pyx_string_tab[109] -#define __pyx_kp_u__3 __pyx_string_tab[110] -#define __pyx_kp_u__4 __pyx_string_tab[111] -#define __pyx_n_u_all __pyx_string_tab[112] -#define __pyx_n_u_allowed_formats __pyx_string_tab[113] -#define __pyx_n_u_append __pyx_string_tab[114] -#define __pyx_n_u_astype __pyx_string_tab[115] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[116] -#define __pyx_n_u_backend __pyx_string_tab[117] -#define __pyx_n_u_center __pyx_string_tab[118] -#define __pyx_n_u_class_getitem __pyx_string_tab[119] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[120] -#define __pyx_n_u_col __pyx_string_tab[121] -#define __pyx_n_u_collections __pyx_string_tab[122] -#define __pyx_kp_u_column_0_is_duplicated_renamed_t __pyx_string_tab[123] -#define __pyx_n_u_column_labels __pyx_string_tab[124] -#define __pyx_n_u_column_names __pyx_string_tab[125] -#define __pyx_n_u_column_names_to_labels __pyx_string_tab[126] -#define __pyx_n_u_columns __pyx_string_tab[127] -#define __pyx_n_u_copy __pyx_string_tab[128] -#define __pyx_n_u_counted_value __pyx_string_tab[129] -#define __pyx_n_u_creation_time __pyx_string_tab[130] -#define __pyx_n_u_d __pyx_string_tab[131] -#define __pyx_kp_u_d_2 __pyx_string_tab[132] -#define __pyx_n_u_data_container __pyx_string_tab[133] -#define __pyx_n_u_data_container___reduce_cython __pyx_string_tab[134] -#define __pyx_n_u_data_container___setstate_cython __pyx_string_tab[135] -#define __pyx_n_u_date __pyx_string_tab[136] -#define __pyx_n_u_datetime __pyx_string_tab[137] -#define __pyx_n_u_dict __pyx_string_tab[138] -#define __pyx_kp_u_disable __pyx_string_tab[139] -#define __pyx_n_u_doc __pyx_string_tab[140] -#define __pyx_n_u_double __pyx_string_tab[141] -#define __pyx_n_u_dtype __pyx_string_tab[142] -#define __pyx_n_u_dtypes __pyx_string_tab[143] -#define __pyx_n_u_duplicated __pyx_string_tab[144] -#define __pyx_n_u_empty __pyx_string_tab[145] -#define __pyx_kp_u_enable __pyx_string_tab[146] -#define __pyx_n_u_encode __pyx_string_tab[147] -#define __pyx_n_u_enumerate __pyx_string_tab[148] -#define __pyx_n_u_expanduser __pyx_string_tab[149] -#define __pyx_n_u_extend __pyx_string_tab[150] -#define __pyx_n_u_file_encoding __pyx_string_tab[151] -#define __pyx_n_u_file_label __pyx_string_tab[152] -#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[153] -#define __pyx_n_u_fill __pyx_string_tab[154] -#define __pyx_n_u_float __pyx_string_tab[155] -#define __pyx_n_u_float64 __pyx_string_tab[156] -#define __pyx_n_u_format __pyx_string_tab[157] -#define __pyx_n_u_from_dict __pyx_string_tab[158] -#define __pyx_n_u_from_epoch __pyx_string_tab[159] -#define __pyx_n_u_fromtimestamp __pyx_string_tab[160] -#define __pyx_n_u_fsdecode __pyx_string_tab[161] -#define __pyx_n_u_fsencode __pyx_string_tab[162] -#define __pyx_n_u_func __pyx_string_tab[163] -#define __pyx_kp_u_gc __pyx_string_tab[164] -#define __pyx_n_u_get __pyx_string_tab[165] -#define __pyx_n_u_get_native_namespace __pyx_string_tab[166] -#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[167] -#define __pyx_n_u_getstate __pyx_string_tab[168] -#define __pyx_n_u_hi __pyx_string_tab[169] -#define __pyx_n_u_init __pyx_string_tab[170] -#define __pyx_n_u_initializing __pyx_string_tab[171] -#define __pyx_n_u_int16 __pyx_string_tab[172] -#define __pyx_n_u_int32 __pyx_string_tab[173] -#define __pyx_n_u_int64 __pyx_string_tab[174] -#define __pyx_n_u_int8 __pyx_string_tab[175] -#define __pyx_n_u_is_coroutine __pyx_string_tab[176] -#define __pyx_n_u_is_dichotomy __pyx_string_tab[177] -#define __pyx_kp_u_isenabled __pyx_string_tab[178] -#define __pyx_n_u_isfile __pyx_string_tab[179] -#define __pyx_n_u_items __pyx_string_tab[180] -#define __pyx_n_u_keys __pyx_string_tab[181] -#define __pyx_n_u_label __pyx_string_tab[182] -#define __pyx_n_u_left __pyx_string_tab[183] -#define __pyx_n_u_lo __pyx_string_tab[184] -#define __pyx_n_u_loc __pyx_string_tab[185] -#define __pyx_n_u_main __pyx_string_tab[186] -#define __pyx_n_u_metaclass __pyx_string_tab[187] -#define __pyx_n_u_metadata_container __pyx_string_tab[188] -#define __pyx_n_u_metadata_container___init __pyx_string_tab[189] -#define __pyx_n_u_missing_ranges __pyx_string_tab[190] -#define __pyx_n_u_missing_user_values __pyx_string_tab[191] -#define __pyx_n_u_modification_time __pyx_string_tab[192] -#define __pyx_n_u_module __pyx_string_tab[193] -#define __pyx_n_u_mr_sets __pyx_string_tab[194] -#define __pyx_n_u_mro_entries __pyx_string_tab[195] -#define __pyx_n_u_name __pyx_string_tab[196] -#define __pyx_n_u_name_2 __pyx_string_tab[197] -#define __pyx_n_u_nan __pyx_string_tab[198] -#define __pyx_n_u_narwhals __pyx_string_tab[199] -#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[200] -#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[201] -#define __pyx_n_u_nominal __pyx_string_tab[202] -#define __pyx_n_u_notes __pyx_string_tab[203] -#define __pyx_n_u_np __pyx_string_tab[204] -#define __pyx_n_u_nt __pyx_string_tab[205] -#define __pyx_n_u_number_columns __pyx_string_tab[206] -#define __pyx_n_u_number_rows __pyx_string_tab[207] -#define __pyx_n_u_numpy __pyx_string_tab[208] -#define __pyx_n_u_nw __pyx_string_tab[209] -#define __pyx_n_u_object __pyx_string_tab[210] -#define __pyx_n_u_ordinal __pyx_string_tab[211] -#define __pyx_n_u_original_variable_types __pyx_string_tab[212] -#define __pyx_n_u_os __pyx_string_tab[213] -#define __pyx_n_u_output_format __pyx_string_tab[214] -#define __pyx_kp_u_output_format_must_be_one_of_all __pyx_string_tab[215] -#define __pyx_n_u_pandas __pyx_string_tab[216] -#define __pyx_n_u_path __pyx_string_tab[217] -#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[218] -#define __pyx_kp_u_path_must_be_str_bytes_or_unicod __pyx_string_tab[219] -#define __pyx_n_u_polars __pyx_string_tab[220] -#define __pyx_n_u_pop __pyx_string_tab[221] -#define __pyx_n_u_prepare __pyx_string_tab[222] -#define __pyx_n_u_pyreadstat__readstat_parser __pyx_string_tab[223] -#define __pyx_kp_u_pyreadstat__readstat_parser_pyx __pyx_string_tab[224] -#define __pyx_n_u_pyx_capi __pyx_string_tab[225] -#define __pyx_n_u_pyx_state __pyx_string_tab[226] -#define __pyx_n_u_qualname __pyx_string_tab[227] -#define __pyx_n_u_range __pyx_string_tab[228] -#define __pyx_n_u_read __pyx_string_tab[229] -#define __pyx_n_u_readstat_to_numpy_types __pyx_string_tab[230] -#define __pyx_n_u_readstat_variable_types __pyx_string_tab[231] -#define __pyx_n_u_reduce __pyx_string_tab[232] -#define __pyx_n_u_reduce_cython __pyx_string_tab[233] -#define __pyx_n_u_reduce_ex __pyx_string_tab[234] -#define __pyx_n_u_right __pyx_string_tab[235] -#define __pyx_n_u_s __pyx_string_tab[236] -#define __pyx_n_u_sas_all_formats __pyx_string_tab[237] -#define __pyx_n_u_sas_date_formats __pyx_string_tab[238] -#define __pyx_n_u_sas_datetime_formats __pyx_string_tab[239] -#define __pyx_n_u_sas_origin __pyx_string_tab[240] -#define __pyx_n_u_sas_time_formats __pyx_string_tab[241] -#define __pyx_n_u_scale __pyx_string_tab[242] -#define __pyx_n_u_schema __pyx_string_tab[243] -#define __pyx_n_u_seek __pyx_string_tab[244] -#define __pyx_n_u_self __pyx_string_tab[245] -#define __pyx_n_u_set_name __pyx_string_tab[246] -#define __pyx_n_u_setstate __pyx_string_tab[247] -#define __pyx_n_u_setstate_cython __pyx_string_tab[248] -#define __pyx_n_u_spec __pyx_string_tab[249] -#define __pyx_n_u_spss_all_formats __pyx_string_tab[250] -#define __pyx_n_u_spss_date_formats __pyx_string_tab[251] -#define __pyx_n_u_spss_datetime_formats __pyx_string_tab[252] -#define __pyx_n_u_spss_origin __pyx_string_tab[253] -#define __pyx_n_u_spss_time_formats __pyx_string_tab[254] -#define __pyx_n_u_stable __pyx_string_tab[255] -#define __pyx_n_u_stata_all_formats __pyx_string_tab[256] -#define __pyx_n_u_stata_date_formats __pyx_string_tab[257] -#define __pyx_n_u_stata_datetime_formats __pyx_string_tab[258] -#define __pyx_n_u_stata_origin __pyx_string_tab[259] -#define __pyx_n_u_stata_time_formats __pyx_string_tab[260] -#define __pyx_n_u_string __pyx_string_tab[261] -#define __pyx_kp_u_stringsource __pyx_string_tab[262] -#define __pyx_n_u_surrogateescape __pyx_string_tab[263] -#define __pyx_n_u_sys __pyx_string_tab[264] -#define __pyx_kp_u_tC __pyx_string_tab[265] -#define __pyx_n_u_table_name __pyx_string_tab[266] -#define __pyx_kp_u_tc __pyx_string_tab[267] -#define __pyx_kp_u_tcHH_MM __pyx_string_tab[268] -#define __pyx_kp_u_tcHH_MM_SS __pyx_string_tab[269] -#define __pyx_kp_u_td __pyx_string_tab[270] -#define __pyx_kp_u_tdCCYY_NN_DD __pyx_string_tab[271] -#define __pyx_kp_u_tdD_m_Y __pyx_string_tab[272] -#define __pyx_n_u_tell __pyx_string_tab[273] -#define __pyx_n_u_test __pyx_string_tab[274] -#define __pyx_n_u_time __pyx_string_tab[275] -#define __pyx_n_u_time_unit __pyx_string_tab[276] -#define __pyx_n_u_to_datetime __pyx_string_tab[277] -#define __pyx_n_u_to_native __pyx_string_tab[278] -#define __pyx_n_u_tolist __pyx_string_tab[279] -#define __pyx_n_u_type __pyx_string_tab[280] -#define __pyx_n_u_undetermined __pyx_string_tab[281] -#define __pyx_n_u_unknown __pyx_string_tab[282] -#define __pyx_kp_u_utf_8 __pyx_string_tab[283] -#define __pyx_n_u_v2 __pyx_string_tab[284] -#define __pyx_n_u_value_labels __pyx_string_tab[285] -#define __pyx_n_u_variable_alignment __pyx_string_tab[286] -#define __pyx_n_u_variable_display_width __pyx_string_tab[287] -#define __pyx_n_u_variable_list __pyx_string_tab[288] -#define __pyx_n_u_variable_measure __pyx_string_tab[289] -#define __pyx_n_u_variable_storage_width __pyx_string_tab[290] -#define __pyx_n_u_variable_to_label __pyx_string_tab[291] -#define __pyx_n_u_variable_value_labels __pyx_string_tab[292] -#define __pyx_n_u_warn __pyx_string_tab[293] -#define __pyx_n_u_warnings __pyx_string_tab[294] -#define __pyx_n_u_with_columns __pyx_string_tab[295] -#define __pyx_kp_u_with_date_type_in_column __pyx_string_tab[296] -#define __pyx_n_u_zip __pyx_string_tab[297] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[73] +#define __pyx_n_u_Object __pyx_string_tab[74] +#define __pyx_n_u_OrderedDict __pyx_string_tab[75] +#define __pyx_n_u_PyreadstatError __pyx_string_tab[76] +#define __pyx_n_u_ReadstatError __pyx_string_tab[77] +#define __pyx_n_u_SDATE __pyx_string_tab[78] +#define __pyx_n_u_SDATE10 __pyx_string_tab[79] +#define __pyx_n_u_SDATE8 __pyx_string_tab[80] +#define __pyx_kp_u_STRING_type_with_value __pyx_string_tab[81] +#define __pyx_n_u_TIME __pyx_string_tab[82] +#define __pyx_kp_u_TIME11_2 __pyx_string_tab[83] +#define __pyx_n_u_TIME20 __pyx_string_tab[84] +#define __pyx_kp_u_TIME20_3 __pyx_string_tab[85] +#define __pyx_n_u_TIME5 __pyx_string_tab[86] +#define __pyx_n_u_TIME8 __pyx_string_tab[87] +#define __pyx_n_u_TIMEAMPM __pyx_string_tab[88] +#define __pyx_n_u_TOD __pyx_string_tab[89] +#define __pyx_kp_u_This_class_holds_metadata_we_wa __pyx_string_tab[90] +#define __pyx_n_u_TypeError __pyx_string_tab[91] +#define __pyx_n_u_UnicodeError __pyx_string_tab[92] +#define __pyx_kp_u_Unknown_file_format __pyx_string_tab[93] +#define __pyx_kp_u_Unkown_data_type __pyx_string_tab[94] +#define __pyx_n_u_WEEKDATE __pyx_string_tab[95] +#define __pyx_n_u_WEEKDATX __pyx_string_tab[96] +#define __pyx_n_u_YMDHMS16 __pyx_string_tab[97] +#define __pyx_n_u_YMDHMS19 __pyx_string_tab[98] +#define __pyx_kp_u_YMDHMS19_2 __pyx_string_tab[99] +#define __pyx_n_u_YMDHMS20 __pyx_string_tab[100] +#define __pyx_n_u_YYMMDD __pyx_string_tab[101] +#define __pyx_n_u_YYMMDD10 __pyx_string_tab[102] +#define __pyx_n_u_YYMMDDB __pyx_string_tab[103] +#define __pyx_n_u_YYMMDDD __pyx_string_tab[104] +#define __pyx_n_u_YYMMDDN __pyx_string_tab[105] +#define __pyx_n_u_YYMMDDP __pyx_string_tab[106] +#define __pyx_n_u_YYMMDDS __pyx_string_tab[107] +#define __pyx_kp_u_You_requested_pandas_as_output_f __pyx_string_tab[108] +#define __pyx_kp_u_You_requested_polars_as_output_f __pyx_string_tab[109] +#define __pyx_kp_u__2 __pyx_string_tab[110] +#define __pyx_kp_u__3 __pyx_string_tab[111] +#define __pyx_kp_u__4 __pyx_string_tab[112] +#define __pyx_kp_u_add_note __pyx_string_tab[113] +#define __pyx_n_u_all __pyx_string_tab[114] +#define __pyx_n_u_allowed_formats __pyx_string_tab[115] +#define __pyx_n_u_append __pyx_string_tab[116] +#define __pyx_n_u_astype __pyx_string_tab[117] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[118] +#define __pyx_n_u_backend __pyx_string_tab[119] +#define __pyx_n_u_center __pyx_string_tab[120] +#define __pyx_n_u_class_getitem __pyx_string_tab[121] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[122] +#define __pyx_n_u_col __pyx_string_tab[123] +#define __pyx_n_u_collections __pyx_string_tab[124] +#define __pyx_kp_u_column_0_is_duplicated_renamed_t __pyx_string_tab[125] +#define __pyx_n_u_column_labels __pyx_string_tab[126] +#define __pyx_n_u_column_names __pyx_string_tab[127] +#define __pyx_n_u_column_names_to_labels __pyx_string_tab[128] +#define __pyx_n_u_columns __pyx_string_tab[129] +#define __pyx_n_u_copy __pyx_string_tab[130] +#define __pyx_n_u_counted_value __pyx_string_tab[131] +#define __pyx_n_u_creation_time __pyx_string_tab[132] +#define __pyx_n_u_d __pyx_string_tab[133] +#define __pyx_kp_u_d_2 __pyx_string_tab[134] +#define __pyx_n_u_data_container __pyx_string_tab[135] +#define __pyx_n_u_data_container___reduce_cython __pyx_string_tab[136] +#define __pyx_n_u_data_container___setstate_cython __pyx_string_tab[137] +#define __pyx_n_u_data_frame __pyx_string_tab[138] +#define __pyx_n_u_date __pyx_string_tab[139] +#define __pyx_n_u_dates_as_pandas __pyx_string_tab[140] +#define __pyx_n_u_dates_as_pandas_datetime __pyx_string_tab[141] +#define __pyx_n_u_datetime __pyx_string_tab[142] +#define __pyx_n_u_dict __pyx_string_tab[143] +#define __pyx_kp_u_disable __pyx_string_tab[144] +#define __pyx_n_u_disable_datetime_conversion __pyx_string_tab[145] +#define __pyx_n_u_doc __pyx_string_tab[146] +#define __pyx_n_u_double __pyx_string_tab[147] +#define __pyx_n_u_dta __pyx_string_tab[148] +#define __pyx_n_u_dtype __pyx_string_tab[149] +#define __pyx_n_u_dtypes __pyx_string_tab[150] +#define __pyx_n_u_duplicated __pyx_string_tab[151] +#define __pyx_n_u_empty __pyx_string_tab[152] +#define __pyx_kp_u_enable __pyx_string_tab[153] +#define __pyx_n_u_encode __pyx_string_tab[154] +#define __pyx_n_u_encoding __pyx_string_tab[155] +#define __pyx_n_u_enumerate __pyx_string_tab[156] +#define __pyx_n_u_expanduser __pyx_string_tab[157] +#define __pyx_n_u_extend __pyx_string_tab[158] +#define __pyx_n_u_extra_date_formats __pyx_string_tab[159] +#define __pyx_n_u_extra_datetime_formats __pyx_string_tab[160] +#define __pyx_n_u_extra_time_formats __pyx_string_tab[161] +#define __pyx_n_u_file_encoding __pyx_string_tab[162] +#define __pyx_n_u_file_extension __pyx_string_tab[163] +#define __pyx_n_u_file_format __pyx_string_tab[164] +#define __pyx_n_u_file_label __pyx_string_tab[165] +#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[166] +#define __pyx_n_u_filename_path __pyx_string_tab[167] +#define __pyx_n_u_fill __pyx_string_tab[168] +#define __pyx_n_u_float __pyx_string_tab[169] +#define __pyx_n_u_float64 __pyx_string_tab[170] +#define __pyx_n_u_format __pyx_string_tab[171] +#define __pyx_n_u_formats_as_category __pyx_string_tab[172] +#define __pyx_n_u_formats_as_ordered_category __pyx_string_tab[173] +#define __pyx_n_u_from_dict __pyx_string_tab[174] +#define __pyx_n_u_from_epoch __pyx_string_tab[175] +#define __pyx_n_u_fromtimestamp __pyx_string_tab[176] +#define __pyx_n_u_fsdecode __pyx_string_tab[177] +#define __pyx_n_u_fsencode __pyx_string_tab[178] +#define __pyx_n_u_func __pyx_string_tab[179] +#define __pyx_kp_u_gc __pyx_string_tab[180] +#define __pyx_n_u_get __pyx_string_tab[181] +#define __pyx_n_u_get_native_namespace __pyx_string_tab[182] +#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[183] +#define __pyx_n_u_getstate __pyx_string_tab[184] +#define __pyx_n_u_hi __pyx_string_tab[185] +#define __pyx_n_u_init __pyx_string_tab[186] +#define __pyx_n_u_initializing __pyx_string_tab[187] +#define __pyx_n_u_int16 __pyx_string_tab[188] +#define __pyx_n_u_int32 __pyx_string_tab[189] +#define __pyx_n_u_int64 __pyx_string_tab[190] +#define __pyx_n_u_int8 __pyx_string_tab[191] +#define __pyx_n_u_is_coroutine __pyx_string_tab[192] +#define __pyx_n_u_is_dichotomy __pyx_string_tab[193] +#define __pyx_kp_u_isenabled __pyx_string_tab[194] +#define __pyx_n_u_isfile __pyx_string_tab[195] +#define __pyx_n_u_items __pyx_string_tab[196] +#define __pyx_n_u_keys __pyx_string_tab[197] +#define __pyx_n_u_label __pyx_string_tab[198] +#define __pyx_n_u_left __pyx_string_tab[199] +#define __pyx_n_u_lo __pyx_string_tab[200] +#define __pyx_n_u_loc __pyx_string_tab[201] +#define __pyx_n_u_main __pyx_string_tab[202] +#define __pyx_n_u_metaclass __pyx_string_tab[203] +#define __pyx_n_u_metadata __pyx_string_tab[204] +#define __pyx_n_u_metadata_container __pyx_string_tab[205] +#define __pyx_n_u_metadata_container___init __pyx_string_tab[206] +#define __pyx_n_u_metadataonly __pyx_string_tab[207] +#define __pyx_n_u_metaonly __pyx_string_tab[208] +#define __pyx_n_u_missing_ranges __pyx_string_tab[209] +#define __pyx_n_u_missing_user_values __pyx_string_tab[210] +#define __pyx_n_u_modification_time __pyx_string_tab[211] +#define __pyx_n_u_module __pyx_string_tab[212] +#define __pyx_n_u_mr_sets __pyx_string_tab[213] +#define __pyx_n_u_mro_entries __pyx_string_tab[214] +#define __pyx_n_u_name __pyx_string_tab[215] +#define __pyx_n_u_name_2 __pyx_string_tab[216] +#define __pyx_n_u_nan __pyx_string_tab[217] +#define __pyx_n_u_narwhals __pyx_string_tab[218] +#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[219] +#define __pyx_n_u_no_datetime_conversion __pyx_string_tab[220] +#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[221] +#define __pyx_n_u_nominal __pyx_string_tab[222] +#define __pyx_n_u_notes __pyx_string_tab[223] +#define __pyx_n_u_np __pyx_string_tab[224] +#define __pyx_n_u_nt __pyx_string_tab[225] +#define __pyx_n_u_number_columns __pyx_string_tab[226] +#define __pyx_n_u_number_rows __pyx_string_tab[227] +#define __pyx_n_u_numpy __pyx_string_tab[228] +#define __pyx_n_u_nw __pyx_string_tab[229] +#define __pyx_n_u_object __pyx_string_tab[230] +#define __pyx_n_u_ordinal __pyx_string_tab[231] +#define __pyx_n_u_original_variable_types __pyx_string_tab[232] +#define __pyx_n_u_os __pyx_string_tab[233] +#define __pyx_n_u_output_format __pyx_string_tab[234] +#define __pyx_kp_u_output_format_must_be_one_of_all __pyx_string_tab[235] +#define __pyx_n_u_pandas __pyx_string_tab[236] +#define __pyx_n_u_parser_entry_point __pyx_string_tab[237] +#define __pyx_n_u_parser_format __pyx_string_tab[238] +#define __pyx_n_u_path __pyx_string_tab[239] +#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[240] +#define __pyx_kp_u_path_must_be_str_bytes_or_unicod __pyx_string_tab[241] +#define __pyx_n_u_polars __pyx_string_tab[242] +#define __pyx_n_u_pop __pyx_string_tab[243] +#define __pyx_n_u_por __pyx_string_tab[244] +#define __pyx_n_u_prepare __pyx_string_tab[245] +#define __pyx_n_u_pyreadstat__readstat_parser __pyx_string_tab[246] +#define __pyx_kp_u_pyreadstat__readstat_parser_pyx __pyx_string_tab[247] +#define __pyx_n_u_pyx_capi __pyx_string_tab[248] +#define __pyx_n_u_pyx_state __pyx_string_tab[249] +#define __pyx_n_u_qualname __pyx_string_tab[250] +#define __pyx_n_u_range __pyx_string_tab[251] +#define __pyx_n_u_read __pyx_string_tab[252] +#define __pyx_n_u_readstat_to_numpy_types __pyx_string_tab[253] +#define __pyx_n_u_readstat_variable_types __pyx_string_tab[254] +#define __pyx_n_u_reduce __pyx_string_tab[255] +#define __pyx_n_u_reduce_cython __pyx_string_tab[256] +#define __pyx_n_u_reduce_ex __pyx_string_tab[257] +#define __pyx_n_u_right __pyx_string_tab[258] +#define __pyx_n_u_row_limit __pyx_string_tab[259] +#define __pyx_n_u_row_offset __pyx_string_tab[260] +#define __pyx_n_u_s __pyx_string_tab[261] +#define __pyx_n_u_sas7bcat __pyx_string_tab[262] +#define __pyx_n_u_sas7bdat __pyx_string_tab[263] +#define __pyx_n_u_sas_all_formats __pyx_string_tab[264] +#define __pyx_n_u_sas_date_formats __pyx_string_tab[265] +#define __pyx_n_u_sas_datetime_formats __pyx_string_tab[266] +#define __pyx_n_u_sas_origin __pyx_string_tab[267] +#define __pyx_n_u_sas_time_formats __pyx_string_tab[268] +#define __pyx_kp_u_sav_zsav __pyx_string_tab[269] +#define __pyx_n_u_scale __pyx_string_tab[270] +#define __pyx_n_u_schema __pyx_string_tab[271] +#define __pyx_n_u_seek __pyx_string_tab[272] +#define __pyx_n_u_self __pyx_string_tab[273] +#define __pyx_n_u_set_name __pyx_string_tab[274] +#define __pyx_n_u_setstate __pyx_string_tab[275] +#define __pyx_n_u_setstate_cython __pyx_string_tab[276] +#define __pyx_n_u_spec __pyx_string_tab[277] +#define __pyx_n_u_spss_all_formats __pyx_string_tab[278] +#define __pyx_n_u_spss_date_formats __pyx_string_tab[279] +#define __pyx_n_u_spss_datetime_formats __pyx_string_tab[280] +#define __pyx_n_u_spss_origin __pyx_string_tab[281] +#define __pyx_n_u_spss_time_formats __pyx_string_tab[282] +#define __pyx_n_u_stable __pyx_string_tab[283] +#define __pyx_n_u_stata_all_formats __pyx_string_tab[284] +#define __pyx_n_u_stata_date_formats __pyx_string_tab[285] +#define __pyx_n_u_stata_datetime_formats __pyx_string_tab[286] +#define __pyx_n_u_stata_origin __pyx_string_tab[287] +#define __pyx_n_u_stata_time_formats __pyx_string_tab[288] +#define __pyx_n_u_string __pyx_string_tab[289] +#define __pyx_kp_u_stringsource __pyx_string_tab[290] +#define __pyx_n_u_surrogateescape __pyx_string_tab[291] +#define __pyx_n_u_sys __pyx_string_tab[292] +#define __pyx_kp_u_tC __pyx_string_tab[293] +#define __pyx_n_u_table_name __pyx_string_tab[294] +#define __pyx_kp_u_tc __pyx_string_tab[295] +#define __pyx_kp_u_tcHH_MM __pyx_string_tab[296] +#define __pyx_kp_u_tcHH_MM_SS __pyx_string_tab[297] +#define __pyx_kp_u_td __pyx_string_tab[298] +#define __pyx_kp_u_tdCCYY_NN_DD __pyx_string_tab[299] +#define __pyx_kp_u_tdD_m_Y __pyx_string_tab[300] +#define __pyx_n_u_tell __pyx_string_tab[301] +#define __pyx_n_u_test __pyx_string_tab[302] +#define __pyx_n_u_time __pyx_string_tab[303] +#define __pyx_n_u_time_unit __pyx_string_tab[304] +#define __pyx_n_u_to_datetime __pyx_string_tab[305] +#define __pyx_n_u_to_native __pyx_string_tab[306] +#define __pyx_n_u_tolist __pyx_string_tab[307] +#define __pyx_n_u_type __pyx_string_tab[308] +#define __pyx_n_u_undetermined __pyx_string_tab[309] +#define __pyx_n_u_unknown __pyx_string_tab[310] +#define __pyx_n_u_usecols __pyx_string_tab[311] +#define __pyx_n_u_user_missing __pyx_string_tab[312] +#define __pyx_n_u_usernan __pyx_string_tab[313] +#define __pyx_kp_u_utf_8 __pyx_string_tab[314] +#define __pyx_n_u_v2 __pyx_string_tab[315] +#define __pyx_n_u_value_labels __pyx_string_tab[316] +#define __pyx_n_u_variable_alignment __pyx_string_tab[317] +#define __pyx_n_u_variable_display_width __pyx_string_tab[318] +#define __pyx_n_u_variable_list __pyx_string_tab[319] +#define __pyx_n_u_variable_measure __pyx_string_tab[320] +#define __pyx_n_u_variable_storage_width __pyx_string_tab[321] +#define __pyx_n_u_variable_to_label __pyx_string_tab[322] +#define __pyx_n_u_variable_value_labels __pyx_string_tab[323] +#define __pyx_n_u_warn __pyx_string_tab[324] +#define __pyx_n_u_warnings __pyx_string_tab[325] +#define __pyx_n_u_with_columns __pyx_string_tab[326] +#define __pyx_kp_u_with_date_type_in_column __pyx_string_tab[327] +#define __pyx_kp_u_wrong_parser_format __pyx_string_tab[328] +#define __pyx_n_u_xport __pyx_string_tab[329] +#define __pyx_n_u_zip __pyx_string_tab[330] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3689,8 +3764,8 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<298; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<331; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_100000); @@ -3724,8 +3799,8 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_type_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<298; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<331; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_100000); @@ -5757,7 +5832,7 @@ static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":85 +/* "pyreadstat/_readstat_parser.pyx":87 * """ * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -5799,7 +5874,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "pyreadstat/_readstat_parser.pyx":86 + /* "pyreadstat/_readstat_parser.pyx":88 * * def __cinit__(self): * self.n_obs = 0 # <<<<<<<<<<<<<< @@ -5808,7 +5883,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->n_obs = 0; - /* "pyreadstat/_readstat_parser.pyx":87 + /* "pyreadstat/_readstat_parser.pyx":89 * def __cinit__(self): * self.n_obs = 0 * self.n_vars = 0 # <<<<<<<<<<<<<< @@ -5817,7 +5892,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->n_vars = 0; - /* "pyreadstat/_readstat_parser.pyx":88 + /* "pyreadstat/_readstat_parser.pyx":90 * self.n_obs = 0 * self.n_vars = 0 * self.max_n_obs = 0 # <<<<<<<<<<<<<< @@ -5826,14 +5901,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->max_n_obs = 0; - /* "pyreadstat/_readstat_parser.pyx":89 + /* "pyreadstat/_readstat_parser.pyx":91 * self.n_vars = 0 * self.max_n_obs = 0 * self.col_data = list() # <<<<<<<<<<<<<< * self.col_data_len = list() * self.col_names = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_data); @@ -5841,14 +5916,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":90 + /* "pyreadstat/_readstat_parser.pyx":92 * self.max_n_obs = 0 * self.col_data = list() * self.col_data_len = list() # <<<<<<<<<<<<<< * self.col_names = list() * self.col_labels = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_data_len); @@ -5856,14 +5931,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_data_len = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":91 + /* "pyreadstat/_readstat_parser.pyx":93 * self.col_data = list() * self.col_data_len = list() * self.col_names = list() # <<<<<<<<<<<<<< * self.col_labels = list() * self.col_dtypes = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_names); @@ -5871,14 +5946,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":92 + /* "pyreadstat/_readstat_parser.pyx":94 * self.col_data_len = list() * self.col_names = list() * self.col_labels = list() # <<<<<<<<<<<<<< * self.col_dtypes = list() * self.col_numpy_dtypes = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_labels); @@ -5886,14 +5961,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_labels = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":93 + /* "pyreadstat/_readstat_parser.pyx":95 * self.col_names = list() * self.col_labels = list() * self.col_dtypes = list() # <<<<<<<<<<<<<< * self.col_numpy_dtypes = list() * self.col_dtypes_isobject = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_dtypes); @@ -5901,14 +5976,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_dtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":94 + /* "pyreadstat/_readstat_parser.pyx":96 * self.col_labels = list() * self.col_dtypes = list() * self.col_numpy_dtypes = list() # <<<<<<<<<<<<<< * self.col_dtypes_isobject = list() * self.col_dytpes_isfloat = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_numpy_dtypes); @@ -5916,14 +5991,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_numpy_dtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":95 + /* "pyreadstat/_readstat_parser.pyx":97 * self.col_dtypes = list() * self.col_numpy_dtypes = list() * self.col_dtypes_isobject = list() # <<<<<<<<<<<<<< * self.col_dytpes_isfloat = list() * self.col_formats = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_dtypes_isobject); @@ -5931,14 +6006,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_dtypes_isobject = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":96 + /* "pyreadstat/_readstat_parser.pyx":98 * self.col_numpy_dtypes = list() * self.col_dtypes_isobject = list() * self.col_dytpes_isfloat = list() # <<<<<<<<<<<<<< * self.col_formats = list() * self.col_formats_original = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_dytpes_isfloat); @@ -5946,14 +6021,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_dytpes_isfloat = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":97 + /* "pyreadstat/_readstat_parser.pyx":99 * self.col_dtypes_isobject = list() * self.col_dytpes_isfloat = list() * self.col_formats = list() # <<<<<<<<<<<<<< * self.col_formats_original = list() * self.origin = None */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_formats); @@ -5961,14 +6036,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_formats = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":98 + /* "pyreadstat/_readstat_parser.pyx":100 * self.col_dytpes_isfloat = list() * self.col_formats = list() * self.col_formats_original = list() # <<<<<<<<<<<<<< * self.origin = None * self.unix_to_origin_secs = 0 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_formats_original); @@ -5976,7 +6051,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_formats_original = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":99 + /* "pyreadstat/_readstat_parser.pyx":101 * self.col_formats = list() * self.col_formats_original = list() * self.origin = None # <<<<<<<<<<<<<< @@ -5989,7 +6064,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->origin); __pyx_v_self->origin = Py_None; - /* "pyreadstat/_readstat_parser.pyx":100 + /* "pyreadstat/_readstat_parser.pyx":102 * self.col_formats_original = list() * self.origin = None * self.unix_to_origin_secs = 0 # <<<<<<<<<<<<<< @@ -5998,7 +6073,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->unix_to_origin_secs = 0.0; - /* "pyreadstat/_readstat_parser.pyx":101 + /* "pyreadstat/_readstat_parser.pyx":103 * self.origin = None * self.unix_to_origin_secs = 0 * self.is_unkown_number_rows = 0 # <<<<<<<<<<<<<< @@ -6007,7 +6082,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->is_unkown_number_rows = 0; - /* "pyreadstat/_readstat_parser.pyx":102 + /* "pyreadstat/_readstat_parser.pyx":104 * self.unix_to_origin_secs = 0 * self.is_unkown_number_rows = 0 * self.file_encoding = None # <<<<<<<<<<<<<< @@ -6020,7 +6095,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->file_encoding); __pyx_v_self->file_encoding = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":103 + /* "pyreadstat/_readstat_parser.pyx":105 * self.is_unkown_number_rows = 0 * self.file_encoding = None * self.file_label = None # <<<<<<<<<<<<<< @@ -6033,7 +6108,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->file_label); __pyx_v_self->file_label = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":104 + /* "pyreadstat/_readstat_parser.pyx":106 * self.file_encoding = None * self.file_label = None * self.metaonly = 0 # <<<<<<<<<<<<<< @@ -6042,7 +6117,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->metaonly = 0; - /* "pyreadstat/_readstat_parser.pyx":105 + /* "pyreadstat/_readstat_parser.pyx":107 * self.file_label = None * self.metaonly = 0 * self.dates_as_pandas = 0 # <<<<<<<<<<<<<< @@ -6051,14 +6126,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->dates_as_pandas = 0; - /* "pyreadstat/_readstat_parser.pyx":106 + /* "pyreadstat/_readstat_parser.pyx":108 * self.metaonly = 0 * self.dates_as_pandas = 0 * self.label_to_var_name = dict() # <<<<<<<<<<<<<< * self.labels_raw = dict() * self.notes = list() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->label_to_var_name); @@ -6066,14 +6141,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->label_to_var_name = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":107 + /* "pyreadstat/_readstat_parser.pyx":109 * self.dates_as_pandas = 0 * self.label_to_var_name = dict() * self.labels_raw = dict() # <<<<<<<<<<<<<< * self.notes = list() * self.user_encoding = None */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->labels_raw); @@ -6081,14 +6156,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->labels_raw = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":108 + /* "pyreadstat/_readstat_parser.pyx":110 * self.label_to_var_name = dict() * self.labels_raw = dict() * self.notes = list() # <<<<<<<<<<<<<< * self.user_encoding = None * self.table_name = None */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->notes); @@ -6096,7 +6171,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->notes = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":109 + /* "pyreadstat/_readstat_parser.pyx":111 * self.labels_raw = dict() * self.notes = list() * self.user_encoding = None # <<<<<<<<<<<<<< @@ -6109,7 +6184,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->user_encoding); __pyx_v_self->user_encoding = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":110 + /* "pyreadstat/_readstat_parser.pyx":112 * self.notes = list() * self.user_encoding = None * self.table_name = None # <<<<<<<<<<<<<< @@ -6122,7 +6197,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->table_name); __pyx_v_self->table_name = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":111 + /* "pyreadstat/_readstat_parser.pyx":113 * self.user_encoding = None * self.table_name = None * self.filter_cols = 0 # <<<<<<<<<<<<<< @@ -6131,14 +6206,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->filter_cols = 0; - /* "pyreadstat/_readstat_parser.pyx":112 + /* "pyreadstat/_readstat_parser.pyx":114 * self.table_name = None * self.filter_cols = 0 * self.use_cols = list() # <<<<<<<<<<<<<< * self.usernan = 0 * self.missing_ranges = dict() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->use_cols); @@ -6146,7 +6221,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->use_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":113 + /* "pyreadstat/_readstat_parser.pyx":115 * self.filter_cols = 0 * self.use_cols = list() * self.usernan = 0 # <<<<<<<<<<<<<< @@ -6155,14 +6230,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->usernan = 0; - /* "pyreadstat/_readstat_parser.pyx":114 + /* "pyreadstat/_readstat_parser.pyx":116 * self.use_cols = list() * self.usernan = 0 * self.missing_ranges = dict() # <<<<<<<<<<<<<< * self.missing_user_values = dict() * self.variable_storage_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->missing_ranges); @@ -6170,14 +6245,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->missing_ranges = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":115 + /* "pyreadstat/_readstat_parser.pyx":117 * self.usernan = 0 * self.missing_ranges = dict() * self.missing_user_values = dict() # <<<<<<<<<<<<<< * self.variable_storage_width = dict() * self.variable_display_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->missing_user_values); @@ -6185,14 +6260,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->missing_user_values = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":116 + /* "pyreadstat/_readstat_parser.pyx":118 * self.missing_ranges = dict() * self.missing_user_values = dict() * self.variable_storage_width = dict() # <<<<<<<<<<<<<< * self.variable_display_width = dict() * self.variable_alignment = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_storage_width); @@ -6200,14 +6275,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_storage_width = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":117 + /* "pyreadstat/_readstat_parser.pyx":119 * self.missing_user_values = dict() * self.variable_storage_width = dict() * self.variable_display_width = dict() # <<<<<<<<<<<<<< * self.variable_alignment = dict() * self.variable_measure = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_display_width); @@ -6215,14 +6290,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_display_width = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":118 + /* "pyreadstat/_readstat_parser.pyx":120 * self.variable_storage_width = dict() * self.variable_display_width = dict() * self.variable_alignment = dict() # <<<<<<<<<<<<<< * self.variable_measure = dict() * self.no_datetime_conversion = 0 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_alignment); @@ -6230,14 +6305,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_alignment = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":119 + /* "pyreadstat/_readstat_parser.pyx":121 * self.variable_display_width = dict() * self.variable_alignment = dict() * self.variable_measure = dict() # <<<<<<<<<<<<<< * self.no_datetime_conversion = 0 * self.ctime = 0 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_measure); @@ -6245,7 +6320,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_measure = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":120 + /* "pyreadstat/_readstat_parser.pyx":122 * self.variable_alignment = dict() * self.variable_measure = dict() * self.no_datetime_conversion = 0 # <<<<<<<<<<<<<< @@ -6254,7 +6329,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->no_datetime_conversion = 0; - /* "pyreadstat/_readstat_parser.pyx":121 + /* "pyreadstat/_readstat_parser.pyx":123 * self.variable_measure = dict() * self.no_datetime_conversion = 0 * self.ctime = 0 # <<<<<<<<<<<<<< @@ -6263,7 +6338,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->ctime = 0; - /* "pyreadstat/_readstat_parser.pyx":122 + /* "pyreadstat/_readstat_parser.pyx":124 * self.no_datetime_conversion = 0 * self.ctime = 0 * self.mtime = 0 # <<<<<<<<<<<<<< @@ -6272,14 +6347,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->mtime = 0; - /* "pyreadstat/_readstat_parser.pyx":123 + /* "pyreadstat/_readstat_parser.pyx":125 * self.ctime = 0 * self.mtime = 0 * self.mr_sets = dict() # <<<<<<<<<<<<<< * self.output_format = "" * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->mr_sets); @@ -6287,7 +6362,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->mr_sets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":124 + /* "pyreadstat/_readstat_parser.pyx":126 * self.mtime = 0 * self.mr_sets = dict() * self.output_format = "" # <<<<<<<<<<<<<< @@ -6300,7 +6375,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->output_format); __pyx_v_self->output_format = __pyx_mstate_global->__pyx_kp_u_; - /* "pyreadstat/_readstat_parser.pyx":85 + /* "pyreadstat/_readstat_parser.pyx":87 * """ * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -6524,7 +6599,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_4__se return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":130 +/* "pyreadstat/_readstat_parser.pyx":132 * This class holds metadata we want to give back to python * """ * def __init__(self): # <<<<<<<<<<<<<< @@ -6571,32 +6646,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,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, 130, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 132, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 130, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 132, __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, "__init__", 0) < 0) __PYX_ERR(0, 130, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 132, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 130, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 132, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 130, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 132, __pyx_L3_error) } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 130, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6626,253 +6701,253 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_18metadata_container__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "pyreadstat/_readstat_parser.pyx":131 + /* "pyreadstat/_readstat_parser.pyx":133 * """ * def __init__(self): * self.column_names = list() # <<<<<<<<<<<<<< * self.column_labels = list() * self.column_names_to_labels = dict() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_1) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":132 + /* "pyreadstat/_readstat_parser.pyx":134 * def __init__(self): * self.column_names = list() * self.column_labels = list() # <<<<<<<<<<<<<< * self.column_names_to_labels = dict() * self.file_encoding = None */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_1) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_1) < 0) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":133 + /* "pyreadstat/_readstat_parser.pyx":135 * self.column_names = list() * self.column_labels = list() * self.column_names_to_labels = dict() # <<<<<<<<<<<<<< * self.file_encoding = None * self.number_columns = None */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_1) < 0) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":134 + /* "pyreadstat/_readstat_parser.pyx":136 * self.column_labels = list() * self.column_names_to_labels = dict() * self.file_encoding = None # <<<<<<<<<<<<<< * self.number_columns = None * self.number_rows = None */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_file_encoding, Py_None) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_file_encoding, Py_None) < 0) __PYX_ERR(0, 136, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":135 + /* "pyreadstat/_readstat_parser.pyx":137 * self.column_names_to_labels = dict() * self.file_encoding = None * self.number_columns = None # <<<<<<<<<<<<<< * self.number_rows = None * self.variable_value_labels = dict() */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_number_columns, Py_None) < 0) __PYX_ERR(0, 135, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_number_columns, Py_None) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":136 + /* "pyreadstat/_readstat_parser.pyx":138 * self.file_encoding = None * self.number_columns = None * self.number_rows = None # <<<<<<<<<<<<<< * self.variable_value_labels = dict() * self.value_labels = dict() */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_number_rows, Py_None) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_number_rows, Py_None) < 0) __PYX_ERR(0, 138, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":137 + /* "pyreadstat/_readstat_parser.pyx":139 * self.number_columns = None * self.number_rows = None * self.variable_value_labels = dict() # <<<<<<<<<<<<<< * self.value_labels = dict() * self.variable_to_label = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_t_1) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":138 + /* "pyreadstat/_readstat_parser.pyx":140 * self.number_rows = None * self.variable_value_labels = dict() * self.value_labels = dict() # <<<<<<<<<<<<<< * self.variable_to_label = dict() * self.notes = list() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_t_1) < 0) __PYX_ERR(0, 138, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_t_1) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":139 + /* "pyreadstat/_readstat_parser.pyx":141 * self.variable_value_labels = dict() * self.value_labels = dict() * self.variable_to_label = dict() # <<<<<<<<<<<<<< * self.notes = list() * self.original_variable_types = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_t_1) < 0) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":140 + /* "pyreadstat/_readstat_parser.pyx":142 * self.value_labels = dict() * self.variable_to_label = dict() * self.notes = list() # <<<<<<<<<<<<<< * self.original_variable_types = dict() * self.readstat_variable_types = dict() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_1) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":141 + /* "pyreadstat/_readstat_parser.pyx":143 * self.variable_to_label = dict() * self.notes = list() * self.original_variable_types = dict() # <<<<<<<<<<<<<< * self.readstat_variable_types = dict() * self.table_name = None */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_t_1) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_t_1) < 0) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":142 + /* "pyreadstat/_readstat_parser.pyx":144 * self.notes = list() * self.original_variable_types = dict() * self.readstat_variable_types = dict() # <<<<<<<<<<<<<< * self.table_name = None * self.missing_ranges = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_t_1) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":143 + /* "pyreadstat/_readstat_parser.pyx":145 * self.original_variable_types = dict() * self.readstat_variable_types = dict() * self.table_name = None # <<<<<<<<<<<<<< * self.missing_ranges = dict() * self.missing_user_values = dict() */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_table_name, Py_None) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_table_name, Py_None) < 0) __PYX_ERR(0, 145, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":144 + /* "pyreadstat/_readstat_parser.pyx":146 * self.readstat_variable_types = dict() * self.table_name = None * self.missing_ranges = dict() # <<<<<<<<<<<<<< * self.missing_user_values = dict() * self.variable_storage_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_1) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_1) < 0) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":145 + /* "pyreadstat/_readstat_parser.pyx":147 * self.table_name = None * self.missing_ranges = dict() * self.missing_user_values = dict() # <<<<<<<<<<<<<< * self.variable_storage_width = dict() * self.variable_display_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_missing_user_values, __pyx_t_1) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_missing_user_values, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":146 + /* "pyreadstat/_readstat_parser.pyx":148 * self.missing_ranges = dict() * self.missing_user_values = dict() * self.variable_storage_width = dict() # <<<<<<<<<<<<<< * self.variable_display_width = dict() * self.variable_alignment = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_1) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":147 + /* "pyreadstat/_readstat_parser.pyx":149 * self.missing_user_values = dict() * self.variable_storage_width = dict() * self.variable_display_width = dict() # <<<<<<<<<<<<<< * self.variable_alignment = dict() * self.variable_measure = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_1) < 0) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":148 + /* "pyreadstat/_readstat_parser.pyx":150 * self.variable_storage_width = dict() * self.variable_display_width = dict() * self.variable_alignment = dict() # <<<<<<<<<<<<<< * self.variable_measure = dict() * self.creation_time = None */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_1) < 0) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":149 + /* "pyreadstat/_readstat_parser.pyx":151 * self.variable_display_width = dict() * self.variable_alignment = dict() * self.variable_measure = dict() # <<<<<<<<<<<<<< * self.creation_time = None * self.modification_time = None */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_1) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_1) < 0) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":150 + /* "pyreadstat/_readstat_parser.pyx":152 * self.variable_alignment = dict() * self.variable_measure = dict() * self.creation_time = None # <<<<<<<<<<<<<< * self.modification_time = None * self.mr_sets = dict() */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_creation_time, Py_None) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_creation_time, Py_None) < 0) __PYX_ERR(0, 152, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":151 + /* "pyreadstat/_readstat_parser.pyx":153 * self.variable_measure = dict() * self.creation_time = None * self.modification_time = None # <<<<<<<<<<<<<< * self.mr_sets = dict() * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_modification_time, Py_None) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_modification_time, Py_None) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":152 + /* "pyreadstat/_readstat_parser.pyx":154 * self.creation_time = None * self.modification_time = None * self.mr_sets = dict() # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_1) < 0) __PYX_ERR(0, 152, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_1) < 0) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":130 + /* "pyreadstat/_readstat_parser.pyx":132 * This class holds metadata we want to give back to python * """ * def __init__(self): # <<<<<<<<<<<<<< @@ -6893,7 +6968,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_18metadata_container__ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":168 +/* "pyreadstat/_readstat_parser.pyx":170 * * * cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): # <<<<<<<<<<<<<< @@ -6908,7 +6983,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "pyreadstat/_readstat_parser.pyx":172 + /* "pyreadstat/_readstat_parser.pyx":174 * Transforms a readstat var_format to a date, datetime or time format label * """ * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -6918,27 +6993,27 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":173 + /* "pyreadstat/_readstat_parser.pyx":175 * """ * if file_format == FILE_FORMAT_SAS: * if var_format in sas_all_formats: # <<<<<<<<<<<<<< * if var_format in sas_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":174 + /* "pyreadstat/_readstat_parser.pyx":176 * if file_format == FILE_FORMAT_SAS: * if var_format in sas_all_formats: * if var_format in sas_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format in sas_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":175 + /* "pyreadstat/_readstat_parser.pyx":177 * if var_format in sas_all_formats: * if var_format in sas_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -6948,7 +7023,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":174 + /* "pyreadstat/_readstat_parser.pyx":176 * if file_format == FILE_FORMAT_SAS: * if var_format in sas_all_formats: * if var_format in sas_date_formats: # <<<<<<<<<<<<<< @@ -6957,17 +7032,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":176 + /* "pyreadstat/_readstat_parser.pyx":178 * if var_format in sas_date_formats: * return DATE_FORMAT_DATE * elif var_format in sas_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":177 + /* "pyreadstat/_readstat_parser.pyx":179 * return DATE_FORMAT_DATE * elif var_format in sas_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -6977,7 +7052,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":176 + /* "pyreadstat/_readstat_parser.pyx":178 * if var_format in sas_date_formats: * return DATE_FORMAT_DATE * elif var_format in sas_datetime_formats: # <<<<<<<<<<<<<< @@ -6986,17 +7061,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":178 + /* "pyreadstat/_readstat_parser.pyx":180 * elif var_format in sas_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * else: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":179 + /* "pyreadstat/_readstat_parser.pyx":181 * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -7006,7 +7081,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":178 + /* "pyreadstat/_readstat_parser.pyx":180 * elif var_format in sas_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: # <<<<<<<<<<<<<< @@ -7015,7 +7090,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":173 + /* "pyreadstat/_readstat_parser.pyx":175 * """ * if file_format == FILE_FORMAT_SAS: * if var_format in sas_all_formats: # <<<<<<<<<<<<<< @@ -7025,7 +7100,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":181 + /* "pyreadstat/_readstat_parser.pyx":183 * return DATE_FORMAT_TIME * else: * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -7038,7 +7113,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":172 + /* "pyreadstat/_readstat_parser.pyx":174 * Transforms a readstat var_format to a date, datetime or time format label * """ * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -7048,27 +7123,27 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":184 + /* "pyreadstat/_readstat_parser.pyx":186 * * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: # <<<<<<<<<<<<<< * if var_format in spss_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":185 + /* "pyreadstat/_readstat_parser.pyx":187 * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: * if var_format in spss_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":186 + /* "pyreadstat/_readstat_parser.pyx":188 * if var_format in spss_all_formats: * if var_format in spss_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -7078,7 +7153,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":185 + /* "pyreadstat/_readstat_parser.pyx":187 * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: * if var_format in spss_date_formats: # <<<<<<<<<<<<<< @@ -7087,17 +7162,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":187 + /* "pyreadstat/_readstat_parser.pyx":189 * if var_format in spss_date_formats: * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":188 + /* "pyreadstat/_readstat_parser.pyx":190 * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -7107,7 +7182,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":187 + /* "pyreadstat/_readstat_parser.pyx":189 * if var_format in spss_date_formats: * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: # <<<<<<<<<<<<<< @@ -7116,17 +7191,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":189 + /* "pyreadstat/_readstat_parser.pyx":191 * elif var_format in spss_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * else: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":190 + /* "pyreadstat/_readstat_parser.pyx":192 * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -7136,7 +7211,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":189 + /* "pyreadstat/_readstat_parser.pyx":191 * elif var_format in spss_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: # <<<<<<<<<<<<<< @@ -7145,7 +7220,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":184 + /* "pyreadstat/_readstat_parser.pyx":186 * * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: # <<<<<<<<<<<<<< @@ -7155,7 +7230,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre goto __pyx_L5; } - /* "pyreadstat/_readstat_parser.pyx":192 + /* "pyreadstat/_readstat_parser.pyx":194 * return DATE_FORMAT_TIME * else: * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -7168,7 +7243,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre } __pyx_L5:; - /* "pyreadstat/_readstat_parser.pyx":183 + /* "pyreadstat/_readstat_parser.pyx":185 * return DATE_FORMAT_NOTADATE * * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7178,27 +7253,27 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":195 + /* "pyreadstat/_readstat_parser.pyx":197 * * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: # <<<<<<<<<<<<<< * if var_format in stata_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 197, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":196 + /* "pyreadstat/_readstat_parser.pyx":198 * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: * if var_format in stata_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":197 + /* "pyreadstat/_readstat_parser.pyx":199 * if var_format in stata_all_formats: * if var_format in stata_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -7208,7 +7283,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":196 + /* "pyreadstat/_readstat_parser.pyx":198 * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: * if var_format in stata_date_formats: # <<<<<<<<<<<<<< @@ -7217,17 +7292,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":198 + /* "pyreadstat/_readstat_parser.pyx":200 * if var_format in stata_date_formats: * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":199 + /* "pyreadstat/_readstat_parser.pyx":201 * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -7237,7 +7312,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":198 + /* "pyreadstat/_readstat_parser.pyx":200 * if var_format in stata_date_formats: * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: # <<<<<<<<<<<<<< @@ -7246,17 +7321,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":200 + /* "pyreadstat/_readstat_parser.pyx":202 * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * else: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":201 + /* "pyreadstat/_readstat_parser.pyx":203 * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -7266,7 +7341,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":200 + /* "pyreadstat/_readstat_parser.pyx":202 * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: # <<<<<<<<<<<<<< @@ -7275,7 +7350,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":195 + /* "pyreadstat/_readstat_parser.pyx":197 * * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: # <<<<<<<<<<<<<< @@ -7285,7 +7360,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre goto __pyx_L7; } - /* "pyreadstat/_readstat_parser.pyx":203 + /* "pyreadstat/_readstat_parser.pyx":205 * return DATE_FORMAT_TIME * else: * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -7298,7 +7373,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre } __pyx_L7:; - /* "pyreadstat/_readstat_parser.pyx":194 + /* "pyreadstat/_readstat_parser.pyx":196 * return DATE_FORMAT_NOTADATE * * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7309,7 +7384,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre default: break; } - /* "pyreadstat/_readstat_parser.pyx":168 + /* "pyreadstat/_readstat_parser.pyx":170 * * * cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): # <<<<<<<<<<<<<< @@ -7327,7 +7402,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":205 +/* "pyreadstat/_readstat_parser.pyx":207 * return DATE_FORMAT_NOTADATE * * cdef object transform_datetime(py_datetime_format var_format, double tstamp, py_file_format file_format, object origin, # <<<<<<<<<<<<<< @@ -7353,7 +7428,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transform_datetime", 0); - /* "pyreadstat/_readstat_parser.pyx":223 + /* "pyreadstat/_readstat_parser.pyx":225 * # for any other we return a python datetime, date or time object. * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -7363,17 +7438,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py switch (__pyx_v_var_format) { case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE: - /* "pyreadstat/_readstat_parser.pyx":224 + /* "pyreadstat/_readstat_parser.pyx":226 * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: * if output_format == "polars": # <<<<<<<<<<<<<< * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":226 + /* "pyreadstat/_readstat_parser.pyx":228 * if output_format == "polars": * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7383,7 +7458,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":228 + /* "pyreadstat/_readstat_parser.pyx":230 * if file_format == FILE_FORMAT_SPSS: * # tstamp is in seconds * return (tstamp - unix_to_origin_secs)/86400 # <<<<<<<<<<<<<< @@ -7391,13 +7466,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * # tstamp is in days */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs) / 86400.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs) / 86400.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":226 + /* "pyreadstat/_readstat_parser.pyx":228 * if output_format == "polars": * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7406,7 +7481,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":231 + /* "pyreadstat/_readstat_parser.pyx":233 * else: * # tstamp is in days * return tstamp - (unix_to_origin_secs/86400) # <<<<<<<<<<<<<< @@ -7415,14 +7490,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - (__pyx_v_unix_to_origin_secs / 86400.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - (__pyx_v_unix_to_origin_secs / 86400.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":224 + /* "pyreadstat/_readstat_parser.pyx":226 * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: * if output_format == "polars": # <<<<<<<<<<<<<< @@ -7431,7 +7506,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":233 + /* "pyreadstat/_readstat_parser.pyx":235 * return tstamp - (unix_to_origin_secs/86400) * * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7441,7 +7516,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":235 + /* "pyreadstat/_readstat_parser.pyx":237 * if file_format == FILE_FORMAT_SPSS: * # tstamp is in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7450,7 +7525,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":236 + /* "pyreadstat/_readstat_parser.pyx":238 * # tstamp is in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7459,19 +7534,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":237 + /* "pyreadstat/_readstat_parser.pyx":239 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * tdelta = timedelta_new(days, secs, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":233 + /* "pyreadstat/_readstat_parser.pyx":235 * return tstamp - (unix_to_origin_secs/86400) * * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7481,7 +7556,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L5; } - /* "pyreadstat/_readstat_parser.pyx":241 + /* "pyreadstat/_readstat_parser.pyx":243 * else: * # tstamp is in days * days = tstamp # <<<<<<<<<<<<<< @@ -7491,33 +7566,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)__pyx_v_tstamp); - /* "pyreadstat/_readstat_parser.pyx":242 + /* "pyreadstat/_readstat_parser.pyx":244 * # tstamp is in days * days = tstamp * tdelta = timedelta_new(days, 0, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L5:; - /* "pyreadstat/_readstat_parser.pyx":244 + /* "pyreadstat/_readstat_parser.pyx":246 * tdelta = timedelta_new(days, 0, 0) * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * if dates_as_pandas: * return mydat */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":245 + /* "pyreadstat/_readstat_parser.pyx":247 * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta * if dates_as_pandas: # <<<<<<<<<<<<<< @@ -7526,7 +7601,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ if (__pyx_v_dates_as_pandas) { - /* "pyreadstat/_readstat_parser.pyx":246 + /* "pyreadstat/_readstat_parser.pyx":248 * mydat = origin + tdelta * if dates_as_pandas: * return mydat # <<<<<<<<<<<<<< @@ -7538,7 +7613,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_r = __pyx_v_mydat; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":245 + /* "pyreadstat/_readstat_parser.pyx":247 * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta * if dates_as_pandas: # <<<<<<<<<<<<<< @@ -7547,7 +7622,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":248 + /* "pyreadstat/_readstat_parser.pyx":250 * return mydat * else: * return mydat.date() # <<<<<<<<<<<<<< @@ -7563,7 +7638,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_date, __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_2)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; @@ -7571,7 +7646,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":223 + /* "pyreadstat/_readstat_parser.pyx":225 * # for any other we return a python datetime, date or time object. * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -7581,17 +7656,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py break; case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME: - /* "pyreadstat/_readstat_parser.pyx":250 + /* "pyreadstat/_readstat_parser.pyx":252 * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: * if output_format == "polars": # <<<<<<<<<<<<<< * # we want to return seconds from unix * if file_format == FILE_FORMAT_STATA: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":252 + /* "pyreadstat/_readstat_parser.pyx":254 * if output_format == "polars": * # we want to return seconds from unix * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7601,7 +7676,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":254 + /* "pyreadstat/_readstat_parser.pyx":256 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * return (tstamp/1000) - unix_to_origin_secs # <<<<<<<<<<<<<< @@ -7609,13 +7684,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * # tstamp in seconds */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp / 1000.0) - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp / 1000.0) - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":252 + /* "pyreadstat/_readstat_parser.pyx":254 * if output_format == "polars": * # we want to return seconds from unix * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7624,7 +7699,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":257 + /* "pyreadstat/_readstat_parser.pyx":259 * else: * # tstamp in seconds * return tstamp - unix_to_origin_secs # <<<<<<<<<<<<<< @@ -7633,14 +7708,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":250 + /* "pyreadstat/_readstat_parser.pyx":252 * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: * if output_format == "polars": # <<<<<<<<<<<<<< @@ -7649,7 +7724,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":259 + /* "pyreadstat/_readstat_parser.pyx":261 * return tstamp - unix_to_origin_secs * * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7659,7 +7734,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":261 + /* "pyreadstat/_readstat_parser.pyx":263 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) # <<<<<<<<<<<<<< @@ -7668,7 +7743,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400000.0))); - /* "pyreadstat/_readstat_parser.pyx":262 + /* "pyreadstat/_readstat_parser.pyx":264 * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 # <<<<<<<<<<<<<< @@ -7677,7 +7752,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_msecs = __Pyx_mod_double(__pyx_v_tstamp, 86400000.0, 1); - /* "pyreadstat/_readstat_parser.pyx":263 + /* "pyreadstat/_readstat_parser.pyx":265 * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 * secs = (msecs/1000) # <<<<<<<<<<<<<< @@ -7686,7 +7761,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)(__pyx_v_msecs / 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":264 + /* "pyreadstat/_readstat_parser.pyx":266 * msecs = tstamp % 86400000 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) # <<<<<<<<<<<<<< @@ -7695,19 +7770,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_usecs = ((int)(__Pyx_mod_double(__pyx_v_msecs, 1000.0, 1) * 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":265 + /* "pyreadstat/_readstat_parser.pyx":267 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(milliseconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":259 + /* "pyreadstat/_readstat_parser.pyx":261 * return tstamp - unix_to_origin_secs * * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7717,7 +7792,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L9; } - /* "pyreadstat/_readstat_parser.pyx":269 + /* "pyreadstat/_readstat_parser.pyx":271 * else: * # tstamp in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7727,7 +7802,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":270 + /* "pyreadstat/_readstat_parser.pyx":272 * # tstamp in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7736,33 +7811,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":271 + /* "pyreadstat/_readstat_parser.pyx":273 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * tdelta = timedelta_new(days, secs, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L9:; - /* "pyreadstat/_readstat_parser.pyx":273 + /* "pyreadstat/_readstat_parser.pyx":275 * tdelta = timedelta_new(days, secs, 0) * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * return mydat * elif var_format == DATE_FORMAT_TIME: */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":274 + /* "pyreadstat/_readstat_parser.pyx":276 * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta * return mydat # <<<<<<<<<<<<<< @@ -7774,7 +7849,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_r = __pyx_v_mydat; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":249 + /* "pyreadstat/_readstat_parser.pyx":251 * else: * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -7784,7 +7859,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py break; case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME: - /* "pyreadstat/_readstat_parser.pyx":276 + /* "pyreadstat/_readstat_parser.pyx":278 * return mydat * elif var_format == DATE_FORMAT_TIME: * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7794,7 +7869,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":278 + /* "pyreadstat/_readstat_parser.pyx":280 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) # <<<<<<<<<<<<<< @@ -7803,7 +7878,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400000.0))); - /* "pyreadstat/_readstat_parser.pyx":279 + /* "pyreadstat/_readstat_parser.pyx":281 * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 # <<<<<<<<<<<<<< @@ -7812,7 +7887,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_msecs = __Pyx_mod_double(__pyx_v_tstamp, 86400000.0, 1); - /* "pyreadstat/_readstat_parser.pyx":280 + /* "pyreadstat/_readstat_parser.pyx":282 * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 * secs = (msecs/1000) # <<<<<<<<<<<<<< @@ -7821,7 +7896,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)(__pyx_v_msecs / 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":281 + /* "pyreadstat/_readstat_parser.pyx":283 * msecs = tstamp % 86400000 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) # <<<<<<<<<<<<<< @@ -7830,19 +7905,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_usecs = ((int)(__Pyx_mod_double(__pyx_v_msecs, 1000.0, 1) * 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":282 + /* "pyreadstat/_readstat_parser.pyx":284 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(milliseconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":276 + /* "pyreadstat/_readstat_parser.pyx":278 * return mydat * elif var_format == DATE_FORMAT_TIME: * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7852,7 +7927,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":286 + /* "pyreadstat/_readstat_parser.pyx":288 * else: * # tstamp in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7862,7 +7937,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":287 + /* "pyreadstat/_readstat_parser.pyx":289 * # tstamp in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7871,33 +7946,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":288 + /* "pyreadstat/_readstat_parser.pyx":290 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * tdelta = timedelta_new(days, secs, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":290 + /* "pyreadstat/_readstat_parser.pyx":292 * tdelta = timedelta_new(days, secs, 0) * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * return mydat.time() * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":291 + /* "pyreadstat/_readstat_parser.pyx":293 * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta * return mydat.time() # <<<<<<<<<<<<<< @@ -7912,14 +7987,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_time, __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_2)) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":275 + /* "pyreadstat/_readstat_parser.pyx":277 * mydat = origin + tdelta * return mydat * elif var_format == DATE_FORMAT_TIME: # <<<<<<<<<<<<<< @@ -7930,7 +8005,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py default: break; } - /* "pyreadstat/_readstat_parser.pyx":205 + /* "pyreadstat/_readstat_parser.pyx":207 * return DATE_FORMAT_NOTADATE * * cdef object transform_datetime(py_datetime_format var_format, double tstamp, py_file_format file_format, object origin, # <<<<<<<<<<<<<< @@ -7954,7 +8029,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":294 +/* "pyreadstat/_readstat_parser.pyx":296 * * * cdef object convert_readstat_to_python_value(readstat_value_t value, int index, data_container dc): # <<<<<<<<<<<<<< @@ -8003,7 +8078,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_readstat_to_python_value", 0); - /* "pyreadstat/_readstat_parser.pyx":322 + /* "pyreadstat/_readstat_parser.pyx":324 * cdef str output_format * * var_type = dc.col_dtypes[index] # <<<<<<<<<<<<<< @@ -8012,15 +8087,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ if (unlikely(__pyx_v_dc->col_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 322, __pyx_L1_error) + __PYX_ERR(0, 324, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_2 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_type = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":323 + /* "pyreadstat/_readstat_parser.pyx":325 * * var_type = dc.col_dtypes[index] * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -8029,15 +8104,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 323, __pyx_L1_error) + __PYX_ERR(0, 325, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_format = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":324 + /* "pyreadstat/_readstat_parser.pyx":326 * var_type = dc.col_dtypes[index] * var_format = dc.col_formats[index] * origin = dc.origin # <<<<<<<<<<<<<< @@ -8049,7 +8124,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_origin = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":325 + /* "pyreadstat/_readstat_parser.pyx":327 * var_format = dc.col_formats[index] * origin = dc.origin * unix_to_origin_secs = dc.unix_to_origin_secs # <<<<<<<<<<<<<< @@ -8059,7 +8134,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_4 = __pyx_v_dc->unix_to_origin_secs; __pyx_v_unix_to_origin_secs = __pyx_t_4; - /* "pyreadstat/_readstat_parser.pyx":326 + /* "pyreadstat/_readstat_parser.pyx":328 * origin = dc.origin * unix_to_origin_secs = dc.unix_to_origin_secs * dates_as_pandas = dc.dates_as_pandas # <<<<<<<<<<<<<< @@ -8069,7 +8144,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_5 = __pyx_v_dc->dates_as_pandas; __pyx_v_dates_as_pandas = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":327 + /* "pyreadstat/_readstat_parser.pyx":329 * unix_to_origin_secs = dc.unix_to_origin_secs * dates_as_pandas = dc.dates_as_pandas * file_format = dc.file_format # <<<<<<<<<<<<<< @@ -8079,7 +8154,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_6 = __pyx_v_dc->file_format; __pyx_v_file_format = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":328 + /* "pyreadstat/_readstat_parser.pyx":330 * dates_as_pandas = dc.dates_as_pandas * file_format = dc.file_format * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -8091,7 +8166,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":331 + /* "pyreadstat/_readstat_parser.pyx":333 * * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -8102,7 +8177,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt case READSTAT_TYPE_STRING: case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":332 + /* "pyreadstat/_readstat_parser.pyx":334 * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) # <<<<<<<<<<<<<< @@ -8111,7 +8186,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_str_value = readstat_string_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":333 + /* "pyreadstat/_readstat_parser.pyx":335 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * if c_str_value != NULL: # <<<<<<<<<<<<<< @@ -8121,14 +8196,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_5 = (__pyx_v_c_str_value != NULL); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":334 + /* "pyreadstat/_readstat_parser.pyx":336 * c_str_value = readstat_string_value(value) * if c_str_value != NULL: * py_str_value = c_str_value # <<<<<<<<<<<<<< * else: * py_str_value = '' */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -8136,7 +8211,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_py_str_value = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":333 + /* "pyreadstat/_readstat_parser.pyx":335 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * if c_str_value != NULL: # <<<<<<<<<<<<<< @@ -8146,7 +8221,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":336 + /* "pyreadstat/_readstat_parser.pyx":338 * py_str_value = c_str_value * else: * py_str_value = '' # <<<<<<<<<<<<<< @@ -8159,7 +8234,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":337 + /* "pyreadstat/_readstat_parser.pyx":339 * else: * py_str_value = '' * pyformat = VAR_FORMAT_STRING # <<<<<<<<<<<<<< @@ -8168,7 +8243,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING; - /* "pyreadstat/_readstat_parser.pyx":331 + /* "pyreadstat/_readstat_parser.pyx":333 * * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -8178,7 +8253,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":339 + /* "pyreadstat/_readstat_parser.pyx":341 * pyformat = VAR_FORMAT_STRING * elif var_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) # <<<<<<<<<<<<<< @@ -8187,7 +8262,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int8_value = readstat_int8_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":340 + /* "pyreadstat/_readstat_parser.pyx":342 * elif var_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value # <<<<<<<<<<<<<< @@ -8196,7 +8271,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int8_value); - /* "pyreadstat/_readstat_parser.pyx":341 + /* "pyreadstat/_readstat_parser.pyx":343 * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -8205,7 +8280,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":338 + /* "pyreadstat/_readstat_parser.pyx":340 * py_str_value = '' * pyformat = VAR_FORMAT_STRING * elif var_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -8215,7 +8290,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":343 + /* "pyreadstat/_readstat_parser.pyx":345 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) # <<<<<<<<<<<<<< @@ -8224,7 +8299,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int16_value = readstat_int16_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":344 + /* "pyreadstat/_readstat_parser.pyx":346 * elif var_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value # <<<<<<<<<<<<<< @@ -8233,7 +8308,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int16_value); - /* "pyreadstat/_readstat_parser.pyx":345 + /* "pyreadstat/_readstat_parser.pyx":347 * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -8242,7 +8317,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":342 + /* "pyreadstat/_readstat_parser.pyx":344 * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -8252,7 +8327,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":347 + /* "pyreadstat/_readstat_parser.pyx":349 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) # <<<<<<<<<<<<<< @@ -8261,7 +8336,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int32_value = readstat_int32_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":348 + /* "pyreadstat/_readstat_parser.pyx":350 * elif var_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value # <<<<<<<<<<<<<< @@ -8270,7 +8345,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int32_value); - /* "pyreadstat/_readstat_parser.pyx":349 + /* "pyreadstat/_readstat_parser.pyx":351 * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -8279,7 +8354,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":346 + /* "pyreadstat/_readstat_parser.pyx":348 * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -8289,7 +8364,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":351 + /* "pyreadstat/_readstat_parser.pyx":353 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) # <<<<<<<<<<<<<< @@ -8298,7 +8373,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_float_value = readstat_float_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":352 + /* "pyreadstat/_readstat_parser.pyx":354 * elif var_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) * py_float_value = c_float_value # <<<<<<<<<<<<<< @@ -8307,7 +8382,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_float_value = ((double)__pyx_v_c_float_value); - /* "pyreadstat/_readstat_parser.pyx":353 + /* "pyreadstat/_readstat_parser.pyx":355 * c_float_value = readstat_float_value(value) * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -8316,7 +8391,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":350 + /* "pyreadstat/_readstat_parser.pyx":352 * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -8326,7 +8401,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":355 + /* "pyreadstat/_readstat_parser.pyx":357 * pyformat = VAR_FORMAT_FLOAT * elif var_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); # <<<<<<<<<<<<<< @@ -8335,7 +8410,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_double_value = readstat_double_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":356 + /* "pyreadstat/_readstat_parser.pyx":358 * elif var_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); * py_float_value = c_double_value # <<<<<<<<<<<<<< @@ -8344,7 +8419,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_float_value = ((double)__pyx_v_c_double_value); - /* "pyreadstat/_readstat_parser.pyx":357 + /* "pyreadstat/_readstat_parser.pyx":359 * c_double_value = readstat_double_value(value); * py_float_value = c_double_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -8353,7 +8428,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":354 + /* "pyreadstat/_readstat_parser.pyx":356 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif var_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -8363,7 +8438,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; default: - /* "pyreadstat/_readstat_parser.pyx":359 + /* "pyreadstat/_readstat_parser.pyx":361 * pyformat = VAR_FORMAT_FLOAT * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -8371,7 +8446,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt * # final transformation and storage */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8390,16 +8465,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __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, 359, __pyx_L1_error) + __PYX_ERR(0, 361, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":363 + /* "pyreadstat/_readstat_parser.pyx":365 * # final transformation and storage * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -8409,7 +8484,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt switch (__pyx_v_pyformat) { case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING: - /* "pyreadstat/_readstat_parser.pyx":364 + /* "pyreadstat/_readstat_parser.pyx":366 * * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8426,18 +8501,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L5_bool_binop_done:; if (likely(__pyx_t_5)) { - /* "pyreadstat/_readstat_parser.pyx":365 + /* "pyreadstat/_readstat_parser.pyx":367 * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_str_value # <<<<<<<<<<<<<< * else: * #str_byte_val = py_str_value.encode("UTF-8") */ - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 365, __pyx_L1_error) } + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 367, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_py_str_value); __pyx_v_result = __pyx_v_py_str_value; - /* "pyreadstat/_readstat_parser.pyx":364 + /* "pyreadstat/_readstat_parser.pyx":366 * * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8447,7 +8522,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L4; } - /* "pyreadstat/_readstat_parser.pyx":368 + /* "pyreadstat/_readstat_parser.pyx":370 * else: * #str_byte_val = py_str_value.encode("UTF-8") * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) # <<<<<<<<<<<<<< @@ -8456,18 +8531,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ /*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, 368, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 368, __pyx_L1_error) } - __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_py_str_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 368, __pyx_L1_error) + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 370, __pyx_L1_error) } + __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_py_str_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 368, __pyx_L1_error) + __PYX_ERR(0, 370, __pyx_L1_error) } - __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_12), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_12), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_STRING_type_with_value; @@ -8476,7 +8551,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_14[3] = __pyx_t_13; __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_14, 5, 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13)); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 368, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -8498,16 +8573,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __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, 368, __pyx_L1_error) + __PYX_ERR(0, 370, __pyx_L1_error) } __pyx_L4:; - /* "pyreadstat/_readstat_parser.pyx":363 + /* "pyreadstat/_readstat_parser.pyx":365 * # final transformation and storage * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -8517,7 +8592,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG: - /* "pyreadstat/_readstat_parser.pyx":370 + /* "pyreadstat/_readstat_parser.pyx":372 * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8534,19 +8609,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L8_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":371 + /* "pyreadstat/_readstat_parser.pyx":373 * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_long_value # <<<<<<<<<<<<<< * else: * tstamp = py_long_value */ - __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_py_long_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_py_long_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":370 + /* "pyreadstat/_readstat_parser.pyx":372 * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8556,7 +8631,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L7; } - /* "pyreadstat/_readstat_parser.pyx":373 + /* "pyreadstat/_readstat_parser.pyx":375 * result = py_long_value * else: * tstamp = py_long_value # <<<<<<<<<<<<<< @@ -8566,21 +8641,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt /*else*/ { __pyx_v_tstamp = ((double)__pyx_v_py_long_value); - /* "pyreadstat/_readstat_parser.pyx":374 + /* "pyreadstat/_readstat_parser.pyx":376 * else: * tstamp = py_long_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L7:; - /* "pyreadstat/_readstat_parser.pyx":369 + /* "pyreadstat/_readstat_parser.pyx":371 * #str_byte_val = py_str_value.encode("UTF-8") * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: # <<<<<<<<<<<<<< @@ -8590,7 +8665,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":376 + /* "pyreadstat/_readstat_parser.pyx":378 * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8607,19 +8682,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L11_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":377 + /* "pyreadstat/_readstat_parser.pyx":379 * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_float_value # <<<<<<<<<<<<<< * else: * #tstamp = py_float_value */ - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":376 + /* "pyreadstat/_readstat_parser.pyx":378 * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8629,7 +8704,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":380 + /* "pyreadstat/_readstat_parser.pyx":382 * else: * #tstamp = py_float_value * tstamp = py_float_value # <<<<<<<<<<<<<< @@ -8639,21 +8714,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt /*else*/ { __pyx_v_tstamp = __pyx_v_py_float_value; - /* "pyreadstat/_readstat_parser.pyx":381 + /* "pyreadstat/_readstat_parser.pyx":383 * #tstamp = py_float_value * tstamp = py_float_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) # <<<<<<<<<<<<<< * #elif pyformat == VAR_FORMAT_MISSING: * # pass */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":375 + /* "pyreadstat/_readstat_parser.pyx":377 * tstamp = py_long_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: # <<<<<<<<<<<<<< @@ -8663,7 +8738,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; default: - /* "pyreadstat/_readstat_parser.pyx":385 + /* "pyreadstat/_readstat_parser.pyx":387 * # pass * else: * raise PyreadstatError("Failed convert C to python value") # <<<<<<<<<<<<<< @@ -8671,7 +8746,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt * return result */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8690,16 +8765,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __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, 385, __pyx_L1_error) + __PYX_ERR(0, 387, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":387 + /* "pyreadstat/_readstat_parser.pyx":389 * raise PyreadstatError("Failed convert C to python value") * * return result # <<<<<<<<<<<<<< @@ -8711,7 +8786,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":294 + /* "pyreadstat/_readstat_parser.pyx":296 * * * cdef object convert_readstat_to_python_value(readstat_value_t value, int index, data_container dc): # <<<<<<<<<<<<<< @@ -8739,7 +8814,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":390 +/* "pyreadstat/_readstat_parser.pyx":392 * * * cdef int handle_metadata(readstat_metadata_t *metadata, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8781,7 +8856,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_metadata", 0); - /* "pyreadstat/_readstat_parser.pyx":399 + /* "pyreadstat/_readstat_parser.pyx":401 * * cdef int var_count, obs_count, mr_len * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -8793,7 +8868,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":408 + /* "pyreadstat/_readstat_parser.pyx":410 * cdef int ctime * cdef int mtime * cdef int i = 0 # <<<<<<<<<<<<<< @@ -8802,31 +8877,31 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_i = 0; - /* "pyreadstat/_readstat_parser.pyx":410 + /* "pyreadstat/_readstat_parser.pyx":412 * cdef int i = 0 * cdef mr_set_t * mr_sets_orig * cdef dict mr_sets = {} # <<<<<<<<<<<<<< * cdef str name * cdef list variable_list = [] */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mr_sets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":412 + /* "pyreadstat/_readstat_parser.pyx":414 * cdef dict mr_sets = {} * cdef str name * cdef list variable_list = [] # <<<<<<<<<<<<<< * * metaonly = dc.metaonly */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":414 + /* "pyreadstat/_readstat_parser.pyx":416 * cdef list variable_list = [] * * metaonly = dc.metaonly # <<<<<<<<<<<<<< @@ -8836,7 +8911,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = __pyx_v_dc->metaonly; __pyx_v_metaonly = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":416 + /* "pyreadstat/_readstat_parser.pyx":418 * metaonly = dc.metaonly * * var_count = readstat_get_var_count(metadata) # <<<<<<<<<<<<<< @@ -8845,7 +8920,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_var_count = readstat_get_var_count(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":417 + /* "pyreadstat/_readstat_parser.pyx":419 * * var_count = readstat_get_var_count(metadata) * if var_count<0: # <<<<<<<<<<<<<< @@ -8855,7 +8930,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_var_count < 0); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":418 + /* "pyreadstat/_readstat_parser.pyx":420 * var_count = readstat_get_var_count(metadata) * if var_count<0: * raise PyreadstatError("Failed to read number of variables") # <<<<<<<<<<<<<< @@ -8863,7 +8938,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta * if obs_count <0: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -8882,14 +8957,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_1 = __Pyx_PyObject_FastCall(__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, 418, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __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, 418, __pyx_L1_error) + __PYX_ERR(0, 420, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":417 + /* "pyreadstat/_readstat_parser.pyx":419 * * var_count = readstat_get_var_count(metadata) * if var_count<0: # <<<<<<<<<<<<<< @@ -8898,7 +8973,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":419 + /* "pyreadstat/_readstat_parser.pyx":421 * if var_count<0: * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) # <<<<<<<<<<<<<< @@ -8907,7 +8982,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_obs_count = readstat_get_row_count(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":420 + /* "pyreadstat/_readstat_parser.pyx":422 * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) * if obs_count <0: # <<<<<<<<<<<<<< @@ -8917,7 +8992,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_obs_count < 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":422 + /* "pyreadstat/_readstat_parser.pyx":424 * if obs_count <0: * # if <0 it means the number of rows is not known, allocate 100 000 * obs_count = 100000 # <<<<<<<<<<<<<< @@ -8926,7 +9001,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_obs_count = 0x186A0; - /* "pyreadstat/_readstat_parser.pyx":423 + /* "pyreadstat/_readstat_parser.pyx":425 * # if <0 it means the number of rows is not known, allocate 100 000 * obs_count = 100000 * dc.is_unkown_number_rows = 1 # <<<<<<<<<<<<<< @@ -8935,7 +9010,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->is_unkown_number_rows = 1; - /* "pyreadstat/_readstat_parser.pyx":420 + /* "pyreadstat/_readstat_parser.pyx":422 * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) * if obs_count <0: # <<<<<<<<<<<<<< @@ -8944,7 +9019,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":425 + /* "pyreadstat/_readstat_parser.pyx":427 * dc.is_unkown_number_rows = 1 * * dc.n_obs = obs_count # <<<<<<<<<<<<<< @@ -8953,7 +9028,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->n_obs = __pyx_v_obs_count; - /* "pyreadstat/_readstat_parser.pyx":426 + /* "pyreadstat/_readstat_parser.pyx":428 * * dc.n_obs = obs_count * dc.n_vars = var_count # <<<<<<<<<<<<<< @@ -8962,7 +9037,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->n_vars = __pyx_v_var_count; - /* "pyreadstat/_readstat_parser.pyx":428 + /* "pyreadstat/_readstat_parser.pyx":430 * dc.n_vars = var_count * * mr_len = readstat_get_multiple_response_sets_length(metadata); # <<<<<<<<<<<<<< @@ -8971,7 +9046,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_mr_len = ((int)readstat_get_multiple_response_sets_length(__pyx_v_metadata)); - /* "pyreadstat/_readstat_parser.pyx":429 + /* "pyreadstat/_readstat_parser.pyx":431 * * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); # <<<<<<<<<<<<<< @@ -8980,7 +9055,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_mr_sets_orig = readstat_get_multiple_response_sets(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":430 + /* "pyreadstat/_readstat_parser.pyx":432 * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: # <<<<<<<<<<<<<< @@ -8990,7 +9065,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_mr_sets_orig != NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":431 + /* "pyreadstat/_readstat_parser.pyx":433 * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: * i = 0 # <<<<<<<<<<<<<< @@ -8999,7 +9074,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_i = 0; - /* "pyreadstat/_readstat_parser.pyx":432 + /* "pyreadstat/_readstat_parser.pyx":434 * if mr_sets_orig != NULL: * i = 0 * while i < mr_len: # <<<<<<<<<<<<<< @@ -9010,14 +9085,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_i < __pyx_v_mr_len); if (!__pyx_t_2) break; - /* "pyreadstat/_readstat_parser.pyx":433 + /* "pyreadstat/_readstat_parser.pyx":435 * i = 0 * while i < mr_len: * name = mr_sets_orig[i].name # <<<<<<<<<<<<<< * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): */ - __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -9025,19 +9100,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_XDECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":434 + /* "pyreadstat/_readstat_parser.pyx":436 * while i < mr_len: * name = mr_sets_orig[i].name * variable_list = [] # <<<<<<<<<<<<<< * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_variable_list, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":435 + /* "pyreadstat/_readstat_parser.pyx":437 * name = mr_sets_orig[i].name * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): # <<<<<<<<<<<<<< @@ -9049,50 +9124,50 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_j = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":436 + /* "pyreadstat/_readstat_parser.pyx":438 * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) # <<<<<<<<<<<<<< * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(((__pyx_v_mr_sets_orig[__pyx_v_i]).subvariables[__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(((__pyx_v_mr_sets_orig[__pyx_v_i]).subvariables[__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_variable_list, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_variable_list, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "pyreadstat/_readstat_parser.pyx":438 + /* "pyreadstat/_readstat_parser.pyx":440 * variable_list.append(mr_sets_orig[i].subvariables[j]) * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), # <<<<<<<<<<<<<< * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyUnicode_FromOrdinal((__pyx_v_mr_sets_orig[__pyx_v_i]).type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal((__pyx_v_mr_sets_orig[__pyx_v_i]).type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_1) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":439 + /* "pyreadstat/_readstat_parser.pyx":441 * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), # <<<<<<<<<<<<<< * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, */ - __pyx_t_1 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).is_dichotomy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).is_dichotomy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_dichotomy, __pyx_t_1) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_dichotomy, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":440 + /* "pyreadstat/_readstat_parser.pyx":442 * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, # <<<<<<<<<<<<<< @@ -9101,7 +9176,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_t_2 = ((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value != -1L); if (__pyx_t_2) { - __pyx_t_3 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; @@ -9109,41 +9184,41 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_counted_value, __pyx_t_1) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_counted_value, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":441 + /* "pyreadstat/_readstat_parser.pyx":443 * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, # <<<<<<<<<<<<<< * 'variable_list': variable_list * } */ - __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_t_1) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":442 + /* "pyreadstat/_readstat_parser.pyx":444 * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, * 'variable_list': variable_list # <<<<<<<<<<<<<< * } * i += 1 */ - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variable_list, __pyx_v_variable_list) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variable_list, __pyx_v_variable_list) < 0) __PYX_ERR(0, 440, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":437 + /* "pyreadstat/_readstat_parser.pyx":439 * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) * mr_sets[name] = { # <<<<<<<<<<<<<< * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), */ - if (unlikely((PyDict_SetItem(__pyx_v_mr_sets, __pyx_v_name, __pyx_t_4) < 0))) __PYX_ERR(0, 437, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_mr_sets, __pyx_v_name, __pyx_t_4) < 0))) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":444 + /* "pyreadstat/_readstat_parser.pyx":446 * 'variable_list': variable_list * } * i += 1 # <<<<<<<<<<<<<< @@ -9153,7 +9228,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_i = (__pyx_v_i + 1); } - /* "pyreadstat/_readstat_parser.pyx":445 + /* "pyreadstat/_readstat_parser.pyx":447 * } * i += 1 * dc.mr_sets = mr_sets # <<<<<<<<<<<<<< @@ -9166,7 +9241,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->mr_sets); __pyx_v_dc->mr_sets = __pyx_v_mr_sets; - /* "pyreadstat/_readstat_parser.pyx":430 + /* "pyreadstat/_readstat_parser.pyx":432 * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: # <<<<<<<<<<<<<< @@ -9175,22 +9250,22 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":447 + /* "pyreadstat/_readstat_parser.pyx":449 * dc.mr_sets = mr_sets * * dc.col_data_len = [obs_count] * var_count # <<<<<<<<<<<<<< * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count */ - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_4) != (0)) __PYX_ERR(0, 447, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_4) != (0)) __PYX_ERR(0, 449, __pyx_L1_error); } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9200,20 +9275,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_data_len = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":448 + /* "pyreadstat/_readstat_parser.pyx":450 * * dc.col_data_len = [obs_count] * var_count * dc.col_numpy_dtypes = [None] * var_count # <<<<<<<<<<<<<< * dc.col_dytpes_isfloat = [0] * var_count * dc.col_dtypes_isobject = [0] * var_count */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 448, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 450, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -9222,20 +9297,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_numpy_dtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":449 + /* "pyreadstat/_readstat_parser.pyx":451 * dc.col_data_len = [obs_count] * var_count * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count # <<<<<<<<<<<<<< * dc.col_dtypes_isobject = [0] * var_count * */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 449, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 451, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -9244,20 +9319,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_dytpes_isfloat = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":450 + /* "pyreadstat/_readstat_parser.pyx":452 * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count * dc.col_dtypes_isobject = [0] * var_count # <<<<<<<<<<<<<< * * # read other metadata */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 450, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 452, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -9266,7 +9341,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_dtypes_isobject = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":453 + /* "pyreadstat/_readstat_parser.pyx":455 * * # read other metadata * flabel_orig = readstat_get_file_label(metadata); # <<<<<<<<<<<<<< @@ -9275,7 +9350,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_flabel_orig = readstat_get_file_label(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":454 + /* "pyreadstat/_readstat_parser.pyx":456 * # read other metadata * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) # <<<<<<<<<<<<<< @@ -9284,7 +9359,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_fencoding_orig = readstat_get_file_encoding(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":455 + /* "pyreadstat/_readstat_parser.pyx":457 * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: # <<<<<<<<<<<<<< @@ -9302,14 +9377,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L11_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":456 + /* "pyreadstat/_readstat_parser.pyx":458 * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: * flabel = flabel_orig # <<<<<<<<<<<<<< * else: * flabel = None */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_flabel_orig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_flabel_orig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -9317,7 +9392,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_flabel = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":455 + /* "pyreadstat/_readstat_parser.pyx":457 * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: # <<<<<<<<<<<<<< @@ -9327,7 +9402,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":458 + /* "pyreadstat/_readstat_parser.pyx":460 * flabel = flabel_orig * else: * flabel = None # <<<<<<<<<<<<<< @@ -9340,7 +9415,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":459 + /* "pyreadstat/_readstat_parser.pyx":461 * else: * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: # <<<<<<<<<<<<<< @@ -9358,14 +9433,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L14_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":460 + /* "pyreadstat/_readstat_parser.pyx":462 * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: * fencoding = fencoding_orig # <<<<<<<<<<<<<< * else: * fencoding = None */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_fencoding_orig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_fencoding_orig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); @@ -9373,7 +9448,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_fencoding = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":459 + /* "pyreadstat/_readstat_parser.pyx":461 * else: * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: # <<<<<<<<<<<<<< @@ -9383,7 +9458,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":462 + /* "pyreadstat/_readstat_parser.pyx":464 * fencoding = fencoding_orig * else: * fencoding = None # <<<<<<<<<<<<<< @@ -9396,7 +9471,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta } __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":464 + /* "pyreadstat/_readstat_parser.pyx":466 * fencoding = None * * dc.file_encoding = fencoding # <<<<<<<<<<<<<< @@ -9409,7 +9484,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->file_encoding); __pyx_v_dc->file_encoding = __pyx_v_fencoding; - /* "pyreadstat/_readstat_parser.pyx":465 + /* "pyreadstat/_readstat_parser.pyx":467 * * dc.file_encoding = fencoding * dc.file_label = flabel # <<<<<<<<<<<<<< @@ -9422,7 +9497,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->file_label); __pyx_v_dc->file_label = __pyx_v_flabel; - /* "pyreadstat/_readstat_parser.pyx":467 + /* "pyreadstat/_readstat_parser.pyx":469 * dc.file_label = flabel * * table = readstat_get_table_name(metadata) # <<<<<<<<<<<<<< @@ -9431,7 +9506,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_table = readstat_get_table_name(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":468 + /* "pyreadstat/_readstat_parser.pyx":470 * * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: # <<<<<<<<<<<<<< @@ -9449,14 +9524,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L17_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":469 + /* "pyreadstat/_readstat_parser.pyx":471 * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: * dc.table_name = table # <<<<<<<<<<<<<< * * dc.ctime = readstat_get_creation_time(metadata) */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -9467,7 +9542,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->table_name = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":468 + /* "pyreadstat/_readstat_parser.pyx":470 * * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: # <<<<<<<<<<<<<< @@ -9476,7 +9551,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":471 + /* "pyreadstat/_readstat_parser.pyx":473 * dc.table_name = table * * dc.ctime = readstat_get_creation_time(metadata) # <<<<<<<<<<<<<< @@ -9485,7 +9560,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->ctime = readstat_get_creation_time(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":472 + /* "pyreadstat/_readstat_parser.pyx":474 * * dc.ctime = readstat_get_creation_time(metadata) * dc.mtime = readstat_get_modified_time(metadata) # <<<<<<<<<<<<<< @@ -9494,7 +9569,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->mtime = readstat_get_modified_time(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":474 + /* "pyreadstat/_readstat_parser.pyx":476 * dc.mtime = readstat_get_modified_time(metadata) * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -9504,7 +9579,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":390 + /* "pyreadstat/_readstat_parser.pyx":392 * * * cdef int handle_metadata(readstat_metadata_t *metadata, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -9530,7 +9605,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":476 +/* "pyreadstat/_readstat_parser.pyx":478 * return READSTAT_HANDLER_OK * * cdef int handle_variable(int index, readstat_variable_t *variable, # <<<<<<<<<<<<<< @@ -9593,7 +9668,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_variable", 0); - /* "pyreadstat/_readstat_parser.pyx":505 + /* "pyreadstat/_readstat_parser.pyx":507 * cdef int dupcolcnt * * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -9605,7 +9680,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":506 + /* "pyreadstat/_readstat_parser.pyx":508 * * cdef data_container dc = ctx * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -9617,7 +9692,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":509 + /* "pyreadstat/_readstat_parser.pyx":511 * * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) # <<<<<<<<<<<<<< @@ -9626,7 +9701,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_name = readstat_variable_get_name(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":510 + /* "pyreadstat/_readstat_parser.pyx":512 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -9636,7 +9711,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_name == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":511 + /* "pyreadstat/_readstat_parser.pyx":513 * var_name = readstat_variable_get_name(variable) * if var_name == NULL: * col_name = None # <<<<<<<<<<<<<< @@ -9646,7 +9721,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_name = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":510 + /* "pyreadstat/_readstat_parser.pyx":512 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -9656,7 +9731,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":513 + /* "pyreadstat/_readstat_parser.pyx":515 * col_name = None * else: * col_name = var_name # <<<<<<<<<<<<<< @@ -9664,7 +9739,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * # if the user introduced a list of columns to include, continue only if the column is in the list */ /*else*/ { - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); @@ -9674,7 +9749,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":516 + /* "pyreadstat/_readstat_parser.pyx":518 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -9686,12 +9761,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_v_dc->filter_cols; goto __pyx_L5_bool_binop_done; } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 518, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":517 + /* "pyreadstat/_readstat_parser.pyx":519 * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 # <<<<<<<<<<<<<< @@ -9700,7 +9775,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dc->n_vars = (__pyx_v_dc->n_vars - 1); - /* "pyreadstat/_readstat_parser.pyx":518 + /* "pyreadstat/_readstat_parser.pyx":520 * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 * return READSTAT_HANDLER_SKIP_VARIABLE # <<<<<<<<<<<<<< @@ -9710,7 +9785,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_r = READSTAT_HANDLER_SKIP_VARIABLE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":516 + /* "pyreadstat/_readstat_parser.pyx":518 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -9719,7 +9794,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":520 + /* "pyreadstat/_readstat_parser.pyx":522 * return READSTAT_HANDLER_SKIP_VARIABLE * * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< @@ -9728,17 +9803,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":522 + /* "pyreadstat/_readstat_parser.pyx":524 * index = readstat_variable_get_index_after_skipping(variable) * * if col_name in dc.col_names: # <<<<<<<<<<<<<< * dupcolcnt = 1 * while True: */ - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->col_names, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->col_names, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 524, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":523 + /* "pyreadstat/_readstat_parser.pyx":525 * * if col_name in dc.col_names: * dupcolcnt = 1 # <<<<<<<<<<<<<< @@ -9747,7 +9822,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dupcolcnt = 1; - /* "pyreadstat/_readstat_parser.pyx":524 + /* "pyreadstat/_readstat_parser.pyx":526 * if col_name in dc.col_names: * dupcolcnt = 1 * while True: # <<<<<<<<<<<<<< @@ -9756,28 +9831,28 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ while (1) { - /* "pyreadstat/_readstat_parser.pyx":525 + /* "pyreadstat/_readstat_parser.pyx":527 * dupcolcnt = 1 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) # <<<<<<<<<<<<<< * if newcolname in col_name: * dupcolcnt += 1 */ - __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_col_name, __pyx_mstate_global->__pyx_n_u_duplicated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_col_name, __pyx_mstate_global->__pyx_n_u_duplicated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dupcolcnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dupcolcnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_newcolname, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":526 + /* "pyreadstat/_readstat_parser.pyx":528 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: # <<<<<<<<<<<<<< @@ -9786,12 +9861,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_col_name == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 526, __pyx_L1_error) + __PYX_ERR(0, 528, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_newcolname, __pyx_v_col_name, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_newcolname, __pyx_v_col_name, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 528, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":527 + /* "pyreadstat/_readstat_parser.pyx":529 * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: * dupcolcnt += 1 # <<<<<<<<<<<<<< @@ -9800,7 +9875,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dupcolcnt = (__pyx_v_dupcolcnt + 1); - /* "pyreadstat/_readstat_parser.pyx":528 + /* "pyreadstat/_readstat_parser.pyx":530 * if newcolname in col_name: * dupcolcnt += 1 * continue # <<<<<<<<<<<<<< @@ -9809,7 +9884,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ goto __pyx_L8_continue; - /* "pyreadstat/_readstat_parser.pyx":526 + /* "pyreadstat/_readstat_parser.pyx":528 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: # <<<<<<<<<<<<<< @@ -9818,7 +9893,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":530 + /* "pyreadstat/_readstat_parser.pyx":532 * continue * else: * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) # <<<<<<<<<<<<<< @@ -9833,13 +9908,13 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_col_name, __pyx_v_newcolname}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":531 + /* "pyreadstat/_readstat_parser.pyx":533 * else: * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) * warnings.warn(msg) # <<<<<<<<<<<<<< @@ -9847,9 +9922,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * break */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = 1; @@ -9869,12 +9944,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":532 + /* "pyreadstat/_readstat_parser.pyx":534 * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) * warnings.warn(msg) * col_name = newcolname # <<<<<<<<<<<<<< @@ -9884,7 +9959,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_v_newcolname); __Pyx_DECREF_SET(__pyx_v_col_name, __pyx_v_newcolname); - /* "pyreadstat/_readstat_parser.pyx":533 + /* "pyreadstat/_readstat_parser.pyx":535 * warnings.warn(msg) * col_name = newcolname * break # <<<<<<<<<<<<<< @@ -9897,7 +9972,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L9_break:; - /* "pyreadstat/_readstat_parser.pyx":522 + /* "pyreadstat/_readstat_parser.pyx":524 * index = readstat_variable_get_index_after_skipping(variable) * * if col_name in dc.col_names: # <<<<<<<<<<<<<< @@ -9906,7 +9981,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":535 + /* "pyreadstat/_readstat_parser.pyx":537 * break * * dc.col_names.append(col_name) # <<<<<<<<<<<<<< @@ -9915,11 +9990,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 535, __pyx_L1_error) + __PYX_ERR(0, 537, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 537, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":538 + /* "pyreadstat/_readstat_parser.pyx":540 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -9929,14 +10004,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_val_labels != NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":539 + /* "pyreadstat/_readstat_parser.pyx":541 * # the name of the value label for the variable * if val_labels != NULL: * label_name = val_labels # <<<<<<<<<<<<<< * if label_name: * dc.label_to_var_name[col_name] = label_name */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -9944,7 +10019,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_label_name = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":540 + /* "pyreadstat/_readstat_parser.pyx":542 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< @@ -9952,19 +10027,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ __pyx_t_2 = (__pyx_v_label_name != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_label_name) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 540, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":541 + /* "pyreadstat/_readstat_parser.pyx":543 * label_name = val_labels * if label_name: * dc.label_to_var_name[col_name] = label_name # <<<<<<<<<<<<<< * * var_label = readstat_variable_get_label(variable) */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0))) __PYX_ERR(0, 543, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":540 + /* "pyreadstat/_readstat_parser.pyx":542 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< @@ -9973,7 +10048,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":538 + /* "pyreadstat/_readstat_parser.pyx":540 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -9982,7 +10057,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":543 + /* "pyreadstat/_readstat_parser.pyx":545 * dc.label_to_var_name[col_name] = label_name * * var_label = readstat_variable_get_label(variable) # <<<<<<<<<<<<<< @@ -9991,7 +10066,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_label = readstat_variable_get_label(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":544 + /* "pyreadstat/_readstat_parser.pyx":546 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< @@ -10001,7 +10076,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_label == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":545 + /* "pyreadstat/_readstat_parser.pyx":547 * var_label = readstat_variable_get_label(variable) * if var_label == NULL: * col_label = None # <<<<<<<<<<<<<< @@ -10011,7 +10086,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_label = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":544 + /* "pyreadstat/_readstat_parser.pyx":546 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< @@ -10021,7 +10096,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":547 + /* "pyreadstat/_readstat_parser.pyx":549 * col_label = None * else: * col_label = var_label # <<<<<<<<<<<<<< @@ -10029,7 +10104,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ /*else*/ { - __pyx_t_7 = __Pyx_PyUnicode_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); @@ -10039,7 +10114,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":548 + /* "pyreadstat/_readstat_parser.pyx":550 * else: * col_label = var_label * dc.col_labels.append(col_label) # <<<<<<<<<<<<<< @@ -10048,11 +10123,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 548, __pyx_L1_error) + __PYX_ERR(0, 550, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 550, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":551 + /* "pyreadstat/_readstat_parser.pyx":553 * * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) # <<<<<<<<<<<<<< @@ -10061,7 +10136,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_format = readstat_variable_get_format(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":552 + /* "pyreadstat/_readstat_parser.pyx":554 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< @@ -10071,7 +10146,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_format == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":554 + /* "pyreadstat/_readstat_parser.pyx":556 * if var_format == NULL: * #col_format_original = "NULL" * col_format_original = None # <<<<<<<<<<<<<< @@ -10081,7 +10156,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_format_original = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":552 + /* "pyreadstat/_readstat_parser.pyx":554 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< @@ -10091,7 +10166,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":556 + /* "pyreadstat/_readstat_parser.pyx":558 * col_format_original = None * else: * col_format_original = var_format # <<<<<<<<<<<<<< @@ -10099,7 +10174,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * dc.col_formats_original.append(col_format_original) */ /*else*/ { - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -10109,7 +10184,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L14:; - /* "pyreadstat/_readstat_parser.pyx":557 + /* "pyreadstat/_readstat_parser.pyx":559 * else: * col_format_original = var_format * file_format = dc.file_format # <<<<<<<<<<<<<< @@ -10119,7 +10194,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_9 = __pyx_v_dc->file_format; __pyx_v_file_format = __pyx_t_9; - /* "pyreadstat/_readstat_parser.pyx":558 + /* "pyreadstat/_readstat_parser.pyx":560 * col_format_original = var_format * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) # <<<<<<<<<<<<<< @@ -10128,21 +10203,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_formats_original == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 558, __pyx_L1_error) + __PYX_ERR(0, 560, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":559 + /* "pyreadstat/_readstat_parser.pyx":561 * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) * col_format_final = transform_variable_format(col_format_original, file_format) # <<<<<<<<<<<<<< * dc.col_formats.append(col_format_final) * # readstat type */ - __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(__pyx_v_col_format_original, __pyx_v_file_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(__pyx_v_col_format_original, __pyx_v_file_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L1_error) __pyx_v_col_format_final = __pyx_t_10; - /* "pyreadstat/_readstat_parser.pyx":560 + /* "pyreadstat/_readstat_parser.pyx":562 * dc.col_formats_original.append(col_format_original) * col_format_final = transform_variable_format(col_format_original, file_format) * dc.col_formats.append(col_format_final) # <<<<<<<<<<<<<< @@ -10151,14 +10226,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 560, __pyx_L1_error) + __PYX_ERR(0, 562, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":562 + /* "pyreadstat/_readstat_parser.pyx":564 * dc.col_formats.append(col_format_final) * # readstat type * var_type = readstat_variable_get_type(variable) # <<<<<<<<<<<<<< @@ -10167,7 +10242,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_type = readstat_variable_get_type(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":563 + /* "pyreadstat/_readstat_parser.pyx":565 * # readstat type * var_type = readstat_variable_get_type(variable) * dc.col_dtypes.append(var_type) # <<<<<<<<<<<<<< @@ -10176,14 +10251,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_dtypes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 563, __pyx_L1_error) + __PYX_ERR(0, 565, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":566 + /* "pyreadstat/_readstat_parser.pyx":568 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< @@ -10201,7 +10276,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_L16_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":567 + /* "pyreadstat/_readstat_parser.pyx":569 * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: * curnptype = object # <<<<<<<<<<<<<< @@ -10211,7 +10286,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_builtin_object); __pyx_v_curnptype = __pyx_builtin_object; - /* "pyreadstat/_readstat_parser.pyx":566 + /* "pyreadstat/_readstat_parser.pyx":568 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< @@ -10221,7 +10296,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L15; } - /* "pyreadstat/_readstat_parser.pyx":569 + /* "pyreadstat/_readstat_parser.pyx":571 * curnptype = object * else: * curnptype = readstat_to_numpy_types[var_type] # <<<<<<<<<<<<<< @@ -10231,11 +10306,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i /*else*/ { if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 569, __pyx_L1_error) + __PYX_ERR(0, 571, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_curnptype = __pyx_t_1; @@ -10243,7 +10318,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L15:; - /* "pyreadstat/_readstat_parser.pyx":570 + /* "pyreadstat/_readstat_parser.pyx":572 * else: * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 # <<<<<<<<<<<<<< @@ -10252,7 +10327,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 0; - /* "pyreadstat/_readstat_parser.pyx":571 + /* "pyreadstat/_readstat_parser.pyx":573 * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 * iscurnptypeobject = 0 # <<<<<<<<<<<<<< @@ -10261,7 +10336,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 0; - /* "pyreadstat/_readstat_parser.pyx":573 + /* "pyreadstat/_readstat_parser.pyx":575 * iscurnptypeobject = 0 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype # <<<<<<<<<<<<<< @@ -10270,23 +10345,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 573, __pyx_L1_error) + __PYX_ERR(0, 575, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 575, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":574 + /* "pyreadstat/_readstat_parser.pyx":576 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< * iscurnptypeobject = 1 * if curnptype == np.float64: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":575 + /* "pyreadstat/_readstat_parser.pyx":577 * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -10295,7 +10370,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":574 + /* "pyreadstat/_readstat_parser.pyx":576 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< @@ -10304,25 +10379,25 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":576 + /* "pyreadstat/_readstat_parser.pyx":578 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __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, 576, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":577 + /* "pyreadstat/_readstat_parser.pyx":579 * iscurnptypeobject = 1 * if curnptype == np.float64: * iscurnptypefloat = 1 # <<<<<<<<<<<<<< @@ -10331,7 +10406,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 1; - /* "pyreadstat/_readstat_parser.pyx":576 + /* "pyreadstat/_readstat_parser.pyx":578 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< @@ -10340,39 +10415,39 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":578 + /* "pyreadstat/_readstat_parser.pyx":580 * if curnptype == np.float64: * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject # <<<<<<<<<<<<<< * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 578, __pyx_L1_error) + __PYX_ERR(0, 580, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 578, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":579 + /* "pyreadstat/_readstat_parser.pyx":581 * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat # <<<<<<<<<<<<<< * metaonly = dc.metaonly * # pre-allocate data */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 579, __pyx_L1_error) + __PYX_ERR(0, 581, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":580 + /* "pyreadstat/_readstat_parser.pyx":582 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly # <<<<<<<<<<<<<< @@ -10382,7 +10457,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_v_dc->metaonly; __pyx_v_metaonly = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":582 + /* "pyreadstat/_readstat_parser.pyx":584 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< @@ -10391,17 +10466,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (__pyx_v_metaonly) { - /* "pyreadstat/_readstat_parser.pyx":583 + /* "pyreadstat/_readstat_parser.pyx":585 * # pre-allocate data * if metaonly: * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(1, dtype=curnptype) * else: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":584 + /* "pyreadstat/_readstat_parser.pyx":586 * if metaonly: * if output_format == "pandas": * row = np.empty(1, dtype=curnptype) # <<<<<<<<<<<<<< @@ -10409,9 +10484,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * row = list() */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; @@ -10428,20 +10503,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_1}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 584, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 586, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_row = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":583 + /* "pyreadstat/_readstat_parser.pyx":585 * # pre-allocate data * if metaonly: * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -10451,7 +10526,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L21; } - /* "pyreadstat/_readstat_parser.pyx":586 + /* "pyreadstat/_readstat_parser.pyx":588 * row = np.empty(1, dtype=curnptype) * else: * row = list() # <<<<<<<<<<<<<< @@ -10459,14 +10534,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * obs_count = dc.n_obs */ /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_row = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L21:; - /* "pyreadstat/_readstat_parser.pyx":582 + /* "pyreadstat/_readstat_parser.pyx":584 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< @@ -10476,7 +10551,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L20; } - /* "pyreadstat/_readstat_parser.pyx":588 + /* "pyreadstat/_readstat_parser.pyx":590 * row = list() * else: * obs_count = dc.n_obs # <<<<<<<<<<<<<< @@ -10487,17 +10562,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_11 = __pyx_v_dc->n_obs; __pyx_v_obs_count = __pyx_t_11; - /* "pyreadstat/_readstat_parser.pyx":589 + /* "pyreadstat/_readstat_parser.pyx":591 * else: * obs_count = dc.n_obs * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":590 + /* "pyreadstat/_readstat_parser.pyx":592 * obs_count = dc.n_obs * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) # <<<<<<<<<<<<<< @@ -10505,12 +10580,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * row.fill(np.nan) */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10526,21 +10601,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_5}; - __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 590, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 592, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_row = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":591 + /* "pyreadstat/_readstat_parser.pyx":593 * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -10556,7 +10631,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_L24_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":592 + /* "pyreadstat/_readstat_parser.pyx":594 * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * row.fill(np.nan) # <<<<<<<<<<<<<< @@ -10565,9 +10640,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_t_7 = __pyx_v_row; __Pyx_INCREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_6 = 0; @@ -10576,12 +10651,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fill, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":591 + /* "pyreadstat/_readstat_parser.pyx":593 * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -10590,7 +10665,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":589 + /* "pyreadstat/_readstat_parser.pyx":591 * else: * obs_count = dc.n_obs * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -10600,7 +10675,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L22; } - /* "pyreadstat/_readstat_parser.pyx":594 + /* "pyreadstat/_readstat_parser.pyx":596 * row.fill(np.nan) * else: * row = [None] * obs_count # <<<<<<<<<<<<<< @@ -10608,13 +10683,13 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ /*else*/ { - __pyx_t_1 = PyList_New(1 * ((__pyx_v_obs_count<0) ? 0:__pyx_v_obs_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_obs_count<0) ? 0:__pyx_v_obs_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_obs_count; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 594, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 596, __pyx_L1_error); } } __pyx_v_row = __pyx_t_1; @@ -10624,7 +10699,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L20:; - /* "pyreadstat/_readstat_parser.pyx":595 + /* "pyreadstat/_readstat_parser.pyx":597 * else: * row = [None] * obs_count * dc.col_data.append(row) # <<<<<<<<<<<<<< @@ -10633,11 +10708,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 595, __pyx_L1_error) + __PYX_ERR(0, 597, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 597, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":598 + /* "pyreadstat/_readstat_parser.pyx":600 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -10646,7 +10721,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (__pyx_v_dc->usernan) { - /* "pyreadstat/_readstat_parser.pyx":599 + /* "pyreadstat/_readstat_parser.pyx":601 * # missing values * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) # <<<<<<<<<<<<<< @@ -10655,7 +10730,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_n_ranges = readstat_variable_get_missing_ranges_count(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":600 + /* "pyreadstat/_readstat_parser.pyx":602 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -10665,19 +10740,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_n_ranges > 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":601 + /* "pyreadstat/_readstat_parser.pyx":603 * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: * missing_ranges = list() # <<<<<<<<<<<<<< * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_ranges = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":602 + /* "pyreadstat/_readstat_parser.pyx":604 * if n_ranges>0: * missing_ranges = list() * for i in range(0, n_ranges): # <<<<<<<<<<<<<< @@ -10689,7 +10764,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; - /* "pyreadstat/_readstat_parser.pyx":603 + /* "pyreadstat/_readstat_parser.pyx":605 * missing_ranges = list() * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) # <<<<<<<<<<<<<< @@ -10698,19 +10773,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_loval = readstat_variable_get_missing_range_lo(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":604 + /* "pyreadstat/_readstat_parser.pyx":606 * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) # <<<<<<<<<<<<<< * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_pyloval, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":605 + /* "pyreadstat/_readstat_parser.pyx":607 * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) # <<<<<<<<<<<<<< @@ -10719,34 +10794,34 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_hival = readstat_variable_get_missing_range_hi(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":606 + /* "pyreadstat/_readstat_parser.pyx":608 * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) # <<<<<<<<<<<<<< * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_pyhival, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":607 + /* "pyreadstat/_readstat_parser.pyx":609 * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) # <<<<<<<<<<<<<< * dc.missing_ranges[col_name] = missing_ranges * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_lo, __pyx_v_pyloval) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hi, __pyx_v_pyhival) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 607, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_lo, __pyx_v_pyloval) < 0) __PYX_ERR(0, 609, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hi, __pyx_v_pyhival) < 0) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "pyreadstat/_readstat_parser.pyx":608 + /* "pyreadstat/_readstat_parser.pyx":610 * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges # <<<<<<<<<<<<<< @@ -10755,11 +10830,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->missing_ranges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 608, __pyx_L1_error) + __PYX_ERR(0, 610, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0))) __PYX_ERR(0, 608, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0))) __PYX_ERR(0, 610, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":600 + /* "pyreadstat/_readstat_parser.pyx":602 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -10768,7 +10843,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":598 + /* "pyreadstat/_readstat_parser.pyx":600 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -10777,7 +10852,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":611 + /* "pyreadstat/_readstat_parser.pyx":613 * * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) # <<<<<<<<<<<<<< @@ -10786,35 +10861,35 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_storage_width = readstat_variable_get_storage_width(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":612 + /* "pyreadstat/_readstat_parser.pyx":614 * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) * dc.variable_storage_width[col_name] = storage_width # <<<<<<<<<<<<<< * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) */ - __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->variable_storage_width == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 612, __pyx_L1_error) + __PYX_ERR(0, 614, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 612, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":614 + /* "pyreadstat/_readstat_parser.pyx":616 * dc.variable_storage_width[col_name] = storage_width * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) # <<<<<<<<<<<<<< * * cdef readstat_alignment_t align */ - __pyx_t_1 = __Pyx_PyLong_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 614, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":618 + /* "pyreadstat/_readstat_parser.pyx":620 * cdef readstat_alignment_t align * cdef str pyalign * align = readstat_variable_get_alignment(variable) # <<<<<<<<<<<<<< @@ -10823,7 +10898,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_align = readstat_variable_get_alignment(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":619 + /* "pyreadstat/_readstat_parser.pyx":621 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -10833,7 +10908,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_align) { case READSTAT_ALIGNMENT_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":620 + /* "pyreadstat/_readstat_parser.pyx":622 * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" # <<<<<<<<<<<<<< @@ -10843,7 +10918,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_unknown); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_unknown; - /* "pyreadstat/_readstat_parser.pyx":619 + /* "pyreadstat/_readstat_parser.pyx":621 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -10853,7 +10928,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_LEFT: - /* "pyreadstat/_readstat_parser.pyx":622 + /* "pyreadstat/_readstat_parser.pyx":624 * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" # <<<<<<<<<<<<<< @@ -10863,7 +10938,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_left); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_left; - /* "pyreadstat/_readstat_parser.pyx":621 + /* "pyreadstat/_readstat_parser.pyx":623 * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: # <<<<<<<<<<<<<< @@ -10873,7 +10948,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_CENTER: - /* "pyreadstat/_readstat_parser.pyx":624 + /* "pyreadstat/_readstat_parser.pyx":626 * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" # <<<<<<<<<<<<<< @@ -10883,7 +10958,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_center); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_center; - /* "pyreadstat/_readstat_parser.pyx":623 + /* "pyreadstat/_readstat_parser.pyx":625 * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: # <<<<<<<<<<<<<< @@ -10893,7 +10968,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_RIGHT: - /* "pyreadstat/_readstat_parser.pyx":626 + /* "pyreadstat/_readstat_parser.pyx":628 * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: * pyalign = "right" # <<<<<<<<<<<<<< @@ -10903,7 +10978,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_right); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_right; - /* "pyreadstat/_readstat_parser.pyx":625 + /* "pyreadstat/_readstat_parser.pyx":627 * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: # <<<<<<<<<<<<<< @@ -10913,7 +10988,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":628 + /* "pyreadstat/_readstat_parser.pyx":630 * pyalign = "right" * else: * pyalign = "undetermined" # <<<<<<<<<<<<<< @@ -10925,16 +11000,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":630 + /* "pyreadstat/_readstat_parser.pyx":632 * pyalign = "undetermined" * * dc.variable_alignment[col_name] = pyalign # <<<<<<<<<<<<<< * * cdef readstat_measure_t measure */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0))) __PYX_ERR(0, 630, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0))) __PYX_ERR(0, 632, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":634 + /* "pyreadstat/_readstat_parser.pyx":636 * cdef readstat_measure_t measure * cdef str pymeasure * measure = readstat_variable_get_measure(variable) # <<<<<<<<<<<<<< @@ -10943,7 +11018,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_measure = readstat_variable_get_measure(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":635 + /* "pyreadstat/_readstat_parser.pyx":637 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -10953,7 +11028,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_measure) { case READSTAT_MEASURE_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":636 + /* "pyreadstat/_readstat_parser.pyx":638 * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" # <<<<<<<<<<<<<< @@ -10963,7 +11038,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_unknown); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_unknown; - /* "pyreadstat/_readstat_parser.pyx":635 + /* "pyreadstat/_readstat_parser.pyx":637 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -10973,7 +11048,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_NOMINAL: - /* "pyreadstat/_readstat_parser.pyx":638 + /* "pyreadstat/_readstat_parser.pyx":640 * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" # <<<<<<<<<<<<<< @@ -10983,7 +11058,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_nominal); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_nominal; - /* "pyreadstat/_readstat_parser.pyx":637 + /* "pyreadstat/_readstat_parser.pyx":639 * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: # <<<<<<<<<<<<<< @@ -10993,7 +11068,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_ORDINAL: - /* "pyreadstat/_readstat_parser.pyx":640 + /* "pyreadstat/_readstat_parser.pyx":642 * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" # <<<<<<<<<<<<<< @@ -11003,7 +11078,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ordinal); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_ordinal; - /* "pyreadstat/_readstat_parser.pyx":639 + /* "pyreadstat/_readstat_parser.pyx":641 * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: # <<<<<<<<<<<<<< @@ -11013,7 +11088,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_SCALE: - /* "pyreadstat/_readstat_parser.pyx":642 + /* "pyreadstat/_readstat_parser.pyx":644 * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: * pymeasure = "scale" # <<<<<<<<<<<<<< @@ -11023,7 +11098,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scale); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_scale; - /* "pyreadstat/_readstat_parser.pyx":641 + /* "pyreadstat/_readstat_parser.pyx":643 * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: # <<<<<<<<<<<<<< @@ -11033,7 +11108,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":644 + /* "pyreadstat/_readstat_parser.pyx":646 * pymeasure = "scale" * else: * pymeasure = "undetermined" # <<<<<<<<<<<<<< @@ -11045,16 +11120,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":646 + /* "pyreadstat/_readstat_parser.pyx":648 * pymeasure = "undetermined" * * dc.variable_measure[col_name] = pymeasure # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0))) __PYX_ERR(0, 646, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0))) __PYX_ERR(0, 648, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":648 + /* "pyreadstat/_readstat_parser.pyx":650 * dc.variable_measure[col_name] = pymeasure * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -11064,7 +11139,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":476 + /* "pyreadstat/_readstat_parser.pyx":478 * return READSTAT_HANDLER_OK * * cdef int handle_variable(int index, readstat_variable_t *variable, # <<<<<<<<<<<<<< @@ -11101,7 +11176,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":651 +/* "pyreadstat/_readstat_parser.pyx":653 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -11139,7 +11214,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value", 0); - /* "pyreadstat/_readstat_parser.pyx":672 + /* "pyreadstat/_readstat_parser.pyx":674 * * # extract variables we need from data container * dc = ctx # <<<<<<<<<<<<<< @@ -11151,7 +11226,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":673 + /* "pyreadstat/_readstat_parser.pyx":675 * # extract variables we need from data container * dc = ctx * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -11163,7 +11238,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":674 + /* "pyreadstat/_readstat_parser.pyx":676 * dc = ctx * output_format = dc.output_format * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< @@ -11172,7 +11247,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":675 + /* "pyreadstat/_readstat_parser.pyx":677 * output_format = dc.output_format * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs # <<<<<<<<<<<<<< @@ -11182,7 +11257,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_2 = __pyx_v_dc->max_n_obs; __pyx_v_max_n_obs = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":676 + /* "pyreadstat/_readstat_parser.pyx":678 * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs * is_unkown_number_rows = dc.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -11192,7 +11267,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = __pyx_v_dc->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":680 + /* "pyreadstat/_readstat_parser.pyx":682 * # check that we still have enough room in our pre-allocated lists * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -11201,15 +11276,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 680, __pyx_L1_error) + __PYX_ERR(0, 682, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":681 + /* "pyreadstat/_readstat_parser.pyx":683 * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] # <<<<<<<<<<<<<< @@ -11218,15 +11293,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 681, __pyx_L1_error) + __PYX_ERR(0, 683, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypefloat = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":682 + /* "pyreadstat/_readstat_parser.pyx":684 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -11235,7 +11310,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (__pyx_v_is_unkown_number_rows) { - /* "pyreadstat/_readstat_parser.pyx":683 + /* "pyreadstat/_readstat_parser.pyx":685 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -11245,7 +11320,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_max_n_obs <= __pyx_v_obs_index); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":684 + /* "pyreadstat/_readstat_parser.pyx":686 * if is_unkown_number_rows: * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 # <<<<<<<<<<<<<< @@ -11254,7 +11329,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_dc->max_n_obs = (__pyx_v_obs_index + 1); - /* "pyreadstat/_readstat_parser.pyx":683 + /* "pyreadstat/_readstat_parser.pyx":685 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -11263,7 +11338,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":685 + /* "pyreadstat/_readstat_parser.pyx":687 * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] # <<<<<<<<<<<<<< @@ -11272,15 +11347,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 685, __pyx_L1_error) + __PYX_ERR(0, 687, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __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, 685, __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, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_max_rows = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":686 + /* "pyreadstat/_readstat_parser.pyx":688 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -11290,17 +11365,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_var_max_rows <= __pyx_v_obs_index); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":687 + /* "pyreadstat/_readstat_parser.pyx":689 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: * if output_format == "pandas": # <<<<<<<<<<<<<< * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":688 + /* "pyreadstat/_readstat_parser.pyx":690 * if var_max_rows <= obs_index: * if output_format == "pandas": * curnptype = dc.col_numpy_dtypes[index] # <<<<<<<<<<<<<< @@ -11309,14 +11384,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 688, __pyx_L1_error) + __PYX_ERR(0, 690, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_curnptype = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":689 + /* "pyreadstat/_readstat_parser.pyx":691 * if output_format == "pandas": * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) # <<<<<<<<<<<<<< @@ -11324,9 +11399,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * buf_list.fill(np.nan) */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; @@ -11343,20 +11418,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_100000}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 689, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 691, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_buf_list = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":690 + /* "pyreadstat/_readstat_parser.pyx":692 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -11372,7 +11447,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L8_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":691 + /* "pyreadstat/_readstat_parser.pyx":693 * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) # <<<<<<<<<<<<<< @@ -11381,9 +11456,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_t_6 = __pyx_v_buf_list; __Pyx_INCREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 0; @@ -11392,12 +11467,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fill, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":690 + /* "pyreadstat/_readstat_parser.pyx":692 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -11406,7 +11481,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":692 + /* "pyreadstat/_readstat_parser.pyx":694 * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) * dc.col_data[index] = np.append(dc.col_data[index], buf_list) # <<<<<<<<<<<<<< @@ -11414,16 +11489,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * buf_list = [None] * 100000 */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_append); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_append); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 692, __pyx_L1_error) + __PYX_ERR(0, 694, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS @@ -11443,17 +11518,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 692, __pyx_L1_error) + __PYX_ERR(0, 694, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 692, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":687 + /* "pyreadstat/_readstat_parser.pyx":689 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11463,7 +11538,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L6; } - /* "pyreadstat/_readstat_parser.pyx":694 + /* "pyreadstat/_readstat_parser.pyx":696 * dc.col_data[index] = np.append(dc.col_data[index], buf_list) * else: * buf_list = [None] * 100000 # <<<<<<<<<<<<<< @@ -11471,19 +11546,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * var_max_rows += 100000 */ /*else*/ { - __pyx_t_1 = PyList_New(1 * 100000); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 100000); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 0x186A0; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 694, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 696, __pyx_L1_error); } } __pyx_v_buf_list = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":695 + /* "pyreadstat/_readstat_parser.pyx":697 * else: * buf_list = [None] * 100000 * dc.col_data[index].extend(buf_list) # <<<<<<<<<<<<<< @@ -11492,9 +11567,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 695, __pyx_L1_error) + __PYX_ERR(0, 697, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); @@ -11504,14 +11579,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L6:; - /* "pyreadstat/_readstat_parser.pyx":696 + /* "pyreadstat/_readstat_parser.pyx":698 * buf_list = [None] * 100000 * dc.col_data[index].extend(buf_list) * var_max_rows += 100000 # <<<<<<<<<<<<<< @@ -11520,23 +11595,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_var_max_rows = (__pyx_v_var_max_rows + 0x186A0); - /* "pyreadstat/_readstat_parser.pyx":697 + /* "pyreadstat/_readstat_parser.pyx":699 * dc.col_data[index].extend(buf_list) * var_max_rows += 100000 * dc.col_data_len[index] = var_max_rows # <<<<<<<<<<<<<< * * # transform to python value types */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 699, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":686 + /* "pyreadstat/_readstat_parser.pyx":688 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -11545,7 +11620,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":682 + /* "pyreadstat/_readstat_parser.pyx":684 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -11554,7 +11629,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":700 + /* "pyreadstat/_readstat_parser.pyx":702 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -11564,7 +11639,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":702 + /* "pyreadstat/_readstat_parser.pyx":704 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -11582,17 +11657,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L12_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":703 + /* "pyreadstat/_readstat_parser.pyx":705 * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": # <<<<<<<<<<<<<< * if iscurnptypefloat == 1 or iscurnptypeobject == 1: * # already allocated */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":704 + /* "pyreadstat/_readstat_parser.pyx":706 * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": * if iscurnptypefloat == 1 or iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11612,7 +11687,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L15; } - /* "pyreadstat/_readstat_parser.pyx":710 + /* "pyreadstat/_readstat_parser.pyx":712 * # for any type except float, the numpy type will be object as now we have nans * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -11622,11 +11697,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 710, __pyx_L1_error) + __PYX_ERR(0, 712, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 710, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 712, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":711 + /* "pyreadstat/_readstat_parser.pyx":713 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -11635,11 +11710,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 711, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 711, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 713, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":712 + /* "pyreadstat/_readstat_parser.pyx":714 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -11648,7 +11723,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":713 + /* "pyreadstat/_readstat_parser.pyx":715 * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -11657,57 +11732,57 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 713, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_builtin_object}; - __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 713, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 715, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 713, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 713, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":714 + /* "pyreadstat/_readstat_parser.pyx":716 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index:] = np.nan # <<<<<<<<<<<<<< * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 714, __pyx_L1_error) + __PYX_ERR(0, 716, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetSlice(__pyx_t_1, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < 0) __PYX_ERR(0, 714, __pyx_L1_error) + if (__Pyx_PyObject_SetSlice(__pyx_t_1, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < 0) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L15:; - /* "pyreadstat/_readstat_parser.pyx":703 + /* "pyreadstat/_readstat_parser.pyx":705 * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11716,7 +11791,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":702 + /* "pyreadstat/_readstat_parser.pyx":704 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -11726,7 +11801,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L11; } - /* "pyreadstat/_readstat_parser.pyx":716 + /* "pyreadstat/_readstat_parser.pyx":718 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -11736,19 +11811,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_defined_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":718 + /* "pyreadstat/_readstat_parser.pyx":720 * elif readstat_value_is_defined_missing(value, variable): * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): */ - __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyvalue = __pyx_t_5; __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":719 + /* "pyreadstat/_readstat_parser.pyx":721 * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -11757,14 +11832,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 719, __pyx_L1_error) + __PYX_ERR(0, 721, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely((__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":716 + /* "pyreadstat/_readstat_parser.pyx":718 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -11774,7 +11849,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L11; } - /* "pyreadstat/_readstat_parser.pyx":720 + /* "pyreadstat/_readstat_parser.pyx":722 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -11784,7 +11859,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":721 + /* "pyreadstat/_readstat_parser.pyx":723 * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -11793,15 +11868,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 723, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":723 + /* "pyreadstat/_readstat_parser.pyx":725 * iscurnptypeobject = dc.col_dtypes_isobject[index] * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -11810,17 +11885,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":726 + /* "pyreadstat/_readstat_parser.pyx":728 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": # <<<<<<<<<<<<<< * if iscurnptypeobject == 1: * dc.col_data[index][obs_index] = chr(missing_tag) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":727 + /* "pyreadstat/_readstat_parser.pyx":729 * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11830,26 +11905,26 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_iscurnptypeobject == 1); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":728 + /* "pyreadstat/_readstat_parser.pyx":730 * if output_format == "pandas": * if iscurnptypeobject == 1: * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * else: * dc.col_numpy_dtypes[index] = object */ - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 728, __pyx_L1_error) + __PYX_ERR(0, 730, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 728, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":727 + /* "pyreadstat/_readstat_parser.pyx":729 * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11859,7 +11934,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L19; } - /* "pyreadstat/_readstat_parser.pyx":730 + /* "pyreadstat/_readstat_parser.pyx":732 * dc.col_data[index][obs_index] = chr(missing_tag) * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -11869,11 +11944,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 730, __pyx_L1_error) + __PYX_ERR(0, 732, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 730, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 732, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":731 + /* "pyreadstat/_readstat_parser.pyx":733 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -11882,11 +11957,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 731, __pyx_L1_error) + __PYX_ERR(0, 733, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 731, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 733, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":732 + /* "pyreadstat/_readstat_parser.pyx":734 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 # <<<<<<<<<<<<<< @@ -11895,11 +11970,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 732, __pyx_L1_error) + __PYX_ERR(0, 734, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_mstate_global->__pyx_int_0, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 732, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_mstate_global->__pyx_int_0, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 734, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":733 + /* "pyreadstat/_readstat_parser.pyx":735 * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -11908,7 +11983,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":734 + /* "pyreadstat/_readstat_parser.pyx":736 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -11917,54 +11992,54 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 734, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_builtin_object}; - __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 734, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 736, __pyx_L1_error) __pyx_t_5 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 734, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 734, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 734, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":735 + /* "pyreadstat/_readstat_parser.pyx":737 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * else: * dc.col_data[index][obs_index] = chr(missing_tag) */ - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 735, __pyx_L1_error) + __PYX_ERR(0, 737, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 735, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L19:; - /* "pyreadstat/_readstat_parser.pyx":726 + /* "pyreadstat/_readstat_parser.pyx":728 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11974,7 +12049,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L18; } - /* "pyreadstat/_readstat_parser.pyx":737 + /* "pyreadstat/_readstat_parser.pyx":739 * dc.col_data[index][obs_index] = chr(missing_tag) * else: * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< @@ -11982,21 +12057,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * if curset is None: */ /*else*/ { - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 737, __pyx_L1_error) + __PYX_ERR(0, 739, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 737, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L18:; - /* "pyreadstat/_readstat_parser.pyx":738 + /* "pyreadstat/_readstat_parser.pyx":740 * else: * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) # <<<<<<<<<<<<<< @@ -12005,18 +12080,18 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 738, __pyx_L1_error) + __PYX_ERR(0, 740, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PySet_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_4))) __PYX_ERR(0, 738, __pyx_L1_error) + if (!(likely(PySet_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_4))) __PYX_ERR(0, 740, __pyx_L1_error) __pyx_v_curset = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":739 + /* "pyreadstat/_readstat_parser.pyx":741 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -12026,19 +12101,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_curset == ((PyObject*)Py_None)); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":740 + /* "pyreadstat/_readstat_parser.pyx":742 * curset = dc.missing_user_values.get(index) * if curset is None: * curset = set() # <<<<<<<<<<<<<< * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_curset, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":739 + /* "pyreadstat/_readstat_parser.pyx":741 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -12047,7 +12122,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":741 + /* "pyreadstat/_readstat_parser.pyx":743 * if curset is None: * curset = set() * curset.add(chr(missing_tag)) # <<<<<<<<<<<<<< @@ -12056,14 +12131,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_curset == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); - __PYX_ERR(0, 741, __pyx_L1_error) + __PYX_ERR(0, 743, __pyx_L1_error) } - __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":742 + /* "pyreadstat/_readstat_parser.pyx":744 * curset = set() * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset # <<<<<<<<<<<<<< @@ -12072,14 +12147,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 742, __pyx_L1_error) + __PYX_ERR(0, 744, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_4, __pyx_v_curset) < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_4, __pyx_v_curset) < 0))) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":720 + /* "pyreadstat/_readstat_parser.pyx":722 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -12089,7 +12164,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ } __pyx_L11:; - /* "pyreadstat/_readstat_parser.pyx":700 + /* "pyreadstat/_readstat_parser.pyx":702 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -12099,7 +12174,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":744 + /* "pyreadstat/_readstat_parser.pyx":746 * dc.missing_user_values[index] = curset * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< @@ -12107,12 +12182,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * */ /*else*/ { - __pyx_t_4 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_4 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_pyvalue = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":745 + /* "pyreadstat/_readstat_parser.pyx":747 * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -12121,16 +12196,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 745, __pyx_L1_error) + __PYX_ERR(0, 747, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 745, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":747 + /* "pyreadstat/_readstat_parser.pyx":749 * dc.col_data[index][obs_index] = pyvalue * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12140,7 +12215,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":651 + /* "pyreadstat/_readstat_parser.pyx":653 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12167,7 +12242,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":750 +/* "pyreadstat/_readstat_parser.pyx":752 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12206,7 +12281,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value_label", 0); - /* "pyreadstat/_readstat_parser.pyx":756 + /* "pyreadstat/_readstat_parser.pyx":758 * """ * * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -12218,14 +12293,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":774 + /* "pyreadstat/_readstat_parser.pyx":776 * cdef str value_label_name * * var_label = val_labels # <<<<<<<<<<<<<< * value_label_name = label * */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12233,14 +12308,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_var_label = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":775 + /* "pyreadstat/_readstat_parser.pyx":777 * * var_label = val_labels * value_label_name = label # <<<<<<<<<<<<<< * * cdef readstat_type_t value_type */ - __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); @@ -12248,7 +12323,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_value_label_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":778 + /* "pyreadstat/_readstat_parser.pyx":780 * * cdef readstat_type_t value_type * value_type = readstat_value_type(value) # <<<<<<<<<<<<<< @@ -12257,7 +12332,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_value_type = readstat_value_type(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":780 + /* "pyreadstat/_readstat_parser.pyx":782 * value_type = readstat_value_type(value) * * labels_raw = dc.labels_raw # <<<<<<<<<<<<<< @@ -12269,7 +12344,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_labels_raw = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":781 + /* "pyreadstat/_readstat_parser.pyx":783 * * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) # <<<<<<<<<<<<<< @@ -12283,36 +12358,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_var_label}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_cur_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":782 + /* "pyreadstat/_readstat_parser.pyx":784 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< * cur_dict = dict() * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":783 + /* "pyreadstat/_readstat_parser.pyx":785 * cur_dict = labels_raw.get(var_label) * if not cur_dict: * cur_dict = dict() # <<<<<<<<<<<<<< * * if readstat_value_is_tagged_missing(value): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_dict, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":782 + /* "pyreadstat/_readstat_parser.pyx":784 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< @@ -12321,7 +12396,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ } - /* "pyreadstat/_readstat_parser.pyx":785 + /* "pyreadstat/_readstat_parser.pyx":787 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -12331,7 +12406,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_5 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":787 + /* "pyreadstat/_readstat_parser.pyx":789 * if readstat_value_is_tagged_missing(value): * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -12340,19 +12415,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":789 + /* "pyreadstat/_readstat_parser.pyx":791 * missing_tag = readstat_value_tag(value) * # In SAS missing values are A to Z or _ in stata a to z * cur_dict[chr(missing_tag)] = value_label_name # <<<<<<<<<<<<<< * else: * */ - __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 789, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":785 + /* "pyreadstat/_readstat_parser.pyx":787 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -12362,7 +12437,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py goto __pyx_L4; } - /* "pyreadstat/_readstat_parser.pyx":792 + /* "pyreadstat/_readstat_parser.pyx":794 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12371,7 +12446,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ /*else*/ { - /* "pyreadstat/_readstat_parser.pyx":812 + /* "pyreadstat/_readstat_parser.pyx":814 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -12381,7 +12456,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_value_type) { case READSTAT_TYPE_STRING: - /* "pyreadstat/_readstat_parser.pyx":792 + /* "pyreadstat/_readstat_parser.pyx":794 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12390,7 +12465,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":793 + /* "pyreadstat/_readstat_parser.pyx":795 * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) # <<<<<<<<<<<<<< @@ -12399,14 +12474,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_str_value = readstat_string_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":794 + /* "pyreadstat/_readstat_parser.pyx":796 * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * py_str_value = c_str_value # <<<<<<<<<<<<<< * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12414,7 +12489,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_py_str_value = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":795 + /* "pyreadstat/_readstat_parser.pyx":797 * c_str_value = readstat_string_value(value) * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING # <<<<<<<<<<<<<< @@ -12423,7 +12498,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING; - /* "pyreadstat/_readstat_parser.pyx":792 + /* "pyreadstat/_readstat_parser.pyx":794 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12433,7 +12508,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":797 + /* "pyreadstat/_readstat_parser.pyx":799 * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) # <<<<<<<<<<<<<< @@ -12442,7 +12517,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int8_value = readstat_int8_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":798 + /* "pyreadstat/_readstat_parser.pyx":800 * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value # <<<<<<<<<<<<<< @@ -12451,7 +12526,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int8_value); - /* "pyreadstat/_readstat_parser.pyx":799 + /* "pyreadstat/_readstat_parser.pyx":801 * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12460,7 +12535,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":796 + /* "pyreadstat/_readstat_parser.pyx":798 * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -12470,7 +12545,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":801 + /* "pyreadstat/_readstat_parser.pyx":803 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) # <<<<<<<<<<<<<< @@ -12479,7 +12554,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int16_value = readstat_int16_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":802 + /* "pyreadstat/_readstat_parser.pyx":804 * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value # <<<<<<<<<<<<<< @@ -12488,7 +12563,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int16_value); - /* "pyreadstat/_readstat_parser.pyx":803 + /* "pyreadstat/_readstat_parser.pyx":805 * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12497,7 +12572,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":800 + /* "pyreadstat/_readstat_parser.pyx":802 * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -12507,7 +12582,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":805 + /* "pyreadstat/_readstat_parser.pyx":807 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) # <<<<<<<<<<<<<< @@ -12516,7 +12591,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int32_value = readstat_int32_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":806 + /* "pyreadstat/_readstat_parser.pyx":808 * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value # <<<<<<<<<<<<<< @@ -12525,7 +12600,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int32_value); - /* "pyreadstat/_readstat_parser.pyx":807 + /* "pyreadstat/_readstat_parser.pyx":809 * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12534,7 +12609,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":804 + /* "pyreadstat/_readstat_parser.pyx":806 * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -12544,7 +12619,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":809 + /* "pyreadstat/_readstat_parser.pyx":811 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) # <<<<<<<<<<<<<< @@ -12553,7 +12628,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_float_value = readstat_float_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":810 + /* "pyreadstat/_readstat_parser.pyx":812 * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) * py_float_value = c_float_value # <<<<<<<<<<<<<< @@ -12562,7 +12637,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_float_value); - /* "pyreadstat/_readstat_parser.pyx":811 + /* "pyreadstat/_readstat_parser.pyx":813 * c_float_value = readstat_float_value(value) * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -12571,7 +12646,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":808 + /* "pyreadstat/_readstat_parser.pyx":810 * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -12581,7 +12656,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":813 + /* "pyreadstat/_readstat_parser.pyx":815 * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); # <<<<<<<<<<<<<< @@ -12590,7 +12665,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_double_value = readstat_double_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":814 + /* "pyreadstat/_readstat_parser.pyx":816 * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); * py_float_value = c_double_value # <<<<<<<<<<<<<< @@ -12599,7 +12674,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_double_value); - /* "pyreadstat/_readstat_parser.pyx":815 + /* "pyreadstat/_readstat_parser.pyx":817 * c_double_value = readstat_double_value(value); * py_float_value = c_double_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -12608,7 +12683,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":812 + /* "pyreadstat/_readstat_parser.pyx":814 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -12618,7 +12693,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":817 + /* "pyreadstat/_readstat_parser.pyx":819 * pyformat = VAR_FORMAT_FLOAT * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -12626,7 +12701,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py * */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS @@ -12645,16 +12720,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __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, 817, __pyx_L1_error) + __PYX_ERR(0, 819, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":820 + /* "pyreadstat/_readstat_parser.pyx":822 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -12664,17 +12739,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_pyformat) { case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING: - /* "pyreadstat/_readstat_parser.pyx":821 + /* "pyreadstat/_readstat_parser.pyx":823 * * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name */ - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 821, __pyx_L1_error) } - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 821, __pyx_L1_error) + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 823, __pyx_L1_error) } + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 823, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":820 + /* "pyreadstat/_readstat_parser.pyx":822 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -12684,16 +12759,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG: - /* "pyreadstat/_readstat_parser.pyx":823 + /* "pyreadstat/_readstat_parser.pyx":825 * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name */ - if (unlikely((__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 823, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 825, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":822 + /* "pyreadstat/_readstat_parser.pyx":824 * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: # <<<<<<<<<<<<<< @@ -12703,19 +12778,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":825 + /* "pyreadstat/_readstat_parser.pyx":827 * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_MISSING: * pass */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 825, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":824 + /* "pyreadstat/_readstat_parser.pyx":826 * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: # <<<<<<<<<<<<<< @@ -12725,7 +12800,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_MISSING: - /* "pyreadstat/_readstat_parser.pyx":826 + /* "pyreadstat/_readstat_parser.pyx":828 * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name * elif pyformat == VAR_FORMAT_MISSING: # <<<<<<<<<<<<<< @@ -12735,7 +12810,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":829 + /* "pyreadstat/_readstat_parser.pyx":831 * pass * else: * raise PyreadstatError("Failed convert C to python value") # <<<<<<<<<<<<<< @@ -12743,7 +12818,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py * dc.labels_raw[var_label] = cur_dict */ __pyx_t_6 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS @@ -12762,27 +12837,27 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __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, 829, __pyx_L1_error) + __PYX_ERR(0, 831, __pyx_L1_error) break; } } __pyx_L4:; - /* "pyreadstat/_readstat_parser.pyx":831 + /* "pyreadstat/_readstat_parser.pyx":833 * raise PyreadstatError("Failed convert C to python value") * * dc.labels_raw[var_label] = cur_dict # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0))) __PYX_ERR(0, 831, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0))) __PYX_ERR(0, 833, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":833 + /* "pyreadstat/_readstat_parser.pyx":835 * dc.labels_raw[var_label] = cur_dict * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12792,7 +12867,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":750 + /* "pyreadstat/_readstat_parser.pyx":752 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12818,7 +12893,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":835 +/* "pyreadstat/_readstat_parser.pyx":837 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12839,7 +12914,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_note", 0); - /* "pyreadstat/_readstat_parser.pyx":841 + /* "pyreadstat/_readstat_parser.pyx":843 * * cdef str pynote * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -12851,14 +12926,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":843 + /* "pyreadstat/_readstat_parser.pyx":845 * cdef data_container dc = ctx * * pynote = note # <<<<<<<<<<<<<< * dc.notes.append(pynote) * */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12866,16 +12941,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_pynote = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":844 + /* "pyreadstat/_readstat_parser.pyx":846 * * pynote = note * dc.notes.append(pynote) # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 846, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":846 + /* "pyreadstat/_readstat_parser.pyx":848 * dc.notes.append(pynote) * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12885,7 +12960,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":835 + /* "pyreadstat/_readstat_parser.pyx":837 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12906,7 +12981,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":848 +/* "pyreadstat/_readstat_parser.pyx":850 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12933,21 +13008,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_open", 0); - /* "pyreadstat/_readstat_parser.pyx":856 + /* "pyreadstat/_readstat_parser.pyx":858 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< * return -1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __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, 856, __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, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { @@ -12956,15 +13031,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "pyreadstat/_readstat_parser.pyx":857 + /* "pyreadstat/_readstat_parser.pyx":859 * * if not os.path.isfile(u8_path): * return -1 # <<<<<<<<<<<<<< @@ -12974,7 +13049,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = -1; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":856 + /* "pyreadstat/_readstat_parser.pyx":858 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< @@ -12983,36 +13058,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":859 + /* "pyreadstat/_readstat_parser.pyx":861 * return -1 * * if os.name == "nt": # <<<<<<<<<<<<<< * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "pyreadstat/_readstat_parser.pyx":860 + /* "pyreadstat/_readstat_parser.pyx":862 * * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(u8_path, &length) # <<<<<<<<<<<<<< * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyUnicode_AsWideCharString(__pyx_t_4, (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((wchar_t *)0))) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_8 = PyUnicode_AsWideCharString(__pyx_t_4, (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((wchar_t *)0))) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_u16_path = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":861 + /* "pyreadstat/_readstat_parser.pyx":863 * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) # <<<<<<<<<<<<<< @@ -13021,7 +13096,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ __pyx_v_fd = _wsopen(__pyx_v_u16_path, (_O_RDONLY | _O_BINARY), _SH_DENYWR, 0); - /* "pyreadstat/_readstat_parser.pyx":862 + /* "pyreadstat/_readstat_parser.pyx":864 * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) # <<<<<<<<<<<<<< @@ -13030,7 +13105,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ assign_fd(__pyx_v_io_ctx, __pyx_v_fd); - /* "pyreadstat/_readstat_parser.pyx":863 + /* "pyreadstat/_readstat_parser.pyx":865 * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) * return fd # <<<<<<<<<<<<<< @@ -13040,7 +13115,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = __pyx_v_fd; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":859 + /* "pyreadstat/_readstat_parser.pyx":861 * return -1 * * if os.name == "nt": # <<<<<<<<<<<<<< @@ -13049,7 +13124,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":865 + /* "pyreadstat/_readstat_parser.pyx":867 * return fd * else: * return -1 # <<<<<<<<<<<<<< @@ -13061,7 +13136,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":848 + /* "pyreadstat/_readstat_parser.pyx":850 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -13082,7 +13157,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":870 +/* "pyreadstat/_readstat_parser.pyx":872 * cdef object _file_object_ctx = None * * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13093,7 +13168,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_UNUSED char const *__pyx_v_path, CYTHON_UNUSED void *__pyx_v_io_ctx) { int __pyx_r; - /* "pyreadstat/_readstat_parser.pyx":872 + /* "pyreadstat/_readstat_parser.pyx":874 * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: * """File is already open - this is a no-op""" * return 0 # <<<<<<<<<<<<<< @@ -13103,7 +13178,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":870 + /* "pyreadstat/_readstat_parser.pyx":872 * cdef object _file_object_ctx = None * * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13116,7 +13191,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":874 +/* "pyreadstat/_readstat_parser.pyx":876 * return 0 * * cdef int pyobject_close_handler(void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13127,7 +13202,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON_UNUSED void *__pyx_v_io_ctx) { int __pyx_r; - /* "pyreadstat/_readstat_parser.pyx":876 + /* "pyreadstat/_readstat_parser.pyx":878 * cdef int pyobject_close_handler(void *io_ctx) noexcept: * """User manages file lifetime - this is a no-op""" * return 0 # <<<<<<<<<<<<<< @@ -13137,7 +13212,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":874 + /* "pyreadstat/_readstat_parser.pyx":876 * return 0 * * cdef int pyobject_close_handler(void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13150,7 +13225,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":878 +/* "pyreadstat/_readstat_parser.pyx":880 * return 0 * * cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13180,7 +13255,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pyobject_read_handler", 0); - /* "pyreadstat/_readstat_parser.pyx":885 + /* "pyreadstat/_readstat_parser.pyx":887 * cdef char *data_ptr * * try: # <<<<<<<<<<<<<< @@ -13196,7 +13271,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":886 + /* "pyreadstat/_readstat_parser.pyx":888 * * try: * file_obj = _file_object_ctx # <<<<<<<<<<<<<< @@ -13206,7 +13281,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); __pyx_v_file_obj = __pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx; - /* "pyreadstat/_readstat_parser.pyx":887 + /* "pyreadstat/_readstat_parser.pyx":889 * try: * file_obj = _file_object_ctx * data = file_obj.read(nbyte) # <<<<<<<<<<<<<< @@ -13215,7 +13290,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ __pyx_t_5 = __pyx_v_file_obj; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_nbyte); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 887, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_nbyte); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 889, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { @@ -13223,14 +13298,14 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L3_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, 887, __pyx_L3_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 889, __pyx_L3_error) __pyx_v_data = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":888 + /* "pyreadstat/_readstat_parser.pyx":890 * file_obj = _file_object_ctx * data = file_obj.read(nbyte) * bytes_read = len(data) # <<<<<<<<<<<<<< @@ -13239,12 +13314,12 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 888, __pyx_L3_error) + __PYX_ERR(0, 890, __pyx_L3_error) } - __pyx_t_8 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 888, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 890, __pyx_L3_error) __pyx_v_bytes_read = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":889 + /* "pyreadstat/_readstat_parser.pyx":891 * data = file_obj.read(nbyte) * bytes_read = len(data) * if bytes_read > 0: # <<<<<<<<<<<<<< @@ -13254,7 +13329,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_t_9 = (__pyx_v_bytes_read > 0); if (__pyx_t_9) { - /* "pyreadstat/_readstat_parser.pyx":890 + /* "pyreadstat/_readstat_parser.pyx":892 * bytes_read = len(data) * if bytes_read > 0: * data_ptr = data # <<<<<<<<<<<<<< @@ -13263,12 +13338,12 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 890, __pyx_L3_error) + __PYX_ERR(0, 892, __pyx_L3_error) } - __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L3_error) + __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L3_error) __pyx_v_data_ptr = ((char *)__pyx_t_10); - /* "pyreadstat/_readstat_parser.pyx":891 + /* "pyreadstat/_readstat_parser.pyx":893 * if bytes_read > 0: * data_ptr = data * memcpy(buf, data_ptr, bytes_read) # <<<<<<<<<<<<<< @@ -13277,7 +13352,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ (void)(memcpy(__pyx_v_buf, __pyx_v_data_ptr, __pyx_v_bytes_read)); - /* "pyreadstat/_readstat_parser.pyx":889 + /* "pyreadstat/_readstat_parser.pyx":891 * data = file_obj.read(nbyte) * bytes_read = len(data) * if bytes_read > 0: # <<<<<<<<<<<<<< @@ -13286,7 +13361,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ } - /* "pyreadstat/_readstat_parser.pyx":892 + /* "pyreadstat/_readstat_parser.pyx":894 * data_ptr = data * memcpy(buf, data_ptr, bytes_read) * return bytes_read # <<<<<<<<<<<<<< @@ -13296,7 +13371,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_r = __pyx_v_bytes_read; goto __pyx_L7_try_return; - /* "pyreadstat/_readstat_parser.pyx":885 + /* "pyreadstat/_readstat_parser.pyx":887 * cdef char *data_ptr * * try: # <<<<<<<<<<<<<< @@ -13309,7 +13384,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_parser.pyx":893 + /* "pyreadstat/_readstat_parser.pyx":895 * memcpy(buf, data_ptr, bytes_read) * return bytes_read * except: # <<<<<<<<<<<<<< @@ -13319,7 +13394,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( /*except:*/ { __Pyx_ErrRestore(0,0,0); - /* "pyreadstat/_readstat_parser.pyx":894 + /* "pyreadstat/_readstat_parser.pyx":896 * return bytes_read * except: * return -1 # <<<<<<<<<<<<<< @@ -13330,7 +13405,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( goto __pyx_L6_except_return; } - /* "pyreadstat/_readstat_parser.pyx":885 + /* "pyreadstat/_readstat_parser.pyx":887 * cdef char *data_ptr * * try: # <<<<<<<<<<<<<< @@ -13351,7 +13426,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":878 + /* "pyreadstat/_readstat_parser.pyx":880 * return 0 * * cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13367,7 +13442,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":896 +/* "pyreadstat/_readstat_parser.pyx":898 * return -1 * * cdef readstat_off_t pyobject_seek_handler(readstat_off_t offset, readstat_io_flags_t whence, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13394,7 +13469,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pyobject_seek_handler", 0); - /* "pyreadstat/_readstat_parser.pyx":901 + /* "pyreadstat/_readstat_parser.pyx":903 * cdef int py_whence * * try: # <<<<<<<<<<<<<< @@ -13410,7 +13485,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":902 + /* "pyreadstat/_readstat_parser.pyx":904 * * try: * file_obj = _file_object_ctx # <<<<<<<<<<<<<< @@ -13420,7 +13495,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); __pyx_v_file_obj = __pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx; - /* "pyreadstat/_readstat_parser.pyx":903 + /* "pyreadstat/_readstat_parser.pyx":905 * try: * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: # <<<<<<<<<<<<<< @@ -13430,7 +13505,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand switch (__pyx_v_whence) { case READSTAT_SEEK_SET: - /* "pyreadstat/_readstat_parser.pyx":904 + /* "pyreadstat/_readstat_parser.pyx":906 * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: * py_whence = 0 # <<<<<<<<<<<<<< @@ -13439,7 +13514,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_v_py_whence = 0; - /* "pyreadstat/_readstat_parser.pyx":903 + /* "pyreadstat/_readstat_parser.pyx":905 * try: * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: # <<<<<<<<<<<<<< @@ -13449,7 +13524,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; case READSTAT_SEEK_CUR: - /* "pyreadstat/_readstat_parser.pyx":906 + /* "pyreadstat/_readstat_parser.pyx":908 * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: * py_whence = 1 # <<<<<<<<<<<<<< @@ -13458,7 +13533,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_v_py_whence = 1; - /* "pyreadstat/_readstat_parser.pyx":905 + /* "pyreadstat/_readstat_parser.pyx":907 * if whence == READSTAT_SEEK_SET: * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: # <<<<<<<<<<<<<< @@ -13468,7 +13543,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; default: - /* "pyreadstat/_readstat_parser.pyx":908 + /* "pyreadstat/_readstat_parser.pyx":910 * py_whence = 1 * else: # READSTAT_SEEK_END * py_whence = 2 # <<<<<<<<<<<<<< @@ -13479,7 +13554,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; } - /* "pyreadstat/_readstat_parser.pyx":910 + /* "pyreadstat/_readstat_parser.pyx":912 * py_whence = 2 * * file_obj.seek(offset, py_whence) # <<<<<<<<<<<<<< @@ -13488,9 +13563,9 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_t_5 = __pyx_v_file_obj; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyLong_From_off_t(__pyx_v_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyLong_From_off_t(__pyx_v_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_py_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 910, __pyx_L3_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_py_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { @@ -13499,12 +13574,12 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":911 + /* "pyreadstat/_readstat_parser.pyx":913 * * file_obj.seek(offset, py_whence) * return file_obj.tell() # <<<<<<<<<<<<<< @@ -13518,15 +13593,15 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 911, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_9 = __Pyx_PyLong_As_off_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((readstat_off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error) + __pyx_t_9 = __Pyx_PyLong_As_off_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((readstat_off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_9; goto __pyx_L7_try_return; - /* "pyreadstat/_readstat_parser.pyx":901 + /* "pyreadstat/_readstat_parser.pyx":903 * cdef int py_whence * * try: # <<<<<<<<<<<<<< @@ -13540,7 +13615,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":912 + /* "pyreadstat/_readstat_parser.pyx":914 * file_obj.seek(offset, py_whence) * return file_obj.tell() * except: # <<<<<<<<<<<<<< @@ -13550,7 +13625,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand /*except:*/ { __Pyx_ErrRestore(0,0,0); - /* "pyreadstat/_readstat_parser.pyx":913 + /* "pyreadstat/_readstat_parser.pyx":915 * return file_obj.tell() * except: * return -1 # <<<<<<<<<<<<<< @@ -13561,7 +13636,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand goto __pyx_L6_except_return; } - /* "pyreadstat/_readstat_parser.pyx":901 + /* "pyreadstat/_readstat_parser.pyx":903 * cdef int py_whence * * try: # <<<<<<<<<<<<<< @@ -13582,7 +13657,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":896 + /* "pyreadstat/_readstat_parser.pyx":898 * return -1 * * cdef readstat_off_t pyobject_seek_handler(readstat_off_t offset, readstat_io_flags_t whence, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13597,7 +13672,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":916 +/* "pyreadstat/_readstat_parser.pyx":918 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -13619,7 +13694,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_exit_status", 0); - /* "pyreadstat/_readstat_parser.pyx":923 + /* "pyreadstat/_readstat_parser.pyx":925 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -13629,7 +13704,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_t_1 = (__pyx_v_retcode != READSTAT_OK); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":924 + /* "pyreadstat/_readstat_parser.pyx":926 * cdef str err_message * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) # <<<<<<<<<<<<<< @@ -13638,14 +13713,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ __pyx_v_err_readstat = readstat_error_message(__pyx_v_retcode); - /* "pyreadstat/_readstat_parser.pyx":925 + /* "pyreadstat/_readstat_parser.pyx":927 * 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, 925, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); @@ -13653,7 +13728,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_v_err_message = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":926 + /* "pyreadstat/_readstat_parser.pyx":928 * err_readstat = readstat_error_message(retcode) * err_message = err_readstat * raise ReadstatError(err_message) # <<<<<<<<<<<<<< @@ -13661,7 +13736,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e * */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -13680,14 +13755,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_t_3 = __Pyx_PyObject_FastCall(__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, 926, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __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, 926, __pyx_L1_error) + __PYX_ERR(0, 928, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":923 + /* "pyreadstat/_readstat_parser.pyx":925 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -13696,7 +13771,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ } - /* "pyreadstat/_readstat_parser.pyx":916 + /* "pyreadstat/_readstat_parser.pyx":918 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -13716,7 +13791,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":929 +/* "pyreadstat/_readstat_parser.pyx":931 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -13756,7 +13831,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ } } - /* "pyreadstat/_readstat_parser.pyx":956 + /* "pyreadstat/_readstat_parser.pyx":958 * cdef bytes encoding_byte * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -13766,7 +13841,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":957 + /* "pyreadstat/_readstat_parser.pyx":959 * * metaonly = data.metaonly * ctx = data # <<<<<<<<<<<<<< @@ -13775,7 +13850,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":960 + /* "pyreadstat/_readstat_parser.pyx":962 * * #readstat_error_t error = READSTAT_OK; * parser = readstat_parser_init() # <<<<<<<<<<<<<< @@ -13784,7 +13859,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_parser = readstat_parser_init(); - /* "pyreadstat/_readstat_parser.pyx":961 + /* "pyreadstat/_readstat_parser.pyx":963 * #readstat_error_t error = READSTAT_OK; * parser = readstat_parser_init() * metadata_handler = handle_metadata # <<<<<<<<<<<<<< @@ -13793,7 +13868,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_metadata_handler = ((readstat_metadata_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_metadata); - /* "pyreadstat/_readstat_parser.pyx":962 + /* "pyreadstat/_readstat_parser.pyx":964 * parser = readstat_parser_init() * metadata_handler = handle_metadata * variable_handler = handle_variable # <<<<<<<<<<<<<< @@ -13802,7 +13877,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_variable_handler = ((readstat_variable_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_variable); - /* "pyreadstat/_readstat_parser.pyx":963 + /* "pyreadstat/_readstat_parser.pyx":965 * metadata_handler = handle_metadata * variable_handler = handle_variable * value_handler = handle_value # <<<<<<<<<<<<<< @@ -13811,7 +13886,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_handler = ((readstat_value_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value); - /* "pyreadstat/_readstat_parser.pyx":964 + /* "pyreadstat/_readstat_parser.pyx":966 * variable_handler = handle_variable * value_handler = handle_value * value_label_handler = handle_value_label # <<<<<<<<<<<<<< @@ -13820,7 +13895,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_label_handler = ((readstat_value_label_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value_label); - /* "pyreadstat/_readstat_parser.pyx":965 + /* "pyreadstat/_readstat_parser.pyx":967 * value_handler = handle_value * value_label_handler = handle_value_label * note_handler = handle_note # <<<<<<<<<<<<<< @@ -13829,43 +13904,43 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_note_handler = ((readstat_note_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_note); - /* "pyreadstat/_readstat_parser.pyx":968 + /* "pyreadstat/_readstat_parser.pyx":970 * * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":969 + /* "pyreadstat/_readstat_parser.pyx":971 * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 969, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":970 + /* "pyreadstat/_readstat_parser.pyx":972 * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_note_handler(parser, note_handler)) * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":971 + /* "pyreadstat/_readstat_parser.pyx":973 * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) # <<<<<<<<<<<<<< * * # Set up custom I/O handlers for file objects */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":974 + /* "pyreadstat/_readstat_parser.pyx":976 * * # Set up custom I/O handlers for file objects * if file_obj is not None: # <<<<<<<<<<<<<< @@ -13875,7 +13950,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_file_obj != Py_None); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":975 + /* "pyreadstat/_readstat_parser.pyx":977 * # Set up custom I/O handlers for file objects * if file_obj is not None: * _file_object_ctx = file_obj # <<<<<<<<<<<<<< @@ -13887,7 +13962,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx, __pyx_v_file_obj); __Pyx_GIVEREF(__pyx_v_file_obj); - /* "pyreadstat/_readstat_parser.pyx":976 + /* "pyreadstat/_readstat_parser.pyx":978 * if file_obj is not None: * _file_object_ctx = file_obj * open_handler = pyobject_open_handler # <<<<<<<<<<<<<< @@ -13896,7 +13971,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_open_handler = ((readstat_open_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler); - /* "pyreadstat/_readstat_parser.pyx":977 + /* "pyreadstat/_readstat_parser.pyx":979 * _file_object_ctx = file_obj * open_handler = pyobject_open_handler * close_handler = pyobject_close_handler # <<<<<<<<<<<<<< @@ -13905,7 +13980,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_close_handler = ((readstat_close_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler); - /* "pyreadstat/_readstat_parser.pyx":978 + /* "pyreadstat/_readstat_parser.pyx":980 * open_handler = pyobject_open_handler * close_handler = pyobject_close_handler * read_handler = pyobject_read_handler # <<<<<<<<<<<<<< @@ -13914,7 +13989,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_read_handler = ((readstat_read_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler); - /* "pyreadstat/_readstat_parser.pyx":979 + /* "pyreadstat/_readstat_parser.pyx":981 * close_handler = pyobject_close_handler * read_handler = pyobject_read_handler * seek_handler = pyobject_seek_handler # <<<<<<<<<<<<<< @@ -13923,7 +13998,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_seek_handler = ((readstat_seek_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_handler); - /* "pyreadstat/_readstat_parser.pyx":980 + /* "pyreadstat/_readstat_parser.pyx":982 * read_handler = pyobject_read_handler * seek_handler = pyobject_seek_handler * readstat_set_open_handler(parser, open_handler) # <<<<<<<<<<<<<< @@ -13932,7 +14007,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_open_handler(__pyx_v_parser, __pyx_v_open_handler)); - /* "pyreadstat/_readstat_parser.pyx":981 + /* "pyreadstat/_readstat_parser.pyx":983 * seek_handler = pyobject_seek_handler * readstat_set_open_handler(parser, open_handler) * readstat_set_close_handler(parser, close_handler) # <<<<<<<<<<<<<< @@ -13941,7 +14016,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_close_handler(__pyx_v_parser, __pyx_v_close_handler)); - /* "pyreadstat/_readstat_parser.pyx":982 + /* "pyreadstat/_readstat_parser.pyx":984 * readstat_set_open_handler(parser, open_handler) * readstat_set_close_handler(parser, close_handler) * readstat_set_read_handler(parser, read_handler) # <<<<<<<<<<<<<< @@ -13950,7 +14025,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_read_handler(__pyx_v_parser, __pyx_v_read_handler)); - /* "pyreadstat/_readstat_parser.pyx":983 + /* "pyreadstat/_readstat_parser.pyx":985 * readstat_set_close_handler(parser, close_handler) * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) # <<<<<<<<<<<<<< @@ -13959,7 +14034,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_seek_handler(__pyx_v_parser, __pyx_v_seek_handler)); - /* "pyreadstat/_readstat_parser.pyx":974 + /* "pyreadstat/_readstat_parser.pyx":976 * * # Set up custom I/O handlers for file objects * if file_obj is not None: # <<<<<<<<<<<<<< @@ -13969,23 +14044,23 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":984 + /* "pyreadstat/_readstat_parser.pyx":986 * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) * elif os.name == "nt": # <<<<<<<<<<<<<< * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __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, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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, 984, __pyx_L1_error) + __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, 986, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":986 + /* "pyreadstat/_readstat_parser.pyx":988 * elif os.name == "nt": * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open # <<<<<<<<<<<<<< @@ -13994,7 +14069,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_open_handler = ((readstat_open_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_open); - /* "pyreadstat/_readstat_parser.pyx":987 + /* "pyreadstat/_readstat_parser.pyx":989 * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open * readstat_set_open_handler(parser, open_handler) # <<<<<<<<<<<<<< @@ -14003,7 +14078,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_open_handler(__pyx_v_parser, __pyx_v_open_handler)); - /* "pyreadstat/_readstat_parser.pyx":984 + /* "pyreadstat/_readstat_parser.pyx":986 * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) * elif os.name == "nt": # <<<<<<<<<<<<<< @@ -14013,7 +14088,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":989 + /* "pyreadstat/_readstat_parser.pyx":991 * readstat_set_open_handler(parser, open_handler) * * if not metaonly: # <<<<<<<<<<<<<< @@ -14023,16 +14098,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (!__pyx_v_metaonly); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":990 + /* "pyreadstat/_readstat_parser.pyx":992 * * if not metaonly: * check_exit_status(readstat_set_value_handler(parser, value_handler)) # <<<<<<<<<<<<<< * * # if the user set the encoding manually */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 990, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":989 + /* "pyreadstat/_readstat_parser.pyx":991 * readstat_set_open_handler(parser, open_handler) * * if not metaonly: # <<<<<<<<<<<<<< @@ -14041,7 +14116,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":993 + /* "pyreadstat/_readstat_parser.pyx":995 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< @@ -14049,10 +14124,10 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ * readstat_set_file_character_encoding(parser, encoding_bytes) */ __pyx_t_1 = (__pyx_v_data->user_encoding != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_data->user_encoding) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 993, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 995, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":994 + /* "pyreadstat/_readstat_parser.pyx":996 * # if the user set the encoding manually * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") # <<<<<<<<<<<<<< @@ -14061,24 +14136,24 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ if (unlikely(__pyx_v_data->user_encoding == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 994, __pyx_L1_error) + __PYX_ERR(0, 996, __pyx_L1_error) } - __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_data->user_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_data->user_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_encoding_bytes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":995 + /* "pyreadstat/_readstat_parser.pyx":997 * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") * readstat_set_file_character_encoding(parser, encoding_bytes) # <<<<<<<<<<<<<< * * if row_limit: */ - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 995, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L1_error) (void)(readstat_set_file_character_encoding(__pyx_v_parser, ((char *)__pyx_t_4))); - /* "pyreadstat/_readstat_parser.pyx":993 + /* "pyreadstat/_readstat_parser.pyx":995 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< @@ -14087,7 +14162,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":997 + /* "pyreadstat/_readstat_parser.pyx":999 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -14097,16 +14172,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_limit != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":998 + /* "pyreadstat/_readstat_parser.pyx":1000 * * if row_limit: * check_exit_status(readstat_set_row_limit(parser, row_limit)) # <<<<<<<<<<<<<< * * if row_offset: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":997 + /* "pyreadstat/_readstat_parser.pyx":999 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -14115,7 +14190,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":1000 + /* "pyreadstat/_readstat_parser.pyx":1002 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -14125,16 +14200,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_offset != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1001 + /* "pyreadstat/_readstat_parser.pyx":1003 * * if row_offset: * check_exit_status(readstat_set_row_offset(parser, row_offset)) # <<<<<<<<<<<<<< * * # parse! */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1003, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1000 + /* "pyreadstat/_readstat_parser.pyx":1002 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -14143,7 +14218,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":1004 + /* "pyreadstat/_readstat_parser.pyx":1006 * * # parse! * if file_extension == FILE_EXT_SAV: # <<<<<<<<<<<<<< @@ -14153,7 +14228,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ switch (__pyx_v_file_extension) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV: - /* "pyreadstat/_readstat_parser.pyx":1005 + /* "pyreadstat/_readstat_parser.pyx":1007 * # parse! * if file_extension == FILE_EXT_SAV: * error = readstat_parse_sav(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14162,7 +14237,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sav(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1004 + /* "pyreadstat/_readstat_parser.pyx":1006 * * # parse! * if file_extension == FILE_EXT_SAV: # <<<<<<<<<<<<<< @@ -14172,7 +14247,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT: - /* "pyreadstat/_readstat_parser.pyx":1007 + /* "pyreadstat/_readstat_parser.pyx":1009 * error = readstat_parse_sav(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BDAT: * error = readstat_parse_sas7bdat(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14181,7 +14256,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sas7bdat(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1006 + /* "pyreadstat/_readstat_parser.pyx":1008 * if file_extension == FILE_EXT_SAV: * error = readstat_parse_sav(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BDAT: # <<<<<<<<<<<<<< @@ -14191,7 +14266,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA: - /* "pyreadstat/_readstat_parser.pyx":1009 + /* "pyreadstat/_readstat_parser.pyx":1011 * error = readstat_parse_sas7bdat(parser, filename, ctx); * elif file_extension == FILE_EXT_DTA: * error = readstat_parse_dta(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14200,7 +14275,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_dta(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1008 + /* "pyreadstat/_readstat_parser.pyx":1010 * elif file_extension == FILE_EXT_SAS7BDAT: * error = readstat_parse_sas7bdat(parser, filename, ctx); * elif file_extension == FILE_EXT_DTA: # <<<<<<<<<<<<<< @@ -14210,7 +14285,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT: - /* "pyreadstat/_readstat_parser.pyx":1011 + /* "pyreadstat/_readstat_parser.pyx":1013 * error = readstat_parse_dta(parser, filename, ctx); * elif file_extension == FILE_EXT_XPORT: * error = readstat_parse_xport(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14219,7 +14294,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_xport(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1010 + /* "pyreadstat/_readstat_parser.pyx":1012 * elif file_extension == FILE_EXT_DTA: * error = readstat_parse_dta(parser, filename, ctx); * elif file_extension == FILE_EXT_XPORT: # <<<<<<<<<<<<<< @@ -14229,7 +14304,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR: - /* "pyreadstat/_readstat_parser.pyx":1013 + /* "pyreadstat/_readstat_parser.pyx":1015 * error = readstat_parse_xport(parser, filename, ctx); * elif file_extension == FILE_EXT_POR: * error = readstat_parse_por(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14238,7 +14313,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_por(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1012 + /* "pyreadstat/_readstat_parser.pyx":1014 * elif file_extension == FILE_EXT_XPORT: * error = readstat_parse_xport(parser, filename, ctx); * elif file_extension == FILE_EXT_POR: # <<<<<<<<<<<<<< @@ -14248,7 +14323,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT: - /* "pyreadstat/_readstat_parser.pyx":1015 + /* "pyreadstat/_readstat_parser.pyx":1017 * error = readstat_parse_por(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BCAT: * error = readstat_parse_sas7bcat(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14257,7 +14332,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sas7bcat(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1014 + /* "pyreadstat/_readstat_parser.pyx":1016 * elif file_extension == FILE_EXT_POR: * error = readstat_parse_por(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -14268,7 +14343,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ default: break; } - /* "pyreadstat/_readstat_parser.pyx":1017 + /* "pyreadstat/_readstat_parser.pyx":1019 * error = readstat_parse_sas7bcat(parser, filename, ctx); * #error = parse_func(parser, filename, ctx); * readstat_parser_free(parser) # <<<<<<<<<<<<<< @@ -14277,7 +14352,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ readstat_parser_free(__pyx_v_parser); - /* "pyreadstat/_readstat_parser.pyx":1020 + /* "pyreadstat/_readstat_parser.pyx":1022 * # check if a python error ocurred, if yes, it will be printed by the interpreter, * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() # <<<<<<<<<<<<<< @@ -14286,7 +14361,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_pyerr = PyErr_Occurred(); - /* "pyreadstat/_readstat_parser.pyx":1021 + /* "pyreadstat/_readstat_parser.pyx":1023 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -14296,16 +14371,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (((void *)__pyx_v_pyerr) == NULL); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1022 + /* "pyreadstat/_readstat_parser.pyx":1024 * pyerr = PyErr_Occurred() * if pyerr == NULL: * check_exit_status(error) # <<<<<<<<<<<<<< * * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1021 + /* "pyreadstat/_readstat_parser.pyx":1023 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -14314,7 +14389,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":929 + /* "pyreadstat/_readstat_parser.pyx":931 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -14333,7 +14408,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":1025 +/* "pyreadstat/_readstat_parser.pyx":1027 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -14367,7 +14442,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_to_dict", 0); - /* "pyreadstat/_readstat_parser.pyx":1039 + /* "pyreadstat/_readstat_parser.pyx":1041 * cdef bint metaonly * * final_container = OrderedDict() # <<<<<<<<<<<<<< @@ -14375,7 +14450,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( * col_names = data.col_names */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -14394,13 +14469,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_final_container = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1040 + /* "pyreadstat/_readstat_parser.pyx":1042 * * final_container = OrderedDict() * col_data = data.col_data # <<<<<<<<<<<<<< @@ -14412,7 +14487,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1041 + /* "pyreadstat/_readstat_parser.pyx":1043 * final_container = OrderedDict() * col_data = data.col_data * col_names = data.col_names # <<<<<<<<<<<<<< @@ -14424,7 +14499,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1042 + /* "pyreadstat/_readstat_parser.pyx":1044 * col_data = data.col_data * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -14434,7 +14509,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":1043 + /* "pyreadstat/_readstat_parser.pyx":1045 * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs # <<<<<<<<<<<<<< @@ -14444,7 +14519,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_6 = __pyx_v_data->max_n_obs; __pyx_v_max_n_obs = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1044 + /* "pyreadstat/_readstat_parser.pyx":1046 * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -14454,7 +14529,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":1046 + /* "pyreadstat/_readstat_parser.pyx":1048 * metaonly = data.metaonly * * for fc_cnt in range(0, len(col_names)): # <<<<<<<<<<<<<< @@ -14463,14 +14538,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1046, __pyx_L1_error) + __PYX_ERR(0, 1048, __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, 1046, __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, 1048, __pyx_L1_error) __pyx_t_8 = __pyx_t_7; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) { __pyx_v_fc_cnt = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1047 + /* "pyreadstat/_readstat_parser.pyx":1049 * * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] # <<<<<<<<<<<<<< @@ -14479,15 +14554,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1047, __pyx_L1_error) + __PYX_ERR(0, 1049, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_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, 1047, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cur_name_str, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1048 + /* "pyreadstat/_readstat_parser.pyx":1050 * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] # <<<<<<<<<<<<<< @@ -14496,14 +14571,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1048, __pyx_L1_error) + __PYX_ERR(0, 1050, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1049 + /* "pyreadstat/_readstat_parser.pyx":1051 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -14520,19 +14595,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_L6_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":1050 + /* "pyreadstat/_readstat_parser.pyx":1052 * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] # <<<<<<<<<<<<<< * if not metaonly: * final_container[cur_name_str] = cur_data */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1049 + /* "pyreadstat/_readstat_parser.pyx":1051 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -14541,7 +14616,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ } - /* "pyreadstat/_readstat_parser.pyx":1051 + /* "pyreadstat/_readstat_parser.pyx":1053 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -14551,16 +14626,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = (!__pyx_v_metaonly); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":1052 + /* "pyreadstat/_readstat_parser.pyx":1054 * cur_data = cur_data[0:max_n_obs] * if not metaonly: * final_container[cur_name_str] = cur_data # <<<<<<<<<<<<<< * else: * final_container[cur_name_str] = list() */ - if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0))) __PYX_ERR(0, 1052, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0))) __PYX_ERR(0, 1054, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1051 + /* "pyreadstat/_readstat_parser.pyx":1053 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -14570,7 +14645,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( goto __pyx_L8; } - /* "pyreadstat/_readstat_parser.pyx":1054 + /* "pyreadstat/_readstat_parser.pyx":1056 * final_container[cur_name_str] = cur_data * else: * final_container[cur_name_str] = list() # <<<<<<<<<<<<<< @@ -14578,15 +14653,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( * return final_container */ /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0))) __PYX_ERR(0, 1054, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0))) __PYX_ERR(0, 1056, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; } - /* "pyreadstat/_readstat_parser.pyx":1056 + /* "pyreadstat/_readstat_parser.pyx":1058 * final_container[cur_name_str] = list() * * return final_container # <<<<<<<<<<<<<< @@ -14598,7 +14673,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_r = __pyx_v_final_container; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1025 + /* "pyreadstat/_readstat_parser.pyx":1027 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -14624,7 +14699,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1058 +/* "pyreadstat/_readstat_parser.pyx":1060 * return final_container * * cdef object dict_to_dataframe(object dict_data, data_container dc): # <<<<<<<<<<<<<< @@ -14676,7 +14751,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dict_to_dataframe", 0); - /* "pyreadstat/_readstat_parser.pyx":1068 + /* "pyreadstat/_readstat_parser.pyx":1070 * cdef py_datetime_format var_format * cdef list dtypes, sertypes, datetime_cols, date_cols * cdef dict schema = None # <<<<<<<<<<<<<< @@ -14686,7 +14761,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(Py_None); __pyx_v_schema = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":1070 + /* "pyreadstat/_readstat_parser.pyx":1072 * cdef dict schema = None * * dates_as_pandas = dc.dates_as_pandas # <<<<<<<<<<<<<< @@ -14696,7 +14771,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_1 = __pyx_v_dc->dates_as_pandas; __pyx_v_dates_as_pandas = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1071 + /* "pyreadstat/_readstat_parser.pyx":1073 * * dates_as_pandas = dc.dates_as_pandas * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -14708,47 +14783,47 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_v_output_format = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1073 + /* "pyreadstat/_readstat_parser.pyx":1075 * output_format = dc.output_format * * if dict_data: # <<<<<<<<<<<<<< * #schema = None * # in polars if missing user values we need to explicitly set the type */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1077 + /* "pyreadstat/_readstat_parser.pyx":1079 * # in polars if missing user values we need to explicitly set the type * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: # <<<<<<<<<<<<<< * schema = dict() * for indx in range(0, len(dc.col_names)): */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_dc->missing_user_values); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_dc->missing_user_values); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1078 + /* "pyreadstat/_readstat_parser.pyx":1080 * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: * schema = dict() # <<<<<<<<<<<<<< * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_schema, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1079 + /* "pyreadstat/_readstat_parser.pyx":1081 * if output_format != "pandas" and dc.missing_user_values: * schema = dict() * for indx in range(0, len(dc.col_names)): # <<<<<<<<<<<<<< @@ -14759,15 +14834,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1079, __pyx_L1_error) + __PYX_ERR(0, 1081, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_indx = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1080 + /* "pyreadstat/_readstat_parser.pyx":1082 * schema = dict() * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] # <<<<<<<<<<<<<< @@ -14776,53 +14851,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1080, __pyx_L1_error) + __PYX_ERR(0, 1082, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_indx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_indx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_col_name, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1081 + /* "pyreadstat/_readstat_parser.pyx":1083 * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): # <<<<<<<<<<<<<< * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide */ - __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 1081, __pyx_L1_error) + __PYX_ERR(0, 1083, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_dc->missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_dc->missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1082 + /* "pyreadstat/_readstat_parser.pyx":1084 * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): * sertypes = [type(x) for x in dict_data[col_name] if x is not None] # <<<<<<<<<<<<<< * # all missing, let polars decide * if not sertypes: */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict_data, __pyx_v_col_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict_data, __pyx_v_col_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1084, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14831,7 +14906,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } @@ -14841,7 +14916,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1082, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } @@ -14852,13 +14927,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_9; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_10(__pyx_t_8); 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, 1082, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1084, __pyx_L1_error) PyErr_Clear(); } break; @@ -14869,14 +14944,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = 0; __pyx_t_1 = (__pyx_v_x != Py_None); if (__pyx_t_1) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)((PyObject *)Py_TYPE(__pyx_v_x))))) __PYX_ERR(0, 1082, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)((PyObject *)Py_TYPE(__pyx_v_x))))) __PYX_ERR(0, 1084, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_sertypes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1084 + /* "pyreadstat/_readstat_parser.pyx":1086 * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide * if not sertypes: # <<<<<<<<<<<<<< @@ -14884,20 +14959,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * continue */ __pyx_t_1 = (__Pyx_PyList_GET_SIZE(__pyx_v_sertypes) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1086, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1085 + /* "pyreadstat/_readstat_parser.pyx":1087 * # all missing, let polars decide * if not sertypes: * schema[col_name] = None # <<<<<<<<<<<<<< * continue * allsame = all([x==sertypes[0] for x in sertypes]) */ - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1085, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1087, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1086 + /* "pyreadstat/_readstat_parser.pyx":1088 * if not sertypes: * schema[col_name] = None * continue # <<<<<<<<<<<<<< @@ -14906,7 +14981,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ goto __pyx_L7_continue; - /* "pyreadstat/_readstat_parser.pyx":1084 + /* "pyreadstat/_readstat_parser.pyx":1086 * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide * if not sertypes: # <<<<<<<<<<<<<< @@ -14915,7 +14990,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1087 + /* "pyreadstat/_readstat_parser.pyx":1089 * schema[col_name] = None * continue * allsame = all([x==sertypes[0] for x in sertypes]) # <<<<<<<<<<<<<< @@ -14925,7 +15000,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_all); __pyx_t_2 = __pyx_builtin_all; - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __pyx_v_sertypes; __Pyx_INCREF(__pyx_t_12); __pyx_t_9 = 0; @@ -14933,21 +15008,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1087, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1089, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } __pyx_t_13 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_9); ++__pyx_t_9; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1087, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_sertypes, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_sertypes, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyObject_RichCompare(__pyx_v_x, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_v_x, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 1087, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -14958,14 +15033,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1087, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1087, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_allsame = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":1089 + /* "pyreadstat/_readstat_parser.pyx":1091 * allsame = all([x==sertypes[0] for x in sertypes]) * # all the same: let polars decide * if allsame: # <<<<<<<<<<<<<< @@ -14974,16 +15049,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (__pyx_v_allsame) { - /* "pyreadstat/_readstat_parser.pyx":1090 + /* "pyreadstat/_readstat_parser.pyx":1092 * # all the same: let polars decide * if allsame: * schema[col_name] = None # <<<<<<<<<<<<<< * # not all the same type, has to be Object * else: */ - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1092, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1089 + /* "pyreadstat/_readstat_parser.pyx":1091 * allsame = all([x==sertypes[0] for x in sertypes]) * # all the same: let polars decide * if allsame: # <<<<<<<<<<<<<< @@ -14993,7 +15068,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L18; } - /* "pyreadstat/_readstat_parser.pyx":1093 + /* "pyreadstat/_readstat_parser.pyx":1095 * # not all the same type, has to be Object * else: * schema[col_name] = nw.Object # <<<<<<<<<<<<<< @@ -15001,17 +15076,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * schema[col_name] = None */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1093, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(0, 1093, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L18:; - /* "pyreadstat/_readstat_parser.pyx":1081 + /* "pyreadstat/_readstat_parser.pyx":1083 * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): # <<<<<<<<<<<<<< @@ -15021,7 +15096,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L9; } - /* "pyreadstat/_readstat_parser.pyx":1095 + /* "pyreadstat/_readstat_parser.pyx":1097 * schema[col_name] = nw.Object * else: * schema[col_name] = None # <<<<<<<<<<<<<< @@ -15029,13 +15104,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) */ /*else*/ { - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1095, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) } __pyx_L9:; __pyx_L7_continue:; } - /* "pyreadstat/_readstat_parser.pyx":1077 + /* "pyreadstat/_readstat_parser.pyx":1079 * # in polars if missing user values we need to explicitly set the type * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: # <<<<<<<<<<<<<< @@ -15044,7 +15119,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1097 + /* "pyreadstat/_readstat_parser.pyx":1099 * schema[col_name] = None * * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) # <<<<<<<<<<<<<< @@ -15052,9 +15127,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * data_frame = data_frame.to_native() */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1097, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1097, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = 1; @@ -15071,21 +15146,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_7, __pyx_v_dict_data}; - __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1097, __pyx_L1_error) + __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_schema, __pyx_t_11, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1099, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_schema, __pyx_t_11, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 1099, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_data_frame = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1098 + /* "pyreadstat/_readstat_parser.pyx":1100 * * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) * natnamespace = nw.get_native_namespace(data_frame) # <<<<<<<<<<<<<< @@ -15093,9 +15168,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1098, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = 1; @@ -15115,13 +15190,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__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, 1098, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_natnamespace = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1099 + /* "pyreadstat/_readstat_parser.pyx":1101 * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) * natnamespace = nw.get_native_namespace(data_frame) * data_frame = data_frame.to_native() # <<<<<<<<<<<<<< @@ -15135,13 +15210,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_native, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1101 + /* "pyreadstat/_readstat_parser.pyx":1103 * data_frame = data_frame.to_native() * * if dates_as_pandas and output_format=="pandas": # <<<<<<<<<<<<<< @@ -15153,12 +15228,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = __pyx_v_dates_as_pandas; goto __pyx_L20_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) __pyx_t_3 = __pyx_t_1; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1102 + /* "pyreadstat/_readstat_parser.pyx":1104 * * if dates_as_pandas and output_format=="pandas": * pd = natnamespace # <<<<<<<<<<<<<< @@ -15168,14 +15243,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_v_natnamespace); __pyx_v_pd = __pyx_v_natnamespace; - /* "pyreadstat/_readstat_parser.pyx":1103 + /* "pyreadstat/_readstat_parser.pyx":1105 * if dates_as_pandas and output_format=="pandas": * pd = natnamespace * dtypes = data_frame.dtypes.tolist() # <<<<<<<<<<<<<< * # check that datetime columns are datetime type * # this is needed in case all date values are nan */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); @@ -15185,14 +15260,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (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_2)) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 1105, __pyx_L1_error) __pyx_v_dtypes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1106 + /* "pyreadstat/_readstat_parser.pyx":1108 * # check that datetime columns are datetime type * # this is needed in case all date values are nan * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15200,16 +15275,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if dtypes[index] != '__pyx_n_u_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1108, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -15218,7 +15293,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15228,7 +15303,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15239,26 +15314,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_10(__pyx_t_8); 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, 1106, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1108, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1108, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_column, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_index = __pyx_t_16; __pyx_t_16 = (__pyx_t_16 + 1); - /* "pyreadstat/_readstat_parser.pyx":1107 + /* "pyreadstat/_readstat_parser.pyx":1109 * # this is needed in case all date values are nan * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -15267,15 +15342,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1107, __pyx_L1_error) + __PYX_ERR(0, 1109, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1107, __pyx_L1_error) + __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_var_format = __pyx_t_17; - /* "pyreadstat/_readstat_parser.pyx":1108 + /* "pyreadstat/_readstat_parser.pyx":1110 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_kp_u_M8_ns, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_M8_ns, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { @@ -15308,7 +15383,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_L25_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1109 + /* "pyreadstat/_readstat_parser.pyx":1111 * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_n_u_to_datetime, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_loc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_loc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1109, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1111, __pyx_L1_error); __Pyx_INCREF(__pyx_v_column); __Pyx_GIVEREF(__pyx_v_column); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_column) != (0)) __PYX_ERR(0, 1109, __pyx_L1_error); - if (unlikely((PyObject_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_2) < 0))) __PYX_ERR(0, 1109, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_column) != (0)) __PYX_ERR(0, 1111, __pyx_L1_error); + if (unlikely((PyObject_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_2) < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1108 + /* "pyreadstat/_readstat_parser.pyx":1110 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; @@ -15389,7 +15464,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_L29_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1113 + /* "pyreadstat/_readstat_parser.pyx":1115 * if output_format == "polars" and not dc.no_datetime_conversion: * # datetime and date vectorized conversion * pl = natnamespace # <<<<<<<<<<<<<< @@ -15399,31 +15474,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_v_natnamespace); __pyx_v_pl = __pyx_v_natnamespace; - /* "pyreadstat/_readstat_parser.pyx":1114 + /* "pyreadstat/_readstat_parser.pyx":1116 * # datetime and date vectorized conversion * pl = natnamespace * datetime_cols = list() # <<<<<<<<<<<<<< * date_cols = list() * for index, column in enumerate(data_frame.columns): */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_datetime_cols = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1115 + /* "pyreadstat/_readstat_parser.pyx":1117 * pl = natnamespace * datetime_cols = list() * date_cols = list() # <<<<<<<<<<<<<< * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_date_cols = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1116 + /* "pyreadstat/_readstat_parser.pyx":1118 * datetime_cols = list() * date_cols = list() * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15431,16 +15506,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if var_format == DATE_FORMAT_DATETIME: */ __pyx_t_16 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -15449,7 +15524,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15459,7 +15534,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15470,26 +15545,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1118, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_10(__pyx_t_2); 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, 1116, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1118, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1116, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_column, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; __pyx_v_index = __pyx_t_16; __pyx_t_16 = (__pyx_t_16 + 1); - /* "pyreadstat/_readstat_parser.pyx":1117 + /* "pyreadstat/_readstat_parser.pyx":1119 * date_cols = list() * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -15498,15 +15573,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1117, __pyx_L1_error) + __PYX_ERR(0, 1119, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_var_format = __pyx_t_17; - /* "pyreadstat/_readstat_parser.pyx":1118 + /* "pyreadstat/_readstat_parser.pyx":1120 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -15516,16 +15591,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = (__pyx_v_var_format == __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1119 + /* "pyreadstat/_readstat_parser.pyx":1121 * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) # <<<<<<<<<<<<<< * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) */ - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_datetime_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_datetime_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1121, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1118 + /* "pyreadstat/_readstat_parser.pyx":1120 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -15534,7 +15609,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1120 + /* "pyreadstat/_readstat_parser.pyx":1122 * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -15544,16 +15619,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = (__pyx_v_var_format == __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1121 + /* "pyreadstat/_readstat_parser.pyx":1123 * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) # <<<<<<<<<<<<<< * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) */ - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_date_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_date_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1123, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1120 + /* "pyreadstat/_readstat_parser.pyx":1122 * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -15562,7 +15637,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1116 + /* "pyreadstat/_readstat_parser.pyx":1118 * datetime_cols = list() * date_cols = list() * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15572,7 +15647,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1122 + /* "pyreadstat/_readstat_parser.pyx":1124 * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) * if datetime_cols: # <<<<<<<<<<<<<< @@ -15580,10 +15655,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if date_cols: */ __pyx_t_3 = (__Pyx_PyList_GET_SIZE(__pyx_v_datetime_cols) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1124, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1123 + /* "pyreadstat/_readstat_parser.pyx":1125 * date_cols.append(column) * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) # <<<<<<<<<<<<<< @@ -15594,25 +15669,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = __pyx_v_pl; __Pyx_INCREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1123, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = PySequence_Tuple(__pyx_v_datetime_cols); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1123, __pyx_L1_error) + __pyx_t_14 = PySequence_Tuple(__pyx_v_datetime_cols); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1123, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_11, __pyx_t_13}; - __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1123, __pyx_L1_error) + __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_s, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1123, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_s, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_from_epoch, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_15 = 0; @@ -15621,13 +15696,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__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, 1123, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1122 + /* "pyreadstat/_readstat_parser.pyx":1124 * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) * if datetime_cols: # <<<<<<<<<<<<<< @@ -15636,7 +15711,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1124 + /* "pyreadstat/_readstat_parser.pyx":1126 * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) * if date_cols: # <<<<<<<<<<<<<< @@ -15644,10 +15719,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * */ __pyx_t_3 = (__Pyx_PyList_GET_SIZE(__pyx_v_date_cols) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1126, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1125 + /* "pyreadstat/_readstat_parser.pyx":1127 * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) * if date_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*date_cols), time_unit='d')) # <<<<<<<<<<<<<< @@ -15658,25 +15733,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_7); __pyx_t_14 = __pyx_v_pl; __Pyx_INCREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = PySequence_Tuple(__pyx_v_date_cols); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_11 = PySequence_Tuple(__pyx_v_date_cols); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_14, __pyx_t_12}; - __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_d, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_d, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_from_epoch, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_15 = 0; @@ -15685,13 +15760,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (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_2)) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1124 + /* "pyreadstat/_readstat_parser.pyx":1126 * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) * if date_cols: # <<<<<<<<<<<<<< @@ -15700,7 +15775,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1111 + /* "pyreadstat/_readstat_parser.pyx":1113 * data_frame.loc[:, column] = pd.to_datetime(data_frame[column]) * * if output_format == "polars" and not dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -15709,7 +15784,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1073 + /* "pyreadstat/_readstat_parser.pyx":1075 * output_format = dc.output_format * * if dict_data: # <<<<<<<<<<<<<< @@ -15719,7 +15794,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1128 + /* "pyreadstat/_readstat_parser.pyx":1130 * * else: * data_frame = nw.from_dict(dict_data, backend=output_format).to_native() # <<<<<<<<<<<<<< @@ -15728,9 +15803,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ /*else*/ { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1128, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_15 = 1; @@ -15747,14 +15822,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_11, __pyx_v_dict_data}; - __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1128, __pyx_L1_error) + __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1128, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1130, __pyx_L1_error) __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_14, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1128, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __pyx_t_7; @@ -15765,7 +15840,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_native, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (1*__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, 1128, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_data_frame = __pyx_t_2; @@ -15773,7 +15848,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1130 + /* "pyreadstat/_readstat_parser.pyx":1132 * data_frame = nw.from_dict(dict_data, backend=output_format).to_native() * * return data_frame # <<<<<<<<<<<<<< @@ -15785,7 +15860,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_r = __pyx_v_data_frame; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1058 + /* "pyreadstat/_readstat_parser.pyx":1060 * return final_container * * cdef object dict_to_dataframe(object dict_data, data_container dc): # <<<<<<<<<<<<<< @@ -15823,7 +15898,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1132 +/* "pyreadstat/_readstat_parser.pyx":1134 * return data_frame * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -15869,7 +15944,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_extract_metadata", 0); - /* "pyreadstat/_readstat_parser.pyx":1149 + /* "pyreadstat/_readstat_parser.pyx":1151 * cdef readstat_type_t var_type * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -15879,7 +15954,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1150 + /* "pyreadstat/_readstat_parser.pyx":1152 * * metaonly = data.metaonly * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -15889,7 +15964,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1152 + /* "pyreadstat/_readstat_parser.pyx":1154 * is_unkown_number_rows = data.is_unkown_number_rows * * cdef object metadata = metadata_container() # <<<<<<<<<<<<<< @@ -15897,7 +15972,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * # mr sets */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -15916,13 +15991,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__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, 1152, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_metadata = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1155 + /* "pyreadstat/_readstat_parser.pyx":1157 * * # mr sets * metadata.mr_sets = data.mr_sets # <<<<<<<<<<<<<< @@ -15931,22 +16006,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->mr_sets; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_2) < 0) __PYX_ERR(0, 1155, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_2) < 0) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1158 + /* "pyreadstat/_readstat_parser.pyx":1160 * * # number of rows * metadata.number_columns = data.n_vars # <<<<<<<<<<<<<< * if is_unkown_number_rows: * if not metaonly: */ - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns, __pyx_t_2) < 0) __PYX_ERR(0, 1158, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns, __pyx_t_2) < 0) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1159 + /* "pyreadstat/_readstat_parser.pyx":1161 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -15955,7 +16030,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (__pyx_v_is_unkown_number_rows) { - /* "pyreadstat/_readstat_parser.pyx":1160 + /* "pyreadstat/_readstat_parser.pyx":1162 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -15965,19 +16040,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = (!__pyx_v_metaonly); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1161 + /* "pyreadstat/_readstat_parser.pyx":1163 * if is_unkown_number_rows: * if not metaonly: * metadata.number_rows = data.max_n_obs # <<<<<<<<<<<<<< * else: * metadata.number_rows = data.n_obs */ - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1161, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1160 + /* "pyreadstat/_readstat_parser.pyx":1162 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -15986,7 +16061,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1159 + /* "pyreadstat/_readstat_parser.pyx":1161 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -15996,7 +16071,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1163 + /* "pyreadstat/_readstat_parser.pyx":1165 * metadata.number_rows = data.max_n_obs * else: * metadata.number_rows = data.n_obs # <<<<<<<<<<<<<< @@ -16004,14 +16079,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * # value labels */ /*else*/ { - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1163, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1166 + /* "pyreadstat/_readstat_parser.pyx":1168 * * # value labels * labels_raw = data.labels_raw # <<<<<<<<<<<<<< @@ -16023,7 +16098,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_labels_raw = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1167 + /* "pyreadstat/_readstat_parser.pyx":1169 * # value labels * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name # <<<<<<<<<<<<<< @@ -16035,29 +16110,29 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_label_to_var_name = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1168 + /* "pyreadstat/_readstat_parser.pyx":1170 * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name * variable_value_labels = dict() # <<<<<<<<<<<<<< * * if labels_raw: */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_variable_value_labels = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1170 + /* "pyreadstat/_readstat_parser.pyx":1172 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1171 + /* "pyreadstat/_readstat_parser.pyx":1173 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< @@ -16071,7 +16146,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_items, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -16079,9 +16154,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1173, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -16090,7 +16165,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1171, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1173, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16100,7 +16175,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1171, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1173, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16111,13 +16186,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_7(__pyx_t_4); 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, 1171, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1173, __pyx_L1_error) PyErr_Clear(); } break; @@ -16130,7 +16205,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1171, __pyx_L1_error) + __PYX_ERR(0, 1173, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16140,22 +16215,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1171, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1171, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __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, 1171, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1173, __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); @@ -16163,7 +16238,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1171, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1173, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -16171,17 +16246,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1171, __pyx_L1_error) + __PYX_ERR(0, 1173, __pyx_L1_error) __pyx_L9_unpacking_done:; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1171, __pyx_L1_error) - if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1171, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1173, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_var_name, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_var_label, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1172 + /* "pyreadstat/_readstat_parser.pyx":1174 * if labels_raw: * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) # <<<<<<<<<<<<<< @@ -16195,32 +16270,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_var_label}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_current_labels, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1173 + /* "pyreadstat/_readstat_parser.pyx":1175 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< * variable_value_labels[var_name] = current_labels * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1175, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1174 + /* "pyreadstat/_readstat_parser.pyx":1176 * current_labels = labels_raw.get(var_label) * if current_labels: * variable_value_labels[var_name] = current_labels # <<<<<<<<<<<<<< * * original_types = dict() */ - if (unlikely((PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1173 + /* "pyreadstat/_readstat_parser.pyx":1175 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< @@ -16229,7 +16304,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1171 + /* "pyreadstat/_readstat_parser.pyx":1173 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< @@ -16239,7 +16314,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1170 + /* "pyreadstat/_readstat_parser.pyx":1172 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< @@ -16248,31 +16323,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1176 + /* "pyreadstat/_readstat_parser.pyx":1178 * variable_value_labels[var_name] = current_labels * * original_types = dict() # <<<<<<<<<<<<<< * readstat_types = dict() * for indx in range(metadata.number_columns): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_original_types = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1177 + /* "pyreadstat/_readstat_parser.pyx":1179 * * original_types = dict() * readstat_types = dict() # <<<<<<<<<<<<<< * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_readstat_types = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1178 + /* "pyreadstat/_readstat_parser.pyx":1180 * original_types = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< @@ -16282,7 +16357,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_range); __pyx_t_8 = __pyx_builtin_range; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -16291,7 +16366,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -16299,9 +16374,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1180, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -16310,7 +16385,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16320,7 +16395,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16331,13 +16406,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_8); 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, 1178, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1180, __pyx_L1_error) PyErr_Clear(); } break; @@ -16347,7 +16422,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1179 + /* "pyreadstat/_readstat_parser.pyx":1181 * readstat_types = dict() * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -16356,14 +16431,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1179, __pyx_L1_error) + __PYX_ERR(0, 1181, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1180 + /* "pyreadstat/_readstat_parser.pyx":1182 * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] # <<<<<<<<<<<<<< @@ -16372,23 +16447,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_formats_original == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1180, __pyx_L1_error) + __PYX_ERR(0, 1182, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_cur_type, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1181 + /* "pyreadstat/_readstat_parser.pyx":1183 * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] * original_types[cur_col] = cur_type # <<<<<<<<<<<<<< * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: */ - if (unlikely((PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1182 + /* "pyreadstat/_readstat_parser.pyx":1184 * cur_type = data.col_formats_original[indx] * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] # <<<<<<<<<<<<<< @@ -16397,15 +16472,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1182, __pyx_L1_error) + __PYX_ERR(0, 1184, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_11 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_var_type = __pyx_t_11; - /* "pyreadstat/_readstat_parser.pyx":1183 + /* "pyreadstat/_readstat_parser.pyx":1185 * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -16416,16 +16491,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ case READSTAT_TYPE_STRING: case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":1184 + /* "pyreadstat/_readstat_parser.pyx":1186 * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_string) < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_string) < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1183 + /* "pyreadstat/_readstat_parser.pyx":1185 * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -16435,16 +16510,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":1186 + /* "pyreadstat/_readstat_parser.pyx":1188 * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int8) < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int8) < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1185 + /* "pyreadstat/_readstat_parser.pyx":1187 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -16454,16 +16529,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":1188 + /* "pyreadstat/_readstat_parser.pyx":1190 * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int16) < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int16) < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1187 + /* "pyreadstat/_readstat_parser.pyx":1189 * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -16473,16 +16548,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":1190 + /* "pyreadstat/_readstat_parser.pyx":1192 * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int32) < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int32) < 0))) __PYX_ERR(0, 1192, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1189 + /* "pyreadstat/_readstat_parser.pyx":1191 * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -16492,16 +16567,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":1192 + /* "pyreadstat/_readstat_parser.pyx":1194 * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_float) < 0))) __PYX_ERR(0, 1192, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_float) < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1191 + /* "pyreadstat/_readstat_parser.pyx":1193 * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -16511,16 +16586,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":1194 + /* "pyreadstat/_readstat_parser.pyx":1196 * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" # <<<<<<<<<<<<<< * else: * raise PyreadstatError("Unkown data type") */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_double) < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_double) < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1193 + /* "pyreadstat/_readstat_parser.pyx":1195 * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -16530,7 +16605,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; default: - /* "pyreadstat/_readstat_parser.pyx":1196 + /* "pyreadstat/_readstat_parser.pyx":1198 * readstat_types[cur_col] = "double" * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -16538,7 +16613,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * for indx, curset in data.missing_user_values.items(): */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1196, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -16557,16 +16632,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __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; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __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, 1196, __pyx_L1_error) + __PYX_ERR(0, 1198, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1178 + /* "pyreadstat/_readstat_parser.pyx":1180 * original_types = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< @@ -16576,7 +16651,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1198 + /* "pyreadstat/_readstat_parser.pyx":1200 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -16585,18 +16660,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1198, __pyx_L1_error) + __PYX_ERR(0, 1200, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1200, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -16605,7 +16680,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1198, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16615,7 +16690,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1198, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16626,13 +16701,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1200, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_7(__pyx_t_4); 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, 1198, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1200, __pyx_L1_error) PyErr_Clear(); } break; @@ -16645,7 +16720,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1198, __pyx_L1_error) + __PYX_ERR(0, 1200, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16655,22 +16730,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -16678,7 +16753,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1200, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_unpacking_done; @@ -16686,7 +16761,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1198, __pyx_L1_error) + __PYX_ERR(0, 1200, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_2); @@ -16694,7 +16769,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_curset, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1199 + /* "pyreadstat/_readstat_parser.pyx":1201 * * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -16703,33 +16778,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1199, __pyx_L1_error) + __PYX_ERR(0, 1201, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1199, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1200 + /* "pyreadstat/_readstat_parser.pyx":1202 * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] * metadata.missing_user_values[cur_col] = sorted(list(curset)) # <<<<<<<<<<<<<< * * metadata.notes = data.notes */ - __pyx_t_8 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_8 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_3 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely((PyList_Sort(__pyx_t_3) < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely((PyList_Sort(__pyx_t_3) < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_v_cur_col, __pyx_t_3) < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_v_cur_col, __pyx_t_3) < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1198 + /* "pyreadstat/_readstat_parser.pyx":1200 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -16739,7 +16814,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1202 + /* "pyreadstat/_readstat_parser.pyx":1204 * metadata.missing_user_values[cur_col] = sorted(list(curset)) * * metadata.notes = data.notes # <<<<<<<<<<<<<< @@ -16748,10 +16823,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->notes; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_4) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_4) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1203 + /* "pyreadstat/_readstat_parser.pyx":1205 * * metadata.notes = data.notes * metadata.column_names = data.col_names # <<<<<<<<<<<<<< @@ -16760,10 +16835,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->col_names; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_4) < 0) __PYX_ERR(0, 1203, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_4) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1204 + /* "pyreadstat/_readstat_parser.pyx":1206 * metadata.notes = data.notes * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels # <<<<<<<<<<<<<< @@ -16772,10 +16847,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->col_labels; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1205 + /* "pyreadstat/_readstat_parser.pyx":1207 * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} # <<<<<<<<<<<<<< @@ -16783,7 +16858,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * metadata.file_label = data.file_label */ { /* enter inner scope */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L22_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_zip); @@ -16794,7 +16869,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__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_3)) __PYX_ERR(0, 1205, __pyx_L22_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -16802,9 +16877,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __pyx_L22_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1205, __pyx_L22_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1207, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -16813,7 +16888,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1205, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L22_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16823,7 +16898,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1205, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L22_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16834,13 +16909,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L22_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L22_error) } else { __pyx_t_3 = __pyx_t_7(__pyx_t_2); 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, 1205, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1207, __pyx_L22_error) PyErr_Clear(); } break; @@ -16853,7 +16928,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1205, __pyx_L22_error) + __PYX_ERR(0, 1207, __pyx_L22_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16863,22 +16938,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1205, __pyx_L22_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1205, __pyx_L22_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1205, __pyx_L22_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1205, __pyx_L22_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1205, __pyx_L22_error) + __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1207, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); @@ -16886,7 +16961,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L25_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1205, __pyx_L22_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1207, __pyx_L22_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L26_unpacking_done; @@ -16894,14 +16969,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1205, __pyx_L22_error) + __PYX_ERR(0, 1207, __pyx_L22_error) __pyx_L26_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 1205, __pyx_L22_error) + if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 1207, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; @@ -16913,10 +16988,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L1_error; __pyx_L28_exit_scope:; } /* exit inner scope */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1206 + /* "pyreadstat/_readstat_parser.pyx":1208 * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding # <<<<<<<<<<<<<< @@ -16925,10 +17000,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->file_encoding; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_encoding, __pyx_t_4) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_encoding, __pyx_t_4) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1207 + /* "pyreadstat/_readstat_parser.pyx":1209 * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label # <<<<<<<<<<<<<< @@ -16937,55 +17012,55 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->file_label; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_label, __pyx_t_4) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_label, __pyx_t_4) < 0) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1208 + /* "pyreadstat/_readstat_parser.pyx":1210 * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels # <<<<<<<<<<<<<< * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_v_variable_value_labels) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_v_variable_value_labels) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1209 + /* "pyreadstat/_readstat_parser.pyx":1211 * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw # <<<<<<<<<<<<<< * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_v_labels_raw) < 0) __PYX_ERR(0, 1209, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_v_labels_raw) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1210 + /* "pyreadstat/_readstat_parser.pyx":1212 * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name # <<<<<<<<<<<<<< * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_v_label_to_var_name) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_v_label_to_var_name) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1211 + /* "pyreadstat/_readstat_parser.pyx":1213 * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types # <<<<<<<<<<<<<< * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_v_original_types) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_v_original_types) < 0) __PYX_ERR(0, 1213, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1212 + /* "pyreadstat/_readstat_parser.pyx":1214 * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types # <<<<<<<<<<<<<< * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_v_readstat_types) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_v_readstat_types) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1213 + /* "pyreadstat/_readstat_parser.pyx":1215 * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name # <<<<<<<<<<<<<< @@ -16994,10 +17069,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->table_name; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_table_name, __pyx_t_4) < 0) __PYX_ERR(0, 1213, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_table_name, __pyx_t_4) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1214 + /* "pyreadstat/_readstat_parser.pyx":1216 * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges # <<<<<<<<<<<<<< @@ -17006,10 +17081,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->missing_ranges; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_4) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_4) < 0) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1215 + /* "pyreadstat/_readstat_parser.pyx":1217 * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width # <<<<<<<<<<<<<< @@ -17018,10 +17093,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_storage_width; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_4) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_4) < 0) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1216 + /* "pyreadstat/_readstat_parser.pyx":1218 * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width # <<<<<<<<<<<<<< @@ -17030,10 +17105,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_display_width; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_4) < 0) __PYX_ERR(0, 1216, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_4) < 0) __PYX_ERR(0, 1218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1217 + /* "pyreadstat/_readstat_parser.pyx":1219 * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment # <<<<<<<<<<<<<< @@ -17042,10 +17117,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_alignment; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_4) < 0) __PYX_ERR(0, 1217, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_4) < 0) __PYX_ERR(0, 1219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1218 + /* "pyreadstat/_readstat_parser.pyx":1220 * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment * metadata.variable_measure = data.variable_measure # <<<<<<<<<<<<<< @@ -17054,24 +17129,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_measure; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_4) < 0) __PYX_ERR(0, 1218, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_4) < 0) __PYX_ERR(0, 1220, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1219 + /* "pyreadstat/_readstat_parser.pyx":1221 * metadata.variable_alignment = data.variable_alignment * metadata.variable_measure = data.variable_measure * metadata.creation_time = datetime.datetime.fromtimestamp(data.ctime) # <<<<<<<<<<<<<< * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->ctime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->ctime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { @@ -17080,27 +17155,27 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_creation_time, __pyx_t_4) < 0) __PYX_ERR(0, 1219, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_creation_time, __pyx_t_4) < 0) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1220 + /* "pyreadstat/_readstat_parser.pyx":1222 * metadata.variable_measure = data.variable_measure * metadata.creation_time = datetime.datetime.fromtimestamp(data.ctime) * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) # <<<<<<<<<<<<<< * * return metadata */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_2; __Pyx_INCREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->mtime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->mtime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { @@ -17109,13 +17184,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1220, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_modification_time, __pyx_t_4) < 0) __PYX_ERR(0, 1220, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_modification_time, __pyx_t_4) < 0) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1222 + /* "pyreadstat/_readstat_parser.pyx":1224 * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) * * return metadata # <<<<<<<<<<<<<< @@ -17127,7 +17202,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_r = __pyx_v_metadata; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1132 + /* "pyreadstat/_readstat_parser.pyx":1134 * return data_frame * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -17166,7 +17241,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1225 +/* "pyreadstat/_readstat_parser.pyx":1227 * * * cdef object run_conversion(object filename_path, py_file_format file_format, py_file_extension file_extension, # <<<<<<<<<<<<<< @@ -17217,7 +17292,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_RefNannySetupContext("run_conversion", 0); __Pyx_INCREF(__pyx_v_output_format); - /* "pyreadstat/_readstat_parser.pyx":1244 + /* "pyreadstat/_readstat_parser.pyx":1246 * cdef object data_dict * cdef object data_frame * cdef object file_obj = None # <<<<<<<<<<<<<< @@ -17227,25 +17302,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(Py_None); __pyx_v_file_obj = Py_None; - /* "pyreadstat/_readstat_parser.pyx":1247 + /* "pyreadstat/_readstat_parser.pyx":1249 * * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): # <<<<<<<<<<<<<< * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used */ - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1249, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1249, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1248 + /* "pyreadstat/_readstat_parser.pyx":1250 * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): * file_obj = filename_path # <<<<<<<<<<<<<< @@ -17255,7 +17330,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_filename_path); __Pyx_DECREF_SET(__pyx_v_file_obj, __pyx_v_filename_path); - /* "pyreadstat/_readstat_parser.pyx":1249 + /* "pyreadstat/_readstat_parser.pyx":1251 * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used # <<<<<<<<<<<<<< @@ -17265,7 +17340,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_); __pyx_v_filename_bytes = __pyx_mstate_global->__pyx_kp_b_; - /* "pyreadstat/_readstat_parser.pyx":1247 + /* "pyreadstat/_readstat_parser.pyx":1249 * * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): # <<<<<<<<<<<<<< @@ -17275,20 +17350,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1250 + /* "pyreadstat/_readstat_parser.pyx":1252 * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_bytes = os.fsencode(filename_path) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_HasAttr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1251 + /* "pyreadstat/_readstat_parser.pyx":1253 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17304,7 +17379,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1252 + /* "pyreadstat/_readstat_parser.pyx":1254 * elif hasattr(os, 'fsencode'): * try: * filename_bytes = os.fsencode(filename_path) # <<<<<<<<<<<<<< @@ -17312,9 +17387,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * 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_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1254, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1252, __pyx_L6_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1254, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = 1; @@ -17334,14 +17409,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L6_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); } - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(0, 1252, __pyx_L6_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(0, 1254, __pyx_L6_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1251 + /* "pyreadstat/_readstat_parser.pyx":1253 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17359,7 +17434,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1253 + /* "pyreadstat/_readstat_parser.pyx":1255 * try: * filename_bytes = os.fsencode(filename_path) * except UnicodeError: # <<<<<<<<<<<<<< @@ -17369,12 +17444,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeError); if (__pyx_t_11) { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1253, __pyx_L8_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1255, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1254 + /* "pyreadstat/_readstat_parser.pyx":1256 * 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()) # <<<<<<<<<<<<<< @@ -17382,15 +17457,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * else: */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1254, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1254, __pyx_L8_except_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1256, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_15 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1254, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1256, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1254, __pyx_L8_except_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1256, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_10 = 1; @@ -17410,10 +17485,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1254, __pyx_L8_except_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_17 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1254, __pyx_L8_except_error) + __pyx_t_17 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1256, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = 1; @@ -17434,12 +17509,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1254, __pyx_L8_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1256, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1255 + /* "pyreadstat/_readstat_parser.pyx":1257 * 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") # <<<<<<<<<<<<<< @@ -17447,9 +17522,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if type(filename_path) == str: */ __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1255, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1257, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1255, __pyx_L8_except_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1257, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_10 = 1; @@ -17469,16 +17544,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L8_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1255, __pyx_L8_except_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1257, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1255, __pyx_L8_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_8))) __PYX_ERR(0, 1255, __pyx_L8_except_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_8))) __PYX_ERR(0, 1257, __pyx_L8_except_error) __Pyx_XDECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17488,7 +17563,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } goto __pyx_L8_except_error; - /* "pyreadstat/_readstat_parser.pyx":1251 + /* "pyreadstat/_readstat_parser.pyx":1253 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17509,7 +17584,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L11_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1250 + /* "pyreadstat/_readstat_parser.pyx":1252 * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< @@ -17519,7 +17594,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1257 + /* "pyreadstat/_readstat_parser.pyx":1259 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -17527,12 +17602,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * elif type(filename_path) == bytes: */ /*else*/ { - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1257, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1258 + /* "pyreadstat/_readstat_parser.pyx":1260 * else: * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -17546,14 +17621,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1258, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1258, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1260, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1257 + /* "pyreadstat/_readstat_parser.pyx":1259 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -17563,19 +17638,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":1259 + /* "pyreadstat/_readstat_parser.pyx":1261 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1259, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1260 + /* "pyreadstat/_readstat_parser.pyx":1262 * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: * filename_bytes = filename_path # <<<<<<<<<<<<<< @@ -17584,11 +17659,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_t_7 = __pyx_v_filename_path; __Pyx_INCREF(__pyx_t_7); - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1260, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1262, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1259 + /* "pyreadstat/_readstat_parser.pyx":1261 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< @@ -17598,7 +17673,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":1262 + /* "pyreadstat/_readstat_parser.pyx":1264 * filename_bytes = filename_path * else: * raise PyreadstatError("path must be either str or bytes") # <<<<<<<<<<<<<< @@ -17607,7 +17682,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*else*/ { __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -17626,16 +17701,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1262, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1264, __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, 1262, __pyx_L1_error) + __PYX_ERR(0, 1264, __pyx_L1_error) } __pyx_L14:; - /* "pyreadstat/_readstat_parser.pyx":1263 + /* "pyreadstat/_readstat_parser.pyx":1265 * else: * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): # <<<<<<<<<<<<<< @@ -17644,24 +17719,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_filename_path))); __pyx_t_7 = ((PyObject *)Py_TYPE(__pyx_v_filename_path)); - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1263, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1263, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1263, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L16_bool_binop_done:; @@ -17669,7 +17744,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_2 = __pyx_t_1; if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":1264 + /* "pyreadstat/_readstat_parser.pyx":1266 * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): * raise PyreadstatError("path must be str, bytes or unicode") # <<<<<<<<<<<<<< @@ -17677,7 +17752,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1264, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -17696,14 +17771,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1264, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1266, __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, 1264, __pyx_L1_error) + __PYX_ERR(0, 1266, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1263 + /* "pyreadstat/_readstat_parser.pyx":1265 * else: * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): # <<<<<<<<<<<<<< @@ -17712,7 +17787,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1265 + /* "pyreadstat/_readstat_parser.pyx":1267 * if type(filename_path) not in (str, bytes, unicode): * raise PyreadstatError("path must be str, bytes or unicode") * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -17726,16 +17801,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1265, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1265, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1268 + /* "pyreadstat/_readstat_parser.pyx":1270 * * # Only check file existence for path-based reads * if file_obj is None: # <<<<<<<<<<<<<< @@ -17745,16 +17820,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_2 = (__pyx_v_file_obj == Py_None); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":1269 + /* "pyreadstat/_readstat_parser.pyx":1271 * # Only check file existence for path-based reads * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) # <<<<<<<<<<<<<< * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1269, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_8; @@ -17765,23 +17840,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_expanduser, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (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_7)) __PYX_ERR(0, 1269, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1269, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1270 + /* "pyreadstat/_readstat_parser.pyx":1272 * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1270, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = __pyx_t_3; @@ -17792,15 +17867,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_isfile, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1270, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (!__pyx_t_2); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1271 + /* "pyreadstat/_readstat_parser.pyx":1273 * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) # <<<<<<<<<<<<<< @@ -17808,7 +17883,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if output_format is None: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1271, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_File_0_does_not_exist; __Pyx_INCREF(__pyx_t_12); @@ -17817,7 +17892,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_filename_path}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1271, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_10 = 1; @@ -17838,14 +17913,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1273, __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, 1271, __pyx_L1_error) + __PYX_ERR(0, 1273, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1270 + /* "pyreadstat/_readstat_parser.pyx":1272 * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< @@ -17854,7 +17929,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1268 + /* "pyreadstat/_readstat_parser.pyx":1270 * * # Only check file existence for path-based reads * if file_obj is None: # <<<<<<<<<<<<<< @@ -17863,7 +17938,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1273 + /* "pyreadstat/_readstat_parser.pyx":1275 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -17873,7 +17948,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_output_format == ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1274 + /* "pyreadstat/_readstat_parser.pyx":1276 * * if output_format is None: * output_format = 'pandas' # <<<<<<<<<<<<<< @@ -17883,7 +17958,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_pandas); __Pyx_DECREF_SET(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas); - /* "pyreadstat/_readstat_parser.pyx":1273 + /* "pyreadstat/_readstat_parser.pyx":1275 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -17892,32 +17967,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1275 + /* "pyreadstat/_readstat_parser.pyx":1277 * if output_format is None: * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} # <<<<<<<<<<<<<< * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) */ - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1275, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pandas) < 0) __PYX_ERR(0, 1275, __pyx_L1_error) - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1275, __pyx_L1_error) - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_polars) < 0) __PYX_ERR(0, 1275, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pandas) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_polars) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) __pyx_v_allowed_formats = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1276 + /* "pyreadstat/_readstat_parser.pyx":1278 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": */ - __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1276, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1278, __pyx_L1_error) if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1277 + /* "pyreadstat/_readstat_parser.pyx":1279 * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) # <<<<<<<<<<<<<< @@ -17925,21 +18000,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * try: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1277, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_output_format_must_be_one_of_all; __Pyx_INCREF(__pyx_t_12); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_12, NULL}; - __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1277, __pyx_L1_error) + __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allowed_formats, __pyx_v_allowed_formats, __pyx_t_14, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_format, __pyx_v_output_format, __pyx_t_14, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allowed_formats, __pyx_v_allowed_formats, __pyx_t_14, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_format, __pyx_v_output_format, __pyx_t_14, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_10 = 1; @@ -17960,14 +18035,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1279, __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, 1277, __pyx_L1_error) + __PYX_ERR(0, 1279, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1276 + /* "pyreadstat/_readstat_parser.pyx":1278 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< @@ -17976,17 +18051,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1278 + /* "pyreadstat/_readstat_parser.pyx":1280 * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": # <<<<<<<<<<<<<< * try: * import pandas */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1279 + /* "pyreadstat/_readstat_parser.pyx":1281 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -18002,19 +18077,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1280 + /* "pyreadstat/_readstat_parser.pyx":1282 * if output_format == "pandas": * try: * import pandas # <<<<<<<<<<<<<< * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") */ - __pyx_t_7 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_pandas, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1280, __pyx_L24_error) + __pyx_t_7 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_pandas, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1282, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_pandas = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1279 + /* "pyreadstat/_readstat_parser.pyx":1281 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -18038,7 +18113,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1281 + /* "pyreadstat/_readstat_parser.pyx":1283 * try: * import pandas * except: # <<<<<<<<<<<<<< @@ -18047,12 +18122,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1281, __pyx_L26_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1283, __pyx_L26_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_3); - /* "pyreadstat/_readstat_parser.pyx":1282 + /* "pyreadstat/_readstat_parser.pyx":1284 * import pandas * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") # <<<<<<<<<<<<<< @@ -18060,7 +18135,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * try: */ __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1282, __pyx_L26_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1284, __pyx_L26_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18079,15 +18154,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1282, __pyx_L26_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1284, __pyx_L26_except_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, 1282, __pyx_L26_except_error) + __PYX_ERR(0, 1284, __pyx_L26_except_error) } - /* "pyreadstat/_readstat_parser.pyx":1279 + /* "pyreadstat/_readstat_parser.pyx":1281 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -18103,7 +18178,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L29_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1278 + /* "pyreadstat/_readstat_parser.pyx":1280 * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -18112,17 +18187,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1283 + /* "pyreadstat/_readstat_parser.pyx":1285 * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": # <<<<<<<<<<<<<< * try: * import polars */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1284 + /* "pyreadstat/_readstat_parser.pyx":1286 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18138,19 +18213,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1285 + /* "pyreadstat/_readstat_parser.pyx":1287 * if output_format == "polars": * try: * import polars # <<<<<<<<<<<<<< * except: * raise PyreadstatError("You requested polars as output_format but cannot import polars") */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_polars, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L33_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_polars, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_polars = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1284 + /* "pyreadstat/_readstat_parser.pyx":1286 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18174,7 +18249,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1286 + /* "pyreadstat/_readstat_parser.pyx":1288 * try: * import polars * except: # <<<<<<<<<<<<<< @@ -18183,12 +18258,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1286, __pyx_L35_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1288, __pyx_L35_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1287 + /* "pyreadstat/_readstat_parser.pyx":1289 * import polars * except: * raise PyreadstatError("You requested polars as output_format but cannot import polars") # <<<<<<<<<<<<<< @@ -18196,7 +18271,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1287, __pyx_L35_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1289, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18215,15 +18290,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1287, __pyx_L35_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L35_except_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, 1287, __pyx_L35_except_error) + __PYX_ERR(0, 1289, __pyx_L35_except_error) } - /* "pyreadstat/_readstat_parser.pyx":1284 + /* "pyreadstat/_readstat_parser.pyx":1286 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18239,7 +18314,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L38_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1283 + /* "pyreadstat/_readstat_parser.pyx":1285 * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": # <<<<<<<<<<<<<< @@ -18248,7 +18323,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1290 + /* "pyreadstat/_readstat_parser.pyx":1292 * * * if extra_date_formats is not None: # <<<<<<<<<<<<<< @@ -18258,7 +18333,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_date_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1291 + /* "pyreadstat/_readstat_parser.pyx":1293 * * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18268,7 +18343,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1292 + /* "pyreadstat/_readstat_parser.pyx":1294 * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_date_formats.extend(extra_date_formats) # <<<<<<<<<<<<<< @@ -18277,11 +18352,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1292, __pyx_L1_error) + __PYX_ERR(0, 1294, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1292, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1294, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1291 + /* "pyreadstat/_readstat_parser.pyx":1293 * * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18291,7 +18366,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1294 + /* "pyreadstat/_readstat_parser.pyx":1296 * sas_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_SPSS: * spss_date_formats.extend(extra_date_formats) # <<<<<<<<<<<<<< @@ -18300,11 +18375,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1294, __pyx_L1_error) + __PYX_ERR(0, 1296, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1296, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1293 + /* "pyreadstat/_readstat_parser.pyx":1295 * if file_format == FILE_FORMAT_SAS: * sas_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18314,7 +18389,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1296 + /* "pyreadstat/_readstat_parser.pyx":1298 * spss_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_STATA: * stata_date_formats.extend(extra_date_formats) # <<<<<<<<<<<<<< @@ -18323,11 +18398,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1296, __pyx_L1_error) + __PYX_ERR(0, 1298, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1298, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1295 + /* "pyreadstat/_readstat_parser.pyx":1297 * elif file_format == FILE_FORMAT_SPSS: * spss_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18337,7 +18412,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1298 + /* "pyreadstat/_readstat_parser.pyx":1300 * stata_date_formats.extend(extra_date_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18345,7 +18420,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if file_format == FILE_FORMAT_SAS: */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18364,16 +18439,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1298, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1300, __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, 1298, __pyx_L1_error) + __PYX_ERR(0, 1300, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1290 + /* "pyreadstat/_readstat_parser.pyx":1292 * * * if extra_date_formats is not None: # <<<<<<<<<<<<<< @@ -18382,7 +18457,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1299 + /* "pyreadstat/_readstat_parser.pyx":1301 * else: * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: # <<<<<<<<<<<<<< @@ -18392,7 +18467,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_datetime_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1300 + /* "pyreadstat/_readstat_parser.pyx":1302 * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18402,7 +18477,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1301 + /* "pyreadstat/_readstat_parser.pyx":1303 * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_datetime_formats.extend(extra_datetime_formats) # <<<<<<<<<<<<<< @@ -18411,11 +18486,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1301, __pyx_L1_error) + __PYX_ERR(0, 1303, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1301, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1303, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1300 + /* "pyreadstat/_readstat_parser.pyx":1302 * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18425,7 +18500,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1303 + /* "pyreadstat/_readstat_parser.pyx":1305 * sas_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_SPSS: * spss_datetime_formats.extend(extra_datetime_formats) # <<<<<<<<<<<<<< @@ -18434,11 +18509,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1303, __pyx_L1_error) + __PYX_ERR(0, 1305, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1303, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1305, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1302 + /* "pyreadstat/_readstat_parser.pyx":1304 * if file_format == FILE_FORMAT_SAS: * sas_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18448,7 +18523,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1305 + /* "pyreadstat/_readstat_parser.pyx":1307 * spss_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_STATA: * stata_datetime_formats.extend(extra_datetime_formats) # <<<<<<<<<<<<<< @@ -18457,11 +18532,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1305, __pyx_L1_error) + __PYX_ERR(0, 1307, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1305, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1307, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1304 + /* "pyreadstat/_readstat_parser.pyx":1306 * elif file_format == FILE_FORMAT_SPSS: * spss_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18471,7 +18546,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1307 + /* "pyreadstat/_readstat_parser.pyx":1309 * stata_datetime_formats.extend(extra_datetime_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18479,7 +18554,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if file_format == FILE_FORMAT_SAS: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1307, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18498,16 +18573,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1307, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1309, __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, 1307, __pyx_L1_error) + __PYX_ERR(0, 1309, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1299 + /* "pyreadstat/_readstat_parser.pyx":1301 * else: * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: # <<<<<<<<<<<<<< @@ -18516,7 +18591,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1308 + /* "pyreadstat/_readstat_parser.pyx":1310 * else: * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: # <<<<<<<<<<<<<< @@ -18526,7 +18601,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_time_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1309 + /* "pyreadstat/_readstat_parser.pyx":1311 * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18536,7 +18611,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1310 + /* "pyreadstat/_readstat_parser.pyx":1312 * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_time_formats.extend(extra_time_formats) # <<<<<<<<<<<<<< @@ -18545,11 +18620,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1310, __pyx_L1_error) + __PYX_ERR(0, 1312, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1310, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1312, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1309 + /* "pyreadstat/_readstat_parser.pyx":1311 * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18559,7 +18634,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1312 + /* "pyreadstat/_readstat_parser.pyx":1314 * sas_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_SPSS: * spss_time_formats.extend(extra_time_formats) # <<<<<<<<<<<<<< @@ -18568,11 +18643,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1312, __pyx_L1_error) + __PYX_ERR(0, 1314, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1312, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1314, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1311 + /* "pyreadstat/_readstat_parser.pyx":1313 * if file_format == FILE_FORMAT_SAS: * sas_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18582,7 +18657,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1314 + /* "pyreadstat/_readstat_parser.pyx":1316 * spss_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_STATA: * stata_time_formats.extend(extra_time_formats) # <<<<<<<<<<<<<< @@ -18591,11 +18666,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1314, __pyx_L1_error) + __PYX_ERR(0, 1316, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1314, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1316, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1313 + /* "pyreadstat/_readstat_parser.pyx":1315 * elif file_format == FILE_FORMAT_SPSS: * spss_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18605,7 +18680,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1316 + /* "pyreadstat/_readstat_parser.pyx":1318 * stata_time_formats.extend(extra_time_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18613,7 +18688,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18632,16 +18707,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1316, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1318, __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, 1316, __pyx_L1_error) + __PYX_ERR(0, 1318, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1308 + /* "pyreadstat/_readstat_parser.pyx":1310 * else: * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: # <<<<<<<<<<<<<< @@ -18650,16 +18725,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1318 + /* "pyreadstat/_readstat_parser.pyx":1320 * raise PyreadstatError("Unknown file format") * global sas_all_formats, spss_all_formats, stata_all_formats * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats # <<<<<<<<<<<<<< * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats */ - __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats); @@ -18667,16 +18742,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1319 + /* "pyreadstat/_readstat_parser.pyx":1321 * global sas_all_formats, spss_all_formats, stata_all_formats * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats # <<<<<<<<<<<<<< * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1319, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats); @@ -18684,16 +18759,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1320 + /* "pyreadstat/_readstat_parser.pyx":1322 * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats # <<<<<<<<<<<<<< * * filename = filename_bytes */ - __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats); @@ -18701,7 +18776,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1322 + /* "pyreadstat/_readstat_parser.pyx":1324 * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * * filename = filename_bytes # <<<<<<<<<<<<<< @@ -18710,12 +18785,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_filename_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 1322, __pyx_L1_error) + __PYX_ERR(0, 1324, __pyx_L1_error) } - __pyx_t_19 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 1324, __pyx_L1_error) __pyx_v_filename = ((char *)__pyx_t_19); - /* "pyreadstat/_readstat_parser.pyx":1324 + /* "pyreadstat/_readstat_parser.pyx":1326 * filename = filename_bytes * * data = data_container() # <<<<<<<<<<<<<< @@ -18731,13 +18806,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); } __pyx_v_data = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1325 + /* "pyreadstat/_readstat_parser.pyx":1327 * * data = data_container() * ctx = data # <<<<<<<<<<<<<< @@ -18746,7 +18821,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":1327 + /* "pyreadstat/_readstat_parser.pyx":1329 * ctx = data * * data.file_format = file_format # <<<<<<<<<<<<<< @@ -18755,7 +18830,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->file_format = __pyx_v_file_format; - /* "pyreadstat/_readstat_parser.pyx":1328 + /* "pyreadstat/_readstat_parser.pyx":1330 * * data.file_format = file_format * data.metaonly = metaonly # <<<<<<<<<<<<<< @@ -18764,7 +18839,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->metaonly = __pyx_v_metaonly; - /* "pyreadstat/_readstat_parser.pyx":1329 + /* "pyreadstat/_readstat_parser.pyx":1331 * data.file_format = file_format * data.metaonly = metaonly * data.dates_as_pandas = dates_as_pandas # <<<<<<<<<<<<<< @@ -18773,7 +18848,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->dates_as_pandas = __pyx_v_dates_as_pandas; - /* "pyreadstat/_readstat_parser.pyx":1330 + /* "pyreadstat/_readstat_parser.pyx":1332 * data.metaonly = metaonly * data.dates_as_pandas = dates_as_pandas * data.output_format = output_format # <<<<<<<<<<<<<< @@ -18786,7 +18861,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->output_format); __pyx_v_data->output_format = __pyx_v_output_format; - /* "pyreadstat/_readstat_parser.pyx":1332 + /* "pyreadstat/_readstat_parser.pyx":1334 * data.output_format = output_format * * if encoding: # <<<<<<<<<<<<<< @@ -18794,10 +18869,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_1 = (__pyx_v_encoding != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_encoding) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1333 + /* "pyreadstat/_readstat_parser.pyx":1335 * * if encoding: * data.user_encoding = encoding # <<<<<<<<<<<<<< @@ -18810,7 +18885,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->user_encoding); __pyx_v_data->user_encoding = __pyx_v_encoding; - /* "pyreadstat/_readstat_parser.pyx":1332 + /* "pyreadstat/_readstat_parser.pyx":1334 * data.output_format = output_format * * if encoding: # <<<<<<<<<<<<<< @@ -18819,7 +18894,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1335 + /* "pyreadstat/_readstat_parser.pyx":1337 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18829,7 +18904,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1336 + /* "pyreadstat/_readstat_parser.pyx":1338 * * if file_format == FILE_FORMAT_SAS: * origin = sas_origin # <<<<<<<<<<<<<< @@ -18839,7 +18914,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_sas_origin; - /* "pyreadstat/_readstat_parser.pyx":1337 + /* "pyreadstat/_readstat_parser.pyx":1339 * if file_format == FILE_FORMAT_SAS: * origin = sas_origin * unix_to_origin_secs = sas_secs_from_unix # <<<<<<<<<<<<<< @@ -18849,7 +18924,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1335 + /* "pyreadstat/_readstat_parser.pyx":1337 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18859,7 +18934,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1339 + /* "pyreadstat/_readstat_parser.pyx":1341 * unix_to_origin_secs = sas_secs_from_unix * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin # <<<<<<<<<<<<<< @@ -18869,7 +18944,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_spss_origin; - /* "pyreadstat/_readstat_parser.pyx":1340 + /* "pyreadstat/_readstat_parser.pyx":1342 * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin * unix_to_origin_secs = spss_secs_from_unix # <<<<<<<<<<<<<< @@ -18879,7 +18954,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1338 + /* "pyreadstat/_readstat_parser.pyx":1340 * origin = sas_origin * unix_to_origin_secs = sas_secs_from_unix * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18889,7 +18964,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1342 + /* "pyreadstat/_readstat_parser.pyx":1344 * unix_to_origin_secs = spss_secs_from_unix * elif file_format == FILE_FORMAT_STATA: * origin = stata_origin # <<<<<<<<<<<<<< @@ -18899,7 +18974,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_stata_origin; - /* "pyreadstat/_readstat_parser.pyx":1343 + /* "pyreadstat/_readstat_parser.pyx":1345 * elif file_format == FILE_FORMAT_STATA: * origin = stata_origin * unix_to_origin_secs = stata_secs_from_unix # <<<<<<<<<<<<<< @@ -18909,7 +18984,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1341 + /* "pyreadstat/_readstat_parser.pyx":1343 * origin = spss_origin * unix_to_origin_secs = spss_secs_from_unix * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18919,7 +18994,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1345 + /* "pyreadstat/_readstat_parser.pyx":1347 * unix_to_origin_secs = stata_secs_from_unix * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18927,7 +19002,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * data.origin = origin */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1345, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18946,16 +19021,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1345, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __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, 1345, __pyx_L1_error) + __PYX_ERR(0, 1347, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1347 + /* "pyreadstat/_readstat_parser.pyx":1349 * raise PyreadstatError("Unknown file format") * * data.origin = origin # <<<<<<<<<<<<<< @@ -18968,17 +19043,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->origin); __pyx_v_data->origin = __pyx_v_origin; - /* "pyreadstat/_readstat_parser.pyx":1348 + /* "pyreadstat/_readstat_parser.pyx":1350 * * data.origin = origin * data.unix_to_origin_secs = unix_to_origin_secs # <<<<<<<<<<<<<< * * if usecols is not None: */ - __pyx_t_20 = __Pyx_PyFloat_AsDouble(__pyx_v_unix_to_origin_secs); if (unlikely((__pyx_t_20 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyFloat_AsDouble(__pyx_v_unix_to_origin_secs); if (unlikely((__pyx_t_20 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1350, __pyx_L1_error) __pyx_v_data->unix_to_origin_secs = __pyx_t_20; - /* "pyreadstat/_readstat_parser.pyx":1350 + /* "pyreadstat/_readstat_parser.pyx":1352 * data.unix_to_origin_secs = unix_to_origin_secs * * if usecols is not None: # <<<<<<<<<<<<<< @@ -18988,7 +19063,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_usecols != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1351 + /* "pyreadstat/_readstat_parser.pyx":1353 * * if usecols is not None: * data.filter_cols = 1 # <<<<<<<<<<<<<< @@ -18997,7 +19072,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->filter_cols = 1; - /* "pyreadstat/_readstat_parser.pyx":1352 + /* "pyreadstat/_readstat_parser.pyx":1354 * if usecols is not None: * data.filter_cols = 1 * data.use_cols = usecols # <<<<<<<<<<<<<< @@ -19010,7 +19085,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->use_cols); __pyx_v_data->use_cols = __pyx_v_usecols; - /* "pyreadstat/_readstat_parser.pyx":1350 + /* "pyreadstat/_readstat_parser.pyx":1352 * data.unix_to_origin_secs = unix_to_origin_secs * * if usecols is not None: # <<<<<<<<<<<<<< @@ -19019,7 +19094,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1354 + /* "pyreadstat/_readstat_parser.pyx":1356 * data.use_cols = usecols * * data.usernan = usernan # <<<<<<<<<<<<<< @@ -19028,7 +19103,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->usernan = __pyx_v_usernan; - /* "pyreadstat/_readstat_parser.pyx":1355 + /* "pyreadstat/_readstat_parser.pyx":1357 * * data.usernan = usernan * data.no_datetime_conversion = no_datetime_conversion # <<<<<<<<<<<<<< @@ -19037,7 +19112,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->no_datetime_conversion = __pyx_v_no_datetime_conversion; - /* "pyreadstat/_readstat_parser.pyx":1358 + /* "pyreadstat/_readstat_parser.pyx":1360 * * # go! * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) # <<<<<<<<<<<<<< @@ -19046,31 +19121,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_t_21.__pyx_n = 1; __pyx_t_21.file_obj = __pyx_v_file_obj; - __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_file_extension, __pyx_v_row_limit, __pyx_v_row_offset, &__pyx_t_21); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_file_extension, __pyx_v_row_limit, __pyx_v_row_offset, &__pyx_t_21); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1359 + /* "pyreadstat/_readstat_parser.pyx":1361 * # go! * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) # <<<<<<<<<<<<<< * if output_format == 'dict': * data_frame = data_dict */ - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1359, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_data_dict = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1360 + /* "pyreadstat/_readstat_parser.pyx":1362 * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< * data_frame = data_dict * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1361 + /* "pyreadstat/_readstat_parser.pyx":1363 * data_dict = data_container_to_dict(data) * if output_format == 'dict': * data_frame = data_dict # <<<<<<<<<<<<<< @@ -19080,7 +19155,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_data_dict); __pyx_v_data_frame = __pyx_v_data_dict; - /* "pyreadstat/_readstat_parser.pyx":1360 + /* "pyreadstat/_readstat_parser.pyx":1362 * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< @@ -19090,7 +19165,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L46; } - /* "pyreadstat/_readstat_parser.pyx":1363 + /* "pyreadstat/_readstat_parser.pyx":1365 * data_frame = data_dict * else: * data_frame = dict_to_dataframe(data_dict, data) # <<<<<<<<<<<<<< @@ -19098,45 +19173,46 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ /*else*/ { - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(__pyx_v_data_dict, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(__pyx_v_data_dict, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_data_frame = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L46:; - /* "pyreadstat/_readstat_parser.pyx":1364 + /* "pyreadstat/_readstat_parser.pyx":1366 * else: * data_frame = dict_to_dataframe(data_dict, data) * metadata = data_container_extract_metadata(data) # <<<<<<<<<<<<<< * * return data_frame, metadata */ - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_metadata = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1366 + /* "pyreadstat/_readstat_parser.pyx":1368 * metadata = data_container_extract_metadata(data) * * return data_frame, metadata # <<<<<<<<<<<<<< * + * def parser_entry_point(filename_path, str parser_format=None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_data_frame); __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1366, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1368, __pyx_L1_error); __Pyx_INCREF(__pyx_v_metadata); __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1366, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1368, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1225 + /* "pyreadstat/_readstat_parser.pyx":1227 * * * cdef object run_conversion(object filename_path, py_file_format file_format, py_file_extension file_extension, # <<<<<<<<<<<<<< @@ -19175,41 +19251,952 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* #### Code section: module_exttypes ### */ -static PyObject *__pyx_tp_new_10pyreadstat_16_readstat_parser_data_container(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *p; - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); +/* "pyreadstat/_readstat_parser.pyx":1370 + * return data_frame, metadata + * + * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10pyreadstat_16_readstat_parser_1parser_entry_point(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10pyreadstat_16_readstat_parser_1parser_entry_point = {"parser_entry_point", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_16_readstat_parser_1parser_entry_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10pyreadstat_16_readstat_parser_1parser_entry_point(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_filename_path = 0; + PyObject *__pyx_v_parser_format = 0; + PyObject *__pyx_v_metadataonly = 0; + PyObject *__pyx_v_dates_as_pandas_datetime = 0; + CYTHON_UNUSED PyObject *__pyx_v_formats_as_category = 0; + CYTHON_UNUSED PyObject *__pyx_v_formats_as_ordered_category = 0; + PyObject *__pyx_v_encoding = 0; + PyObject *__pyx_v_usecols = 0; + PyObject *__pyx_v_user_missing = 0; + PyObject *__pyx_v_disable_datetime_conversion = 0; + int __pyx_v_row_limit; + int __pyx_v_row_offset; + PyObject *__pyx_v_output_format = 0; + PyObject *__pyx_v_extra_datetime_formats = 0; + PyObject *__pyx_v_extra_date_formats = 0; + PyObject *__pyx_v_extra_time_formats = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("parser_entry_point (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif - p = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)o); - p->col_data = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_data_len = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_names = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_labels = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_dtypes = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_numpy_dtypes = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_dtypes_isobject = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_dytpes_isfloat = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_formats = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->col_formats_original = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->origin = Py_None; Py_INCREF(Py_None); - p->file_label = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->file_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->label_to_var_name = Py_None; Py_INCREF(Py_None); - p->labels_raw = Py_None; Py_INCREF(Py_None); - p->notes = Py_None; Py_INCREF(Py_None); - p->user_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->table_name = ((PyObject*)Py_None); Py_INCREF(Py_None); + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_parser_format,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_formats_as_category,&__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_user_missing,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,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, 1370, __pyx_L3_error) + if (__pyx_kwds_len > 0) { + switch (__pyx_nargs) { + case 16: + values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, "parser_entry_point", 0) < 0) __PYX_ERR(0, 1370, __pyx_L3_error) + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_parser.pyx":1371 + * + * def parser_entry_point(filename_path, str parser_format=None, + * metadataonly=False, dates_as_pandas_datetime=False, # <<<<<<<<<<<<<< + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, +*/ + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + + /* "pyreadstat/_readstat_parser.pyx":1372 + * def parser_entry_point(filename_path, str parser_format=None, + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, + * list extra_date_formats=None, list extra_time_formats=None): +*/ + if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); + if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + + /* "pyreadstat/_readstat_parser.pyx":1373 + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< + * list extra_date_formats=None, list extra_time_formats=None): + * +*/ + if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_parser.pyx":1374 + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, + * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< + * + * +*/ + if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, i); __PYX_ERR(0, 1370, __pyx_L3_error) } + } + } else { + switch (__pyx_nargs) { + case 16: + values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __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, 1370, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + + /* "pyreadstat/_readstat_parser.pyx":1370 + * return data_frame, metadata + * + * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, +*/ + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); + if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + + /* "pyreadstat/_readstat_parser.pyx":1372 + * def parser_entry_point(filename_path, str parser_format=None, + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, + * list extra_date_formats=None, list extra_time_formats=None): +*/ + if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + + /* "pyreadstat/_readstat_parser.pyx":1373 + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< + * list extra_date_formats=None, list extra_time_formats=None): + * +*/ + if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_parser.pyx":1374 + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, + * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< + * + * +*/ + if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); + if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); + } + __pyx_v_filename_path = values[0]; + __pyx_v_parser_format = ((PyObject*)values[1]); + __pyx_v_metadataonly = values[2]; + __pyx_v_dates_as_pandas_datetime = values[3]; + __pyx_v_formats_as_category = values[4]; + __pyx_v_formats_as_ordered_category = values[5]; + __pyx_v_encoding = ((PyObject*)values[6]); + __pyx_v_usecols = ((PyObject*)values[7]); + __pyx_v_user_missing = values[8]; + __pyx_v_disable_datetime_conversion = values[9]; + if (values[10]) { + __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L3_error) + } else { + __pyx_v_row_limit = ((int)((int)0)); + } + if (values[11]) { + __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L3_error) + } else { + __pyx_v_row_offset = ((int)((int)0)); + } + __pyx_v_output_format = ((PyObject*)values[12]); + __pyx_v_extra_datetime_formats = ((PyObject*)values[13]); + __pyx_v_extra_date_formats = ((PyObject*)values[14]); + __pyx_v_extra_time_formats = ((PyObject*)values[15]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 1370, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("pyreadstat._readstat_parser.parser_entry_point", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser_format), (&PyUnicode_Type), 1, "parser_format", 1))) __PYX_ERR(0, 1370, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 1372, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 1372, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 1373, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 1373, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 1374, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_r = __pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(__pyx_self, __pyx_v_filename_path, __pyx_v_parser_format, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_formats_as_category, __pyx_v_formats_as_ordered_category, __pyx_v_encoding, __pyx_v_usecols, __pyx_v_user_missing, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); + + /* "pyreadstat/_readstat_parser.pyx":1370 + * return data_frame, metadata + * + * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, +*/ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __pyx_L7_cleaned_up:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_parser_format, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, CYTHON_UNUSED PyObject *__pyx_v_formats_as_category, CYTHON_UNUSED PyObject *__pyx_v_formats_as_ordered_category, PyObject *__pyx_v_encoding, PyObject *__pyx_v_usecols, PyObject *__pyx_v_user_missing, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats) { + __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; + __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_v_file_extension; + int __pyx_v_metaonly; + int __pyx_v_dates_as_pandas; + int __pyx_v_usernan; + int __pyx_v_no_datetime_conversion; + PyObject *__pyx_v_data_frame = NULL; + PyObject *__pyx_v_metadata = NULL; + PyObject *__pyx_r = NULL; + __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; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("parser_entry_point", 0); + + /* "pyreadstat/_readstat_parser.pyx":1380 + * cdef py_file_extension file_extension + * + * if parser_format == "sav/zsav": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_SAV +*/ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_kp_u_sav_zsav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1380, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1381 + * + * if parser_format == "sav/zsav": + * file_format = FILE_FORMAT_SPSS # <<<<<<<<<<<<<< + * file_extension = FILE_EXT_SAV + * elif parser_format == "sas7bdat": +*/ + __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; + + /* "pyreadstat/_readstat_parser.pyx":1382 + * if parser_format == "sav/zsav": + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_SAV # <<<<<<<<<<<<<< + * elif parser_format == "sas7bdat": + * file_format = FILE_FORMAT_SAS +*/ + __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV; + + /* "pyreadstat/_readstat_parser.pyx":1380 + * cdef py_file_extension file_extension + * + * if parser_format == "sav/zsav": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_SAV +*/ + goto __pyx_L3; + } + + /* "pyreadstat/_readstat_parser.pyx":1383 + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_SAV + * elif parser_format == "sas7bdat": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BDAT +*/ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bdat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1383, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1384 + * file_extension = FILE_EXT_SAV + * elif parser_format == "sas7bdat": + * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< + * file_extension = FILE_EXT_SAS7BDAT + * elif parser_format == "xport": +*/ + __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; + + /* "pyreadstat/_readstat_parser.pyx":1385 + * elif parser_format == "sas7bdat": + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BDAT # <<<<<<<<<<<<<< + * elif parser_format == "xport": + * file_format = FILE_FORMAT_SAS +*/ + __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT; + + /* "pyreadstat/_readstat_parser.pyx":1383 + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_SAV + * elif parser_format == "sas7bdat": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BDAT +*/ + goto __pyx_L3; + } + + /* "pyreadstat/_readstat_parser.pyx":1386 + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BDAT + * elif parser_format == "xport": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_XPORT +*/ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1386, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1387 + * file_extension = FILE_EXT_SAS7BDAT + * elif parser_format == "xport": + * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< + * file_extension = FILE_EXT_XPORT + * elif parser_format == "dta": +*/ + __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; + + /* "pyreadstat/_readstat_parser.pyx":1388 + * elif parser_format == "xport": + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_XPORT # <<<<<<<<<<<<<< + * elif parser_format == "dta": + * file_format = FILE_FORMAT_STATA +*/ + __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT; + + /* "pyreadstat/_readstat_parser.pyx":1386 + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BDAT + * elif parser_format == "xport": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_XPORT +*/ + goto __pyx_L3; + } + + /* "pyreadstat/_readstat_parser.pyx":1389 + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_XPORT + * elif parser_format == "dta": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_STATA + * file_extension = FILE_EXT_DTA +*/ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1390 + * file_extension = FILE_EXT_XPORT + * elif parser_format == "dta": + * file_format = FILE_FORMAT_STATA # <<<<<<<<<<<<<< + * file_extension = FILE_EXT_DTA + * elif parser_format == "por": +*/ + __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA; + + /* "pyreadstat/_readstat_parser.pyx":1391 + * elif parser_format == "dta": + * file_format = FILE_FORMAT_STATA + * file_extension = FILE_EXT_DTA # <<<<<<<<<<<<<< + * elif parser_format == "por": + * file_format = FILE_FORMAT_SPSS +*/ + __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA; + + /* "pyreadstat/_readstat_parser.pyx":1389 + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_XPORT + * elif parser_format == "dta": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_STATA + * file_extension = FILE_EXT_DTA +*/ + goto __pyx_L3; + } + + /* "pyreadstat/_readstat_parser.pyx":1392 + * file_format = FILE_FORMAT_STATA + * file_extension = FILE_EXT_DTA + * elif parser_format == "por": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_POR +*/ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1392, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1393 + * file_extension = FILE_EXT_DTA + * elif parser_format == "por": + * file_format = FILE_FORMAT_SPSS # <<<<<<<<<<<<<< + * file_extension = FILE_EXT_POR + * elif parser_format == "sas7bcat": +*/ + __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; + + /* "pyreadstat/_readstat_parser.pyx":1394 + * elif parser_format == "por": + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_POR # <<<<<<<<<<<<<< + * elif parser_format == "sas7bcat": + * file_format = FILE_FORMAT_SAS +*/ + __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR; + + /* "pyreadstat/_readstat_parser.pyx":1392 + * file_format = FILE_FORMAT_STATA + * file_extension = FILE_EXT_DTA + * elif parser_format == "por": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_POR +*/ + goto __pyx_L3; + } + + /* "pyreadstat/_readstat_parser.pyx":1395 + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_POR + * elif parser_format == "sas7bcat": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BCAT +*/ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bcat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1395, __pyx_L1_error) + if (likely(__pyx_t_1)) { + + /* "pyreadstat/_readstat_parser.pyx":1396 + * file_extension = FILE_EXT_POR + * elif parser_format == "sas7bcat": + * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< + * file_extension = FILE_EXT_SAS7BCAT + * else: +*/ + __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; + + /* "pyreadstat/_readstat_parser.pyx":1397 + * elif parser_format == "sas7bcat": + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BCAT # <<<<<<<<<<<<<< + * else: + * raise PyreadstatError("wrong parser format") +*/ + __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT; + + /* "pyreadstat/_readstat_parser.pyx":1395 + * file_format = FILE_FORMAT_SPSS + * file_extension = FILE_EXT_POR + * elif parser_format == "sas7bcat": # <<<<<<<<<<<<<< + * file_format = FILE_FORMAT_SAS + * file_extension = FILE_EXT_SAS7BCAT +*/ + goto __pyx_L3; + } + + /* "pyreadstat/_readstat_parser.pyx":1399 + * file_extension = FILE_EXT_SAS7BCAT + * else: + * raise PyreadstatError("wrong parser format") # <<<<<<<<<<<<<< + * + * cdef bint metaonly = 0 +*/ + /*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, 1399, __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_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_mstate_global->__pyx_kp_u_wrong_parser_format}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__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, 1399, __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, 1399, __pyx_L1_error) + } + __pyx_L3:; + + /* "pyreadstat/_readstat_parser.pyx":1401 + * raise PyreadstatError("wrong parser format") + * + * cdef bint metaonly = 0 # <<<<<<<<<<<<<< + * if metadataonly: + * metaonly = 1 +*/ + __pyx_v_metaonly = 0; + + /* "pyreadstat/_readstat_parser.pyx":1402 + * + * cdef bint metaonly = 0 + * if metadataonly: # <<<<<<<<<<<<<< + * metaonly = 1 + * +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1403 + * cdef bint metaonly = 0 + * if metadataonly: + * metaonly = 1 # <<<<<<<<<<<<<< + * + * cdef bint dates_as_pandas = 0 +*/ + __pyx_v_metaonly = 1; + + /* "pyreadstat/_readstat_parser.pyx":1402 + * + * cdef bint metaonly = 0 + * if metadataonly: # <<<<<<<<<<<<<< + * metaonly = 1 + * +*/ + } + + /* "pyreadstat/_readstat_parser.pyx":1405 + * metaonly = 1 + * + * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< + * if dates_as_pandas_datetime: + * dates_as_pandas = 1 +*/ + __pyx_v_dates_as_pandas = 0; + + /* "pyreadstat/_readstat_parser.pyx":1406 + * + * cdef bint dates_as_pandas = 0 + * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< + * dates_as_pandas = 1 + * +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1406, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1407 + * cdef bint dates_as_pandas = 0 + * if dates_as_pandas_datetime: + * dates_as_pandas = 1 # <<<<<<<<<<<<<< + * + * cdef bint usernan = 0 +*/ + __pyx_v_dates_as_pandas = 1; + + /* "pyreadstat/_readstat_parser.pyx":1406 + * + * cdef bint dates_as_pandas = 0 + * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< + * dates_as_pandas = 1 + * +*/ + } + + /* "pyreadstat/_readstat_parser.pyx":1409 + * dates_as_pandas = 1 + * + * cdef bint usernan = 0 # <<<<<<<<<<<<<< + * if user_missing: + * usernan = 1 +*/ + __pyx_v_usernan = 0; + + /* "pyreadstat/_readstat_parser.pyx":1410 + * + * cdef bint usernan = 0 + * if user_missing: # <<<<<<<<<<<<<< + * usernan = 1 + * +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1411 + * cdef bint usernan = 0 + * if user_missing: + * usernan = 1 # <<<<<<<<<<<<<< + * + * cdef bint no_datetime_conversion = 0 +*/ + __pyx_v_usernan = 1; + + /* "pyreadstat/_readstat_parser.pyx":1410 + * + * cdef bint usernan = 0 + * if user_missing: # <<<<<<<<<<<<<< + * usernan = 1 + * +*/ + } + + /* "pyreadstat/_readstat_parser.pyx":1413 + * usernan = 1 + * + * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< + * if disable_datetime_conversion: + * no_datetime_conversion = 1 +*/ + __pyx_v_no_datetime_conversion = 0; + + /* "pyreadstat/_readstat_parser.pyx":1414 + * + * cdef bint no_datetime_conversion = 0 + * if disable_datetime_conversion: # <<<<<<<<<<<<<< + * no_datetime_conversion = 1 + * +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1414, __pyx_L1_error) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_parser.pyx":1415 + * cdef bint no_datetime_conversion = 0 + * if disable_datetime_conversion: + * no_datetime_conversion = 1 # <<<<<<<<<<<<<< + * + * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, +*/ + __pyx_v_no_datetime_conversion = 1; + + /* "pyreadstat/_readstat_parser.pyx":1414 + * + * cdef bint no_datetime_conversion = 0 + * if disable_datetime_conversion: # <<<<<<<<<<<<<< + * no_datetime_conversion = 1 + * +*/ + } + + /* "pyreadstat/_readstat_parser.pyx":1417 + * no_datetime_conversion = 1 + * + * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< + * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, + * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) +*/ + __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 1417, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); + } else { + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + } + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1417, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1417, __pyx_L1_error) + __pyx_L9_unpacking_done:; + } + __pyx_v_data_frame = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_metadata = __pyx_t_3; + __pyx_t_3 = 0; + + /* "pyreadstat/_readstat_parser.pyx":1421 + * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) + * + * return data_frame, metadata # <<<<<<<<<<<<<< + * +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_data_frame); + __Pyx_GIVEREF(__pyx_v_data_frame); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1421, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_metadata); + __Pyx_GIVEREF(__pyx_v_metadata); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1421, __pyx_L1_error); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "pyreadstat/_readstat_parser.pyx":1370 + * return data_frame, metadata + * + * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("pyreadstat._readstat_parser.parser_entry_point", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_data_frame); + __Pyx_XDECREF(__pyx_v_metadata); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +/* #### Code section: module_exttypes ### */ + +static PyObject *__pyx_tp_new_10pyreadstat_16_readstat_parser_data_container(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *p; + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + p = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)o); + p->col_data = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_data_len = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_names = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_labels = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_dtypes = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_numpy_dtypes = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_dtypes_isobject = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_dytpes_isfloat = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_formats = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->col_formats_original = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->origin = Py_None; Py_INCREF(Py_None); + p->file_label = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->file_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->label_to_var_name = Py_None; Py_INCREF(Py_None); + p->labels_raw = Py_None; Py_INCREF(Py_None); + p->notes = Py_None; Py_INCREF(Py_None); + p->user_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->table_name = ((PyObject*)Py_None); Py_INCREF(Py_None); p->use_cols = ((PyObject*)Py_None); Py_INCREF(Py_None); p->missing_ranges = ((PyObject*)Py_None); Py_INCREF(Py_None); p->missing_user_values = ((PyObject*)Py_None); Py_INCREF(Py_None); @@ -19639,23 +20626,23 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container)) __PYX_ERR(0, 79, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container)) __PYX_ERR(0, 81, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = &__pyx_type_10pyreadstat_16_readstat_parser_data_container; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container->tp_dictoffset && __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container->tp_getattro = PyObject_GenericGetAttr; } #endif - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_data_container, (PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 79, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_data_container, (PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -20043,97 +21030,97 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - /* "pyreadstat/_readstat_parser.pyx":25 + /* "pyreadstat/_readstat_parser.pyx":27 * from libc.string cimport memcpy * * from collections import OrderedDict # <<<<<<<<<<<<<< * import datetime * import os */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OrderedDict, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OrderedDict, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":26 + /* "pyreadstat/_readstat_parser.pyx":28 * * from collections import OrderedDict * import datetime # <<<<<<<<<<<<<< * import os * import warnings */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_datetime, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_datetime, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_datetime, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_datetime, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":27 + /* "pyreadstat/_readstat_parser.pyx":29 * from collections import OrderedDict * import datetime * import os # <<<<<<<<<<<<<< * import warnings * import sys */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_os, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_os, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":28 + /* "pyreadstat/_readstat_parser.pyx":30 * import datetime * import os * import warnings # <<<<<<<<<<<<<< * import sys * */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_warnings, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_warnings, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":29 + /* "pyreadstat/_readstat_parser.pyx":31 * import os * import warnings * import sys # <<<<<<<<<<<<<< * * import narwhals.stable.v2 as nw */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":31 + /* "pyreadstat/_readstat_parser.pyx":33 * import sys * * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< * import numpy as np * */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_narwhals_stable_v2, __pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_narwhals_stable_v2, __pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nw, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nw, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":32 + /* "pyreadstat/_readstat_parser.pyx":34 * * import narwhals.stable.v2 as nw * import numpy as np # <<<<<<<<<<<<<< * * from readstat_api cimport * */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":37 + /* "pyreadstat/_readstat_parser.pyx":39 * * # necessary to work with the datetime C API * import_datetime() # <<<<<<<<<<<<<< @@ -20142,87 +21129,87 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); */ __pyx_f_7cpython_8datetime_import_datetime(); - /* "pyreadstat/_readstat_parser.pyx":39 + /* "pyreadstat/_readstat_parser.pyx":41 * import_datetime() * * cdef object unix_origin = datetime_new(1970, 1, 1, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * * cdef list sas_date_formats = ["WEEKDATE", "MMDDYY", "DDMMYY", "YYMMDD", "DATE", "DATE9", "YYMMDD10", */ - __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":41 + /* "pyreadstat/_readstat_parser.pyx":43 * cdef object unix_origin = datetime_new(1970, 1, 1, 0, 0, 0, 0, None) * * cdef list sas_date_formats = ["WEEKDATE", "MMDDYY", "DDMMYY", "YYMMDD", "DATE", "DATE9", "YYMMDD10", # <<<<<<<<<<<<<< * "DDMMYYB", "DDMMYYB10", "DDMMYYC", "DDMMYYC10", "DDMMYYD", "DDMMYYD10", * "DDMMYYN6", "DDMMYYN8", "DDMMYYP", "DDMMYYP10", "DDMMYYS", "DDMMYYS10", */ - __pyx_t_3 = __Pyx_PyList_Pack(41, __pyx_mstate_global->__pyx_n_u_WEEKDATE, __pyx_mstate_global->__pyx_n_u_MMDDYY, __pyx_mstate_global->__pyx_n_u_DDMMYY, __pyx_mstate_global->__pyx_n_u_YYMMDD, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE9, __pyx_mstate_global->__pyx_n_u_YYMMDD10, __pyx_mstate_global->__pyx_n_u_DDMMYYB, __pyx_mstate_global->__pyx_n_u_DDMMYYB10, __pyx_mstate_global->__pyx_n_u_DDMMYYC, __pyx_mstate_global->__pyx_n_u_DDMMYYC10, __pyx_mstate_global->__pyx_n_u_DDMMYYD, __pyx_mstate_global->__pyx_n_u_DDMMYYD10, __pyx_mstate_global->__pyx_n_u_DDMMYYN6, __pyx_mstate_global->__pyx_n_u_DDMMYYN8, __pyx_mstate_global->__pyx_n_u_DDMMYYP, __pyx_mstate_global->__pyx_n_u_DDMMYYP10, __pyx_mstate_global->__pyx_n_u_DDMMYYS, __pyx_mstate_global->__pyx_n_u_DDMMYYS10, __pyx_mstate_global->__pyx_n_u_MMDDYYB, __pyx_mstate_global->__pyx_n_u_MMDDYYB10, __pyx_mstate_global->__pyx_n_u_MMDDYYC, __pyx_mstate_global->__pyx_n_u_MMDDYYC10, __pyx_mstate_global->__pyx_n_u_MMDDYYD, __pyx_mstate_global->__pyx_n_u_MMDDYYD10, __pyx_mstate_global->__pyx_n_u_MMDDYYN6, __pyx_mstate_global->__pyx_n_u_MMDDYYN8, __pyx_mstate_global->__pyx_n_u_MMDDYYP, __pyx_mstate_global->__pyx_n_u_MMDDYYP10, __pyx_mstate_global->__pyx_n_u_MMDDYYS, __pyx_mstate_global->__pyx_n_u_MMDDYYS10, __pyx_mstate_global->__pyx_n_u_WEEKDATX, __pyx_mstate_global->__pyx_n_u_DTDATE, __pyx_mstate_global->__pyx_n_u_IS8601DA, __pyx_mstate_global->__pyx_n_u_E8601DA, __pyx_mstate_global->__pyx_n_u_B8601DA, __pyx_mstate_global->__pyx_n_u_YYMMDDB, __pyx_mstate_global->__pyx_n_u_YYMMDDD, __pyx_mstate_global->__pyx_n_u_YYMMDDN, __pyx_mstate_global->__pyx_n_u_YYMMDDP, __pyx_mstate_global->__pyx_n_u_YYMMDDS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_Pack(41, __pyx_mstate_global->__pyx_n_u_WEEKDATE, __pyx_mstate_global->__pyx_n_u_MMDDYY, __pyx_mstate_global->__pyx_n_u_DDMMYY, __pyx_mstate_global->__pyx_n_u_YYMMDD, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE9, __pyx_mstate_global->__pyx_n_u_YYMMDD10, __pyx_mstate_global->__pyx_n_u_DDMMYYB, __pyx_mstate_global->__pyx_n_u_DDMMYYB10, __pyx_mstate_global->__pyx_n_u_DDMMYYC, __pyx_mstate_global->__pyx_n_u_DDMMYYC10, __pyx_mstate_global->__pyx_n_u_DDMMYYD, __pyx_mstate_global->__pyx_n_u_DDMMYYD10, __pyx_mstate_global->__pyx_n_u_DDMMYYN6, __pyx_mstate_global->__pyx_n_u_DDMMYYN8, __pyx_mstate_global->__pyx_n_u_DDMMYYP, __pyx_mstate_global->__pyx_n_u_DDMMYYP10, __pyx_mstate_global->__pyx_n_u_DDMMYYS, __pyx_mstate_global->__pyx_n_u_DDMMYYS10, __pyx_mstate_global->__pyx_n_u_MMDDYYB, __pyx_mstate_global->__pyx_n_u_MMDDYYB10, __pyx_mstate_global->__pyx_n_u_MMDDYYC, __pyx_mstate_global->__pyx_n_u_MMDDYYC10, __pyx_mstate_global->__pyx_n_u_MMDDYYD, __pyx_mstate_global->__pyx_n_u_MMDDYYD10, __pyx_mstate_global->__pyx_n_u_MMDDYYN6, __pyx_mstate_global->__pyx_n_u_MMDDYYN8, __pyx_mstate_global->__pyx_n_u_MMDDYYP, __pyx_mstate_global->__pyx_n_u_MMDDYYP10, __pyx_mstate_global->__pyx_n_u_MMDDYYS, __pyx_mstate_global->__pyx_n_u_MMDDYYS10, __pyx_mstate_global->__pyx_n_u_WEEKDATX, __pyx_mstate_global->__pyx_n_u_DTDATE, __pyx_mstate_global->__pyx_n_u_IS8601DA, __pyx_mstate_global->__pyx_n_u_E8601DA, __pyx_mstate_global->__pyx_n_u_B8601DA, __pyx_mstate_global->__pyx_n_u_YYMMDDB, __pyx_mstate_global->__pyx_n_u_YYMMDDD, __pyx_mstate_global->__pyx_n_u_YYMMDDN, __pyx_mstate_global->__pyx_n_u_YYMMDDP, __pyx_mstate_global->__pyx_n_u_YYMMDDS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":50 + /* "pyreadstat/_readstat_parser.pyx":52 * "IS8601DA", "E8601DA", "B8601DA", * "YYMMDDB", "YYMMDDD", "YYMMDDN", "YYMMDDP", "YYMMDDS",] * cdef list sas_datetime_formats = ["DATETIME", "DATETIME18", "DATETIME19", "DATETIME20", "DATETIME21", "DATETIME22", # <<<<<<<<<<<<<< * "E8601DT", "DATEAMPM", "MDYAMPM", "IS8601DT", "B8601DT", "B8601DN"] * cdef list sas_time_formats = ["TIME", "HHMM", "TIME20.3", "TIME20", "TIME5", "TOD", "TIMEAMPM", "IS8601TM", "E8601TM", "B8601TM", ] */ - __pyx_t_3 = __Pyx_PyList_Pack(12, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME18, __pyx_mstate_global->__pyx_n_u_DATETIME19, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_n_u_DATETIME21, __pyx_mstate_global->__pyx_n_u_DATETIME22, __pyx_mstate_global->__pyx_n_u_E8601DT, __pyx_mstate_global->__pyx_n_u_DATEAMPM, __pyx_mstate_global->__pyx_n_u_MDYAMPM, __pyx_mstate_global->__pyx_n_u_IS8601DT, __pyx_mstate_global->__pyx_n_u_B8601DT, __pyx_mstate_global->__pyx_n_u_B8601DN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_Pack(12, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME18, __pyx_mstate_global->__pyx_n_u_DATETIME19, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_n_u_DATETIME21, __pyx_mstate_global->__pyx_n_u_DATETIME22, __pyx_mstate_global->__pyx_n_u_E8601DT, __pyx_mstate_global->__pyx_n_u_DATEAMPM, __pyx_mstate_global->__pyx_n_u_MDYAMPM, __pyx_mstate_global->__pyx_n_u_IS8601DT, __pyx_mstate_global->__pyx_n_u_B8601DT, __pyx_mstate_global->__pyx_n_u_B8601DN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":52 + /* "pyreadstat/_readstat_parser.pyx":54 * cdef list sas_datetime_formats = ["DATETIME", "DATETIME18", "DATETIME19", "DATETIME20", "DATETIME21", "DATETIME22", * "E8601DT", "DATEAMPM", "MDYAMPM", "IS8601DT", "B8601DT", "B8601DN"] * cdef list sas_time_formats = ["TIME", "HHMM", "TIME20.3", "TIME20", "TIME5", "TOD", "TIMEAMPM", "IS8601TM", "E8601TM", "B8601TM", ] # <<<<<<<<<<<<<< * # "HOUR" # these do not print as full time formats in sas * #cdef list sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats */ - __pyx_t_3 = __Pyx_PyList_Pack(10, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_HHMM, __pyx_mstate_global->__pyx_kp_u_TIME20_3, __pyx_mstate_global->__pyx_n_u_TIME20, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_n_u_TOD, __pyx_mstate_global->__pyx_n_u_TIMEAMPM, __pyx_mstate_global->__pyx_n_u_IS8601TM, __pyx_mstate_global->__pyx_n_u_E8601TM, __pyx_mstate_global->__pyx_n_u_B8601TM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_Pack(10, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_HHMM, __pyx_mstate_global->__pyx_kp_u_TIME20_3, __pyx_mstate_global->__pyx_n_u_TIME20, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_n_u_TOD, __pyx_mstate_global->__pyx_n_u_TIMEAMPM, __pyx_mstate_global->__pyx_n_u_IS8601TM, __pyx_mstate_global->__pyx_n_u_E8601TM, __pyx_mstate_global->__pyx_n_u_B8601TM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":56 + /* "pyreadstat/_readstat_parser.pyx":58 * #cdef list sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * cdef list sas_all_formats * cdef object sas_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * cdef object sas_secs_from_unix = total_seconds(unix_origin - sas_origin) * */ - __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":57 + /* "pyreadstat/_readstat_parser.pyx":59 * cdef list sas_all_formats * cdef object sas_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) * cdef object sas_secs_from_unix = total_seconds(unix_origin - sas_origin) # <<<<<<<<<<<<<< * * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] */ - __pyx_t_3 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_sas_origin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_sas_origin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 57, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix); @@ -20230,73 +21217,73 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":59 + /* "pyreadstat/_readstat_parser.pyx":61 * cdef object sas_secs_from_unix = total_seconds(unix_origin - sas_origin) * * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] # <<<<<<<<<<<<<< * cdef list spss_date_formats = ["DATE",'DATE8','DATE11', 'DATE12', "ADATE","ADATE8", "ADATE10", "EDATE", 'EDATE8','EDATE10', "JDATE", "JDATE5", "JDATE7", "SDATE", "SDATE8", "SDATE10",] * cdef list spss_time_formats = ["TIME", "DTIME", 'TIME8', 'TIME5', 'TIME11.2'] */ - __pyx_t_2 = __Pyx_PyList_Pack(9, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME8, __pyx_mstate_global->__pyx_n_u_DATETIME17, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_kp_u_DATETIME23_2, __pyx_mstate_global->__pyx_n_u_YMDHMS16, __pyx_mstate_global->__pyx_n_u_YMDHMS19, __pyx_mstate_global->__pyx_kp_u_YMDHMS19_2, __pyx_mstate_global->__pyx_n_u_YMDHMS20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(9, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME8, __pyx_mstate_global->__pyx_n_u_DATETIME17, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_kp_u_DATETIME23_2, __pyx_mstate_global->__pyx_n_u_YMDHMS16, __pyx_mstate_global->__pyx_n_u_YMDHMS19, __pyx_mstate_global->__pyx_kp_u_YMDHMS19_2, __pyx_mstate_global->__pyx_n_u_YMDHMS20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":60 + /* "pyreadstat/_readstat_parser.pyx":62 * * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] * cdef list spss_date_formats = ["DATE",'DATE8','DATE11', 'DATE12', "ADATE","ADATE8", "ADATE10", "EDATE", 'EDATE8','EDATE10', "JDATE", "JDATE5", "JDATE7", "SDATE", "SDATE8", "SDATE10",] # <<<<<<<<<<<<<< * cdef list spss_time_formats = ["TIME", "DTIME", 'TIME8', 'TIME5', 'TIME11.2'] * #cdef list spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats */ - __pyx_t_2 = __Pyx_PyList_Pack(16, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE8, __pyx_mstate_global->__pyx_n_u_DATE11, __pyx_mstate_global->__pyx_n_u_DATE12, __pyx_mstate_global->__pyx_n_u_ADATE, __pyx_mstate_global->__pyx_n_u_ADATE8, __pyx_mstate_global->__pyx_n_u_ADATE10, __pyx_mstate_global->__pyx_n_u_EDATE, __pyx_mstate_global->__pyx_n_u_EDATE8, __pyx_mstate_global->__pyx_n_u_EDATE10, __pyx_mstate_global->__pyx_n_u_JDATE, __pyx_mstate_global->__pyx_n_u_JDATE5, __pyx_mstate_global->__pyx_n_u_JDATE7, __pyx_mstate_global->__pyx_n_u_SDATE, __pyx_mstate_global->__pyx_n_u_SDATE8, __pyx_mstate_global->__pyx_n_u_SDATE10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(16, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE8, __pyx_mstate_global->__pyx_n_u_DATE11, __pyx_mstate_global->__pyx_n_u_DATE12, __pyx_mstate_global->__pyx_n_u_ADATE, __pyx_mstate_global->__pyx_n_u_ADATE8, __pyx_mstate_global->__pyx_n_u_ADATE10, __pyx_mstate_global->__pyx_n_u_EDATE, __pyx_mstate_global->__pyx_n_u_EDATE8, __pyx_mstate_global->__pyx_n_u_EDATE10, __pyx_mstate_global->__pyx_n_u_JDATE, __pyx_mstate_global->__pyx_n_u_JDATE5, __pyx_mstate_global->__pyx_n_u_JDATE7, __pyx_mstate_global->__pyx_n_u_SDATE, __pyx_mstate_global->__pyx_n_u_SDATE8, __pyx_mstate_global->__pyx_n_u_SDATE10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":61 + /* "pyreadstat/_readstat_parser.pyx":63 * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] * cdef list spss_date_formats = ["DATE",'DATE8','DATE11', 'DATE12', "ADATE","ADATE8", "ADATE10", "EDATE", 'EDATE8','EDATE10', "JDATE", "JDATE5", "JDATE7", "SDATE", "SDATE8", "SDATE10",] * cdef list spss_time_formats = ["TIME", "DTIME", 'TIME8', 'TIME5', 'TIME11.2'] # <<<<<<<<<<<<<< * #cdef list spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * cdef list spss_all_formats */ - __pyx_t_2 = __Pyx_PyList_Pack(5, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_DTIME, __pyx_mstate_global->__pyx_n_u_TIME8, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_kp_u_TIME11_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_Pack(5, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_DTIME, __pyx_mstate_global->__pyx_n_u_TIME8, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_kp_u_TIME11_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":64 + /* "pyreadstat/_readstat_parser.pyx":66 * #cdef list spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * cdef list spss_all_formats * cdef object spss_origin = datetime_new(1582, 10, 14, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * cdef object spss_secs_from_unix = total_seconds(unix_origin - spss_origin) * */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x62E, 10, 14, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x62E, 10, 14, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":65 + /* "pyreadstat/_readstat_parser.pyx":67 * cdef list spss_all_formats * cdef object spss_origin = datetime_new(1582, 10, 14, 0, 0, 0, 0, None) * cdef object spss_secs_from_unix = total_seconds(unix_origin - spss_origin) # <<<<<<<<<<<<<< * * cdef list stata_datetime_formats = ["%tC", "%tc"] */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_spss_origin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_spss_origin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 65, __pyx_L1_error) - __pyx_t_3 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix); @@ -20304,73 +21291,73 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":67 + /* "pyreadstat/_readstat_parser.pyx":69 * cdef object spss_secs_from_unix = total_seconds(unix_origin - spss_origin) * * cdef list stata_datetime_formats = ["%tC", "%tc"] # <<<<<<<<<<<<<< * cdef list stata_date_formats = ["%td", "%d", "%tdD_m_Y", "%tdCCYY-NN-DD"] * cdef list stata_time_formats = ["%tcHH:MM:SS", "%tcHH:MM"] */ - __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tC, __pyx_mstate_global->__pyx_kp_u_tc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tC, __pyx_mstate_global->__pyx_kp_u_tc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":68 + /* "pyreadstat/_readstat_parser.pyx":70 * * cdef list stata_datetime_formats = ["%tC", "%tc"] * cdef list stata_date_formats = ["%td", "%d", "%tdD_m_Y", "%tdCCYY-NN-DD"] # <<<<<<<<<<<<<< * cdef list stata_time_formats = ["%tcHH:MM:SS", "%tcHH:MM"] * #cdef list stata_all_formats = stata_datetime_formats + stata_date_formats + stata_time_formats */ - __pyx_t_3 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_kp_u_td, __pyx_mstate_global->__pyx_kp_u_d_2, __pyx_mstate_global->__pyx_kp_u_tdD_m_Y, __pyx_mstate_global->__pyx_kp_u_tdCCYY_NN_DD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_kp_u_td, __pyx_mstate_global->__pyx_kp_u_d_2, __pyx_mstate_global->__pyx_kp_u_tdD_m_Y, __pyx_mstate_global->__pyx_kp_u_tdCCYY_NN_DD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":69 + /* "pyreadstat/_readstat_parser.pyx":71 * cdef list stata_datetime_formats = ["%tC", "%tc"] * cdef list stata_date_formats = ["%td", "%d", "%tdD_m_Y", "%tdCCYY-NN-DD"] * cdef list stata_time_formats = ["%tcHH:MM:SS", "%tcHH:MM"] # <<<<<<<<<<<<<< * #cdef list stata_all_formats = stata_datetime_formats + stata_date_formats + stata_time_formats * cdef list stata_all_formats */ - __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tcHH_MM_SS, __pyx_mstate_global->__pyx_kp_u_tcHH_MM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tcHH_MM_SS, __pyx_mstate_global->__pyx_kp_u_tcHH_MM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":72 + /* "pyreadstat/_readstat_parser.pyx":74 * #cdef list stata_all_formats = stata_datetime_formats + stata_date_formats + stata_time_formats * cdef list stata_all_formats * cdef object stata_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * cdef object stata_secs_from_unix = total_seconds(unix_origin - stata_origin) * */ - __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":73 + /* "pyreadstat/_readstat_parser.pyx":75 * cdef list stata_all_formats * cdef object stata_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) * cdef object stata_secs_from_unix = total_seconds(unix_origin - stata_origin) # <<<<<<<<<<<<<< * * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, */ - __pyx_t_3 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_stata_origin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_stata_origin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 73, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix); @@ -20378,87 +21365,87 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":75 + /* "pyreadstat/_readstat_parser.pyx":77 * cdef object stata_secs_from_unix = total_seconds(unix_origin - stata_origin) * * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, # <<<<<<<<<<<<<< * READSTAT_TYPE_INT8: np.int64, READSTAT_TYPE_INT16: np.int64, READSTAT_TYPE_INT32:np.int64, * READSTAT_TYPE_FLOAT: np.float64, READSTAT_TYPE_DOUBLE: np.float64} */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_builtin_object) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_builtin_object) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_builtin_object) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_builtin_object) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":76 + /* "pyreadstat/_readstat_parser.pyx":78 * * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, * READSTAT_TYPE_INT8: np.int64, READSTAT_TYPE_INT16: np.int64, READSTAT_TYPE_INT32:np.int64, # <<<<<<<<<<<<<< * READSTAT_TYPE_FLOAT: np.float64, READSTAT_TYPE_DOUBLE: np.float64} * */ - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_5) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_5) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":77 + /* "pyreadstat/_readstat_parser.pyx":79 * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, * READSTAT_TYPE_INT8: np.int64, READSTAT_TYPE_INT16: np.int64, READSTAT_TYPE_INT32:np.int64, * READSTAT_TYPE_FLOAT: np.float64, READSTAT_TYPE_DOUBLE: np.float64} # <<<<<<<<<<<<<< * * cdef class data_container: */ - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_FLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_FLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_5) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_5) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types); @@ -20487,96 +21474,96 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":126 + /* "pyreadstat/_readstat_parser.pyx":128 * self.output_format = "" * * class metadata_container: # <<<<<<<<<<<<<< * """ * This class holds metadata we want to give back to python */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_mstate_global->__pyx_n_u_metadata_container, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_This_class_holds_metadata_we_wa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_mstate_global->__pyx_n_u_metadata_container, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_This_class_holds_metadata_we_wa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "pyreadstat/_readstat_parser.pyx":130 + /* "pyreadstat/_readstat_parser.pyx":132 * This class holds metadata we want to give back to python * """ * def __init__(self): # <<<<<<<<<<<<<< * self.column_names = list() * self.column_labels = list() */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_18metadata_container_1__init__, 0, __pyx_mstate_global->__pyx_n_u_metadata_container___init, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_18metadata_container_1__init__, 0, __pyx_mstate_global->__pyx_n_u_metadata_container___init, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":126 + /* "pyreadstat/_readstat_parser.pyx":128 * self.output_format = "" * * class metadata_container: # <<<<<<<<<<<<<< * """ * This class holds metadata we want to give back to python */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_t_4) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_t_4) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":155 + /* "pyreadstat/_readstat_parser.pyx":157 * * * class ReadstatError(Exception): # <<<<<<<<<<<<<< * """ * Just defining a custom exception to raise when readstat gives an error return code. */ - __pyx_t_2 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_ReadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_ReadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_4 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 155, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 157, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_4, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_4, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_2) < 0) __PYX_ERR(0, 155, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_2) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":161 + /* "pyreadstat/_readstat_parser.pyx":163 * pass * * class PyreadstatError(Exception): # <<<<<<<<<<<<<< * """ * Just defining a custom exception to raise when pyreadstat raises an exception. */ - __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_5 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 163, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_5, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_5, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_4) < 0) __PYX_ERR(0, 161, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_4) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__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; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":868 + /* "pyreadstat/_readstat_parser.pyx":870 * * * cdef object _file_object_ctx = None # <<<<<<<<<<<<<< @@ -20588,15 +21575,45 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx, Py_None); __Pyx_GIVEREF(Py_None); + /* "pyreadstat/_readstat_parser.pyx":1373 + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, + * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< + * list extra_date_formats=None, list extra_time_formats=None): + * +*/ + __pyx_t_5 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "pyreadstat/_readstat_parser.pyx":1370 + * return data_frame, metadata + * + * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< + * metadataonly=False, dates_as_pandas_datetime=False, + * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, +*/ + __pyx_t_2 = PyTuple_Pack(15, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_5, __pyx_t_3, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_1parser_entry_point, 0, __pyx_mstate_global->__pyx_n_u_parser_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parser_entry_point, __pyx_t_3) < 0) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* "pyreadstat/_readstat_parser.pyx":1 * # cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 # <<<<<<<<<<<<<< * * # ############################################################################# */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ @@ -20636,11 +21653,11 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); typedef struct { const char *s; -#if 149 <= 65535 +#if 179 <= 65535 const unsigned short n; -#elif 149 / 2 < INT_MAX +#elif 179 / 2 < INT_MAX const unsigned int n; -#elif 149 / 2 < LONG_MAX +#elif 179 / 2 < LONG_MAX const unsigned long n; #else const Py_ssize_t n; @@ -20732,6 +21749,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_MMDDYYS, sizeof(__pyx_k_MMDDYYS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MMDDYYS */ {__pyx_k_MMDDYYS10, sizeof(__pyx_k_MMDDYYS10), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MMDDYYS10 */ {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_None */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ {__pyx_k_Object, sizeof(__pyx_k_Object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Object */ {__pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OrderedDict */ {__pyx_k_PyreadstatError, sizeof(__pyx_k_PyreadstatError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PyreadstatError */ @@ -20771,6 +21789,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ {__pyx_k_all, sizeof(__pyx_k_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all */ {__pyx_k_allowed_formats, sizeof(__pyx_k_allowed_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allowed_formats */ {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ @@ -20795,28 +21814,42 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_data_container, sizeof(__pyx_k_data_container), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_container */ {__pyx_k_data_container___reduce_cython, sizeof(__pyx_k_data_container___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_container___reduce_cython */ {__pyx_k_data_container___setstate_cython, sizeof(__pyx_k_data_container___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_container___setstate_cython */ + {__pyx_k_data_frame, sizeof(__pyx_k_data_frame), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_frame */ {__pyx_k_date, sizeof(__pyx_k_date), 0, 1, 1}, /* PyObject cname: __pyx_n_u_date */ + {__pyx_k_dates_as_pandas, sizeof(__pyx_k_dates_as_pandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dates_as_pandas */ + {__pyx_k_dates_as_pandas_datetime, sizeof(__pyx_k_dates_as_pandas_datetime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dates_as_pandas_datetime */ {__pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_datetime */ {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ + {__pyx_k_disable_datetime_conversion, sizeof(__pyx_k_disable_datetime_conversion), 0, 1, 1}, /* PyObject cname: __pyx_n_u_disable_datetime_conversion */ {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ {__pyx_k_double, sizeof(__pyx_k_double), 0, 1, 1}, /* PyObject cname: __pyx_n_u_double */ + {__pyx_k_dta, sizeof(__pyx_k_dta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dta */ {__pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtype */ {__pyx_k_dtypes, sizeof(__pyx_k_dtypes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtypes */ {__pyx_k_duplicated, sizeof(__pyx_k_duplicated), 0, 1, 1}, /* PyObject cname: __pyx_n_u_duplicated */ {__pyx_k_empty, sizeof(__pyx_k_empty), 0, 1, 1}, /* PyObject cname: __pyx_n_u_empty */ {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ {__pyx_k_encode, sizeof(__pyx_k_encode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode */ + {__pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encoding */ {__pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enumerate */ {__pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_expanduser */ {__pyx_k_extend, sizeof(__pyx_k_extend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extend */ + {__pyx_k_extra_date_formats, sizeof(__pyx_k_extra_date_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extra_date_formats */ + {__pyx_k_extra_datetime_formats, sizeof(__pyx_k_extra_datetime_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extra_datetime_formats */ + {__pyx_k_extra_time_formats, sizeof(__pyx_k_extra_time_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extra_time_formats */ {__pyx_k_file_encoding, sizeof(__pyx_k_file_encoding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_encoding */ + {__pyx_k_file_extension, sizeof(__pyx_k_file_extension), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_extension */ + {__pyx_k_file_format, sizeof(__pyx_k_file_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_format */ {__pyx_k_file_label, sizeof(__pyx_k_file_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_label */ {__pyx_k_file_path_could_not_be_encoded_w, sizeof(__pyx_k_file_path_could_not_be_encoded_w), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_file_path_could_not_be_encoded_w */ + {__pyx_k_filename_path, sizeof(__pyx_k_filename_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filename_path */ {__pyx_k_fill, sizeof(__pyx_k_fill), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fill */ {__pyx_k_float, sizeof(__pyx_k_float), 0, 1, 1}, /* PyObject cname: __pyx_n_u_float */ {__pyx_k_float64, sizeof(__pyx_k_float64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_float64 */ {__pyx_k_format, sizeof(__pyx_k_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format */ + {__pyx_k_formats_as_category, sizeof(__pyx_k_formats_as_category), 0, 1, 1}, /* PyObject cname: __pyx_n_u_formats_as_category */ + {__pyx_k_formats_as_ordered_category, sizeof(__pyx_k_formats_as_ordered_category), 0, 1, 1}, /* PyObject cname: __pyx_n_u_formats_as_ordered_category */ {__pyx_k_from_dict, sizeof(__pyx_k_from_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_dict */ {__pyx_k_from_epoch, sizeof(__pyx_k_from_epoch), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_epoch */ {__pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fromtimestamp */ @@ -20847,8 +21880,11 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_loc, sizeof(__pyx_k_loc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_loc */ {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ + {__pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata */ {__pyx_k_metadata_container, sizeof(__pyx_k_metadata_container), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata_container */ {__pyx_k_metadata_container___init, sizeof(__pyx_k_metadata_container___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata_container___init */ + {__pyx_k_metadataonly, sizeof(__pyx_k_metadataonly), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadataonly */ + {__pyx_k_metaonly, sizeof(__pyx_k_metaonly), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaonly */ {__pyx_k_missing_ranges, sizeof(__pyx_k_missing_ranges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_ranges */ {__pyx_k_missing_user_values, sizeof(__pyx_k_missing_user_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_user_values */ {__pyx_k_modification_time, sizeof(__pyx_k_modification_time), 0, 1, 1}, /* PyObject cname: __pyx_n_u_modification_time */ @@ -20860,6 +21896,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_nan, sizeof(__pyx_k_nan), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nan */ {__pyx_k_narwhals, sizeof(__pyx_k_narwhals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals */ {__pyx_k_narwhals_stable_v2, sizeof(__pyx_k_narwhals_stable_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals_stable_v2 */ + {__pyx_k_no_datetime_conversion, sizeof(__pyx_k_no_datetime_conversion), 0, 1, 1}, /* PyObject cname: __pyx_n_u_no_datetime_conversion */ {__pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_no_default___reduce___due_to_non */ {__pyx_k_nominal, sizeof(__pyx_k_nominal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nominal */ {__pyx_k_notes, sizeof(__pyx_k_notes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_notes */ @@ -20876,11 +21913,14 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_output_format, sizeof(__pyx_k_output_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_format */ {__pyx_k_output_format_must_be_one_of_all, sizeof(__pyx_k_output_format_must_be_one_of_all), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_output_format_must_be_one_of_all */ {__pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pandas */ + {__pyx_k_parser_entry_point, sizeof(__pyx_k_parser_entry_point), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parser_entry_point */ + {__pyx_k_parser_format, sizeof(__pyx_k_parser_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parser_format */ {__pyx_k_path, sizeof(__pyx_k_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_path */ {__pyx_k_path_must_be_either_str_or_bytes, sizeof(__pyx_k_path_must_be_either_str_or_bytes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_path_must_be_either_str_or_bytes */ {__pyx_k_path_must_be_str_bytes_or_unicod, sizeof(__pyx_k_path_must_be_str_bytes_or_unicod), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_path_must_be_str_bytes_or_unicod */ {__pyx_k_polars, sizeof(__pyx_k_polars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_polars */ {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ + {__pyx_k_por, sizeof(__pyx_k_por), 0, 1, 1}, /* PyObject cname: __pyx_n_u_por */ {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ {__pyx_k_pyreadstat__readstat_parser, sizeof(__pyx_k_pyreadstat__readstat_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyreadstat__readstat_parser */ {__pyx_k_pyreadstat__readstat_parser_pyx, sizeof(__pyx_k_pyreadstat__readstat_parser_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_pyreadstat__readstat_parser_pyx */ @@ -20895,12 +21935,17 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_cython */ {__pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_ex */ {__pyx_k_right, sizeof(__pyx_k_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right */ + {__pyx_k_row_limit, sizeof(__pyx_k_row_limit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_limit */ + {__pyx_k_row_offset, sizeof(__pyx_k_row_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_offset */ {__pyx_k_s, sizeof(__pyx_k_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s */ + {__pyx_k_sas7bcat, sizeof(__pyx_k_sas7bcat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas7bcat */ + {__pyx_k_sas7bdat, sizeof(__pyx_k_sas7bdat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas7bdat */ {__pyx_k_sas_all_formats, sizeof(__pyx_k_sas_all_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas_all_formats */ {__pyx_k_sas_date_formats, sizeof(__pyx_k_sas_date_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas_date_formats */ {__pyx_k_sas_datetime_formats, sizeof(__pyx_k_sas_datetime_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas_datetime_formats */ {__pyx_k_sas_origin, sizeof(__pyx_k_sas_origin), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas_origin */ {__pyx_k_sas_time_formats, sizeof(__pyx_k_sas_time_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas_time_formats */ + {__pyx_k_sav_zsav, sizeof(__pyx_k_sav_zsav), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_sav_zsav */ {__pyx_k_scale, sizeof(__pyx_k_scale), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scale */ {__pyx_k_schema, sizeof(__pyx_k_schema), 0, 1, 1}, /* PyObject cname: __pyx_n_u_schema */ {__pyx_k_seek, sizeof(__pyx_k_seek), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seek */ @@ -20942,6 +21987,9 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_type, sizeof(__pyx_k_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_type */ {__pyx_k_undetermined, sizeof(__pyx_k_undetermined), 0, 1, 1}, /* PyObject cname: __pyx_n_u_undetermined */ {__pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unknown */ + {__pyx_k_usecols, sizeof(__pyx_k_usecols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_usecols */ + {__pyx_k_user_missing, sizeof(__pyx_k_user_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_user_missing */ + {__pyx_k_usernan, sizeof(__pyx_k_usernan), 0, 1, 1}, /* PyObject cname: __pyx_n_u_usernan */ {__pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_utf_8 */ {__pyx_k_v2, sizeof(__pyx_k_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v2 */ {__pyx_k_value_labels, sizeof(__pyx_k_value_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value_labels */ @@ -20956,6 +22004,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warnings */ {__pyx_k_with_columns, sizeof(__pyx_k_with_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_with_columns */ {__pyx_k_with_date_type_in_column, sizeof(__pyx_k_with_date_type_in_column), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_with_date_type_in_column */ + {__pyx_k_wrong_parser_format, sizeof(__pyx_k_wrong_parser_format), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_wrong_parser_format */ + {__pyx_k_xport, sizeof(__pyx_k_xport), 0, 1, 1}, /* PyObject cname: __pyx_n_u_xport */ {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ {0, 0, 0, 0, 0} }; @@ -20966,13 +22016,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 435, __pyx_L1_error) - __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_all); if (!__pyx_builtin_all) __PYX_ERR(0, 1087, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1106, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 1205, __pyx_L1_error) - __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 1253, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_all); if (!__pyx_builtin_all) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 1207, __pyx_L1_error) + __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 1255, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -20984,36 +22034,36 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "pyreadstat/_readstat_parser.pyx":1109 + /* "pyreadstat/_readstat_parser.pyx":1111 * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "pyreadstat/_readstat_parser.pyx":1255 + /* "pyreadstat/_readstat_parser.pyx":1257 * 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, 1255, __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, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "pyreadstat/_readstat_parser.pyx":31 + /* "pyreadstat/_readstat_parser.pyx":33 * import sys * * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< * import numpy as np * */ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_narwhals, __pyx_mstate_global->__pyx_n_u_stable, __pyx_mstate_global->__pyx_n_u_v2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_narwhals, __pyx_mstate_global->__pyx_n_u_stable, __pyx_mstate_global->__pyx_n_u_v2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_RefNannyFinishContext(); @@ -21045,13 +22095,13 @@ static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { /* #### Code section: init_codeobjects ### */ \ typedef struct { - unsigned int argcount : 2; + unsigned int argcount : 5; unsigned int num_posonly_args : 1; unsigned int num_kwonly_args : 1; - unsigned int nlocals : 2; + unsigned int nlocals : 5; unsigned int flags : 10; - unsigned int first_line : 8; - unsigned int line_table_length : 12; + unsigned int first_line : 11; + unsigned int line_table_length : 13; } __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( @@ -21078,10 +22128,15 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 130, 174}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 132, 174}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_parser_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_Q_a_O1_Q_M_1_1_N_q_a_A_Q_O1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } + { + const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1370, 283}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_parser_format, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_formats_as_category, __pyx_mstate->__pyx_n_u_formats_as_ordered_category, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_user_missing, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_parser_pyx, __pyx_mstate->__pyx_n_u_parser_entry_point, __pyx_k_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + } Py_DECREF(tuple_dedup_map); return 0; bad: @@ -23893,6 +24948,54 @@ static PyObject *__Pyx_ImportDottedModuleRelFirst(PyObject *name, PyObject *part return __Pyx_ImportDottedModule(name, parts_tuple); } +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (!exact) { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } + } + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -26437,6 +27540,260 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_readstat_type_t(readstat_type_t } } +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { +#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(!PyLong_Check(x))) { + int val; + PyObject *tmp = __Pyx_PyNumber_Long(x); + if (!tmp) return (int) -1; + val = __Pyx_PyLong_As_int(tmp); + Py_DECREF(tmp); + return val; + } + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + int ret = -1; +#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API + Py_ssize_t bytes_copied = PyLong_AsNativeBytes( + x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); + if (unlikely(bytes_copied == -1)) { + } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { + goto raise_overflow; + } else { + ret = 0; + } +#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)x, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *v; + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (likely(PyLong_CheckExact(x))) { + v = __Pyx_NewRef(x); + } else { + v = PyNumber_Long(x); + if (unlikely(!v)) return (int) -1; + assert(PyLong_CheckExact(v)); + } + { + int result = PyObject_RichCompareBool(v, Py_False, Py_LT); + if (unlikely(result < 0)) { + Py_DECREF(v); + return (int) -1; + } + is_negative = result == 1; + } + if (is_unsigned && unlikely(is_negative)) { + Py_DECREF(v); + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + Py_DECREF(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = v; + } + v = NULL; + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + long idigit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + val |= ((int) idigit) << bits; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + } + Py_DECREF(shift); shift = NULL; + Py_DECREF(mask); mask = NULL; + { + long idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + } + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + if (unlikely(ret)) + return (int) -1; + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC @@ -26957,260 +28314,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } } -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { -#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(!PyLong_Check(x))) { - int val; - PyObject *tmp = __Pyx_PyNumber_Long(x); - if (!tmp) return (int) -1; - val = __Pyx_PyLong_As_int(tmp); - Py_DECREF(tmp); - return val; - } - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - int ret = -1; -#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API - Py_ssize_t bytes_copied = PyLong_AsNativeBytes( - x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); - if (unlikely(bytes_copied == -1)) { - } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { - goto raise_overflow; - } else { - ret = 0; - } -#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)x, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *v; - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (likely(PyLong_CheckExact(x))) { - v = __Pyx_NewRef(x); - } else { - v = PyNumber_Long(x); - if (unlikely(!v)) return (int) -1; - assert(PyLong_CheckExact(v)); - } - { - int result = PyObject_RichCompareBool(v, Py_False, Py_LT); - if (unlikely(result < 0)) { - Py_DECREF(v); - return (int) -1; - } - is_negative = result == 1; - } - if (is_unsigned && unlikely(is_negative)) { - Py_DECREF(v); - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - Py_DECREF(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = v; - } - v = NULL; - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - long idigit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - val |= ((int) idigit) << bits; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - } - Py_DECREF(shift); shift = NULL; - Py_DECREF(mask); mask = NULL; - { - long idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - } - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - if (unlikely(ret)) - return (int) -1; - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_char(char value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC diff --git a/pyreadstat/_readstat_parser.pyx b/pyreadstat/_readstat_parser.pyx index 3e007bb..28e9049 100644 --- a/pyreadstat/_readstat_parser.pyx +++ b/pyreadstat/_readstat_parser.pyx @@ -16,6 +16,8 @@ # limitations under the License. # ############################################################################# +## if want to profile: # cython: profile=True + from cpython.datetime cimport import_datetime, timedelta_new, datetime_new, total_seconds from cpython.exc cimport PyErr_Occurred from cpython.object cimport PyObject @@ -1365,3 +1367,56 @@ cdef object run_conversion(object filename_path, py_file_format file_format, py_ return data_frame, metadata +def parser_entry_point(filename_path, str parser_format=None, + metadataonly=False, dates_as_pandas_datetime=False, + formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, + disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, + list extra_date_formats=None, list extra_time_formats=None): + + + cdef py_file_format file_format + cdef py_file_extension file_extension + + if parser_format == "sav/zsav": + file_format = FILE_FORMAT_SPSS + file_extension = FILE_EXT_SAV + elif parser_format == "sas7bdat": + file_format = FILE_FORMAT_SAS + file_extension = FILE_EXT_SAS7BDAT + elif parser_format == "xport": + file_format = FILE_FORMAT_SAS + file_extension = FILE_EXT_XPORT + elif parser_format == "dta": + file_format = FILE_FORMAT_STATA + file_extension = FILE_EXT_DTA + elif parser_format == "por": + file_format = FILE_FORMAT_SPSS + file_extension = FILE_EXT_POR + elif parser_format == "sas7bcat": + file_format = FILE_FORMAT_SAS + file_extension = FILE_EXT_SAS7BCAT + else: + raise PyreadstatError("wrong parser format") + + cdef bint metaonly = 0 + if metadataonly: + metaonly = 1 + + cdef bint dates_as_pandas = 0 + if dates_as_pandas_datetime: + dates_as_pandas = 1 + + cdef bint usernan = 0 + if user_missing: + usernan = 1 + + cdef bint no_datetime_conversion = 0 + if disable_datetime_conversion: + no_datetime_conversion = 1 + + data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, + dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, + output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) + + return data_frame, metadata + diff --git a/pyreadstat/_readstat_writer.c b/pyreadstat/_readstat_writer.c index e657bd7..4a684f3 100644 --- a/pyreadstat/_readstat_writer.c +++ b/pyreadstat/_readstat_writer.c @@ -1539,6 +1539,9 @@ static const char* const __pyx_f[] = { __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) #endif +/* IncludeStructmemberH.proto */ +#include + /* CriticalSections.proto */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* @@ -2326,6 +2329,72 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) +#else + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif +#else + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS +#endif +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) +#else +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_1_2 #define __PYX_HAVE_RT_ImportType_proto_3_1_2 @@ -2361,6 +2430,142 @@ static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* LimitedApiGetTypeDict.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); +#endif + +/* SetItemOnTypeDict.proto */ +static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); +#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) + +/* FixUpExtensionType.proto */ +static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* dict_setdefault.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); + +/* CommonTypesMetaclass.proto */ +static int __pyx_CommonTypesMetaclass_init(PyObject *module); +#define __Pyx_CommonTypesMetaclass_USED + +/* CallTypeTraverse.proto */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); +#endif + +/* PyMethodNew.proto */ +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) + __pyx_vectorcallfunc func_vectorcall; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + PyObject *defaults; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + /* CLineInTraceback.proto */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); @@ -2594,6 +2799,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *); /*prot static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int); /*proto*/ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes(PyObject *); /*proto*/ static void __pyx_f_10pyreadstat_16_readstat_writer_initial_checks(int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *); /*proto*/ +static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int); /*proto*/ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_label(readstat_writer_t *, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *); /*proto*/ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject *, readstat_variable_t *, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *); /*proto*/ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(readstat_variable_t *, PyObject *, PyObject *); /*proto*/ @@ -2614,9 +2820,11 @@ static PyObject *__pyx_builtin_zip; static const char __pyx_k_[] = ")"; static const char __pyx_k_x[] = "x"; static const char __pyx_k__2[] = " "; -static const char __pyx_k__3[] = "."; -static const char __pyx_k__4[] = "_"; -static const char __pyx_k__5[] = "?"; +static const char __pyx_k__3[] = ""; +static const char __pyx_k__4[] = "."; +static const char __pyx_k__5[] = "_"; +static const char __pyx_k__6[] = "?"; +static const char __pyx_k_df[] = "df"; static const char __pyx_k_hi[] = "hi"; static const char __pyx_k_lo[] = "lo"; static const char __pyx_k_ms[] = "ms"; @@ -2628,9 +2836,13 @@ static const char __pyx_k_os[] = "os"; static const char __pyx_k_us[] = "us"; static const char __pyx_k_v2[] = "v2"; static const char __pyx_k_cat[] = "cat"; +static const char __pyx_k_dta[] = "dta"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_min[] = "min"; static const char __pyx_k_nth[] = "nth"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_por[] = "por"; +static const char __pyx_k_sav[] = "sav"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_utc[] = "utc"; static const char __pyx_k_zip[] = "zip"; @@ -2642,11 +2854,13 @@ static const char __pyx_k_Time[] = "Time"; static const char __pyx_k_cast[] = "cast"; static const char __pyx_k_date[] = "date"; static const char __pyx_k_days[] = "days"; +static const char __pyx_k_func[] = "__func__"; static const char __pyx_k_isna[] = "isna"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; +static const char __pyx_k_note[] = "note"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; @@ -2670,6 +2884,7 @@ static const char __pyx_k_round[] = "round"; static const char __pyx_k_scale[] = "scale"; static const char __pyx_k_upper[] = "upper"; static const char __pyx_k_utf_8[] = "utf-8"; +static const char __pyx_k_xport[] = "xport"; static const char __pyx_k_Int128[] = "Int128"; static const char __pyx_k_Object[] = "Object"; static const char __pyx_k_String[] = "String"; @@ -2697,12 +2912,17 @@ static const char __pyx_k_nominal[] = "nominal"; static const char __pyx_k_ordinal[] = "ordinal"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_unknown[] = "unknown"; +static const char __pyx_k_version[] = "version"; static const char __pyx_k_Datetime[] = "Datetime"; +static const char __pyx_k_add_note[] = "add_note"; +static const char __pyx_k_compress[] = "compress"; static const char __pyx_k_datetime[] = "datetime"; +static const char __pyx_k_dst_path[] = "dst_path"; static const char __pyx_k_fsdecode[] = "fsdecode"; static const char __pyx_k_fsencode[] = "fsencode"; static const char __pyx_k_narwhals[] = "narwhals"; static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_timezone[] = "timezone"; static const char __pyx_k_warnings[] = "warnings"; static const char __pyx_k_is_pandas[] = "is_pandas"; @@ -2715,53 +2935,78 @@ static const char __pyx_k_datetime64[] = "datetime64"; static const char __pyx_k_drop_nulls[] = "drop_nulls"; static const char __pyx_k_eager_only[] = "eager_only"; static const char __pyx_k_expanduser[] = "expanduser"; +static const char __pyx_k_file_label[] = "file_label"; static const char __pyx_k_is_of_type[] = "' is of type "; static const char __pyx_k_null_count[] = "null_count"; +static const char __pyx_k_table_name[] = "table_name"; static const char __pyx_k_Categorical[] = "Categorical"; static const char __pyx_k_from_native[] = "from_native"; static const char __pyx_k_in_variable[] = " in variable "; static const char __pyx_k_must_be_int[] = " must be int"; static const char __pyx_k_UnicodeError[] = "UnicodeError"; static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_iter_columns[] = "iter_columns"; +static const char __pyx_k_row_compress[] = "row_compress"; static const char __pyx_k_with_columns[] = "with_columns"; static const char __pyx_k_ReadstatError[] = "ReadstatError"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; +static const char __pyx_k_column_labels[] = "column_labels"; static const char __pyx_k_total_seconds[] = "total_seconds"; static const char __pyx_k_variable_name[] = "variable name '"; +static const char __pyx_k_writer_format[] = "writer_format"; static const char __pyx_k_does_not_exist[] = " does not exist!"; static const char __pyx_k_get_categories[] = "get_categories"; static const char __pyx_k_implementation[] = "implementation"; +static const char __pyx_k_missing_ranges[] = "missing_ranges"; static const char __pyx_k_must_be_string[] = " must be string"; static const char __pyx_k_PyreadstatError[] = "PyreadstatError"; static const char __pyx_k_must_be_numeric[] = " must be numeric"; static const char __pyx_k_readstat_parser[] = "_readstat_parser"; +static const char __pyx_k_row_compression[] = "row_compression"; static const char __pyx_k_surrogateescape[] = "surrogateescape"; +static const char __pyx_k_variable_format[] = "variable_format"; static const char __pyx_k_must_be_dict_got[] = " must be dict, got "; +static const char __pyx_k_variable_measure[] = "variable_measure"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_narwhals_stable_v2[] = "narwhals.stable.v2"; +static const char __pyx_k_variable_alignment[] = "variable_alignment"; +static const char __pyx_k_writer_entry_point[] = "writer_entry_point"; +static const char __pyx_k_writer_file_format[] = "writer_file_format"; +static const char __pyx_k_file_format_version[] = "file_format_version"; +static const char __pyx_k_missing_user_values[] = "missing_user_values"; static const char __pyx_k_unknown_file_format[] = "unknown file format"; +static const char __pyx_k_wrong_writer_format[] = "wrong writer format"; static const char __pyx_k_get_native_namespace[] = "get_native_namespace"; static const char __pyx_k_measure_for_variable[] = "measure for variable "; +static const char __pyx_k_Version_not_supported[] = "Version not supported"; static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; +static const char __pyx_k_variable_value_labels[] = "variable_value_labels"; static const char __pyx_k_alignment_for_variable[] = "alignment for variable "; static const char __pyx_k_the_destination_folder[] = "the destination folder "; +static const char __pyx_k_variable_display_width[] = "variable_display_width"; +static const char __pyx_k_pyreadstat__readstat_writer[] = "pyreadstat._readstat_writer"; static const char __pyx_k_must_be_boolean_or_be_1_or_0[] = " must be boolean or be 1 or 0"; static const char __pyx_k_Column_labels_must_be_strings[] = "Column labels must be strings"; static const char __pyx_k_Unknown_data_format_to_insert[] = "Unknown data format to insert"; static const char __pyx_k_must_be_either_nominal_ordinal[] = " must be either nominal, ordinal, scale or unknown got "; +static const char __pyx_k_Q_22BBVVW_11K1_1_S_Q_a_9D_1_1_a[] = "\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\320WX"; static const char __pyx_k_and_it_must_be_str_not_starting[] = " and it must be str (not starting with numbers!)"; static const char __pyx_k_length_of_column_labels_must_be[] = "length of column labels must be the same as number of columns"; static const char __pyx_k_missing_ranges_hi_and_lo_values[] = "missing_ranges: hi and lo values must be both the same for string type"; static const char __pyx_k_missing_user_values_not_allowed[] = "missing_user_values not allowed for character variable %s"; static const char __pyx_k_must_be_either_right_center_lef[] = " must be either right, center, left or unknown got "; static const char __pyx_k_must_match_the_type_of_the_colu[] = " must match the type of the column in dataframe and be of type date, datetime or time"; +static const char __pyx_k_pyreadstat__readstat_writer_pyx[] = "pyreadstat/_readstat_writer.pyx"; static const char __pyx_k_starts_with_an_illegal_non_alph[] = "' starts with an illegal (non-alphabetic) character: '"; static const char __pyx_k_variable_value_labels_value_for[] = "variable_value_labels: value for key "; static const char __pyx_k_Non_unique_column_names_detected[] = "Non unique column names detected in the dataframe!"; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note 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."; static const char __pyx_k_Unknown_pywriter_variable_format[] = "Unknown pywriter variable format"; static const char __pyx_k_character_missing_ranges_value_g[] = "character missing_ranges value given for non character variable %s"; static const char __pyx_k_column_labels_must_be_either_lis[] = "column_labels must be either list or dict!"; +static const char __pyx_k_compress_and_row_compress_cannot[] = "compress and row_compress cannot be both True"; static const char __pyx_k_dataframe_must_be_pandas_or_pola[] = "dataframe must be pandas or polars dataframe"; static const char __pyx_k_dictionaries_in_missing_ranges_m[] = "dictionaries in missing_ranges must have the keys hi and lo"; static const char __pyx_k_file_path_could_not_be_encoded_w[] = "file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly."; @@ -2783,6 +3028,7 @@ static const char __pyx_k_variable_value_labels_type_of_La[] = "variable_value_l static const char __pyx_k_variable_value_labels_type_of_Va[] = "variable_value_labels: type of Value "; static const char __pyx_k_missing_ranges_hi_and_lo_values_2[] = "missing_ranges: hi and lo values must be both either of numeric or string type"; /* #### Code section: decls ### */ +static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_writer_format, PyObject *__pyx_v_file_label, int __pyx_v_version, PyObject *__pyx_v_table_name, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_compress, PyObject *__pyx_v_row_compress, PyObject *__pyx_v_note, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_format, PyObject *__pyx_v_variable_alignment); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ @@ -2825,8 +3071,10 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; PyObject *__pyx_tuple[3]; - PyObject *__pyx_string_tab[171]; + PyObject *__pyx_codeobj_tab[1]; + PyObject *__pyx_string_tab[209]; PyObject *__pyx_float_1e3; PyObject *__pyx_float_1e6; PyObject *__pyx_float_1e9; @@ -2837,6 +3085,14 @@ typedef struct { PyObject *__pyx_int_1970; PyObject *__pyx_int_neg_9223372036854775808; /* #### Code section: module_state_contents ### */ +/* CommonTypesMetaclass.module_state_decls */ +PyTypeObject *__pyx_CommonTypesMetaclassType; + +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -2882,160 +3138,198 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_Int8 __pyx_string_tab[14] #define __pyx_kp_u_Non_unique_column_names_detected __pyx_string_tab[15] #define __pyx_kp_u_None __pyx_string_tab[16] -#define __pyx_n_u_Object __pyx_string_tab[17] -#define __pyx_n_u_PyreadstatError __pyx_string_tab[18] -#define __pyx_n_u_ReadstatError __pyx_string_tab[19] -#define __pyx_n_u_String __pyx_string_tab[20] -#define __pyx_n_u_Time __pyx_string_tab[21] -#define __pyx_n_u_UInt128 __pyx_string_tab[22] -#define __pyx_n_u_UInt16 __pyx_string_tab[23] -#define __pyx_n_u_UInt32 __pyx_string_tab[24] -#define __pyx_n_u_UInt64 __pyx_string_tab[25] -#define __pyx_n_u_UInt8 __pyx_string_tab[26] -#define __pyx_n_u_UnicodeError __pyx_string_tab[27] -#define __pyx_kp_u_Unknown_data_format_to_insert __pyx_string_tab[28] -#define __pyx_kp_u_Unknown_pywriter_variable_format __pyx_string_tab[29] -#define __pyx_kp_u__2 __pyx_string_tab[30] -#define __pyx_kp_u__3 __pyx_string_tab[31] -#define __pyx_n_u__4 __pyx_string_tab[32] -#define __pyx_kp_u__5 __pyx_string_tab[33] -#define __pyx_kp_u_alignment_for_variable __pyx_string_tab[34] -#define __pyx_kp_u_and_it_must_be_str_not_starting __pyx_string_tab[35] -#define __pyx_n_u_cast __pyx_string_tab[36] -#define __pyx_n_u_cat __pyx_string_tab[37] -#define __pyx_n_u_center __pyx_string_tab[38] -#define __pyx_kp_u_character_missing_ranges_value_g __pyx_string_tab[39] -#define __pyx_n_u_class_getitem __pyx_string_tab[40] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[41] -#define __pyx_n_u_clone __pyx_string_tab[42] -#define __pyx_kp_u_column_labels_must_be_either_lis __pyx_string_tab[43] -#define __pyx_n_u_columns __pyx_string_tab[44] -#define __pyx_n_u_combine __pyx_string_tab[45] -#define __pyx_kp_u_dataframe_must_be_pandas_or_pola __pyx_string_tab[46] -#define __pyx_n_u_date __pyx_string_tab[47] -#define __pyx_n_u_datetime __pyx_string_tab[48] -#define __pyx_n_u_datetime64 __pyx_string_tab[49] -#define __pyx_n_u_days __pyx_string_tab[50] -#define __pyx_kp_u_dictionaries_in_missing_ranges_m __pyx_string_tab[51] -#define __pyx_n_u_dirname __pyx_string_tab[52] -#define __pyx_kp_u_does_not_exist __pyx_string_tab[53] -#define __pyx_n_u_drop_nulls __pyx_string_tab[54] -#define __pyx_n_u_dtype __pyx_string_tab[55] -#define __pyx_n_u_eager_only __pyx_string_tab[56] -#define __pyx_n_u_encode __pyx_string_tab[57] -#define __pyx_n_u_expanduser __pyx_string_tab[58] -#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[59] -#define __pyx_n_u_filter __pyx_string_tab[60] -#define __pyx_n_u_from_native __pyx_string_tab[61] -#define __pyx_n_u_fsdecode __pyx_string_tab[62] -#define __pyx_n_u_fsencode __pyx_string_tab[63] -#define __pyx_n_u_get __pyx_string_tab[64] -#define __pyx_n_u_get_categories __pyx_string_tab[65] -#define __pyx_n_u_get_native_namespace __pyx_string_tab[66] -#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[67] -#define __pyx_n_u_hi __pyx_string_tab[68] -#define __pyx_n_u_implementation __pyx_string_tab[69] -#define __pyx_kp_u_in_variable __pyx_string_tab[70] -#define __pyx_n_u_initializing __pyx_string_tab[71] -#define __pyx_kp_u_instead __pyx_string_tab[72] -#define __pyx_n_u_is_in __pyx_string_tab[73] -#define __pyx_kp_u_is_of_type __pyx_string_tab[74] -#define __pyx_n_u_is_pandas __pyx_string_tab[75] -#define __pyx_n_u_is_polars __pyx_string_tab[76] -#define __pyx_n_u_isalpha __pyx_string_tab[77] -#define __pyx_n_u_isdir __pyx_string_tab[78] -#define __pyx_n_u_isna __pyx_string_tab[79] -#define __pyx_n_u_items __pyx_string_tab[80] -#define __pyx_n_u_iter_columns __pyx_string_tab[81] -#define __pyx_n_u_iter_rows __pyx_string_tab[82] -#define __pyx_n_u_keys __pyx_string_tab[83] -#define __pyx_n_u_left __pyx_string_tab[84] -#define __pyx_kp_u_length_of_column_labels_must_be __pyx_string_tab[85] -#define __pyx_n_u_lo __pyx_string_tab[86] -#define __pyx_n_u_main __pyx_string_tab[87] -#define __pyx_kp_u_measure_for_variable __pyx_string_tab[88] -#define __pyx_n_u_min __pyx_string_tab[89] -#define __pyx_kp_u_missing_ranges_hi_and_lo_values __pyx_string_tab[90] -#define __pyx_kp_u_missing_ranges_hi_and_lo_values_2 __pyx_string_tab[91] -#define __pyx_kp_u_missing_ranges_max_1_discrete_nu __pyx_string_tab[92] -#define __pyx_kp_u_missing_ranges_max_1_range_value __pyx_string_tab[93] -#define __pyx_kp_u_missing_ranges_max_3_discrete_nu __pyx_string_tab[94] -#define __pyx_kp_u_missing_ranges_max_3_string_valu __pyx_string_tab[95] -#define __pyx_kp_u_missing_ranges_string_values_len __pyx_string_tab[96] -#define __pyx_kp_u_missing_ranges_values_in_diction __pyx_string_tab[97] -#define __pyx_kp_u_missing_ranges_values_must_be_bo __pyx_string_tab[98] -#define __pyx_kp_u_missing_user_values_not_allowed __pyx_string_tab[99] -#define __pyx_kp_u_missing_user_values_supports_val __pyx_string_tab[100] -#define __pyx_kp_u_missing_user_values_values_in_di __pyx_string_tab[101] -#define __pyx_n_u_module __pyx_string_tab[102] -#define __pyx_n_u_ms __pyx_string_tab[103] -#define __pyx_kp_u_must_be_boolean_or_be_1_or_0 __pyx_string_tab[104] -#define __pyx_kp_u_must_be_dict_got __pyx_string_tab[105] -#define __pyx_kp_u_must_be_either_nominal_ordinal __pyx_string_tab[106] -#define __pyx_kp_u_must_be_either_right_center_lef __pyx_string_tab[107] -#define __pyx_kp_u_must_be_int __pyx_string_tab[108] -#define __pyx_kp_u_must_be_numeric __pyx_string_tab[109] -#define __pyx_kp_u_must_be_string __pyx_string_tab[110] -#define __pyx_kp_u_must_match_the_type_of_the_colu __pyx_string_tab[111] -#define __pyx_n_u_name __pyx_string_tab[112] -#define __pyx_n_u_name_2 __pyx_string_tab[113] -#define __pyx_n_u_narwhals __pyx_string_tab[114] -#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[115] -#define __pyx_n_u_nominal __pyx_string_tab[116] -#define __pyx_kp_u_note_should_be_either_str_or_lis __pyx_string_tab[117] -#define __pyx_n_u_np __pyx_string_tab[118] -#define __pyx_n_u_ns __pyx_string_tab[119] -#define __pyx_n_u_nt __pyx_string_tab[120] -#define __pyx_n_u_nth __pyx_string_tab[121] -#define __pyx_n_u_null_count __pyx_string_tab[122] -#define __pyx_kp_u_numeric_missing_ranges_value_giv __pyx_string_tab[123] -#define __pyx_n_u_numpy __pyx_string_tab[124] -#define __pyx_n_u_nw __pyx_string_tab[125] -#define __pyx_n_u_ordinal __pyx_string_tab[126] -#define __pyx_kp_u_ordinal_2 __pyx_string_tab[127] -#define __pyx_n_u_os __pyx_string_tab[128] -#define __pyx_n_u_path __pyx_string_tab[129] -#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[130] -#define __pyx_n_u_qualname __pyx_string_tab[131] -#define __pyx_n_u_range __pyx_string_tab[132] -#define __pyx_n_u_readstat_parser __pyx_string_tab[133] -#define __pyx_n_u_replace __pyx_string_tab[134] -#define __pyx_n_u_right __pyx_string_tab[135] -#define __pyx_n_u_round __pyx_string_tab[136] -#define __pyx_n_u_scale __pyx_string_tab[137] -#define __pyx_n_u_spec __pyx_string_tab[138] -#define __pyx_n_u_stable __pyx_string_tab[139] -#define __pyx_kp_u_starts_with_an_illegal_non_alph __pyx_string_tab[140] -#define __pyx_n_u_surrogateescape __pyx_string_tab[141] -#define __pyx_n_u_sys __pyx_string_tab[142] -#define __pyx_n_u_test __pyx_string_tab[143] -#define __pyx_kp_u_the_destination_folder __pyx_string_tab[144] -#define __pyx_n_u_then __pyx_string_tab[145] -#define __pyx_n_u_time __pyx_string_tab[146] -#define __pyx_n_u_time_unit __pyx_string_tab[147] -#define __pyx_n_u_timestamp __pyx_string_tab[148] -#define __pyx_n_u_timezone __pyx_string_tab[149] -#define __pyx_n_u_total_seconds __pyx_string_tab[150] -#define __pyx_n_u_tzinfo __pyx_string_tab[151] -#define __pyx_n_u_unknown __pyx_string_tab[152] -#define __pyx_kp_u_unknown_file_format __pyx_string_tab[153] -#define __pyx_n_u_upper __pyx_string_tab[154] -#define __pyx_n_u_us __pyx_string_tab[155] -#define __pyx_n_u_utc __pyx_string_tab[156] -#define __pyx_kp_u_utf_8 __pyx_string_tab[157] -#define __pyx_n_u_v2 __pyx_string_tab[158] -#define __pyx_kp_u_variable_name __pyx_string_tab[159] -#define __pyx_kp_u_variable_name_s_contains_a_space __pyx_string_tab[160] -#define __pyx_kp_u_variable_names_must_be_non_empty __pyx_string_tab[161] -#define __pyx_kp_u_variable_value_labels_type_of_La __pyx_string_tab[162] -#define __pyx_kp_u_variable_value_labels_type_of_Va __pyx_string_tab[163] -#define __pyx_kp_u_variable_value_labels_value_for __pyx_string_tab[164] -#define __pyx_n_u_warn __pyx_string_tab[165] -#define __pyx_n_u_warnings __pyx_string_tab[166] -#define __pyx_n_u_when __pyx_string_tab[167] -#define __pyx_n_u_with_columns __pyx_string_tab[168] -#define __pyx_n_u_x __pyx_string_tab[169] -#define __pyx_n_u_zip __pyx_string_tab[170] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[17] +#define __pyx_n_u_Object __pyx_string_tab[18] +#define __pyx_n_u_PyreadstatError __pyx_string_tab[19] +#define __pyx_n_u_ReadstatError __pyx_string_tab[20] +#define __pyx_n_u_String __pyx_string_tab[21] +#define __pyx_n_u_Time __pyx_string_tab[22] +#define __pyx_n_u_UInt128 __pyx_string_tab[23] +#define __pyx_n_u_UInt16 __pyx_string_tab[24] +#define __pyx_n_u_UInt32 __pyx_string_tab[25] +#define __pyx_n_u_UInt64 __pyx_string_tab[26] +#define __pyx_n_u_UInt8 __pyx_string_tab[27] +#define __pyx_n_u_UnicodeError __pyx_string_tab[28] +#define __pyx_kp_u_Unknown_data_format_to_insert __pyx_string_tab[29] +#define __pyx_kp_u_Unknown_pywriter_variable_format __pyx_string_tab[30] +#define __pyx_kp_u_Version_not_supported __pyx_string_tab[31] +#define __pyx_kp_u__2 __pyx_string_tab[32] +#define __pyx_kp_u__3 __pyx_string_tab[33] +#define __pyx_kp_u__4 __pyx_string_tab[34] +#define __pyx_n_u__5 __pyx_string_tab[35] +#define __pyx_kp_u__6 __pyx_string_tab[36] +#define __pyx_kp_u_add_note __pyx_string_tab[37] +#define __pyx_kp_u_alignment_for_variable __pyx_string_tab[38] +#define __pyx_kp_u_and_it_must_be_str_not_starting __pyx_string_tab[39] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[40] +#define __pyx_n_u_cast __pyx_string_tab[41] +#define __pyx_n_u_cat __pyx_string_tab[42] +#define __pyx_n_u_center __pyx_string_tab[43] +#define __pyx_kp_u_character_missing_ranges_value_g __pyx_string_tab[44] +#define __pyx_n_u_class_getitem __pyx_string_tab[45] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[46] +#define __pyx_n_u_clone __pyx_string_tab[47] +#define __pyx_n_u_column_labels __pyx_string_tab[48] +#define __pyx_kp_u_column_labels_must_be_either_lis __pyx_string_tab[49] +#define __pyx_n_u_columns __pyx_string_tab[50] +#define __pyx_n_u_combine __pyx_string_tab[51] +#define __pyx_n_u_compress __pyx_string_tab[52] +#define __pyx_kp_u_compress_and_row_compress_cannot __pyx_string_tab[53] +#define __pyx_kp_u_dataframe_must_be_pandas_or_pola __pyx_string_tab[54] +#define __pyx_n_u_date __pyx_string_tab[55] +#define __pyx_n_u_datetime __pyx_string_tab[56] +#define __pyx_n_u_datetime64 __pyx_string_tab[57] +#define __pyx_n_u_days __pyx_string_tab[58] +#define __pyx_n_u_df __pyx_string_tab[59] +#define __pyx_kp_u_dictionaries_in_missing_ranges_m __pyx_string_tab[60] +#define __pyx_n_u_dirname __pyx_string_tab[61] +#define __pyx_kp_u_does_not_exist __pyx_string_tab[62] +#define __pyx_n_u_drop_nulls __pyx_string_tab[63] +#define __pyx_n_u_dst_path __pyx_string_tab[64] +#define __pyx_n_u_dta __pyx_string_tab[65] +#define __pyx_n_u_dtype __pyx_string_tab[66] +#define __pyx_n_u_eager_only __pyx_string_tab[67] +#define __pyx_n_u_encode __pyx_string_tab[68] +#define __pyx_n_u_expanduser __pyx_string_tab[69] +#define __pyx_n_u_file_format_version __pyx_string_tab[70] +#define __pyx_n_u_file_label __pyx_string_tab[71] +#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[72] +#define __pyx_n_u_filter __pyx_string_tab[73] +#define __pyx_n_u_from_native __pyx_string_tab[74] +#define __pyx_n_u_fsdecode __pyx_string_tab[75] +#define __pyx_n_u_fsencode __pyx_string_tab[76] +#define __pyx_n_u_func __pyx_string_tab[77] +#define __pyx_n_u_get __pyx_string_tab[78] +#define __pyx_n_u_get_categories __pyx_string_tab[79] +#define __pyx_n_u_get_native_namespace __pyx_string_tab[80] +#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[81] +#define __pyx_n_u_hi __pyx_string_tab[82] +#define __pyx_n_u_implementation __pyx_string_tab[83] +#define __pyx_kp_u_in_variable __pyx_string_tab[84] +#define __pyx_n_u_initializing __pyx_string_tab[85] +#define __pyx_kp_u_instead __pyx_string_tab[86] +#define __pyx_n_u_is_coroutine __pyx_string_tab[87] +#define __pyx_n_u_is_in __pyx_string_tab[88] +#define __pyx_kp_u_is_of_type __pyx_string_tab[89] +#define __pyx_n_u_is_pandas __pyx_string_tab[90] +#define __pyx_n_u_is_polars __pyx_string_tab[91] +#define __pyx_n_u_isalpha __pyx_string_tab[92] +#define __pyx_n_u_isdir __pyx_string_tab[93] +#define __pyx_n_u_isna __pyx_string_tab[94] +#define __pyx_n_u_items __pyx_string_tab[95] +#define __pyx_n_u_iter_columns __pyx_string_tab[96] +#define __pyx_n_u_iter_rows __pyx_string_tab[97] +#define __pyx_n_u_keys __pyx_string_tab[98] +#define __pyx_n_u_left __pyx_string_tab[99] +#define __pyx_kp_u_length_of_column_labels_must_be __pyx_string_tab[100] +#define __pyx_n_u_lo __pyx_string_tab[101] +#define __pyx_n_u_main __pyx_string_tab[102] +#define __pyx_kp_u_measure_for_variable __pyx_string_tab[103] +#define __pyx_n_u_min __pyx_string_tab[104] +#define __pyx_n_u_missing_ranges __pyx_string_tab[105] +#define __pyx_kp_u_missing_ranges_hi_and_lo_values __pyx_string_tab[106] +#define __pyx_kp_u_missing_ranges_hi_and_lo_values_2 __pyx_string_tab[107] +#define __pyx_kp_u_missing_ranges_max_1_discrete_nu __pyx_string_tab[108] +#define __pyx_kp_u_missing_ranges_max_1_range_value __pyx_string_tab[109] +#define __pyx_kp_u_missing_ranges_max_3_discrete_nu __pyx_string_tab[110] +#define __pyx_kp_u_missing_ranges_max_3_string_valu __pyx_string_tab[111] +#define __pyx_kp_u_missing_ranges_string_values_len __pyx_string_tab[112] +#define __pyx_kp_u_missing_ranges_values_in_diction __pyx_string_tab[113] +#define __pyx_kp_u_missing_ranges_values_must_be_bo __pyx_string_tab[114] +#define __pyx_n_u_missing_user_values __pyx_string_tab[115] +#define __pyx_kp_u_missing_user_values_not_allowed __pyx_string_tab[116] +#define __pyx_kp_u_missing_user_values_supports_val __pyx_string_tab[117] +#define __pyx_kp_u_missing_user_values_values_in_di __pyx_string_tab[118] +#define __pyx_n_u_module __pyx_string_tab[119] +#define __pyx_n_u_ms __pyx_string_tab[120] +#define __pyx_kp_u_must_be_boolean_or_be_1_or_0 __pyx_string_tab[121] +#define __pyx_kp_u_must_be_dict_got __pyx_string_tab[122] +#define __pyx_kp_u_must_be_either_nominal_ordinal __pyx_string_tab[123] +#define __pyx_kp_u_must_be_either_right_center_lef __pyx_string_tab[124] +#define __pyx_kp_u_must_be_int __pyx_string_tab[125] +#define __pyx_kp_u_must_be_numeric __pyx_string_tab[126] +#define __pyx_kp_u_must_be_string __pyx_string_tab[127] +#define __pyx_kp_u_must_match_the_type_of_the_colu __pyx_string_tab[128] +#define __pyx_n_u_name __pyx_string_tab[129] +#define __pyx_n_u_name_2 __pyx_string_tab[130] +#define __pyx_n_u_narwhals __pyx_string_tab[131] +#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[132] +#define __pyx_n_u_nominal __pyx_string_tab[133] +#define __pyx_n_u_note __pyx_string_tab[134] +#define __pyx_kp_u_note_should_be_either_str_or_lis __pyx_string_tab[135] +#define __pyx_n_u_np __pyx_string_tab[136] +#define __pyx_n_u_ns __pyx_string_tab[137] +#define __pyx_n_u_nt __pyx_string_tab[138] +#define __pyx_n_u_nth __pyx_string_tab[139] +#define __pyx_n_u_null_count __pyx_string_tab[140] +#define __pyx_kp_u_numeric_missing_ranges_value_giv __pyx_string_tab[141] +#define __pyx_n_u_numpy __pyx_string_tab[142] +#define __pyx_n_u_nw __pyx_string_tab[143] +#define __pyx_n_u_ordinal __pyx_string_tab[144] +#define __pyx_kp_u_ordinal_2 __pyx_string_tab[145] +#define __pyx_n_u_os __pyx_string_tab[146] +#define __pyx_n_u_path __pyx_string_tab[147] +#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[148] +#define __pyx_n_u_pop __pyx_string_tab[149] +#define __pyx_n_u_por __pyx_string_tab[150] +#define __pyx_n_u_pyreadstat__readstat_writer __pyx_string_tab[151] +#define __pyx_kp_u_pyreadstat__readstat_writer_pyx __pyx_string_tab[152] +#define __pyx_n_u_qualname __pyx_string_tab[153] +#define __pyx_n_u_range __pyx_string_tab[154] +#define __pyx_n_u_readstat_parser __pyx_string_tab[155] +#define __pyx_n_u_replace __pyx_string_tab[156] +#define __pyx_n_u_right __pyx_string_tab[157] +#define __pyx_n_u_round __pyx_string_tab[158] +#define __pyx_n_u_row_compress __pyx_string_tab[159] +#define __pyx_n_u_row_compression __pyx_string_tab[160] +#define __pyx_n_u_sav __pyx_string_tab[161] +#define __pyx_n_u_scale __pyx_string_tab[162] +#define __pyx_n_u_set_name __pyx_string_tab[163] +#define __pyx_n_u_spec __pyx_string_tab[164] +#define __pyx_n_u_stable __pyx_string_tab[165] +#define __pyx_kp_u_starts_with_an_illegal_non_alph __pyx_string_tab[166] +#define __pyx_n_u_surrogateescape __pyx_string_tab[167] +#define __pyx_n_u_sys __pyx_string_tab[168] +#define __pyx_n_u_table_name __pyx_string_tab[169] +#define __pyx_n_u_test __pyx_string_tab[170] +#define __pyx_kp_u_the_destination_folder __pyx_string_tab[171] +#define __pyx_n_u_then __pyx_string_tab[172] +#define __pyx_n_u_time __pyx_string_tab[173] +#define __pyx_n_u_time_unit __pyx_string_tab[174] +#define __pyx_n_u_timestamp __pyx_string_tab[175] +#define __pyx_n_u_timezone __pyx_string_tab[176] +#define __pyx_n_u_total_seconds __pyx_string_tab[177] +#define __pyx_n_u_tzinfo __pyx_string_tab[178] +#define __pyx_n_u_unknown __pyx_string_tab[179] +#define __pyx_kp_u_unknown_file_format __pyx_string_tab[180] +#define __pyx_n_u_upper __pyx_string_tab[181] +#define __pyx_n_u_us __pyx_string_tab[182] +#define __pyx_n_u_utc __pyx_string_tab[183] +#define __pyx_kp_u_utf_8 __pyx_string_tab[184] +#define __pyx_n_u_v2 __pyx_string_tab[185] +#define __pyx_n_u_variable_alignment __pyx_string_tab[186] +#define __pyx_n_u_variable_display_width __pyx_string_tab[187] +#define __pyx_n_u_variable_format __pyx_string_tab[188] +#define __pyx_n_u_variable_measure __pyx_string_tab[189] +#define __pyx_kp_u_variable_name __pyx_string_tab[190] +#define __pyx_kp_u_variable_name_s_contains_a_space __pyx_string_tab[191] +#define __pyx_kp_u_variable_names_must_be_non_empty __pyx_string_tab[192] +#define __pyx_n_u_variable_value_labels __pyx_string_tab[193] +#define __pyx_kp_u_variable_value_labels_type_of_La __pyx_string_tab[194] +#define __pyx_kp_u_variable_value_labels_type_of_Va __pyx_string_tab[195] +#define __pyx_kp_u_variable_value_labels_value_for __pyx_string_tab[196] +#define __pyx_n_u_version __pyx_string_tab[197] +#define __pyx_n_u_warn __pyx_string_tab[198] +#define __pyx_n_u_warnings __pyx_string_tab[199] +#define __pyx_n_u_when __pyx_string_tab[200] +#define __pyx_n_u_with_columns __pyx_string_tab[201] +#define __pyx_n_u_writer_entry_point __pyx_string_tab[202] +#define __pyx_n_u_writer_file_format __pyx_string_tab[203] +#define __pyx_n_u_writer_format __pyx_string_tab[204] +#define __pyx_kp_u_wrong_writer_format __pyx_string_tab[205] +#define __pyx_n_u_x __pyx_string_tab[206] +#define __pyx_n_u_xport __pyx_string_tab[207] +#define __pyx_n_u_zip __pyx_string_tab[208] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3058,7 +3352,8 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { #endif Py_CLEAR(clear_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<171; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<209; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_float_1e3); Py_CLEAR(clear_module_state->__pyx_float_1e6); Py_CLEAR(clear_module_state->__pyx_float_1e9); @@ -3090,7 +3385,8 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #endif Py_VISIT(traverse_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<171; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<209; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1e3); __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1e6); __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1e9); @@ -16877,6 +17173,8 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * close_file(fd) * * return 0 # <<<<<<<<<<<<<< + * + * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", */ __pyx_r = 0; goto __pyx_L0; @@ -16944,1090 +17242,2069 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* #### Code section: module_exttypes ### */ - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -/* #### Code section: initfunc_declarations ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ -/* #### Code section: init_module ### */ - -static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __pyx_v_10pyreadstat_16_readstat_writer_int_types = ((PyObject*)Py_None); Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_float_types = ((PyObject*)Py_None); Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_nat_types = ((PyObject*)Py_None); Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types = ((PyObject*)Py_None); Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types = ((PyObject*)Py_None); Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types = ((PyObject*)Py_None); Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_date_0 = Py_None; Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas = Py_None; Py_INCREF(Py_None); - __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata = Py_None; Py_INCREF(Py_None); - __Pyx_RefNannyFinishContext(); - return 0; -} -static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} +/* "pyreadstat/_readstat_writer.pyx":995 + * return 0 + * + * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< + * int version=0, + * str table_name=None, +*/ -static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); +/* Python wrapper */ +static PyObject *__pyx_pw_10pyreadstat_16_readstat_writer_1writer_entry_point(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10pyreadstat_16_readstat_writer_1writer_entry_point = {"writer_entry_point", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_16_readstat_writer_1writer_entry_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10pyreadstat_16_readstat_writer_1writer_entry_point(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_df = 0; + PyObject *__pyx_v_dst_path = 0; + PyObject *__pyx_v_writer_format = 0; + PyObject *__pyx_v_file_label = 0; + int __pyx_v_version; + PyObject *__pyx_v_table_name = 0; + PyObject *__pyx_v_column_labels = 0; + PyObject *__pyx_v_compress = 0; + PyObject *__pyx_v_row_compress = 0; + PyObject *__pyx_v_note = 0; + PyObject *__pyx_v_variable_value_labels = 0; + PyObject *__pyx_v_missing_ranges = 0; + PyObject *__pyx_v_variable_display_width = 0; + PyObject *__pyx_v_variable_measure = 0; + PyObject *__pyx_v_missing_user_values = 0; + PyObject *__pyx_v_variable_format = 0; + PyObject *__pyx_v_variable_alignment = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - if (__Pyx_ExportFunction("vectorized_convert_datetime_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number, "PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("vectorized_convert_date_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date_to_number, "PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("vectorized_convert_time_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time_to_number, "PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("convert_datetimelike_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number, "double (__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("get_datetimelike_format_for_readstat", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat, "char *(__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("get_narwhals_str_series_max_length", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length, "int (PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("check_series_all_same_types", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types, "int (PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("get_narwhals_column_types", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_types, "PyObject *(PyObject *, PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("write_bytes", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_write_bytes, "Py_ssize_t (void const *, size_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("open_file", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_open_file, "int (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("close_file", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_close_file, "int (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("filepath_to_bytes", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("initial_checks", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_initial_checks, "void (int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ExportFunction("run_write", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_run_write, "int (PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = __Pyx_ImportType_3_1_2(__pyx_t_1, "pyreadstat._readstat_parser", "data_container", - #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), - #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), + __Pyx_RefNannySetupContext("writer_entry_point (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else - sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif - __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) __PYX_ERR(1, 49, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + 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 (__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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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 (!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))); + + /* "pyreadstat/_readstat_writer.pyx":997 + * 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, + * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, +*/ + if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":998 + * int version=0, + * 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, + * dict variable_measure=None, +*/ + if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None)); + if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + 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 + * 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, # <<<<<<<<<<<<<< + * dict variable_measure=None, + * dict missing_user_values=None, +*/ + if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); + 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 + * 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, # <<<<<<<<<<<<<< + * dict missing_user_values=None, + * dict variable_format=None, +*/ + if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1001 + * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, + * dict variable_measure=None, + * dict missing_user_values=None, # <<<<<<<<<<<<<< + * dict variable_format=None, + * dict variable_alignment = None, +*/ + if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1002 + * dict variable_measure=None, + * dict missing_user_values=None, + * dict variable_format=None, # <<<<<<<<<<<<<< + * dict variable_alignment = None, + * ): +*/ + if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1003 + * dict missing_user_values=None, + * dict variable_format=None, + * dict variable_alignment = None, # <<<<<<<<<<<<<< + * ): + * +*/ + 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) } + } + } 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } -static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "readstat_to_numpy_types", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "pyreadstat/_readstat_writer.pyx":995 + * return 0 + * + * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< + * int version=0, + * 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))); + + /* "pyreadstat/_readstat_writer.pyx":997 + * 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, + * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, +*/ + if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":998 + * int version=0, + * 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, + * dict variable_measure=None, +*/ + if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None)); + if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + 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 + * 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, # <<<<<<<<<<<<<< + * dict variable_measure=None, + * dict missing_user_values=None, +*/ + if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); + 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 + * 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, # <<<<<<<<<<<<<< + * dict missing_user_values=None, + * dict variable_format=None, +*/ + if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1001 + * dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, + * dict variable_measure=None, + * dict missing_user_values=None, # <<<<<<<<<<<<<< + * dict variable_format=None, + * dict variable_alignment = None, +*/ + if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1002 + * dict variable_measure=None, + * dict missing_user_values=None, + * dict variable_format=None, # <<<<<<<<<<<<<< + * dict variable_alignment = None, + * ): +*/ + if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); + + /* "pyreadstat/_readstat_writer.pyx":1003 + * dict missing_user_values=None, + * dict variable_format=None, + * dict variable_alignment = None, # <<<<<<<<<<<<<< + * ): + * +*/ + if (!values[16]) values[16] = __Pyx_NewRef(((PyObject*)Py_None)); + } + __pyx_v_df = values[0]; + __pyx_v_dst_path = values[1]; + __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) + } else { + __pyx_v_version = ((int)((int)0)); + } + __pyx_v_table_name = ((PyObject*)values[5]); + __pyx_v_column_labels = values[6]; + __pyx_v_compress = values[7]; + __pyx_v_row_compress = values[8]; + __pyx_v_note = values[9]; + __pyx_v_variable_value_labels = ((PyObject*)values[10]); + __pyx_v_missing_ranges = ((PyObject*)values[11]); + __pyx_v_variable_display_width = ((PyObject*)values[12]); + __pyx_v_variable_measure = ((PyObject*)values[13]); + __pyx_v_missing_user_values = ((PyObject*)values[14]); + __pyx_v_variable_format = ((PyObject*)values[15]); + __pyx_v_variable_alignment = ((PyObject*)values[16]); + } + 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_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("pyreadstat._readstat_writer.writer_entry_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return 0; + 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) + __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 + * return 0 + * + * def writer_entry_point(df, dst_path, str writer_format=None, str file_label="", # <<<<<<<<<<<<<< + * int version=0, + * str table_name=None, +*/ + + /* function exit code */ + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __pyx_L7_cleaned_up:; __Pyx_RefNannyFinishContext(); - return -1; + return __pyx_r; } -static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { +static PyObject *__pyx_pf_10pyreadstat_16_readstat_writer_writer_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_writer_format, PyObject *__pyx_v_file_label, int __pyx_v_version, PyObject *__pyx_v_table_name, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_compress, PyObject *__pyx_v_row_compress, PyObject *__pyx_v_note, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_format, PyObject *__pyx_v_variable_alignment) { + int __pyx_v_file_format_version; + int __pyx_v_row_compression; + __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_v_writer_file_format; + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "check_exit_status", (void (**)(void))&__pyx_f_10pyreadstat_16_readstat_parser_check_exit_status, "void (readstat_error_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} + __Pyx_RefNannySetupContext("writer_entry_point", 0); + __Pyx_INCREF(__pyx_v_note); -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec__readstat_writer(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec__readstat_writer}, - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - {Py_mod_gil, Py_MOD_GIL_USED}, - #endif - #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE - {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, - #endif - {0, NULL} -}; -#endif + /* "pyreadstat/_readstat_writer.pyx":1007 + * + * + * cdef int file_format_version = 0 # <<<<<<<<<<<<<< + * cdef bint row_compression = 0 + * +*/ + __pyx_v_file_format_version = 0; -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "_readstat_writer", - 0, /* m_doc */ - #if CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstatetype), /* m_size */ - #else - (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif + /* "pyreadstat/_readstat_writer.pyx":1008 + * + * cdef int file_format_version = 0 + * cdef bint row_compression = 0 # <<<<<<<<<<<<<< + * + * cdef dst_file_format writer_file_format +*/ + __pyx_v_row_compression = 0; -/* PyModInitFuncType */ -#ifndef CYTHON_NO_PYINIT_EXPORT - #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#else - #ifdef __cplusplus - #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * - #else - #define __Pyx_PyMODINIT_FUNC PyObject * - #endif -#endif + /* "pyreadstat/_readstat_writer.pyx":1012 + * 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) + if (__pyx_t_1) { -__Pyx_PyMODINIT_FUNC PyInit__readstat_writer(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit__readstat_writer(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -/* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 -static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { - { - PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think - if (!module) { - PyErr_Clear(); // just try the 3.8-3.12 version - module = PyImport_ImportModule("_xxsubinterpreters"); - if (!module) goto bad; - } - PyObject *current = PyObject_CallMethod(module, "get_current", NULL); - Py_DECREF(module); - if (!current) goto bad; - if (PyTuple_Check(current)) { - PyObject *new_current = PySequence_GetItem(current, 0); - Py_DECREF(current); - current = new_current; - if (!new_current) goto bad; - } - long long as_c_int = PyLong_AsLongLong(current); - Py_DECREF(current); - return as_c_int; - } - bad: - PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); - return -1; -} -#endif -#if !CYTHON_USE_MODULE_STATE -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL - PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API - PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); -#else - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); -#endif - if (unlikely(current_id == -1)) { - return -1; + /* "pyreadstat/_readstat_writer.pyx":1013 + * + * if writer_format == "sav": + * writer_file_format = FILE_FORMAT_SAV # <<<<<<<<<<<<<< + * file_format_version = 2 + * if compress and row_compress: +*/ + __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV; + + /* "pyreadstat/_readstat_writer.pyx":1014 + * if writer_format == "sav": + * 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") +*/ + __pyx_v_file_format_version = 2; + + /* "pyreadstat/_readstat_writer.pyx":1015 + * 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) + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; } - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return 0; - } else if (unlikely(main_interpreter_id != current_id)) { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; + __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_1 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "pyreadstat/_readstat_writer.pyx":1016 + * file_format_version = 2 + * if compress and row_compress: + * raise PyreadstatError("compress and row_compress cannot be both True") # <<<<<<<<<<<<<< + * if compress: + * 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_GOTREF(__pyx_t_5); + __pyx_t_6 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_6 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_compress_and_row_compress_cannot}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__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) + __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) + + /* "pyreadstat/_readstat_writer.pyx":1015 + * 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: +*/ } - return 0; -} -#endif -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { - result = PyDict_SetItemString(moddict, to_name, value); - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; + + /* "pyreadstat/_readstat_writer.pyx":1017 + * 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) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_writer.pyx":1018 + * raise PyreadstatError("compress and row_compress cannot be both True") + * if compress: + * file_format_version = 3 # <<<<<<<<<<<<<< + * if row_compress: + * row_compression = 1 +*/ + __pyx_v_file_format_version = 3; + + /* "pyreadstat/_readstat_writer.pyx":1017 + * if compress and row_compress: + * raise PyreadstatError("compress and row_compress cannot be both True") + * if compress: # <<<<<<<<<<<<<< + * file_format_version = 3 + * if row_compress: +*/ } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - #if !CYTHON_USE_MODULE_STATE - if (__Pyx_check_single_interpreter()) - return NULL; - #endif - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} + /* "pyreadstat/_readstat_writer.pyx":1019 + * 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) + if (__pyx_t_1) { -static CYTHON_SMALL_CODE int __pyx_pymod_exec__readstat_writer(PyObject *__pyx_pyinit_module) -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - __pyx_mstatetype *__pyx_mstate = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - size_t __pyx_t_12; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); - int __pyx_t_15; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module '_readstat_writer' has already been imported. Re-initialisation is not supported."); - return -1; - } - #else - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_t_1 = __pyx_pyinit_module; - Py_INCREF(__pyx_t_1); - #else - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #if CYTHON_USE_MODULE_STATE - { - int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_readstat_writer" pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; + /* "pyreadstat/_readstat_writer.pyx":1020 + * file_format_version = 3 + * if row_compress: + * row_compression = 1 # <<<<<<<<<<<<<< + * elif writer_format == "dta": + * writer_file_format = FILE_FORMAT_DTA +*/ + __pyx_v_row_compression = 1; + + /* "pyreadstat/_readstat_writer.pyx":1019 + * if compress: + * file_format_version = 3 + * if row_compress: # <<<<<<<<<<<<<< + * row_compression = 1 + * elif writer_format == "dta": +*/ + } + + /* "pyreadstat/_readstat_writer.pyx":1012 + * cdef dst_file_format writer_file_format + * + * if writer_format == "sav": # <<<<<<<<<<<<<< + * writer_file_format = FILE_FORMAT_SAV + * file_format_version = 2 +*/ + goto __pyx_L3; } - #else - __pyx_m = __pyx_t_1; - #endif - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); - #endif - __pyx_mstate = __pyx_mstate_global; - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_mstate->__pyx_d); - __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /* ImportRefnannyAPI */ - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif -__Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - if (__pyx_module_is_main_pyreadstat___readstat_writer) { - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "pyreadstat._readstat_writer")) { - if (unlikely((PyDict_SetItemString(modules, "pyreadstat._readstat_writer", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + /* "pyreadstat/_readstat_writer.pyx":1021 + * 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) + if (__pyx_t_1) { + + /* "pyreadstat/_readstat_writer.pyx":1022 + * row_compression = 1 + * elif writer_format == "dta": + * writer_file_format = FILE_FORMAT_DTA # <<<<<<<<<<<<<< + * if version == 15: + * file_format_version = 119 +*/ + __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA; + + /* "pyreadstat/_readstat_writer.pyx":1023 + * elif writer_format == "dta": + * writer_file_format = FILE_FORMAT_DTA + * if version == 15: # <<<<<<<<<<<<<< + * file_format_version = 119 + * elif version == 14: +*/ + switch (__pyx_v_version) { + case 15: + + /* "pyreadstat/_readstat_writer.pyx":1024 + * writer_file_format = FILE_FORMAT_DTA + * if version == 15: + * file_format_version = 119 # <<<<<<<<<<<<<< + * elif version == 14: + * file_format_version = 118 +*/ + __pyx_v_file_format_version = 0x77; + + /* "pyreadstat/_readstat_writer.pyx":1023 + * elif writer_format == "dta": + * writer_file_format = FILE_FORMAT_DTA + * if version == 15: # <<<<<<<<<<<<<< + * file_format_version = 119 + * elif version == 14: +*/ + break; + case 14: + + /* "pyreadstat/_readstat_writer.pyx":1026 + * file_format_version = 119 + * elif version == 14: + * file_format_version = 118 # <<<<<<<<<<<<<< + * elif version == 13: + * file_format_version = 117 +*/ + __pyx_v_file_format_version = 0x76; + + /* "pyreadstat/_readstat_writer.pyx":1025 + * if version == 15: + * file_format_version = 119 + * elif version == 14: # <<<<<<<<<<<<<< + * file_format_version = 118 + * elif version == 13: +*/ + break; + case 13: + + /* "pyreadstat/_readstat_writer.pyx":1028 + * file_format_version = 118 + * elif version == 13: + * file_format_version = 117 # <<<<<<<<<<<<<< + * elif version == 12: + * file_format_version = 115 +*/ + __pyx_v_file_format_version = 0x75; + + /* "pyreadstat/_readstat_writer.pyx":1027 + * elif version == 14: + * file_format_version = 118 + * elif version == 13: # <<<<<<<<<<<<<< + * file_format_version = 117 + * elif version == 12: +*/ + break; + case 12: + + /* "pyreadstat/_readstat_writer.pyx":1030 + * file_format_version = 117 + * elif version == 12: + * file_format_version = 115 # <<<<<<<<<<<<<< + * elif version in {10, 11}: + * file_format_version = 114 +*/ + __pyx_v_file_format_version = 0x73; + + /* "pyreadstat/_readstat_writer.pyx":1029 + * elif version == 13: + * file_format_version = 117 + * elif version == 12: # <<<<<<<<<<<<<< + * file_format_version = 115 + * elif version in {10, 11}: +*/ + break; + case 10: + + /* "pyreadstat/_readstat_writer.pyx":1031 + * elif version == 12: + * file_format_version = 115 + * elif version in {10, 11}: # <<<<<<<<<<<<<< + * file_format_version = 114 + * elif version in {8, 9}: +*/ + case 11: + + /* "pyreadstat/_readstat_writer.pyx":1032 + * file_format_version = 115 + * elif version in {10, 11}: + * file_format_version = 114 # <<<<<<<<<<<<<< + * elif version in {8, 9}: + * file_format_version = 113 +*/ + __pyx_v_file_format_version = 0x72; + + /* "pyreadstat/_readstat_writer.pyx":1031 + * elif version == 12: + * file_format_version = 115 + * elif version in {10, 11}: # <<<<<<<<<<<<<< + * file_format_version = 114 + * elif version in {8, 9}: +*/ + break; + case 8: + + /* "pyreadstat/_readstat_writer.pyx":1033 + * elif version in {10, 11}: + * file_format_version = 114 + * elif version in {8, 9}: # <<<<<<<<<<<<<< + * file_format_version = 113 + * else: +*/ + case 9: + + /* "pyreadstat/_readstat_writer.pyx":1034 + * file_format_version = 114 + * elif version in {8, 9}: + * file_format_version = 113 # <<<<<<<<<<<<<< + * else: + * raise PyreadstatError("Version not supported") +*/ + __pyx_v_file_format_version = 0x71; + + /* "pyreadstat/_readstat_writer.pyx":1033 + * elif version in {10, 11}: + * file_format_version = 114 + * elif version in {8, 9}: # <<<<<<<<<<<<<< + * file_format_version = 113 + * else: +*/ + break; + default: + + /* "pyreadstat/_readstat_writer.pyx":1036 + * file_format_version = 113 + * else: + * raise PyreadstatError("Version not supported") # <<<<<<<<<<<<<< + * note = "" + * 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_GOTREF(__pyx_t_4); + __pyx_t_6 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_6 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Version_not_supported}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__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) + __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) + break; } + + /* "pyreadstat/_readstat_writer.pyx":1037 + * 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); + + /* "pyreadstat/_readstat_writer.pyx":1021 + * if row_compress: + * row_compression = 1 + * elif writer_format == "dta": # <<<<<<<<<<<<<< + * writer_file_format = FILE_FORMAT_DTA + * if version == 15: +*/ + goto __pyx_L3; } - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(__pyx_mstate); - (void)__Pyx_modinit_variable_export_code(__pyx_mstate); - if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_init_code(__pyx_mstate); - if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - if (unlikely((__Pyx_modinit_variable_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Execution code ---*/ - /* "pyreadstat/_readstat_writer.pyx":18 - * # limitations under the License. - * # ############################################################################# - * import os # <<<<<<<<<<<<<< - * import warnings - * import sys + /* "pyreadstat/_readstat_writer.pyx":1038 + * raise PyreadstatError("Version not supported") + * note = "" + * elif writer_format == "xport": # <<<<<<<<<<<<<< + * writer_file_format = FILE_FORMAT_XPORT + * file_format_version = version */ - __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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) + if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":19 - * # ############################################################################# - * import os - * import warnings # <<<<<<<<<<<<<< - * import sys - * import datetime + /* "pyreadstat/_readstat_writer.pyx":1039 + * note = "" + * elif writer_format == "xport": + * writer_file_format = FILE_FORMAT_XPORT # <<<<<<<<<<<<<< + * file_format_version = version + * elif writer_format == "por": */ - __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT; - /* "pyreadstat/_readstat_writer.pyx":20 - * import os - * import warnings - * import sys # <<<<<<<<<<<<<< - * import datetime - * #import calendar + /* "pyreadstat/_readstat_writer.pyx":1040 + * elif writer_format == "xport": + * writer_file_format = FILE_FORMAT_XPORT + * file_format_version = version # <<<<<<<<<<<<<< + * elif writer_format == "por": + * writer_file_format = FILE_FORMAT_POR */ - __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_file_format_version = __pyx_v_version; - /* "pyreadstat/_readstat_writer.pyx":21 - * import warnings - * import sys - * import datetime # <<<<<<<<<<<<<< - * #import calendar - * from datetime import timezone + /* "pyreadstat/_readstat_writer.pyx":1038 + * raise PyreadstatError("Version not supported") + * note = "" + * elif writer_format == "xport": # <<<<<<<<<<<<<< + * writer_file_format = FILE_FORMAT_XPORT + * file_format_version = version */ - __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_datetime, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } - /* "pyreadstat/_readstat_writer.pyx":23 - * import datetime - * #import calendar - * from datetime import timezone # <<<<<<<<<<<<<< - * #from datetime import timezone as _timezone - * #from libc.math cimport round, NAN + /* "pyreadstat/_readstat_writer.pyx":1041 + * writer_file_format = FILE_FORMAT_XPORT + * file_format_version = version + * elif writer_format == "por": # <<<<<<<<<<<<<< + * writer_file_format = FILE_FORMAT_POR + * else: */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_timezone, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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) + if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":27 - * #from libc.math cimport round, NAN - * - * import numpy as np # <<<<<<<<<<<<<< - * import narwhals.stable.v2 as nw - * + /* "pyreadstat/_readstat_writer.pyx":1042 + * file_format_version = version + * elif writer_format == "por": + * writer_file_format = FILE_FORMAT_POR # <<<<<<<<<<<<<< + * else: + * raise PyreadstatError("wrong writer format") */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_writer_file_format = __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR; - /* "pyreadstat/_readstat_writer.pyx":28 - * - * import numpy as np - * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< + /* "pyreadstat/_readstat_writer.pyx":1041 + * writer_file_format = FILE_FORMAT_XPORT + * file_format_version = version + * elif writer_format == "por": # <<<<<<<<<<<<<< + * writer_file_format = FILE_FORMAT_POR + * else: +*/ + goto __pyx_L3; + } + + /* "pyreadstat/_readstat_writer.pyx":1044 + * writer_file_format = FILE_FORMAT_POR + * else: + * raise PyreadstatError("wrong writer format") # <<<<<<<<<<<<<< * - * from readstat_api cimport * + * run_write(df, dst_path, writer_file_format, file_label, column_labels, */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_narwhals_stable_v2, __pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nw, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /*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_GOTREF(__pyx_t_5); + __pyx_t_6 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_6 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_wrong_writer_format}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__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) + __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_L3:; - /* "pyreadstat/_readstat_writer.pyx":31 + /* "pyreadstat/_readstat_writer.pyx":1046 + * raise PyreadstatError("wrong writer format") * - * from readstat_api cimport * - * from _readstat_parser import ReadstatError, PyreadstatError # <<<<<<<<<<<<<< - * from _readstat_parser cimport check_exit_status + * 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) + + /* "pyreadstat/_readstat_writer.pyx":995 + * 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_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_readstat_parser, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/_readstat_writer.pyx":34 - * 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_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __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_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __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_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __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_GOTREF(__pyx_t_2); - if (PySet_Add(__pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_6) < 0) __PYX_ERR(0, 34, __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) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 - * - * 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_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float64); 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, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float32); 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, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __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_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int128); 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, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt128); 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, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt64); 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_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_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt32); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __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_GOTREF(__pyx_t_2); - 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_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_5) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - 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_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - 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, 35, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_10) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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; + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("pyreadstat._readstat_writer.writer_entry_point", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_note); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +/* #### Code section: module_exttypes ### */ - /* "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} - * 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_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); 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_np); 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_datetime64); 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_datetime); 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_time); 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_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __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_GOTREF(__pyx_t_2); - 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_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, 36, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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; +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ +/* #### Code section: init_module ### */ - /* "pyreadstat/_readstat_writer.pyx":37 - * 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_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 37, __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_DATETIME64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 37, __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_TIME64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PySet_Add(__pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_8) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_9) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PySet_Add(__pyx_t_5, __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_5, __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_pyrwriter_datetimelike_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, ((PyObject*)__pyx_t_5)); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_10pyreadstat_16_readstat_writer_int_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_float_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_nat_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_date_0 = Py_None; Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas = Py_None; Py_INCREF(Py_None); + __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "pyreadstat/_readstat_writer.pyx":38 - * 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_5 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); 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_LOGICAL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __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, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __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, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "pyreadstat/_readstat_writer.pyx":39 - * 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_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_DATE64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PySet_Add(__pyx_t_11, __pyx_t_5) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PySet_Add(__pyx_t_11, __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_11, __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_11, __pyx_t_9) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PySet_Add(__pyx_t_11, __pyx_t_8) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PySet_Add(__pyx_t_11, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PySet_Add(__pyx_t_11, __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_11, __pyx_t_6) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PySet_Add(__pyx_t_11, __pyx_t_7) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_11)); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "pyreadstat/_readstat_writer.pyx":40 - * 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_11 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __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, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("vectorized_convert_datetime_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_datetime_to_number, "PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("vectorized_convert_date_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_date_to_number, "PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("vectorized_convert_time_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_vectorized_convert_time_to_number, "PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("convert_datetimelike_to_number", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number, "double (__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_datetimelike_format_for_readstat", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat, "char *(__pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_narwhals_str_series_max_length", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_str_series_max_length, "int (PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("check_series_all_same_types", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_check_series_all_same_types, "int (PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_narwhals_column_types", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_get_narwhals_column_types, "PyObject *(PyObject *, PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("write_bytes", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_write_bytes, "Py_ssize_t (void const *, size_t, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("open_file", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_open_file, "int (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("close_file", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_close_file, "int (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("filepath_to_bytes", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_filepath_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("initial_checks", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_initial_checks, "void (int, int, PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("run_write", (void (*)(void))__pyx_f_10pyreadstat_16_readstat_writer_run_write, "int (PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} - /* "pyreadstat/_readstat_writer.pyx":41 - * 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_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "pyreadstat/_readstat_writer.pyx":42 - * 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_7 = __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_7)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = __Pyx_ImportType_3_1_2(__pyx_t_1, "pyreadstat._readstat_parser", "data_container", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), + #elif CYTHON_COMPILING_IN_LIMITED_API + sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), + #else + sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), + #endif + __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) __PYX_ERR(1, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} - /* "pyreadstat/_readstat_writer.pyx":43 - * 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_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "readstat_to_numpy_types", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} - /* "pyreadstat/_readstat_writer.pyx":44 - * 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_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "check_exit_status", (void (**)(void))&__pyx_f_10pyreadstat_16_readstat_parser_check_exit_status, "void (readstat_error_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} - /* "pyreadstat/_readstat_writer.pyx":45 - * 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_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, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__readstat_writer(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__readstat_writer}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_USED}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif + {0, NULL} +}; +#endif - /* "pyreadstat/_readstat_writer.pyx":46 - * 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_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, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, ((PyObject*)__pyx_t_11)); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "_readstat_writer", + 0, /* m_doc */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ + #else + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif - /* "pyreadstat/_readstat_writer.pyx":48 - * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } - * - * cdef double spss_offset_secs = 12219379200 # <<<<<<<<<<<<<< - * cdef double sas_offset_secs = 315619200 - * cdef double spss_offset_days = 141428 -*/ - __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs = 12219379200.0; +/* PyModInitFuncType */ +#ifndef CYTHON_NO_PYINIT_EXPORT + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#else + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif +#endif - /* "pyreadstat/_readstat_writer.pyx":49 - * - * cdef double spss_offset_secs = 12219379200 - * cdef double sas_offset_secs = 315619200 # <<<<<<<<<<<<<< - * cdef double spss_offset_days = 141428 - * cdef double sas_offset_days = 3653 -*/ - __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_secs = 315619200.0; +__Pyx_PyMODINIT_FUNC PyInit__readstat_writer(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__readstat_writer(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE + if (__Pyx_check_single_interpreter()) + return NULL; + #endif + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} - /* "pyreadstat/_readstat_writer.pyx":50 - * cdef double spss_offset_secs = 12219379200 - * cdef double sas_offset_secs = 315619200 - * cdef double spss_offset_days = 141428 # <<<<<<<<<<<<<< - * cdef double sas_offset_days = 3653 - * cdef object date_0 = datetime.datetime(1970,1,1).date() -*/ - __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days = 141428.0; - /* "pyreadstat/_readstat_writer.pyx":51 - * cdef double sas_offset_secs = 315619200 - * cdef double spss_offset_days = 141428 - * cdef double sas_offset_days = 3653 # <<<<<<<<<<<<<< - * cdef object date_0 = datetime.datetime(1970,1,1).date() - * +static CYTHON_SMALL_CODE int __pyx_pymod_exec__readstat_writer(PyObject *__pyx_pyinit_module) +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + __pyx_mstatetype *__pyx_mstate = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + size_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_readstat_writer' has already been imported. Re-initialisation is not supported."); + return -1; + } + #else + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); + #else + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE + { + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_readstat_writer" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = __pyx_t_1; + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); + #endif + __pyx_mstate = __pyx_mstate_global; + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + +__Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) + if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + if (__pyx_module_is_main_pyreadstat___readstat_writer) { + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "pyreadstat._readstat_writer")) { + if (unlikely((PyDict_SetItemString(modules, "pyreadstat._readstat_writer", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_init_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely((__Pyx_modinit_variable_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Execution code ---*/ + + /* "pyreadstat/_readstat_writer.pyx":18 + * # limitations under the License. + * # ############################################################################# + * import os # <<<<<<<<<<<<<< + * import warnings + * import sys */ - __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_days = 3653.0; + __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":52 - * 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)] + ["_"] + /* "pyreadstat/_readstat_writer.pyx":19 + * # ############################################################################# + * import os + * import warnings # <<<<<<<<<<<<<< + * import sys + * import datetime */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __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, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __pyx_t_6; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_12 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_date, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - } - __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_date_0); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_date_0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; - /* "pyreadstat/_readstat_writer.pyx":54 - * cdef object date_0 = datetime.datetime(1970,1,1).date() + /* "pyreadstat/_readstat_writer.pyx":20 + * import os + * import warnings + * import sys # <<<<<<<<<<<<<< + * import datetime + * #import calendar +*/ + __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pyreadstat/_readstat_writer.pyx":21 + * import warnings + * import sys + * import datetime # <<<<<<<<<<<<<< + * #import calendar + * from datetime import timezone +*/ + __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_datetime, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_datetime, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pyreadstat/_readstat_writer.pyx":23 + * import datetime + * #import calendar + * from datetime import timezone # <<<<<<<<<<<<<< + * #from datetime import timezone as _timezone + * #from libc.math cimport round, NAN +*/ + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_datetime, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_timezone, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pyreadstat/_readstat_writer.pyx":27 + * #from libc.math cimport round, NAN * - * 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)] + * import numpy as np # <<<<<<<<<<<<<< + * import narwhals.stable.v2 as nw * */ - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_range); - __pyx_t_2 = __pyx_builtin_range; - __pyx_t_3 = __Pyx_PyLong_From_long((90 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = 1; - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_65, __pyx_t_3}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - } - if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); - __pyx_t_13 = 0; - __pyx_t_14 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 54, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - for (;;) { - if (likely(!__pyx_t_14)) { + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pyreadstat/_readstat_writer.pyx":28 + * + * import numpy as np + * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< + * + * from readstat_api cimport * +*/ + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_narwhals_stable_v2, __pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nw, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "pyreadstat/_readstat_writer.pyx":31 + * + * from readstat_api cimport * + * from _readstat_parser import ReadstatError, PyreadstatError # <<<<<<<<<<<<<< + * from _readstat_parser cimport check_exit_status + * +*/ + __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_readstat_parser, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pyreadstat/_readstat_writer.pyx":34 + * 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_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __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_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __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_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __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_GOTREF(__pyx_t_2); + if (PySet_Add(__pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PySet_Add(__pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PySet_Add(__pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PySet_Add(__pyx_t_2, __pyx_t_6) < 0) __PYX_ERR(0, 34, __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) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 + * + * 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_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float64); 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, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Float32); 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, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __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_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int128); 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, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt128); 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, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt64); 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_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_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UInt32); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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_GOTREF(__pyx_t_2); + 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_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_5) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + 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_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + 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, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PySet_Add(__pyx_t_2, __pyx_t_10) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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 + * 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_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_datetime); 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_np); 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_datetime64); 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_datetime); 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_time); 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_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __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_GOTREF(__pyx_t_2); + 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_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, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PySet_Add(__pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 + * 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_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 37, __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_DATETIME64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 37, __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_TIME64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PySet_Add(__pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PySet_Add(__pyx_t_5, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PySet_Add(__pyx_t_5, __pyx_t_8) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PySet_Add(__pyx_t_5, __pyx_t_9) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PySet_Add(__pyx_t_5, __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_5, __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_pyrwriter_datetimelike_types); + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, ((PyObject*)__pyx_t_5)); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + + /* "pyreadstat/_readstat_writer.pyx":38 + * 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_5 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); 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_LOGICAL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __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, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __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, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "pyreadstat/_readstat_writer.pyx":39 + * 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_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_DATE64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PySet_Add(__pyx_t_11, __pyx_t_5) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PySet_Add(__pyx_t_11, __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_11, __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_11, __pyx_t_9) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PySet_Add(__pyx_t_11, __pyx_t_8) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PySet_Add(__pyx_t_11, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PySet_Add(__pyx_t_11, __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_11, __pyx_t_6) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PySet_Add(__pyx_t_11, __pyx_t_7) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_11)); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + + /* "pyreadstat/_readstat_writer.pyx":40 + * 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_11 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __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, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __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, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pyreadstat/_readstat_writer.pyx":41 + * 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_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "pyreadstat/_readstat_writer.pyx":42 + * 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_7 = __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_7)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":43 + * 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_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":44 + * 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_6 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":45 + * 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_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, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":46 + * 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_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, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_11, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types); + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_narwhals_to_readstat_types, ((PyObject*)__pyx_t_11)); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + + /* "pyreadstat/_readstat_writer.pyx":48 + * PYWRITER_TIME64: READSTAT_TYPE_DOUBLE, } + * + * cdef double spss_offset_secs = 12219379200 # <<<<<<<<<<<<<< + * cdef double sas_offset_secs = 315619200 + * cdef double spss_offset_days = 141428 +*/ + __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_secs = 12219379200.0; + + /* "pyreadstat/_readstat_writer.pyx":49 + * + * cdef double spss_offset_secs = 12219379200 + * cdef double sas_offset_secs = 315619200 # <<<<<<<<<<<<<< + * cdef double spss_offset_days = 141428 + * cdef double sas_offset_days = 3653 +*/ + __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_secs = 315619200.0; + + /* "pyreadstat/_readstat_writer.pyx":50 + * cdef double spss_offset_secs = 12219379200 + * cdef double sas_offset_secs = 315619200 + * cdef double spss_offset_days = 141428 # <<<<<<<<<<<<<< + * cdef double sas_offset_days = 3653 + * cdef object date_0 = datetime.datetime(1970,1,1).date() +*/ + __pyx_v_10pyreadstat_16_readstat_writer_spss_offset_days = 141428.0; + + /* "pyreadstat/_readstat_writer.pyx":51 + * cdef double sas_offset_secs = 315619200 + * cdef double spss_offset_days = 141428 + * cdef double sas_offset_days = 3653 # <<<<<<<<<<<<<< + * cdef object date_0 = datetime.datetime(1970,1,1).date() + * +*/ + __pyx_v_10pyreadstat_16_readstat_writer_sas_offset_days = 3653.0; + + /* "pyreadstat/_readstat_writer.pyx":52 + * 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_6, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __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, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_6; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_12 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; + __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_date, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + } + __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_date_0); + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_date_0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + + /* "pyreadstat/_readstat_writer.pyx":54 + * 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_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = NULL; + __Pyx_INCREF(__pyx_builtin_range); + __pyx_t_2 = __pyx_builtin_range; + __pyx_t_3 = __Pyx_PyLong_From_long((90 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_65, __pyx_t_3}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); + __pyx_t_13 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 54, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); @@ -18036,3128 +19313,5291 @@ __Pyx_RefNannySetupContext("PyInit__readstat_writer", 0); #endif if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); - ++__pyx_t_13; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 54, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + ++__pyx_t_13; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 54, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) + } else { + __pyx_t_6 = __pyx_t_14(__pyx_t_2); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 54, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_6) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyUnicode_FromOrdinal(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_GOTREF(__pyx_t_2); + __pyx_t_6 = PyNumber_Add(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas); + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":55 + * + * 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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = NULL; + __Pyx_INCREF(__pyx_builtin_range); + __pyx_t_3 = __pyx_builtin_range; + __pyx_t_7 = __Pyx_PyLong_From_long((0x7A + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_int_97, __pyx_t_7}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); + __pyx_t_13 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 55, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_14)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + 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, 55, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_13); + ++__pyx_t_13; + } else { + { + 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, 55, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13)); + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); + #endif + ++__pyx_t_13; + } + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + } else { + __pyx_t_2 = __pyx_t_14(__pyx_t_3); + 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) + 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) + __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_GOTREF(__pyx_t_2); + __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata); + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":58 + * + * # 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 + * cdef int dta_117_max_width = 2045 +*/ + __pyx_v_10pyreadstat_16_readstat_writer_dta_old_max_width = 0x80; + + /* "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 + * cdef int dta_111_max_width = 244 # <<<<<<<<<<<<<< + * cdef int dta_117_max_width = 2045 + * +*/ + __pyx_v_10pyreadstat_16_readstat_writer_dta_111_max_width = 0xF4; + + /* "pyreadstat/_readstat_writer.pyx":60 + * cdef int dta_old_max_width = 128 + * cdef int dta_111_max_width = 244 + * 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): +*/ + __pyx_v_10pyreadstat_16_readstat_writer_dta_117_max_width = 0x7FD; + + /* "pyreadstat/_readstat_writer.pyx":996 + * + * 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_6 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "pyreadstat/_readstat_writer.pyx":995 + * 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_3 = PyTuple_Pack(15, Py_None, ((PyObject*)__pyx_mstate_global->__pyx_kp_u__3), __pyx_t_6, 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_3)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __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_6)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_writer_entry_point, __pyx_t_6) < 0) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "pyreadstat/_readstat_writer.pyx":1 + * # cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 # <<<<<<<<<<<<<< + * # ###cython: profile=True + * # ############################################################################# +*/ + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + if (__pyx_m) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init pyreadstat._readstat_writer", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init pyreadstat._readstat_writer"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #else + return __pyx_m; + #endif +} +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 179 <= 65535 + const unsigned short n; +#elif 179 / 2 < INT_MAX + const unsigned int n; +#elif 179 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_Boolean, sizeof(__pyx_k_Boolean), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Boolean */ + {__pyx_k_Categorical, sizeof(__pyx_k_Categorical), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Categorical */ + {__pyx_k_Column_labels_must_be_strings, sizeof(__pyx_k_Column_labels_must_be_strings), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Column_labels_must_be_strings */ + {__pyx_k_Date, sizeof(__pyx_k_Date), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Date */ + {__pyx_k_Datetime, sizeof(__pyx_k_Datetime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Datetime */ + {__pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Decimal */ + {__pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Enum */ + {__pyx_k_Float32, sizeof(__pyx_k_Float32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Float32 */ + {__pyx_k_Float64, sizeof(__pyx_k_Float64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Float64 */ + {__pyx_k_Int128, sizeof(__pyx_k_Int128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int128 */ + {__pyx_k_Int16, sizeof(__pyx_k_Int16), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int16 */ + {__pyx_k_Int32, sizeof(__pyx_k_Int32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int32 */ + {__pyx_k_Int64, sizeof(__pyx_k_Int64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int64 */ + {__pyx_k_Int8, sizeof(__pyx_k_Int8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int8 */ + {__pyx_k_Non_unique_column_names_detected, sizeof(__pyx_k_Non_unique_column_names_detected), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Non_unique_column_names_detected */ + {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_None */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_Object, sizeof(__pyx_k_Object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Object */ + {__pyx_k_PyreadstatError, sizeof(__pyx_k_PyreadstatError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PyreadstatError */ + {__pyx_k_ReadstatError, sizeof(__pyx_k_ReadstatError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ReadstatError */ + {__pyx_k_String, sizeof(__pyx_k_String), 0, 1, 1}, /* PyObject cname: __pyx_n_u_String */ + {__pyx_k_Time, sizeof(__pyx_k_Time), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Time */ + {__pyx_k_UInt128, sizeof(__pyx_k_UInt128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt128 */ + {__pyx_k_UInt16, sizeof(__pyx_k_UInt16), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt16 */ + {__pyx_k_UInt32, sizeof(__pyx_k_UInt32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt32 */ + {__pyx_k_UInt64, sizeof(__pyx_k_UInt64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt64 */ + {__pyx_k_UInt8, sizeof(__pyx_k_UInt8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt8 */ + {__pyx_k_UnicodeError, sizeof(__pyx_k_UnicodeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UnicodeError */ + {__pyx_k_Unknown_data_format_to_insert, sizeof(__pyx_k_Unknown_data_format_to_insert), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_data_format_to_insert */ + {__pyx_k_Unknown_pywriter_variable_format, sizeof(__pyx_k_Unknown_pywriter_variable_format), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_pywriter_variable_format */ + {__pyx_k_Version_not_supported, sizeof(__pyx_k_Version_not_supported), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Version_not_supported */ + {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ + {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ + {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */ + {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 1}, /* PyObject cname: __pyx_n_u__5 */ + {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__6 */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_alignment_for_variable, sizeof(__pyx_k_alignment_for_variable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_alignment_for_variable */ + {__pyx_k_and_it_must_be_str_not_starting, sizeof(__pyx_k_and_it_must_be_str_not_starting), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_and_it_must_be_str_not_starting */ + {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ + {__pyx_k_cast, sizeof(__pyx_k_cast), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cast */ + {__pyx_k_cat, sizeof(__pyx_k_cat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cat */ + {__pyx_k_center, sizeof(__pyx_k_center), 0, 1, 1}, /* PyObject cname: __pyx_n_u_center */ + {__pyx_k_character_missing_ranges_value_g, sizeof(__pyx_k_character_missing_ranges_value_g), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_character_missing_ranges_value_g */ + {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_clone, sizeof(__pyx_k_clone), 0, 1, 1}, /* PyObject cname: __pyx_n_u_clone */ + {__pyx_k_column_labels, sizeof(__pyx_k_column_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_column_labels */ + {__pyx_k_column_labels_must_be_either_lis, sizeof(__pyx_k_column_labels_must_be_either_lis), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_column_labels_must_be_either_lis */ + {__pyx_k_columns, sizeof(__pyx_k_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_columns */ + {__pyx_k_combine, sizeof(__pyx_k_combine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_combine */ + {__pyx_k_compress, sizeof(__pyx_k_compress), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compress */ + {__pyx_k_compress_and_row_compress_cannot, sizeof(__pyx_k_compress_and_row_compress_cannot), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_compress_and_row_compress_cannot */ + {__pyx_k_dataframe_must_be_pandas_or_pola, sizeof(__pyx_k_dataframe_must_be_pandas_or_pola), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dataframe_must_be_pandas_or_pola */ + {__pyx_k_date, sizeof(__pyx_k_date), 0, 1, 1}, /* PyObject cname: __pyx_n_u_date */ + {__pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_datetime */ + {__pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_datetime64 */ + {__pyx_k_days, sizeof(__pyx_k_days), 0, 1, 1}, /* PyObject cname: __pyx_n_u_days */ + {__pyx_k_df, sizeof(__pyx_k_df), 0, 1, 1}, /* PyObject cname: __pyx_n_u_df */ + {__pyx_k_dictionaries_in_missing_ranges_m, sizeof(__pyx_k_dictionaries_in_missing_ranges_m), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dictionaries_in_missing_ranges_m */ + {__pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dirname */ + {__pyx_k_does_not_exist, sizeof(__pyx_k_does_not_exist), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_does_not_exist */ + {__pyx_k_drop_nulls, sizeof(__pyx_k_drop_nulls), 0, 1, 1}, /* PyObject cname: __pyx_n_u_drop_nulls */ + {__pyx_k_dst_path, sizeof(__pyx_k_dst_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dst_path */ + {__pyx_k_dta, sizeof(__pyx_k_dta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dta */ + {__pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtype */ + {__pyx_k_eager_only, sizeof(__pyx_k_eager_only), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eager_only */ + {__pyx_k_encode, sizeof(__pyx_k_encode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode */ + {__pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_expanduser */ + {__pyx_k_file_format_version, sizeof(__pyx_k_file_format_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_format_version */ + {__pyx_k_file_label, sizeof(__pyx_k_file_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_label */ + {__pyx_k_file_path_could_not_be_encoded_w, sizeof(__pyx_k_file_path_could_not_be_encoded_w), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_file_path_could_not_be_encoded_w */ + {__pyx_k_filter, sizeof(__pyx_k_filter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filter */ + {__pyx_k_from_native, sizeof(__pyx_k_from_native), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_native */ + {__pyx_k_fsdecode, sizeof(__pyx_k_fsdecode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fsdecode */ + {__pyx_k_fsencode, sizeof(__pyx_k_fsencode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fsencode */ + {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ + {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */ + {__pyx_k_get_categories, sizeof(__pyx_k_get_categories), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_categories */ + {__pyx_k_get_native_namespace, sizeof(__pyx_k_get_native_namespace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_native_namespace */ + {__pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getfilesystemencoding */ + {__pyx_k_hi, sizeof(__pyx_k_hi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hi */ + {__pyx_k_implementation, sizeof(__pyx_k_implementation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_implementation */ + {__pyx_k_in_variable, sizeof(__pyx_k_in_variable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_in_variable */ + {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ + {__pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_instead */ + {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ + {__pyx_k_is_in, sizeof(__pyx_k_is_in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_in */ + {__pyx_k_is_of_type, sizeof(__pyx_k_is_of_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is_of_type */ + {__pyx_k_is_pandas, sizeof(__pyx_k_is_pandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_pandas */ + {__pyx_k_is_polars, sizeof(__pyx_k_is_polars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_polars */ + {__pyx_k_isalpha, sizeof(__pyx_k_isalpha), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isalpha */ + {__pyx_k_isdir, sizeof(__pyx_k_isdir), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isdir */ + {__pyx_k_isna, sizeof(__pyx_k_isna), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isna */ + {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */ + {__pyx_k_iter_columns, sizeof(__pyx_k_iter_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_iter_columns */ + {__pyx_k_iter_rows, sizeof(__pyx_k_iter_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_iter_rows */ + {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ + {__pyx_k_left, sizeof(__pyx_k_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left */ + {__pyx_k_length_of_column_labels_must_be, sizeof(__pyx_k_length_of_column_labels_must_be), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_length_of_column_labels_must_be */ + {__pyx_k_lo, sizeof(__pyx_k_lo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lo */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_measure_for_variable, sizeof(__pyx_k_measure_for_variable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_measure_for_variable */ + {__pyx_k_min, sizeof(__pyx_k_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min */ + {__pyx_k_missing_ranges, sizeof(__pyx_k_missing_ranges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_ranges */ + {__pyx_k_missing_ranges_hi_and_lo_values, sizeof(__pyx_k_missing_ranges_hi_and_lo_values), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_hi_and_lo_values */ + {__pyx_k_missing_ranges_hi_and_lo_values_2, sizeof(__pyx_k_missing_ranges_hi_and_lo_values_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_hi_and_lo_values_2 */ + {__pyx_k_missing_ranges_max_1_discrete_nu, sizeof(__pyx_k_missing_ranges_max_1_discrete_nu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_1_discrete_nu */ + {__pyx_k_missing_ranges_max_1_range_value, sizeof(__pyx_k_missing_ranges_max_1_range_value), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_1_range_value */ + {__pyx_k_missing_ranges_max_3_discrete_nu, sizeof(__pyx_k_missing_ranges_max_3_discrete_nu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_3_discrete_nu */ + {__pyx_k_missing_ranges_max_3_string_valu, sizeof(__pyx_k_missing_ranges_max_3_string_valu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_3_string_valu */ + {__pyx_k_missing_ranges_string_values_len, sizeof(__pyx_k_missing_ranges_string_values_len), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_string_values_len */ + {__pyx_k_missing_ranges_values_in_diction, sizeof(__pyx_k_missing_ranges_values_in_diction), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_values_in_diction */ + {__pyx_k_missing_ranges_values_must_be_bo, sizeof(__pyx_k_missing_ranges_values_must_be_bo), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_values_must_be_bo */ + {__pyx_k_missing_user_values, sizeof(__pyx_k_missing_user_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_user_values */ + {__pyx_k_missing_user_values_not_allowed, sizeof(__pyx_k_missing_user_values_not_allowed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_user_values_not_allowed */ + {__pyx_k_missing_user_values_supports_val, sizeof(__pyx_k_missing_user_values_supports_val), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_user_values_supports_val */ + {__pyx_k_missing_user_values_values_in_di, sizeof(__pyx_k_missing_user_values_values_in_di), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_user_values_values_in_di */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ms */ + {__pyx_k_must_be_boolean_or_be_1_or_0, sizeof(__pyx_k_must_be_boolean_or_be_1_or_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_boolean_or_be_1_or_0 */ + {__pyx_k_must_be_dict_got, sizeof(__pyx_k_must_be_dict_got), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_dict_got */ + {__pyx_k_must_be_either_nominal_ordinal, sizeof(__pyx_k_must_be_either_nominal_ordinal), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_either_nominal_ordinal */ + {__pyx_k_must_be_either_right_center_lef, sizeof(__pyx_k_must_be_either_right_center_lef), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_either_right_center_lef */ + {__pyx_k_must_be_int, sizeof(__pyx_k_must_be_int), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_int */ + {__pyx_k_must_be_numeric, sizeof(__pyx_k_must_be_numeric), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_numeric */ + {__pyx_k_must_be_string, sizeof(__pyx_k_must_be_string), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_string */ + {__pyx_k_must_match_the_type_of_the_colu, sizeof(__pyx_k_must_match_the_type_of_the_colu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_match_the_type_of_the_colu */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name_2 */ + {__pyx_k_narwhals, sizeof(__pyx_k_narwhals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals */ + {__pyx_k_narwhals_stable_v2, sizeof(__pyx_k_narwhals_stable_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals_stable_v2 */ + {__pyx_k_nominal, sizeof(__pyx_k_nominal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nominal */ + {__pyx_k_note, sizeof(__pyx_k_note), 0, 1, 1}, /* PyObject cname: __pyx_n_u_note */ + {__pyx_k_note_should_be_either_str_or_lis, sizeof(__pyx_k_note_should_be_either_str_or_lis), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_note_should_be_either_str_or_lis */ + {__pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_np */ + {__pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ns */ + {__pyx_k_nt, sizeof(__pyx_k_nt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nt */ + {__pyx_k_nth, sizeof(__pyx_k_nth), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nth */ + {__pyx_k_null_count, sizeof(__pyx_k_null_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_null_count */ + {__pyx_k_numeric_missing_ranges_value_giv, sizeof(__pyx_k_numeric_missing_ranges_value_giv), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_numeric_missing_ranges_value_giv */ + {__pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numpy */ + {__pyx_k_nw, sizeof(__pyx_k_nw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nw */ + {__pyx_k_ordinal, sizeof(__pyx_k_ordinal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ordinal */ + {__pyx_k_ordinal_2, sizeof(__pyx_k_ordinal_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ordinal_2 */ + {__pyx_k_os, sizeof(__pyx_k_os), 0, 1, 1}, /* PyObject cname: __pyx_n_u_os */ + {__pyx_k_path, sizeof(__pyx_k_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_path */ + {__pyx_k_path_must_be_either_str_or_bytes, sizeof(__pyx_k_path_must_be_either_str_or_bytes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_path_must_be_either_str_or_bytes */ + {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ + {__pyx_k_por, sizeof(__pyx_k_por), 0, 1, 1}, /* PyObject cname: __pyx_n_u_por */ + {__pyx_k_pyreadstat__readstat_writer, sizeof(__pyx_k_pyreadstat__readstat_writer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyreadstat__readstat_writer */ + {__pyx_k_pyreadstat__readstat_writer_pyx, sizeof(__pyx_k_pyreadstat__readstat_writer_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_pyreadstat__readstat_writer_pyx */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ + {__pyx_k_readstat_parser, sizeof(__pyx_k_readstat_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_readstat_parser */ + {__pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace */ + {__pyx_k_right, sizeof(__pyx_k_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right */ + {__pyx_k_round, sizeof(__pyx_k_round), 0, 1, 1}, /* PyObject cname: __pyx_n_u_round */ + {__pyx_k_row_compress, sizeof(__pyx_k_row_compress), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_compress */ + {__pyx_k_row_compression, sizeof(__pyx_k_row_compression), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_compression */ + {__pyx_k_sav, sizeof(__pyx_k_sav), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sav */ + {__pyx_k_scale, sizeof(__pyx_k_scale), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scale */ + {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ + {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ + {__pyx_k_stable, sizeof(__pyx_k_stable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stable */ + {__pyx_k_starts_with_an_illegal_non_alph, sizeof(__pyx_k_starts_with_an_illegal_non_alph), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_starts_with_an_illegal_non_alph */ + {__pyx_k_surrogateescape, sizeof(__pyx_k_surrogateescape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_surrogateescape */ + {__pyx_k_sys, sizeof(__pyx_k_sys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sys */ + {__pyx_k_table_name, sizeof(__pyx_k_table_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_table_name */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_the_destination_folder, sizeof(__pyx_k_the_destination_folder), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_the_destination_folder */ + {__pyx_k_then, sizeof(__pyx_k_then), 0, 1, 1}, /* PyObject cname: __pyx_n_u_then */ + {__pyx_k_time, sizeof(__pyx_k_time), 0, 1, 1}, /* PyObject cname: __pyx_n_u_time */ + {__pyx_k_time_unit, sizeof(__pyx_k_time_unit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_time_unit */ + {__pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_timestamp */ + {__pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 1, 1}, /* PyObject cname: __pyx_n_u_timezone */ + {__pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_total_seconds */ + {__pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tzinfo */ + {__pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unknown */ + {__pyx_k_unknown_file_format, sizeof(__pyx_k_unknown_file_format), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unknown_file_format */ + {__pyx_k_upper, sizeof(__pyx_k_upper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_upper */ + {__pyx_k_us, sizeof(__pyx_k_us), 0, 1, 1}, /* PyObject cname: __pyx_n_u_us */ + {__pyx_k_utc, sizeof(__pyx_k_utc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_utc */ + {__pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_utf_8 */ + {__pyx_k_v2, sizeof(__pyx_k_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v2 */ + {__pyx_k_variable_alignment, sizeof(__pyx_k_variable_alignment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_alignment */ + {__pyx_k_variable_display_width, sizeof(__pyx_k_variable_display_width), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_display_width */ + {__pyx_k_variable_format, sizeof(__pyx_k_variable_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_format */ + {__pyx_k_variable_measure, sizeof(__pyx_k_variable_measure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_measure */ + {__pyx_k_variable_name, sizeof(__pyx_k_variable_name), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_name */ + {__pyx_k_variable_name_s_contains_a_space, sizeof(__pyx_k_variable_name_s_contains_a_space), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_name_s_contains_a_space */ + {__pyx_k_variable_names_must_be_non_empty, sizeof(__pyx_k_variable_names_must_be_non_empty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_names_must_be_non_empty */ + {__pyx_k_variable_value_labels, sizeof(__pyx_k_variable_value_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_value_labels */ + {__pyx_k_variable_value_labels_type_of_La, sizeof(__pyx_k_variable_value_labels_type_of_La), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_value_labels_type_of_La */ + {__pyx_k_variable_value_labels_type_of_Va, sizeof(__pyx_k_variable_value_labels_type_of_Va), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_value_labels_type_of_Va */ + {__pyx_k_variable_value_labels_value_for, sizeof(__pyx_k_variable_value_labels_value_for), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_value_labels_value_for */ + {__pyx_k_version, sizeof(__pyx_k_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_version */ + {__pyx_k_warn, sizeof(__pyx_k_warn), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warn */ + {__pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warnings */ + {__pyx_k_when, sizeof(__pyx_k_when), 0, 1, 1}, /* PyObject cname: __pyx_n_u_when */ + {__pyx_k_with_columns, sizeof(__pyx_k_with_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_with_columns */ + {__pyx_k_writer_entry_point, sizeof(__pyx_k_writer_entry_point), 0, 1, 1}, /* PyObject cname: __pyx_n_u_writer_entry_point */ + {__pyx_k_writer_file_format, sizeof(__pyx_k_writer_file_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_writer_file_format */ + {__pyx_k_writer_format, sizeof(__pyx_k_writer_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_writer_format */ + {__pyx_k_wrong_writer_format, sizeof(__pyx_k_wrong_writer_format), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_wrong_writer_format */ + {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */ + {__pyx_k_xport, sizeof(__pyx_k_xport), 0, 1, 1}, /* PyObject cname: __pyx_n_u_xport */ + {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 740, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "pyreadstat/_readstat_writer.pyx":674 + * 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_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "pyreadstat/_readstat_writer.pyx":28 + * + * import numpy as np + * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< + * + * from readstat_api cimport * +*/ + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_narwhals, __pyx_mstate_global->__pyx_n_u_stable, __pyx_mstate_global->__pyx_n_u_v2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + + /* "pyreadstat/_readstat_writer.pyx":52 + * 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[2] = 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[2])) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_mstate->__pyx_float_1e3 = PyFloat_FromDouble(1e3); if (unlikely(!__pyx_mstate->__pyx_float_1e3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_float_1e6 = PyFloat_FromDouble(1e6); if (unlikely(!__pyx_mstate->__pyx_float_1e6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_float_1e9 = PyFloat_FromDouble(1e9); if (unlikely(!__pyx_mstate->__pyx_float_1e9)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_65 = PyLong_FromLong(65); if (unlikely(!__pyx_mstate->__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_97 = PyLong_FromLong(97); if (unlikely(!__pyx_mstate->__pyx_int_97)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_1970 = PyLong_FromLong(1970); if (unlikely(!__pyx_mstate->__pyx_int_1970)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_neg_9223372036854775808 = PyLong_FromString("-9223372036854775808", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_neg_9223372036854775808)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ +\ + typedef struct { + unsigned int argcount : 5; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 10; + unsigned int line_table_length : 13; + } __Pyx_PyCode_New_function_description; +/* NewCodeObj.proto */ +static PyObject* __Pyx_PyCode_New( + const __Pyx_PyCode_New_function_description descr, + PyObject * const *varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +); + + +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, 306}; + 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_k_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; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* PythonCompatibility.init */ + if (likely(__Pyx_init_co_variables() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* CachedMethodType.init */ + #if CYTHON_COMPILING_IN_LIMITED_API +{ + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } +} // error handling follows +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, + "name '%U' is not defined", name); + } + return result; +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + return __Pyx_PyList_GetItemRef(o, n); + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyLong_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +} + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + if (!PyErr_Occurred()) + PyErr_SetNone(PyExc_NameError); + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } + PyErr_Clear(); +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; + } +#else + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; + PyObject *kwdefs; + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + if ( + co->co_kwonlyargcount == 0 && + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); - #endif - ++__pyx_t_13; - } - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) - } else { - __pyx_t_6 = __pyx_t_14(__pyx_t_2); - if (unlikely(!__pyx_t_6)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 54, __pyx_L1_error) - PyErr_Clear(); + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; } - break; - } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; } - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_x, __pyx_t_6) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyUnicode_FromOrdinal(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Add(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); + kwdefs = PyFunction_GET_KW_DEFAULTS(func); + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif - /* "pyreadstat/_readstat_writer.pyx":55 - * - * 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_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_range); - __pyx_t_3 = __pyx_builtin_range; - __pyx_t_7 = __Pyx_PyLong_From_long((0x7A + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = 1; - { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_int_97, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); - __pyx_t_13 = 0; - __pyx_t_14 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 55, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - 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, 55, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #elif CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { + PyTypeObject *tp = Py_TYPE(callable); + #if defined(__Pyx_CyFunction_USED) + if (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_13); - ++__pyx_t_13; - } else { - { - 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, 55, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; + } + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); + if (f) { + return f(func, args, _nargs, NULL); } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13)); - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); - #endif - ++__pyx_t_13; - } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) - } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_3); - 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) - PyErr_Clear(); + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, _nargs, NULL); } - break; - } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, _nargs, NULL); + #endif } - __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) - __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_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - - /* "pyreadstat/_readstat_writer.pyx":58 - * - * # 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 - * cdef int dta_117_max_width = 2045 -*/ - __pyx_v_10pyreadstat_16_readstat_writer_dta_old_max_width = 0x80; - - /* "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 - * cdef int dta_111_max_width = 244 # <<<<<<<<<<<<<< - * cdef int dta_117_max_width = 2045 - * -*/ - __pyx_v_10pyreadstat_16_readstat_writer_dta_111_max_width = 0xF4; + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} - /* "pyreadstat/_readstat_writer.pyx":60 - * cdef int dta_old_max_width = 128 - * cdef int dta_111_max_width = 244 - * 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): -*/ - __pyx_v_10pyreadstat_16_readstat_writer_dta_117_max_width = 0x7FD; +/* PyObjectFastCallMethod */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { + PyObject *result; + PyObject *attr = PyObject_GetAttr(args[0], name); + if (unlikely(!attr)) + return NULL; + result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); + Py_DECREF(attr); + return result; +} +#endif - /* "pyreadstat/_readstat_writer.pyx":1 - * # cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 # <<<<<<<<<<<<<< - * # ###cython: profile=True - * # ############################################################################# -*/ - __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +/* DictGetItem */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return value; +} +#endif - /*--- Wrapped vars code ---*/ +/* PyFloatBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { + const double b = floatval; + double a, result; + CYTHON_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + if (likely(PyFloat_CheckExact(op1))) { + a = __Pyx_PyFloat_AS_DOUBLE(op1); + + } else + if (likely(PyLong_CheckExact(op1))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsZero(op1)) { + a = 0.0; + + } else if (__Pyx_PyLong_IsCompact(op1)) { + a = (double) __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + case 2: + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { + a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { + if (size == -2) + a = -a; + break; + } + } + CYTHON_FALLTHROUGH; + case -3: + case 3: + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { + a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { + if (size == -3) + a = -a; + break; + } + } + CYTHON_FALLTHROUGH; + case -4: + case 4: + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { + a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { + if (size == -4) + a = -a; + break; + } + } + CYTHON_FALLTHROUGH; + default: + #endif + a = PyLong_AsDouble(op1); + if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; + #if CYTHON_USE_PYLONG_INTERNALS + } + } + #endif + } else { + return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)); + } + result = a / b; + return PyFloat_FromDouble(result); +} +#endif - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - if (__pyx_m) { - if (__pyx_mstate->__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init pyreadstat._readstat_writer", __pyx_clineno, __pyx_lineno, __pyx_filename); +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init pyreadstat._readstat_writer"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #else - return __pyx_m; - #endif + return PyDict_SetItem(builder, key, value); } -/* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 149 <= 65535 - const unsigned short n; -#elif 149 / 2 < INT_MAX - const unsigned int n; -#elif 149 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; #endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_Boolean, sizeof(__pyx_k_Boolean), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Boolean */ - {__pyx_k_Categorical, sizeof(__pyx_k_Categorical), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Categorical */ - {__pyx_k_Column_labels_must_be_strings, sizeof(__pyx_k_Column_labels_must_be_strings), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Column_labels_must_be_strings */ - {__pyx_k_Date, sizeof(__pyx_k_Date), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Date */ - {__pyx_k_Datetime, sizeof(__pyx_k_Datetime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Datetime */ - {__pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Decimal */ - {__pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Enum */ - {__pyx_k_Float32, sizeof(__pyx_k_Float32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Float32 */ - {__pyx_k_Float64, sizeof(__pyx_k_Float64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Float64 */ - {__pyx_k_Int128, sizeof(__pyx_k_Int128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int128 */ - {__pyx_k_Int16, sizeof(__pyx_k_Int16), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int16 */ - {__pyx_k_Int32, sizeof(__pyx_k_Int32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int32 */ - {__pyx_k_Int64, sizeof(__pyx_k_Int64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int64 */ - {__pyx_k_Int8, sizeof(__pyx_k_Int8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Int8 */ - {__pyx_k_Non_unique_column_names_detected, sizeof(__pyx_k_Non_unique_column_names_detected), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Non_unique_column_names_detected */ - {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_None */ - {__pyx_k_Object, sizeof(__pyx_k_Object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Object */ - {__pyx_k_PyreadstatError, sizeof(__pyx_k_PyreadstatError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PyreadstatError */ - {__pyx_k_ReadstatError, sizeof(__pyx_k_ReadstatError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ReadstatError */ - {__pyx_k_String, sizeof(__pyx_k_String), 0, 1, 1}, /* PyObject cname: __pyx_n_u_String */ - {__pyx_k_Time, sizeof(__pyx_k_Time), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Time */ - {__pyx_k_UInt128, sizeof(__pyx_k_UInt128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt128 */ - {__pyx_k_UInt16, sizeof(__pyx_k_UInt16), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt16 */ - {__pyx_k_UInt32, sizeof(__pyx_k_UInt32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt32 */ - {__pyx_k_UInt64, sizeof(__pyx_k_UInt64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt64 */ - {__pyx_k_UInt8, sizeof(__pyx_k_UInt8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UInt8 */ - {__pyx_k_UnicodeError, sizeof(__pyx_k_UnicodeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UnicodeError */ - {__pyx_k_Unknown_data_format_to_insert, sizeof(__pyx_k_Unknown_data_format_to_insert), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_data_format_to_insert */ - {__pyx_k_Unknown_pywriter_variable_format, sizeof(__pyx_k_Unknown_pywriter_variable_format), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_pywriter_variable_format */ - {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ - {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ - {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 1}, /* PyObject cname: __pyx_n_u__4 */ - {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__5 */ - {__pyx_k_alignment_for_variable, sizeof(__pyx_k_alignment_for_variable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_alignment_for_variable */ - {__pyx_k_and_it_must_be_str_not_starting, sizeof(__pyx_k_and_it_must_be_str_not_starting), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_and_it_must_be_str_not_starting */ - {__pyx_k_cast, sizeof(__pyx_k_cast), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cast */ - {__pyx_k_cat, sizeof(__pyx_k_cat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cat */ - {__pyx_k_center, sizeof(__pyx_k_center), 0, 1, 1}, /* PyObject cname: __pyx_n_u_center */ - {__pyx_k_character_missing_ranges_value_g, sizeof(__pyx_k_character_missing_ranges_value_g), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_character_missing_ranges_value_g */ - {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_clone, sizeof(__pyx_k_clone), 0, 1, 1}, /* PyObject cname: __pyx_n_u_clone */ - {__pyx_k_column_labels_must_be_either_lis, sizeof(__pyx_k_column_labels_must_be_either_lis), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_column_labels_must_be_either_lis */ - {__pyx_k_columns, sizeof(__pyx_k_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_columns */ - {__pyx_k_combine, sizeof(__pyx_k_combine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_combine */ - {__pyx_k_dataframe_must_be_pandas_or_pola, sizeof(__pyx_k_dataframe_must_be_pandas_or_pola), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dataframe_must_be_pandas_or_pola */ - {__pyx_k_date, sizeof(__pyx_k_date), 0, 1, 1}, /* PyObject cname: __pyx_n_u_date */ - {__pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_datetime */ - {__pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_datetime64 */ - {__pyx_k_days, sizeof(__pyx_k_days), 0, 1, 1}, /* PyObject cname: __pyx_n_u_days */ - {__pyx_k_dictionaries_in_missing_ranges_m, sizeof(__pyx_k_dictionaries_in_missing_ranges_m), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dictionaries_in_missing_ranges_m */ - {__pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dirname */ - {__pyx_k_does_not_exist, sizeof(__pyx_k_does_not_exist), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_does_not_exist */ - {__pyx_k_drop_nulls, sizeof(__pyx_k_drop_nulls), 0, 1, 1}, /* PyObject cname: __pyx_n_u_drop_nulls */ - {__pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dtype */ - {__pyx_k_eager_only, sizeof(__pyx_k_eager_only), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eager_only */ - {__pyx_k_encode, sizeof(__pyx_k_encode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode */ - {__pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_expanduser */ - {__pyx_k_file_path_could_not_be_encoded_w, sizeof(__pyx_k_file_path_could_not_be_encoded_w), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_file_path_could_not_be_encoded_w */ - {__pyx_k_filter, sizeof(__pyx_k_filter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filter */ - {__pyx_k_from_native, sizeof(__pyx_k_from_native), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_native */ - {__pyx_k_fsdecode, sizeof(__pyx_k_fsdecode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fsdecode */ - {__pyx_k_fsencode, sizeof(__pyx_k_fsencode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fsencode */ - {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */ - {__pyx_k_get_categories, sizeof(__pyx_k_get_categories), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_categories */ - {__pyx_k_get_native_namespace, sizeof(__pyx_k_get_native_namespace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_native_namespace */ - {__pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getfilesystemencoding */ - {__pyx_k_hi, sizeof(__pyx_k_hi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hi */ - {__pyx_k_implementation, sizeof(__pyx_k_implementation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_implementation */ - {__pyx_k_in_variable, sizeof(__pyx_k_in_variable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_in_variable */ - {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ - {__pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_instead */ - {__pyx_k_is_in, sizeof(__pyx_k_is_in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_in */ - {__pyx_k_is_of_type, sizeof(__pyx_k_is_of_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is_of_type */ - {__pyx_k_is_pandas, sizeof(__pyx_k_is_pandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_pandas */ - {__pyx_k_is_polars, sizeof(__pyx_k_is_polars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_polars */ - {__pyx_k_isalpha, sizeof(__pyx_k_isalpha), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isalpha */ - {__pyx_k_isdir, sizeof(__pyx_k_isdir), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isdir */ - {__pyx_k_isna, sizeof(__pyx_k_isna), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isna */ - {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */ - {__pyx_k_iter_columns, sizeof(__pyx_k_iter_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_iter_columns */ - {__pyx_k_iter_rows, sizeof(__pyx_k_iter_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_iter_rows */ - {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ - {__pyx_k_left, sizeof(__pyx_k_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left */ - {__pyx_k_length_of_column_labels_must_be, sizeof(__pyx_k_length_of_column_labels_must_be), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_length_of_column_labels_must_be */ - {__pyx_k_lo, sizeof(__pyx_k_lo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lo */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_measure_for_variable, sizeof(__pyx_k_measure_for_variable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_measure_for_variable */ - {__pyx_k_min, sizeof(__pyx_k_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min */ - {__pyx_k_missing_ranges_hi_and_lo_values, sizeof(__pyx_k_missing_ranges_hi_and_lo_values), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_hi_and_lo_values */ - {__pyx_k_missing_ranges_hi_and_lo_values_2, sizeof(__pyx_k_missing_ranges_hi_and_lo_values_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_hi_and_lo_values_2 */ - {__pyx_k_missing_ranges_max_1_discrete_nu, sizeof(__pyx_k_missing_ranges_max_1_discrete_nu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_1_discrete_nu */ - {__pyx_k_missing_ranges_max_1_range_value, sizeof(__pyx_k_missing_ranges_max_1_range_value), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_1_range_value */ - {__pyx_k_missing_ranges_max_3_discrete_nu, sizeof(__pyx_k_missing_ranges_max_3_discrete_nu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_3_discrete_nu */ - {__pyx_k_missing_ranges_max_3_string_valu, sizeof(__pyx_k_missing_ranges_max_3_string_valu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_max_3_string_valu */ - {__pyx_k_missing_ranges_string_values_len, sizeof(__pyx_k_missing_ranges_string_values_len), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_string_values_len */ - {__pyx_k_missing_ranges_values_in_diction, sizeof(__pyx_k_missing_ranges_values_in_diction), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_values_in_diction */ - {__pyx_k_missing_ranges_values_must_be_bo, sizeof(__pyx_k_missing_ranges_values_must_be_bo), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_ranges_values_must_be_bo */ - {__pyx_k_missing_user_values_not_allowed, sizeof(__pyx_k_missing_user_values_not_allowed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_user_values_not_allowed */ - {__pyx_k_missing_user_values_supports_val, sizeof(__pyx_k_missing_user_values_supports_val), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_user_values_supports_val */ - {__pyx_k_missing_user_values_values_in_di, sizeof(__pyx_k_missing_user_values_values_in_di), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_missing_user_values_values_in_di */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ms */ - {__pyx_k_must_be_boolean_or_be_1_or_0, sizeof(__pyx_k_must_be_boolean_or_be_1_or_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_boolean_or_be_1_or_0 */ - {__pyx_k_must_be_dict_got, sizeof(__pyx_k_must_be_dict_got), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_dict_got */ - {__pyx_k_must_be_either_nominal_ordinal, sizeof(__pyx_k_must_be_either_nominal_ordinal), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_either_nominal_ordinal */ - {__pyx_k_must_be_either_right_center_lef, sizeof(__pyx_k_must_be_either_right_center_lef), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_either_right_center_lef */ - {__pyx_k_must_be_int, sizeof(__pyx_k_must_be_int), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_int */ - {__pyx_k_must_be_numeric, sizeof(__pyx_k_must_be_numeric), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_numeric */ - {__pyx_k_must_be_string, sizeof(__pyx_k_must_be_string), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_be_string */ - {__pyx_k_must_match_the_type_of_the_colu, sizeof(__pyx_k_must_match_the_type_of_the_colu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_must_match_the_type_of_the_colu */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name_2 */ - {__pyx_k_narwhals, sizeof(__pyx_k_narwhals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals */ - {__pyx_k_narwhals_stable_v2, sizeof(__pyx_k_narwhals_stable_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals_stable_v2 */ - {__pyx_k_nominal, sizeof(__pyx_k_nominal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nominal */ - {__pyx_k_note_should_be_either_str_or_lis, sizeof(__pyx_k_note_should_be_either_str_or_lis), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_note_should_be_either_str_or_lis */ - {__pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_np */ - {__pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ns */ - {__pyx_k_nt, sizeof(__pyx_k_nt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nt */ - {__pyx_k_nth, sizeof(__pyx_k_nth), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nth */ - {__pyx_k_null_count, sizeof(__pyx_k_null_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_null_count */ - {__pyx_k_numeric_missing_ranges_value_giv, sizeof(__pyx_k_numeric_missing_ranges_value_giv), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_numeric_missing_ranges_value_giv */ - {__pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numpy */ - {__pyx_k_nw, sizeof(__pyx_k_nw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nw */ - {__pyx_k_ordinal, sizeof(__pyx_k_ordinal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ordinal */ - {__pyx_k_ordinal_2, sizeof(__pyx_k_ordinal_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ordinal_2 */ - {__pyx_k_os, sizeof(__pyx_k_os), 0, 1, 1}, /* PyObject cname: __pyx_n_u_os */ - {__pyx_k_path, sizeof(__pyx_k_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_path */ - {__pyx_k_path_must_be_either_str_or_bytes, sizeof(__pyx_k_path_must_be_either_str_or_bytes), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_path_must_be_either_str_or_bytes */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ - {__pyx_k_readstat_parser, sizeof(__pyx_k_readstat_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_readstat_parser */ - {__pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace */ - {__pyx_k_right, sizeof(__pyx_k_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right */ - {__pyx_k_round, sizeof(__pyx_k_round), 0, 1, 1}, /* PyObject cname: __pyx_n_u_round */ - {__pyx_k_scale, sizeof(__pyx_k_scale), 0, 1, 1}, /* PyObject cname: __pyx_n_u_scale */ - {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ - {__pyx_k_stable, sizeof(__pyx_k_stable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stable */ - {__pyx_k_starts_with_an_illegal_non_alph, sizeof(__pyx_k_starts_with_an_illegal_non_alph), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_starts_with_an_illegal_non_alph */ - {__pyx_k_surrogateescape, sizeof(__pyx_k_surrogateescape), 0, 1, 1}, /* PyObject cname: __pyx_n_u_surrogateescape */ - {__pyx_k_sys, sizeof(__pyx_k_sys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sys */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_the_destination_folder, sizeof(__pyx_k_the_destination_folder), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_the_destination_folder */ - {__pyx_k_then, sizeof(__pyx_k_then), 0, 1, 1}, /* PyObject cname: __pyx_n_u_then */ - {__pyx_k_time, sizeof(__pyx_k_time), 0, 1, 1}, /* PyObject cname: __pyx_n_u_time */ - {__pyx_k_time_unit, sizeof(__pyx_k_time_unit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_time_unit */ - {__pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_timestamp */ - {__pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 1, 1}, /* PyObject cname: __pyx_n_u_timezone */ - {__pyx_k_total_seconds, sizeof(__pyx_k_total_seconds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_total_seconds */ - {__pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tzinfo */ - {__pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unknown */ - {__pyx_k_unknown_file_format, sizeof(__pyx_k_unknown_file_format), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unknown_file_format */ - {__pyx_k_upper, sizeof(__pyx_k_upper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_upper */ - {__pyx_k_us, sizeof(__pyx_k_us), 0, 1, 1}, /* PyObject cname: __pyx_n_u_us */ - {__pyx_k_utc, sizeof(__pyx_k_utc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_utc */ - {__pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_utf_8 */ - {__pyx_k_v2, sizeof(__pyx_k_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v2 */ - {__pyx_k_variable_name, sizeof(__pyx_k_variable_name), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_name */ - {__pyx_k_variable_name_s_contains_a_space, sizeof(__pyx_k_variable_name_s_contains_a_space), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_name_s_contains_a_space */ - {__pyx_k_variable_names_must_be_non_empty, sizeof(__pyx_k_variable_names_must_be_non_empty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_names_must_be_non_empty */ - {__pyx_k_variable_value_labels_type_of_La, sizeof(__pyx_k_variable_value_labels_type_of_La), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_value_labels_type_of_La */ - {__pyx_k_variable_value_labels_type_of_Va, sizeof(__pyx_k_variable_value_labels_type_of_Va), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_value_labels_type_of_Va */ - {__pyx_k_variable_value_labels_value_for, sizeof(__pyx_k_variable_value_labels_value_for), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_variable_value_labels_value_for */ - {__pyx_k_warn, sizeof(__pyx_k_warn), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warn */ - {__pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warnings */ - {__pyx_k_when, sizeof(__pyx_k_when), 0, 1, 1}, /* PyObject cname: __pyx_n_u_when */ - {__pyx_k_with_columns, sizeof(__pyx_k_with_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_with_columns */ - {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */ - {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); -/* #### Code section: cached_builtins ### */ +/* PyObjectVectorCallMethodKwBuilder */ +#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { + PyObject *result; + PyObject *obj = PyObject_GetAttr(args[0], name); + if (unlikely(!obj)) + return NULL; + result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); + Py_DECREF(obj); + return result; +} +#endif -static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { - CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 672, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 740, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; +/* RaiseException */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); +#elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; } -/* #### Code section: cached_constants ### */ -static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); +/* RaiseUnexpectedTypeError */ +static int +__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) +{ + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, + expected, obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} - /* "pyreadstat/_readstat_writer.pyx":674 - * 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_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} - /* "pyreadstat/_readstat_writer.pyx":28 - * - * import numpy as np - * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< - * - * from readstat_api cimport * -*/ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_narwhals, __pyx_mstate_global->__pyx_n_u_stable, __pyx_mstate_global->__pyx_n_u_v2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); +} +#else +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall +#else + PyObject_Vectorcall +#endif + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); +} +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, +#else + METH_FASTCALL | METH_KEYWORDS, +#endif + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; + } + } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else +#endif + target->method = result; + return 0; +} - /* "pyreadstat/_readstat_writer.pyx":52 - * 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[2] = 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[2])) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; +/* CallUnboundCMethod0 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + if (likely(cfunc->flag == METH_NOARGS)) + return __Pyx_CallCFunction(cfunc, self, NULL); + if (likely(cfunc->flag == METH_FASTCALL)) + return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); + if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) + return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (cfunc->flag == METH_VARARGS) + return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); + return __Pyx__CallUnboundCMethod0(cfunc, self); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 +#endif + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; } -/* #### Code section: init_constants ### */ - -static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { - CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; - __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; - __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_mstate->__pyx_float_1e3 = PyFloat_FromDouble(1e3); if (unlikely(!__pyx_mstate->__pyx_float_1e3)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_float_1e6 = PyFloat_FromDouble(1e6); if (unlikely(!__pyx_mstate->__pyx_float_1e6)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_float_1e9 = PyFloat_FromDouble(1e9); if (unlikely(!__pyx_mstate->__pyx_float_1e9)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_65 = PyLong_FromLong(65); if (unlikely(!__pyx_mstate->__pyx_int_65)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_97 = PyLong_FromLong(97); if (unlikely(!__pyx_mstate->__pyx_int_97)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1970 = PyLong_FromLong(1970); if (unlikely(!__pyx_mstate->__pyx_int_1970)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_neg_9223372036854775808 = PyLong_FromString("-9223372036854775808", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_neg_9223372036854775808)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; +#endif +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); + return result; } -/* #### Code section: init_codeobjects ### */ -static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { - CYTHON_UNUSED_VAR(__pyx_mstate); - return 0; +/* py_dict_keys */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); } -/* #### Code section: init_globals ### */ - -static int __Pyx_InitGlobals(void) { - /* PythonCompatibility.init */ - if (likely(__Pyx_init_co_variables() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return __Pyx_CallCFunction(cfunc, self, arg); + } else if (flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); + } + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 #endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); - for (i=0; itype; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg); } - for (i=0; ifunc && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + } else +#endif + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); } - return 0; + return result; } -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { - int result; - PyObject *exc_type; -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); + } + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 #endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif +#endif + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); return result; } #endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); #endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } } -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif + +/* dict_getitem_default */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; } + Py_INCREF(value); + if ((1)); #else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; + if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } #endif + else { + if (default_value == Py_None) + value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); + else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); + } + return value; } -#endif -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); - return PyObject_GetAttr(obj, attr_name); +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -#endif -/* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - (void) PyObject_GetOptionalAttr(obj, attr_name, &result); - return result; +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000) +#if CYTHON_COMPILING_IN_LIMITED_API + || __Pyx_get_runtime_version() >= 0x030A0000 #endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; + ) + return result; + { + Py_ssize_t size = __Pyx_PySet_GET_SIZE(result); + if (likely(size > 0)) + return result; +#if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) { + Py_DECREF(result); + return NULL; + } +#endif + } + Py_DECREF(result); #endif + } + return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type); } -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, - "name '%U' is not defined", name); +/* PySetContains */ +static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { + int result = -1; + if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { + PyObject *tmpkey; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey != NULL) { + result = PySet_Contains(set, tmpkey); + Py_DECREF(tmpkey); + } } return result; } - -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { + int result = PySet_Contains(set, key); + if (unlikely(result < 0)) { + result = __Pyx_PySet_ContainsUnhashable(set, key); } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) + return PyObject_RichCompareBool(s1, s2, equals); #else - return PySequence_GetItem(o, i); + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } #endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); #endif } -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_PyList_GetItemRef(o, n); - } + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + return PyObject_RichCompareBool(s1, s2, equals); +#else + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyLong_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length, length2; + int kind; + void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { + goto return_ne; } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; } - return sm->sq_item(o, i); } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; } -#else - if (is_list || !PyMapping_Check(o)) { - return PySequence_GetItem(o, i); - } +return_eq: + return (equals == Py_EQ); +return_ne: + return (equals == Py_NE); #endif - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +/* py_dict_items */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); } -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); } -#endif -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - if (!PyErr_Occurred()) - PyErr_SetNone(PyExc_NameError); - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } - PyErr_Clear(); -#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); - __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return result; - } -#else - result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); + return 0; } -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; + return __Pyx_IterFinish(); } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; + +/* PyUnicode_Unicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { + if (unlikely(obj == Py_None)) + obj = __pyx_mstate_global->__pyx_kp_u_None; + return __Pyx_NewRef(obj); +} + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + if (max_char > 1114111) max_char = 1114111; + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) + goto bad; + #endif + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); + char_pos += ulength; } - else { - d = NULL; - nd = 0; + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); return result; -} #endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; } -#endif -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); - self = __Pyx_CyOrPyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); +/* UnicodeAsUCS4 */ +static void __Pyx_PyUnicode_AsPy_UCS4_error(Py_ssize_t length) { + if (likely(length >= 0)) { + PyErr_Format(PyExc_ValueError, + "only single character unicode strings can be converted to Py_UCS4, " + "got length %" CYTHON_FORMAT_SSIZE_T "d", length); } - return result; } -#endif - -/* PyObjectFastCall */ -#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; +static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { + Py_ssize_t length = __Pyx_PyUnicode_GET_LENGTH(x); + if (unlikely(length != 1)) { + __Pyx_PyUnicode_AsPy_UCS4_error(length); + return (Py_UCS4)-1; } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; + return __Pyx_PyUnicode_READ_CHAR(x, 0); } + +/* object_ord */ +static long __Pyx__PyObject_Ord(PyObject* c) { + Py_ssize_t size; + if (PyBytes_Check(c)) { + size = __Pyx_PyBytes_GET_SIZE(c); + if (likely(size == 1)) { +#if CYTHON_ASSUME_SAFE_MACROS + return (unsigned char) PyBytes_AS_STRING(c)[0]; +#else + char *data = PyBytes_AsString(c); + if (unlikely(!data)) return -1; + return (unsigned char) data[0]; #endif -#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - #if PY_VERSION_HEX < 0x03090000 - #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) - #elif CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { - PyTypeObject *tp = Py_TYPE(callable); - #if defined(__Pyx_CyFunction_USED) - if (__Pyx_CyFunction_CheckExact(callable)) { - return __Pyx_CyFunction_func_vectorcall(callable); - } - #endif - if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { - return NULL; - } - assert(PyCallable_Check(callable)); - Py_ssize_t offset = tp->tp_vectorcall_offset; - assert(offset > 0); - vectorcallfunc ptr; - memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); - return ptr; -} - #else - #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) - #endif + } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(size < 0)) return -1; #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) - return __Pyx_PyObject_CallMethO(func, NULL); + } else if (PyByteArray_Check(c)) { + size = __Pyx_PyByteArray_GET_SIZE(c); + if (likely(size == 1)) { +#if CYTHON_ASSUME_SAFE_MACROS + return (unsigned char) PyByteArray_AS_STRING(c)[0]; +#else + char *data = PyByteArray_AsString(c); + if (unlikely(!data)) return -1; + return (unsigned char) data[0]; +#endif + } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(size < 0)) return -1; +#endif + } else { + __Pyx_TypeName c_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(c)); + PyErr_Format(PyExc_TypeError, + "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", + c_type_name); + __Pyx_DECREF_TypeName(c_type_name); + return (long)(Py_UCS4)-1; } - else if (nargs == 1 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) - return __Pyx_PyObject_CallMethO(func, args[0]); + PyErr_Format(PyExc_TypeError, + "ord() expected a character, but string of length %zd found", size); + return (long)(Py_UCS4)-1; +} + +/* PyLongCompare */ +static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(inplace); + if (op1 == op2) { + return 0; } -#endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + if (intval == 0) { + return (__Pyx_PyLong_IsZero(op1) != 1); + } else if (intval < 0) { + if (__Pyx_PyLong_IsNonNeg(op1)) + return 1; + intval = -intval; } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + if (__Pyx_PyLong_IsNeg(op1)) + return 1; } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + return (unequal != 0); } #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = __Pyx_PyFloat_AS_DOUBLE(op1); + return ((double)a != (double)b); } - #endif - #endif - if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); - #endif + return __Pyx_PyObject_IsTrueAndDecref( + PyObject_RichCompare(op1, op2, Py_NE)); +} + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); + else state = (PyGILState_STATE)0; + CYTHON_UNUSED_VAR(clineno); + CYTHON_UNUSED_VAR(lineno); + CYTHON_UNUSED_VAR(filename); + CYTHON_MAYBE_UNUSED_VAR(nogil); + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(0); } - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); + ctx = PyUnicode_FromString(name); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); } - #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API - return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); - #else - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); - #endif + if (nogil) + PyGILState_Release(state); } -/* PyObjectFastCallMethod */ -#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 -static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { +/* PyObjectFormatAndDecref */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { + if (unlikely(!s)) return NULL; + if (likely(PyUnicode_CheckExact(s))) return s; + return __Pyx_PyObject_FormatAndDecref(s, f); +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { PyObject *result; - PyObject *attr = PyObject_GetAttr(args[0], name); - if (unlikely(!attr)) - return NULL; - result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); - Py_DECREF(attr); + if (unlikely(!s)) return NULL; + result = PyObject_Format(s, f); + Py_DECREF(s); return result; } -#endif -/* DictGetItem */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); - } - } - return value; +/* RaiseUnboundLocalError */ +static void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } -#endif -/* PyFloatBinop */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) { - const double b = floatval; - double a, result; - CYTHON_UNUSED_VAR(inplace); - CYTHON_UNUSED_VAR(zerodivision_check); - if (likely(PyFloat_CheckExact(op1))) { - a = __Pyx_PyFloat_AS_DOUBLE(op1); - - } else - if (likely(PyLong_CheckExact(op1))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsZero(op1)) { - a = 0.0; - - } else if (__Pyx_PyLong_IsCompact(op1)) { - a = (double) __Pyx_PyLong_CompactValue(op1); - } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); - switch (size) { - case -2: - case 2: - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) { - a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { - if (size == -2) - a = -a; - break; - } - } - CYTHON_FALLTHROUGH; - case -3: - case 3: - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) { - a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { - if (size == -3) - a = -a; - break; - } - } - CYTHON_FALLTHROUGH; - case -4: - case 4: - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) { - a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) { - if (size == -4) - a = -a; - break; - } - } - CYTHON_FALLTHROUGH; - default: - #endif - a = PyLong_AsDouble(op1); - if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL; - #if CYTHON_USE_PYLONG_INTERNALS +/* CIntToDigits */ +static const char DIGIT_PAIRS_10[2*10*10+1] = { + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899" +}; +static const char DIGIT_PAIRS_8[2*8*8+1] = { + "0001020304050607" + "1011121314151617" + "2021222324252627" + "3031323334353637" + "4041424344454647" + "5051525354555657" + "6061626364656667" + "7071727374757677" +}; +static const char DIGITS_HEX[2*16+1] = { + "0123456789abcdef" + "0123456789ABCDEF" +}; + +/* BuildPyUnicode */ +static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength, + int prepend_sign, char padding_char) { + PyObject *uval; + Py_ssize_t uoffset = ulength - clength; +#if CYTHON_USE_UNICODE_INTERNALS + Py_ssize_t i; + void *udata; + uval = PyUnicode_New(ulength, 127); + if (unlikely(!uval)) return NULL; + udata = PyUnicode_DATA(uval); + if (uoffset > 0) { + i = 0; + if (prepend_sign) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); + i++; + } + for (; i < uoffset; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + } + } + for (i=0; i < clength; i++) { + __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + } +#else + { + PyObject *sign = NULL, *padding = NULL; + uval = NULL; + if (uoffset > 0) { + prepend_sign = !!prepend_sign; + if (uoffset > prepend_sign) { + padding = PyUnicode_FromOrdinal(padding_char); + if (likely(padding) && uoffset > prepend_sign + 1) { + PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign); + Py_DECREF(padding); + padding = tmp; + } + if (unlikely(!padding)) goto done_or_error; + } + if (prepend_sign) { + sign = PyUnicode_FromOrdinal('-'); + if (unlikely(!sign)) goto done_or_error; } } - #endif - } else { - return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)); + uval = PyUnicode_DecodeASCII(chars, clength, NULL); + if (likely(uval) && padding) { + PyObject *tmp = PyUnicode_Concat(padding, uval); + Py_DECREF(uval); + uval = tmp; + } + if (likely(uval) && sign) { + PyObject *tmp = PyUnicode_Concat(sign, uval); + Py_DECREF(uval); + uval = tmp; + } +done_or_error: + Py_XDECREF(padding); + Py_XDECREF(sign); } - result = a / b; - return PyFloat_FromDouble(result); -} #endif + return uval; +} -/* PyObjectVectorCallKwBuilder */ -#if CYTHON_VECTORCALL -static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - (void)__Pyx_PyObject_FastCallDict; - if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; - Py_INCREF(key); - args[n] = value; - return 0; +/* COrdinalToPyUnicode */ +static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) { + return value <= 1114111; } -CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - (void)__Pyx_VectorcallBuilder_AddArgStr; - if (unlikely(!PyUnicode_Check(key))) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - return -1; +static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) { + if (likely(ulength <= 250)) { + char chars[256]; + if (value <= 255) { + memset(chars, padding_char, (size_t) (ulength - 1)); + chars[ulength-1] = (char) value; + return PyUnicode_DecodeLatin1(chars, ulength, NULL); + } + char *cpos = chars + sizeof(chars); + if (value < 0x800) { + *--cpos = (char) (0x80 | (value & 0x3f)); + value >>= 6; + *--cpos = (char) (0xc0 | (value & 0x1f)); + } else if (value < 0x10000) { + *--cpos = (char) (0x80 | (value & 0x3f)); + value >>= 6; + *--cpos = (char) (0x80 | (value & 0x3f)); + value >>= 6; + *--cpos = (char) (0xe0 | (value & 0x0f)); + } else { + *--cpos = (char) (0x80 | (value & 0x3f)); + value >>= 6; + *--cpos = (char) (0x80 | (value & 0x3f)); + value >>= 6; + *--cpos = (char) (0x80 | (value & 0x3f)); + value >>= 6; + *--cpos = (char) (0xf0 | (value & 0x07)); + } + cpos -= ulength; + memset(cpos, padding_char, (size_t) (ulength - 1)); + return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL); } - return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); -} -static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - PyObject *pyKey = PyUnicode_FromString(key); - if (!pyKey) return -1; - return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); -} -#else // CYTHON_VECTORCALL -CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { - if (unlikely(!PyUnicode_Check(key))) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - return -1; + if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) { + const char chars[1] = {(char) value}; + return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char); + } + { + PyObject *uchar, *padding_uchar, *padding, *result; + padding_uchar = PyUnicode_FromOrdinal(padding_char); + if (unlikely(!padding_uchar)) return NULL; + padding = PySequence_Repeat(padding_uchar, ulength - 1); + Py_DECREF(padding_uchar); + if (unlikely(!padding)) return NULL; + uchar = PyUnicode_FromOrdinal(value); + if (unlikely(!uchar)) { + Py_DECREF(padding); + return NULL; + } + result = PyUnicode_Concat(padding, uchar); + Py_DECREF(padding); + Py_DECREF(uchar); + return result; } - return PyDict_SetItem(builder, key, value); } -#endif -/* PyObjectVectorCallMethodKwBuilder */ -#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 -static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { - PyObject *result; - PyObject *obj = PyObject_GetAttr(args[0], name); - if (unlikely(!obj)) - return NULL; - result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); - Py_DECREF(obj); - return result; -} +/* CIntToPyUnicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) { + char digits[sizeof(long)*3+2]; + char *dpos, *end = digits + sizeof(long)*3+2; + const char *hex_digits = DIGITS_HEX; + Py_ssize_t length, ulength; + int prepend_sign, last_one_off; + long remaining; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" #endif - -/* RaiseException */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (format_char == 'c') { + if (unlikely(!(is_unsigned || value == 0 || value > 0) || + !(sizeof(value) <= 2 || value & ~ (long) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) { + PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)"); + return NULL; } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } + if (width <= 1) { + return PyUnicode_FromOrdinal((int) value); } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; + return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char); } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); + if (format_char == 'X') { + hex_digits += 16; + format_char = 'x'; } - PyErr_SetObject(type, value); - if (tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); -#elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); + 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 = (long) (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 = (long) (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 = (long) (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; } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif + ++ulength; } -bad: - Py_XDECREF(owned_instance); - return; + if (width > ulength) { + ulength = width; + } + if (ulength == 1) { + return PyUnicode_FromOrdinal(*dpos); + } + return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } -/* RaiseUnexpectedTypeError */ -static int -__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) -{ - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, - expected, obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; +/* HasAttr */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!PyUnicode_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_PyObject_GetAttrStrNoError(o, n); + if (!r) { + return (unlikely(PyErr_Occurred())) ? -1 : 0; + } else { + Py_DECREF(r); + return 1; + } } +#endif -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; } +#endif -/* UnpackUnboundCMethod */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { - return _PyObject_Vectorcall - (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif } -#else -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - return -#if PY_VERSION_HEX < 0x03090000 - _PyObject_Vectorcall -#else - PyObject_Vectorcall -#endif - (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif } #endif -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 - METH_VARARGS | METH_KEYWORDS, + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else - METH_FASTCALL | METH_KEYWORDS, -#endif - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method, *result=NULL; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - result = method; -#if CYTHON_COMPILING_IN_CPYTHON - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif -#if CYTHON_COMPILING_IN_PYPY +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C0000 + local_value = tstate->current_exception; + tstate->current_exception = 0; + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 + local_value = PyErr_GetRaisedException(); #else - if (PyCFunction_Check(method)) + PyErr_Fetch(&local_type, &local_value, &local_tb); #endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } +#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } #else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) #endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - result = unbound_method; - } + goto bad; + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } +#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif } -#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - if (unlikely(target->method)) { - Py_DECREF(result); - } else + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + PyErr_SetHandledException(local_value); + Py_XDECREF(local_value); + Py_XDECREF(local_type); + Py_XDECREF(local_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); #endif - target->method = result; return 0; +#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +#endif } -/* CallUnboundCMethod0 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - if (likely(cfunc->flag == METH_NOARGS)) - return __Pyx_CallCFunction(cfunc, self, NULL); - if (likely(cfunc->flag == METH_FASTCALL)) - return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); - if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) - return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (cfunc->flag == METH_VARARGS) - return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); - return __Pyx__CallUnboundCMethod0(cfunc, self); +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 -#endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); } -#endif - PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; -} -#endif -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *result; - if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; - result = __Pyx_PyObject_CallOneArg(cfunc->method, self); - return result; -} - -/* py_dict_keys */ -static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { - return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); -} - -/* PyObjectCall2Args */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { - PyObject *args[3] = {NULL, arg1, arg2}; - return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + return NULL; } - -/* CallUnboundCMethod1 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - int flag = cfunc->flag; - if (flag == METH_O) { - return __Pyx_CallCFunction(cfunc, self, arg); - } else if (flag == METH_FASTCALL) { - return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); - } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); + if (!meth) { + PyErr_Clear(); + } else { + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; } } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 -#endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); } -#endif - PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - if (cfunc->flag & METH_KEYWORDS) - result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); - else - result = __Pyx_CallCFunction(cfunc, self, args); - Py_DECREF(args); - } else + +/* PyLongBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) { + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; #endif - { - result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + return __Pyx_NewRef(op2); } - return result; -} - -/* CallUnboundCMethod2 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - PyObject *args[2] = {arg1, arg2}; - if (cfunc->flag == METH_FASTCALL) { - return __Pyx_CallCFunctionFast(cfunc, self, args, 2); + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + #ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; + #endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); - } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 -#endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); #endif - PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); + + } #endif -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - PyObject *result = NULL; - PyObject *args = PyTuple_New(2); - if (unlikely(!args)) return NULL; - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 0, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 1, arg2); - if (cfunc->flag & METH_KEYWORDS) - result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); - else - result = __Pyx_CallCFunction(cfunc, self, args); - Py_DECREF(args); - return result; - } -#endif - { - PyObject *args[4] = {NULL, self, arg1, arg2}; - return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); - } +static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) { + CYTHON_UNUSED_VAR(zerodivision_check); + const long b = intval; + double a = __Pyx_PyFloat_AS_DOUBLE(float_val); + double result; + + result = ((double)a) + (double)b; + return PyFloat_FromDouble(result); } - -/* dict_getitem_default */ -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { - PyObject* value; -#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (unlikely(PyErr_Occurred())) - return NULL; - value = default_value; - } - Py_INCREF(value); - if ((1)); -#else - if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { - value = PyDict_GetItem(d, key); - if (unlikely(!value)) { - value = default_value; - } - Py_INCREF(value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_UNUSED_VAR(zerodivision_check); + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check); } -#endif - else { - if (default_value == Py_None) - value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); - else - value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); + #endif + if (PyFloat_CheckExact(op1)) { + return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check); } - return value; -} - -/* PyObjectCallNoArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg[2] = {NULL, NULL}; - return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); } - -/* pyfrozenset_new */ -static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { - if (it) { - PyObject* result; -#if CYTHON_COMPILING_IN_PYPY - PyObject* args; - args = PyTuple_Pack(1, it); - if (unlikely(!args)) - return NULL; - result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); - Py_DECREF(args); - return result; -#else - if (PyFrozenSet_CheckExact(it)) { - Py_INCREF(it); - return it; - } - result = PyFrozenSet_New(it); - if (unlikely(!result)) - return NULL; - if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000) -#if CYTHON_COMPILING_IN_LIMITED_API - || __Pyx_get_runtime_version() >= 0x030A0000 -#endif - ) - return result; - { - Py_ssize_t size = __Pyx_PySet_GET_SIZE(result); - if (likely(size > 0)) - return result; -#if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(size < 0)) { - Py_DECREF(result); - return NULL; - } -#endif - } - Py_DECREF(result); #endif - } - return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type); -} -/* PySetContains */ -static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { - int result = -1; - if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { - PyObject *tmpkey; - PyErr_Clear(); - tmpkey = __Pyx_PyFrozenSet_New(key); - if (tmpkey != NULL) { - result = PySet_Contains(set, tmpkey); - Py_DECREF(tmpkey); - } - } - return result; -} -static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { - int result = PySet_Contains(set, key); - if (unlikely(result < 0)) { - result = __Pyx_PySet_ContainsUnhashable(set, key); +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_value = exc_info->exc_value; + exc_info->exc_value = *value; + if (tmp_value == NULL || tmp_value == Py_None) { + Py_XDECREF(tmp_value); + tmp_value = NULL; + tmp_type = NULL; + tmp_tb = NULL; + } else { + tmp_type = (PyObject*) Py_TYPE(tmp_value); + Py_INCREF(tmp_type); + #if CYTHON_COMPILING_IN_CPYTHON + tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; + Py_XINCREF(tmp_tb); + #else + tmp_tb = PyException_GetTraceback(tmp_value); + #endif } - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; } - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ - !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) - return PyObject_RichCompareBool(s1, s2, equals); #else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} #endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); + +/* TupleAndListFromArray */ +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; + Py_INCREF(src[i]); } -#endif + return res; } - -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL - return PyObject_RichCompareBool(s1, s2, equals); -#else - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; +#elif CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length, length2; - int kind; - void *data1, *data2; - #if !CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - #endif - length = __Pyx_PyUnicode_GET_LENGTH(s1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(length < 0)) return -1; +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif + for (i = 0; i < n; i++) + { + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; #endif - length2 = __Pyx_PyUnicode_GET_LENGTH(s2); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(length2 < 0)) return -1; + if (s == namei) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; #endif - if (length != length2) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - return (equals == Py_EQ) ? (result == 0) : (result != 0); + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; } -return_eq: - return (equals == Py_EQ); -return_ne: - return (equals == Py_NE); + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs; + PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i__pyx_umethod_PyDict_Type_items, d); +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); } -/* RaiseTooManyValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; + } + name++; + } + return 0; +bad: + return -1; } - -/* RaiseNeedMoreValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); } - -/* IterFinish */ -static CYTHON_INLINE int __Pyx_IterFinish(void) { - PyObject* exc_type; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - exc_type = __Pyx_PyErr_CurrentExceptionType(); - if (unlikely(exc_type)) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) - return -1; - __Pyx_PyErr_Clear(); - return 0; +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; + } + } + #endif + name++; + } + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + } + #endif + name++; } return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; } - -/* UnpackItemEndCheck */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; } - return __Pyx_IterFinish(); + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +bad: + return -1; } - -/* PyUnicode_Unicode */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { - if (unlikely(obj == Py_None)) - obj = __pyx_mstate_global->__pyx_kp_u_None; - return __Pyx_NewRef(obj); +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); } - -/* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char) { -#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyObject *result_uval; - int result_ukind, kind_shift; - Py_ssize_t i, char_pos; - void *result_udata; - if (max_char > 1114111) max_char = 1114111; - result_uval = PyUnicode_New(result_ulength, max_char); - if (unlikely(!result_uval)) return NULL; - result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; - kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; - result_udata = PyUnicode_DATA(result_uval); - assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) - goto overflow; - char_pos = 0; - for (i=0; i < value_count; i++) { - int ukind; - Py_ssize_t ulength; - void *udata; - PyObject *uval = values[i]; - #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_PyUnicode_READY(uval) == (-1)) - goto bad; - #endif - ulength = __Pyx_PyUnicode_GET_LENGTH(uval); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(ulength < 0)) goto bad; - #endif - if (unlikely(!ulength)) - continue; - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) - goto overflow; - ukind = __Pyx_PyUnicode_KIND(uval); - udata = __Pyx_PyUnicode_DATA(uval); - if (ukind == result_ukind) { - memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); - } else { - #if PY_VERSION_HEX >= 0x030d0000 - if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) - _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); - #else - Py_ssize_t j; - for (j=0; j < ulength; j++) { - Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); - __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + PyObject** const *name = first_kw_arg; + while (*name && (**name != key)) name++; + if (!*name) { + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); + #endif + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp != 1) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); #endif } - char_pos += ulength; } - return result_uval; -overflow: - PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; bad: - Py_DECREF(result_uval); - return NULL; + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } #else - Py_ssize_t i; - PyObject *result = NULL; - PyObject *value_tuple = PyTuple_New(value_count); - if (unlikely(!value_tuple)) return NULL; - CYTHON_UNUSED_VAR(max_char); - CYTHON_UNUSED_VAR(result_ulength); - for (i=0; i__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } +#endif + name++; } - result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple); + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; bad: - Py_DECREF(value_tuple); - return result; + return -1; +} +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); +#endif +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; #endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif + } + return 0; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + goto bad; +bad: + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(key); + #endif + return -1; +} +static int __Pyx_ParseKeywords( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); } -/* UnicodeAsUCS4 */ -static void __Pyx_PyUnicode_AsPy_UCS4_error(Py_ssize_t length) { - if (likely(length >= 0)) { - PyErr_Format(PyExc_ValueError, - "only single character unicode strings can be converted to Py_UCS4, " - "got length %" CYTHON_FORMAT_SSIZE_T "d", length); +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; } -} -static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { - Py_ssize_t length = __Pyx_PyUnicode_GET_LENGTH(x); - if (unlikely(length != 1)) { - __Pyx_PyUnicode_AsPy_UCS4_error(length); - return (Py_UCS4)-1; + if (exact) { + more_or_less = "exactly"; } - return __Pyx_PyUnicode_READ_CHAR(x, 0); + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } -/* object_ord */ -static long __Pyx__PyObject_Ord(PyObject* c) { - Py_ssize_t size; - if (PyBytes_Check(c)) { - size = __Pyx_PyBytes_GET_SIZE(c); - if (likely(size == 1)) { -#if CYTHON_ASSUME_SAFE_MACROS - return (unsigned char) PyBytes_AS_STRING(c)[0]; -#else - char *data = PyBytes_AsString(c); - if (unlikely(!data)) return -1; - return (unsigned char) data[0]; -#endif +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (!exact) { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; } -#if !CYTHON_ASSUME_SAFE_SIZE - else if (unlikely(size < 0)) return -1; + } + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType_3_1_2 +#define __PYX_HAVE_RT_ImportType_3_1_2 +static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size) +{ + PyObject *result = 0; + Py_ssize_t basicsize; + Py_ssize_t itemsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + PyObject *py_itemsize; #endif - } else if (PyByteArray_Check(c)) { - size = __Pyx_PyByteArray_GET_SIZE(c); - if (likely(size == 1)) { -#if CYTHON_ASSUME_SAFE_MACROS - return (unsigned char) PyByteArray_AS_STRING(c)[0]; + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#if !CYTHON_COMPILING_IN_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else - char *data = PyByteArray_AsString(c); - if (unlikely(!data)) return -1; - return (unsigned char) data[0]; + if (size == 0) { + return (PyTypeObject *)result; + } + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; } -#if !CYTHON_ASSUME_SAFE_SIZE - else if (unlikely(size < 0)) return -1; + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize+itemsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_2 && + ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd-%zd from PyObject", + module_name, class_name, size, basicsize, basicsize+itemsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_2 && (size_t)basicsize > size) { + if (PyErr_WarnFormat(NULL, 0, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize) < 0) { + goto bad; + } + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} #endif - } else { - __Pyx_TypeName c_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(c)); - PyErr_Format(PyExc_TypeError, - "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", - c_type_name); - __Pyx_DECREF_TypeName(c_type_name); - return (long)(Py_UCS4)-1; + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + if (level == -1) { + const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); + if (package_sep != (0)) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; } - PyErr_Format(PyExc_TypeError, - "ord() expected a character, but string of length %zd found", size); - return (long)(Py_UCS4)-1; + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + return module; } -/* PyLongCompare */ -static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(inplace); - if (op1 == op2) { - return 0; +/* ImportDottedModule */ +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + Py_ssize_t size; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } +#if CYTHON_ASSUME_SAFE_SIZE + size = PyTuple_GET_SIZE(parts_tuple); +#else + size = PyTuple_Size(parts_tuple); + if (size < 0) goto bad; +#endif + if (likely(size == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); } - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); - const digit* digits = __Pyx_PyLong_Digits(op1); - if (intval == 0) { - return (__Pyx_PyLong_IsZero(op1) != 1); - } else if (intval < 0) { - if (__Pyx_PyLong_IsNonNeg(op1)) - return 1; - intval = -intval; - } else { - if (__Pyx_PyLong_IsNeg(op1)) - return 1; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else + PyErr_Format( + PyExc_ModuleNotFoundError, + "No module named '%U'", partial_name); +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); #endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else + return imported_module; +} +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; +#if CYTHON_ASSUME_SAFE_SIZE + nparts = PyTuple_GET_SIZE(parts_tuple); +#else + nparts = PyTuple_Size(parts_tuple); + if (nparts < 0) return NULL; #endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = __Pyx_PySequence_ITEM(parts_tuple, i); + if (!part) return NULL; #endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); #endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - return (unequal != 0); + Py_DECREF(module); + module = submodule; } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = __Pyx_PyFloat_AS_DOUBLE(op1); - return ((double)a != (double)b); + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } - return __Pyx_PyObject_IsTrueAndDecref( - PyObject_RichCompare(op1, op2, Py_NE)); + return module; } - -/* WriteUnraisableException */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_PyThreadState_declare - PyGILState_STATE state; - if (nogil) - state = PyGILState_Ensure(); - else state = (PyGILState_STATE)0; - CYTHON_UNUSED_VAR(clineno); - CYTHON_UNUSED_VAR(lineno); - CYTHON_UNUSED_VAR(filename); - CYTHON_MAYBE_UNUSED_VAR(nogil); - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - if (full_traceback) { - Py_XINCREF(old_exc); - Py_XINCREF(old_val); - Py_XINCREF(old_tb); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - PyErr_PrintEx(0); +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; } - ctx = PyUnicode_FromString(name); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); } - if (nogil) - PyGILState_Release(state); +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); } -/* PyObjectFormatAndDecref */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { - if (unlikely(!s)) return NULL; - if (likely(PyUnicode_CheckExact(s))) return s; - return __Pyx_PyObject_FormatAndDecref(s, f); -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { - PyObject *result; - if (unlikely(!s)) return NULL; - result = PyObject_Format(s, f); - Py_DECREF(s); - return result; +/* ImportDottedModuleRelFirst */ +static PyObject *__Pyx_ImportDottedModuleRelFirst(PyObject *name, PyObject *parts_tuple) { + PyObject *module; + PyObject *from_list = NULL; + module = __Pyx_Import(name, from_list, -1); + Py_XDECREF(from_list); + if (module) { + if (parts_tuple) { + module = __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); + } + return module; + } + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + return NULL; + PyErr_Clear(); + return __Pyx_ImportDottedModule(name, parts_tuple); } -/* RaiseUnboundLocalError */ -static void __Pyx_RaiseUnboundLocalError(const char *varname) { - PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i 0) { - i = 0; - if (prepend_sign) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); - i++; +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + const char* module_name_str = 0; + PyObject* module_name = 0; + PyObject* module_dot = 0; + PyObject* full_name = 0; + PyErr_Clear(); + module_name_str = PyModule_GetName(module); + 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); + if (unlikely(!module_dot)) { goto modbad; } + full_name = PyUnicode_Concat(module_dot, name); + if (unlikely(!full_name)) { goto modbad; } + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL + { + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + goto modbad; + value = PyObject_GetItem(modules, full_name); } - for (; i < uoffset; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); + #else + value = PyImport_GetModule(full_name); + #endif + modbad: + Py_XDECREF(full_name); + Py_XDECREF(module_dot); + Py_XDECREF(module_name); + } + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); + } + return value; +} + +/* LimitedApiGetTypeDict */ +#if CYTHON_COMPILING_IN_LIMITED_API +static Py_ssize_t __Pyx_GetTypeDictOffset(void) { + PyObject *tp_dictoffset_o; + Py_ssize_t tp_dictoffset; + tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); + if (unlikely(!tp_dictoffset_o)) return -1; + tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); + Py_DECREF(tp_dictoffset_o); + if (unlikely(tp_dictoffset == 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' doesn't have a dictoffset"); + return -1; + } else if (unlikely(tp_dictoffset < 0)) { + PyErr_SetString( + PyExc_TypeError, + "'type' has an unexpected negative dictoffset. " + "Please report this as Cython bug"); + return -1; + } + return tp_dictoffset; +} +static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { + static Py_ssize_t tp_dictoffset = 0; + if (unlikely(tp_dictoffset == 0)) { + tp_dictoffset = __Pyx_GetTypeDictOffset(); + if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { + tp_dictoffset = 0; // try again next time? + return NULL; } } - for (i=0; i < clength; i++) { - __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); + return *(PyObject**)((char*)tp + tp_dictoffset); +} +#endif + +/* SetItemOnTypeDict */ +static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { + int result; + PyObject *tp_dict; +#if CYTHON_COMPILING_IN_LIMITED_API + tp_dict = __Pyx_GetTypeDict(tp); + if (unlikely(!tp_dict)) return -1; +#else + tp_dict = tp->tp_dict; +#endif + result = PyDict_SetItem(tp_dict, k, v); + if (likely(!result)) { + PyType_Modified(tp); + if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { + PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); + if (!setNameResult) return -1; + Py_DECREF(setNameResult); + } } + return result; +} + +/* FixUpExtensionType */ +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if __PYX_LIMITED_VERSION_HEX > 0x030900B1 + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); #else - { - PyObject *sign = NULL, *padding = NULL; - uval = NULL; - if (uoffset > 0) { - prepend_sign = !!prepend_sign; - if (uoffset > prepend_sign) { - padding = PyUnicode_FromOrdinal(padding_char); - if (likely(padding) && uoffset > prepend_sign + 1) { - PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign); - Py_DECREF(padding); - padding = tmp; + const PyType_Slot *slot = spec->slots; + int changed = 0; +#if !CYTHON_COMPILING_IN_LIMITED_API + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { +#if !CYTHON_COMPILING_IN_CPYTHON + const +#endif // !CYTHON_COMPILING_IN_CPYTHON) + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif // CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { + return -1; + } + changed = 1; } - if (unlikely(!padding)) goto done_or_error; } - if (prepend_sign) { - sign = PyUnicode_FromOrdinal('-'); - if (unlikely(!sign)) goto done_or_error; + memb++; + } + } +#endif // !CYTHON_COMPILING_IN_LIMITED_API + slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_getset) + slot++; + if (slot && slot->slot == Py_tp_getset) { + PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; + while (getset && getset->name) { + if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { + PyObject *descr = PyDescr_NewGetSet(type, getset); + if (unlikely(!descr)) + return -1; + #if CYTHON_COMPILING_IN_LIMITED_API + PyObject *pyname = PyUnicode_FromString(getset->name); + if (unlikely(!pyname)) { + Py_DECREF(descr); + return -1; + } + int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); + Py_DECREF(pyname); + #else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); + int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); + #endif + Py_DECREF(descr); + if (unlikely(set_item_result < 0)) { + return -1; + } + changed = 1; } + ++getset; } - uval = PyUnicode_DecodeASCII(chars, clength, NULL); - if (likely(uval) && padding) { - PyObject *tmp = PyUnicode_Concat(padding, uval); - Py_DECREF(uval); - uval = tmp; - } - if (likely(uval) && sign) { - PyObject *tmp = PyUnicode_Concat(sign, uval); - Py_DECREF(uval); - uval = tmp; - } -done_or_error: - Py_XDECREF(padding); - Py_XDECREF(sign); } -#endif - return uval; + if (changed) + PyType_Modified(type); +#endif // PY_VERSION_HEX > 0x030900B1 + return 0; } -/* COrdinalToPyUnicode */ -static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) { - return value <= 1114111; +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } -static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) { - if (likely(ulength <= 250)) { - char chars[256]; - if (value <= 255) { - memset(chars, padding_char, (size_t) (ulength - 1)); - chars[ulength-1] = (char) value; - return PyUnicode_DecodeLatin1(chars, ulength, NULL); - } - char *cpos = chars + sizeof(chars); - if (value < 0x800) { - *--cpos = (char) (0x80 | (value & 0x3f)); - value >>= 6; - *--cpos = (char) (0xc0 | (value & 0x1f)); - } else if (value < 0x10000) { - *--cpos = (char) (0x80 | (value & 0x3f)); - value >>= 6; - *--cpos = (char) (0x80 | (value & 0x3f)); - value >>= 6; - *--cpos = (char) (0xe0 | (value & 0x0f)); - } else { - *--cpos = (char) (0x80 | (value & 0x3f)); - value >>= 6; - *--cpos = (char) (0x80 | (value & 0x3f)); - value >>= 6; - *--cpos = (char) (0x80 | (value & 0x3f)); - value >>= 6; - *--cpos = (char) (0xf0 | (value & 0x07)); - } - cpos -= ulength; - memset(cpos, padding_char, (size_t) (ulength - 1)); - return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL); - } - if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) { - const char chars[1] = {(char) value}; - return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char); - } - { - PyObject *uchar, *padding_uchar, *padding, *result; - padding_uchar = PyUnicode_FromOrdinal(padding_char); - if (unlikely(!padding_uchar)) return NULL; - padding = PySequence_Repeat(padding_uchar, ulength - 1); - Py_DECREF(padding_uchar); - if (unlikely(!padding)) return NULL; - uchar = PyUnicode_FromOrdinal(value); - if (unlikely(!uchar)) { - Py_DECREF(padding); - return NULL; - } - result = PyUnicode_Concat(padding, uchar); - Py_DECREF(padding); - Py_DECREF(uchar); - return result; - } + +/* dict_setdefault */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, + int is_safe_type) { + PyObject* value; + CYTHON_MAYBE_UNUSED_VAR(is_safe_type); +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value); +#elif PY_VERSION_HEX >= 0x030d0000 + PyDict_SetDefaultRef(d, key, default_value, &value); +#else + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); +#endif + return value; } -/* CIntToPyUnicode */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) { - char digits[sizeof(long)*3+2]; - char *dpos, *end = digits + sizeof(long)*3+2; - const char *hex_digits = DIGITS_HEX; - Py_ssize_t length, ulength; - int prepend_sign, last_one_off; - long remaining; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" +/* FetchCommonType */ +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); + if (result && metaclass) { + PyObject *old_tp = (PyObject*)Py_TYPE(result); + Py_INCREF((PyObject*)metaclass); +#if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + Py_SET_TYPE(result, metaclass); +#else + result->ob_type = metaclass; #endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop + Py_DECREF(old_tp); + } + return result; +} +#else +#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) #endif - const int is_unsigned = neg_one > const_zero; - if (format_char == 'c') { - if (unlikely(!(is_unsigned || value == 0 || value > 0) || - !(sizeof(value) <= 2 || value & ~ (long) 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 int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t expected_basicsize) { + Py_ssize_t basicsize; + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; } - if (format_char == 'X') { - hex_digits += 16; - format_char = 'x'; + if (expected_basicsize == 0) { + return 0; // size is inherited, nothing useful to check } - 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 = (long) (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 = (long) (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 = (long) (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 CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) return -1; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = NULL; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; +#else + basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; +#endif + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; } - if (width > ulength) { - ulength = width; + return 0; +} +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; + int get_item_ref_result; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + py_object_name = PyUnicode_FromString(object_name); + if (!py_object_name) return NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) goto done; + abi_module_dict = PyModule_GetDict(abi_module); + if (!abi_module_dict) goto done; + get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); + if (get_item_ref_result == 1) { + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } else if (unlikely(get_item_ref_result == -1)) { + goto bad; } - if (ulength == 1) { - return PyUnicode_FromOrdinal(*dpos); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + if (unlikely(new_cached_type != cached_type)) { + if (unlikely(!new_cached_type)) goto bad; + Py_DECREF(cached_type); + cached_type = new_cached_type; + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } else { + Py_DECREF(new_cached_type); } - return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); +done: + Py_XDECREF(abi_module); + Py_DECREF(py_object_name); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; } -/* HasAttr */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 -static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { - PyObject *r; - if (unlikely(!PyUnicode_Check(n))) { - PyErr_SetString(PyExc_TypeError, - "hasattr(): attribute name must be string"); +/* CommonTypesMetaclass */ +PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { + return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); +} +static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { + {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, + {0, 0, 0, 0, 0} +}; +static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { + {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, + {0, 0} +}; +static PyType_Spec __pyx_CommonTypesMetaclass_spec = { + __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", + 0, + 0, +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | + Py_TPFLAGS_DISALLOW_INSTANTIATION | +#endif + Py_TPFLAGS_DEFAULT, + __pyx_CommonTypesMetaclass_slots +}; +static int __pyx_CommonTypesMetaclass_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + PyObject *bases = PyTuple_Pack(1, &PyType_Type); + if (unlikely(!bases)) { return -1; } - r = __Pyx_PyObject_GetAttrStrNoError(o, n); - if (!r) { - return (unlikely(PyErr_Occurred())) ? -1 : 0; - } else { - Py_DECREF(r); - return 1; + mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { + return -1; } + return 0; } -#endif -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; +/* CallTypeTraverse */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } } - return exc_info; + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; } #endif -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; } -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= + #if CYTHON_COMPILING_IN_LIMITED_API + PyType_GetFlags(Py_TYPE(key)); + #else + Py_TYPE(key)->tp_flags; + #endif + Py_INCREF(key); + Py_INCREF(value); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; + #else + PyTuple_SET_ITEM(kwnames, i, key); + #endif + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { + return vc(func, args, nargs, NULL); + } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif +} +static PyObject * +__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op) { - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C0000 - local_value = tstate->current_exception; - tstate->current_exception = 0; - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 - local_value = PyErr_GetRaisedException(); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; #else - PyErr_Fetch(&local_type, &local_value, &local_tb); + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } #endif -#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { + PyObject *result; + CYTHON_UNUSED_VAR(closure); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_doc_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + __Pyx_END_CRITICAL_SECTION(); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); #else - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif - goto bad; - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; + if (unlikely(op->func_name == NULL)) + return NULL; } -#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif + Py_INCREF(op->func_name); + return op->func_name; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + PyObject *result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_name_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL || !PyUnicode_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); + __Pyx_Py_XDECREF_SET(op->func_name, value); + __Pyx_END_CRITICAL_SECTION(); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(op); + Py_INCREF(op->func_qualname); + result = op->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL || !PyUnicode_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + __Pyx_END_CRITICAL_SECTION(); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + PyObject *result; + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_dict_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; } + Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + __Pyx_END_CRITICAL_SECTION(); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - PyErr_SetHandledException(local_value); - Py_XDECREF(local_value); - Py_XDECREF(local_type); - Py_XDECREF(local_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + __Pyx_END_CRITICAL_SECTION(); return 0; -#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -#endif } - -/* ObjectGetItem */ -#if CYTHON_USE_TYPE_SLOTS -static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { - PyObject *runerr = NULL; - Py_ssize_t key_value; - key_value = __Pyx_PyIndex_AsSsize_t(index); - if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); +static PyObject * +__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } } - if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); - PyErr_Clear(); - PyErr_Format(PyExc_IndexError, - "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); - __Pyx_DECREF_TypeName(index_type_name); + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = NULL; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_defaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; } - return NULL; + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + __Pyx_END_CRITICAL_SECTION(); + return 0; } -static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { - __Pyx_TypeName obj_type_name; - if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); - if (!meth) { - PyErr_Clear(); +static PyObject * +__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; } else { - PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); - Py_DECREF(meth); - return result; + result = Py_None; } } - obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return NULL; + Py_INCREF(result); + return result; } -static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { - PyTypeObject *tp = Py_TYPE(obj); - PyMappingMethods *mm = tp->tp_as_mapping; - PySequenceMethods *sm = tp->tp_as_sequence; - if (likely(mm && mm->mp_subscript)) { - return mm->mp_subscript(obj, key); +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_kwdefaults_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; } - if (likely(sm && sm->sq_item)) { - return __Pyx_PyObject_GetIndex(obj, key); + Py_XINCREF(value); + __Pyx_BEGIN_CRITICAL_SECTION(op); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + __Pyx_END_CRITICAL_SECTION(); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; } - return __Pyx_PyObject_GetItem_Slow(obj, key); + Py_INCREF(result); + return result; } -#endif - -/* PyLongBinop */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) { - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; + CYTHON_UNUSED_VAR(context); + __Pyx_BEGIN_CRITICAL_SECTION(op); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; } -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(inplace); - CYTHON_UNUSED_VAR(zerodivision_check); - const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; +static PyObject * +__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { + int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; + if (is_coroutine) { + PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } #endif - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - return __Pyx_NewRef(op2); - } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(is_coroutine_value)) { + return is_coroutine_value; } +ignore: + PyErr_Clear(); } - x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); - - -} -#endif -static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) { - CYTHON_UNUSED_VAR(zerodivision_check); - const long b = intval; - double a = __Pyx_PyFloat_AS_DOUBLE(float_val); - double result; - - result = ((double)a) + (double)b; - return PyFloat_FromDouble(result); + return __Pyx_PyBool_FromLong(is_coroutine); } -static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(zerodivision_check); - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check); +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + PyObject *result; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); } - #endif - if (PyFloat_CheckExact(op1)) { - return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check); + result = __Pyx_CyFunction_get_is_coroutine_value(op); + if (unlikely(!result)) + return NULL; + __Pyx_BEGIN_CRITICAL_SECTION(op); + if (op->func_is_coroutine) { + Py_DECREF(result); + result = __Pyx_NewRef(op->func_is_coroutine); + } else { + op->func_is_coroutine = __Pyx_NewRef(result); } - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); + __Pyx_END_CRITICAL_SECTION(); + return result; } +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); #endif - -/* SwapException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_value = exc_info->exc_value; - exc_info->exc_value = *value; - if (tmp_value == NULL || tmp_value == Py_None) { - Py_XDECREF(tmp_value); - tmp_value = NULL; - tmp_type = NULL; - tmp_tb = NULL; - } else { - tmp_type = (PyObject*) Py_TYPE(tmp_value); - Py_INCREF(tmp_type); - #if CYTHON_COMPILING_IN_CPYTHON - tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; - Py_XINCREF(tmp_tb); - #else - tmp_tb = PyException_GetTraceback(tmp_value); - #endif - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = *type; - exc_info->exc_value = *value; - exc_info->exc_traceback = *tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - #endif - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; } +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); #else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); - PyErr_SetExcInfo(*type, *value, *tb); - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); +#endif +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); } #endif - -/* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_1_2 -#define __PYX_HAVE_RT_ImportType_3_1_2 -static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size) +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { - PyObject *result = 0; - Py_ssize_t basicsize; - Py_ssize_t itemsize; + PyObject *result = NULL; + CYTHON_UNUSED_VAR(args); + __Pyx_BEGIN_CRITICAL_SECTION(m); + Py_INCREF(m->func_qualname); + result = m->func_qualname; + __Pyx_END_CRITICAL_SECTION(); + return result; +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; #if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - PyObject *py_itemsize; +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif - result = PyObject_GetAttrString(module, class_name); - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; - itemsize = ((PyTypeObject *)result)->tp_itemsize; + PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; #else - if (size == 0) { - return (PyTypeObject *)result; + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; } - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; - py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); - if (!py_itemsize) - goto bad; - itemsize = PyLong_AsSsize_t(py_itemsize); - Py_DECREF(py_itemsize); - py_itemsize = 0; - if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; #endif - if (itemsize) { - if (size % alignment) { - alignment = size % alignment; - } - if (itemsize < (Py_ssize_t)alignment) - itemsize = (Py_ssize_t)alignment; - } - if ((size_t)(basicsize + itemsize) < size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize+itemsize); - goto bad; - } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_2 && - ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd-%zd from PyObject", - module_name, class_name, size, basicsize, basicsize+itemsize); - goto bad; + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_2 && (size_t)basicsize > size) { - if (PyErr_WarnFormat(NULL, 0, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize) < 0) { - goto bad; - } +#endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + Py_CLEAR(m->defaults); + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; } - return (PyTypeObject *)result; -bad: - Py_XDECREF(result); - return NULL; + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + __Pyx_VISIT_CONST(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + Py_VISIT(m->defaults); + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ + PyObject *repr; + __Pyx_BEGIN_CRITICAL_SECTION(op); + repr = PyUnicode_FromFormat("", + op->func_qualname, (void *)op); + __Pyx_END_CRITICAL_SECTION(); + return repr; } +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; #endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - if (level == -1) { - const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); - if (package_sep != (0)) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_SIZE + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_SIZE + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; } + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); + return NULL; } - level = 0; - } - if (!module) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - return module; + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); + return NULL; } - -/* ImportDottedModule */ -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - Py_ssize_t size; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; #if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(parts_tuple); + argc = PyTuple_GET_SIZE(args); #else - size = PyTuple_Size(parts_tuple); - if (size < 0) goto bad; + argc = PyTuple_Size(args); + if (unlikely(argc < 0)) return NULL; #endif - if (likely(size == count)) { - partial_name = name; + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); + result = __Pyx_CyFunction_Call(func, args, kw); } - PyErr_Format( - PyExc_ModuleNotFoundError, - "No module named '%U'", partial_name); -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; + return result; } -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; #else - imported_module = PyImport_GetModule(name); + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif - return imported_module; + PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); + return NULL; + } + return meth(self, NULL); } -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; -#if CYTHON_ASSUME_SAFE_SIZE - nparts = PyTuple_GET_SIZE(parts_tuple); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; #else - nparts = PyTuple_Size(parts_tuple); - if (nparts < 0) return NULL; + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); + PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; #else - part = __Pyx_PySequence_ITEM(parts_tuple, i); - if (!part) return NULL; + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; #endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)cyfunc)->m_self; #endif - Py_DECREF(module); - module = submodule; + break; + default: + return NULL; } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + if (unlikely(nargs != 1)) { + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); + return NULL; } - return module; + return meth(self, args[0]); } -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif + break; + default: + return NULL; } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif - return __Pyx__ImportDottedModule(name, parts_tuple); + PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } - -/* ImportDottedModuleRelFirst */ -static PyObject *__Pyx_ImportDottedModuleRelFirst(PyObject *name, PyObject *parts_tuple) { - PyObject *module; - PyObject *from_list = NULL; - module = __Pyx_Import(name, from_list, -1); - Py_XDECREF(from_list); - if (module) { - if (parts_tuple) { - module = __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); - } - return module; +#endif +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif +#endif // CYTHON_METH_FASTCALL +#if PY_VERSION_HEX >= 0x030A0000 + Py_TPFLAGS_IMMUTABLETYPE | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +static int __pyx_CyFunction_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( + mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { + return -1; } - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + return 0; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); + if (unlikely(!m->defaults)) return NULL; - PyErr_Clear(); - return __Pyx_ImportDottedModule(name, parts_tuple); + return m->defaults; } - -/* ListPack */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { - va_list va; - PyObject *l = PyList_New(n); - va_start(va, n); - if (unlikely(!l)) goto end; - for (Py_ssize_t i=0; idefaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); } -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - const char* module_name_str = 0; - PyObject* module_name = 0; - PyObject* module_dot = 0; - PyObject* full_name = 0; - PyErr_Clear(); - module_name_str = PyModule_GetName(module); - 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__3); - if (unlikely(!module_dot)) { goto modbad; } - full_name = PyUnicode_Concat(module_dot, name); - if (unlikely(!full_name)) { goto modbad; } - #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - { - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - goto modbad; - value = PyObject_GetItem(modules, full_name); - } - #else - value = PyImport_GetModule(full_name); - #endif - modbad: - Py_XDECREF(full_name); - Py_XDECREF(module_dot); - Py_XDECREF(module_name); - } - if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, "cannot import name %S", name); +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); } - return value; + return op; } /* CLineInTraceback */ @@ -22687,7 +26127,7 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) result = name; name = NULL; } else { - result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__5); + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__6); } goto done; } @@ -23205,6 +26645,143 @@ static int __Pyx_ImportFunction_3_1_2(PyObject *module, const char *funcname, vo } #endif +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +static PyObject* __Pyx_PyCode_New( + const __Pyx_PyCode_New_function_description descr, + PyObject * const *varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; + PyObject *varnames_tuple = PyTuple_New(var_count); + if (unlikely(!varnames_tuple)) return NULL; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(varnames_tuple_dedup); + #endif + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL + && !CYTHON_COMPILING_IN_GRAAL) { + line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); + if (unlikely(!line_table_bytes)) goto done; + Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + ); +done: + Py_XDECREF(code_bytes); + Py_XDECREF(line_table_bytes); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(varnames_tuple_dedup); + #endif + Py_DECREF(varnames_tuple); + return code_obj; +} + /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { while (t->s) { diff --git a/pyreadstat/_readstat_writer.pyx b/pyreadstat/_readstat_writer.pyx index a730346..35d2a6f 100644 --- a/pyreadstat/_readstat_writer.pyx +++ b/pyreadstat/_readstat_writer.pyx @@ -991,3 +991,58 @@ cdef int run_write(df, object filename_path, dst_file_format file_format, str fi close_file(fd) return 0 + +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, + dict variable_value_labels=None, dict missing_ranges=None, dict variable_display_width=None, + dict variable_measure=None, + dict missing_user_values=None, + dict variable_format=None, + dict variable_alignment = None, + ): + + + cdef int file_format_version = 0 + cdef bint row_compression = 0 + + cdef dst_file_format writer_file_format + + if writer_format == "sav": + 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: + file_format_version = 3 + if row_compress: + row_compression = 1 + elif writer_format == "dta": + writer_file_format = FILE_FORMAT_DTA + if version == 15: + file_format_version = 119 + elif version == 14: + file_format_version = 118 + elif version == 13: + file_format_version = 117 + elif version == 12: + file_format_version = 115 + elif version in {10, 11}: + file_format_version = 114 + elif version in {8, 9}: + file_format_version = 113 + else: + raise PyreadstatError("Version not supported") + note = "" + elif writer_format == "xport": + writer_file_format = FILE_FORMAT_XPORT + file_format_version = version + elif writer_format == "por": + writer_file_format = FILE_FORMAT_POR + else: + 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) diff --git a/pyreadstat/_readstat_writer_pandas.pyx b/pyreadstat/_readstat_writer_pandas.pyx deleted file mode 100644 index d52f270..0000000 --- a/pyreadstat/_readstat_writer_pandas.pyx +++ /dev/null @@ -1,903 +0,0 @@ -# cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 -# ###cython: profile=True -# ############################################################################# -# Copyright 2018 Hoffmann-La Roche -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ############################################################################# -import os -import warnings -import sys - -import numpy as np -#cimport numpy as np -import pandas as pd -from pandas.api.types import is_datetime64_any_dtype, is_datetime64_ns_dtype -import datetime -import calendar -from datetime import timezone as _timezone -from libc.math cimport round, NAN - -from readstat_api cimport * -from _readstat_parser import ReadstatError, PyreadstatError -from _readstat_parser cimport check_exit_status - -cdef set int_types = {int, np.dtype('int32'), np.dtype('int16'), np.dtype('int8'), np.dtype('uint8'), np.dtype('uint16'), - np.int32, np.int16, np.int8, np.uint8, np.uint16} -cdef set int_mixed_types = {pd.Int8Dtype(), pd.Int16Dtype(), pd.Int32Dtype(), pd.UInt8Dtype(), pd.UInt16Dtype()} -cdef set float_types = {float, np.dtype('int64'), np.dtype('uint64'), np.dtype('uint32'), np.dtype('float'), - np.dtype('float32'), np.int64, np.uint64, np.uint32, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype(), - pd.Float64Dtype(), pd.Float32Dtype()} -cdef set numeric_types = int_types.union(float_types).union(int_mixed_types) -cdef set datetime_types = {datetime.datetime}#, np.datetime64, pd._libs.tslibs.timestamps.Timestamp, pd.DatetimeTZDtype, 'datetime64[ns, UTC]'} -cdef set nat_types = {datetime.datetime, np.datetime64, pd._libs.tslibs.timestamps.Timestamp, datetime.time, datetime.date} -cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64_NS, PYWRITER_DATETIME64_US} -cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME} -cdef dict pandas_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, - PYWRITER_DATETIME64_NS: READSTAT_TYPE_DOUBLE, PYWRITER_DATETIME64_US: READSTAT_TYPE_DOUBLE} - -cdef double spss_offset_secs = 12219379200 -cdef double sas_offset_secs = 315619200 -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)] + ["_"] -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 -cdef int dta_old_max_width = 128 -cdef int dta_111_max_width = 244 -cdef int dta_117_max_width = 2045 - - -cdef double convert_datetimelike_to_number(dst_file_format file_format, pywriter_variable_type curtype, object curval) except *: - """ - converts a datime like python/pandas object to a float - """ - - cdef double offset_days, tstamp - - if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: - offset_days = spss_offset_days - offset_secs = spss_offset_secs - else: - offset_days = sas_offset_days - offset_secs = sas_offset_secs - - if curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64_NS: - # get timestamp in seconds - if type(curval) == pd._libs.tslibs.timestamps.Timestamp: - curval = curval.asm8 - - 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()) - elif type(curval) == np.datetime64: - if curval.dtype.name == "datetime64[ns]": - tstamp = round(curval.astype(float)/1e9) - elif curval.dtype.name == "datetime64[us]": - tstamp = round(curval.astype(float)/1e6) - elif curval.dtype.name == "datetime64[ms]": - tstamp = round(curval.astype(float)/1e3) - - tstamp += offset_secs - if file_format == FILE_FORMAT_DTA: - # stata stores in milliseconds - tstamp *= 1000 - - elif curtype == PYWRITER_DATE: - 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: - # spss stores in seconds - tstamp *= 86400 - - 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 - if file_format == FILE_FORMAT_DTA: - # stata stores in milliseconds - tstamp *= 1000 - - return tstamp - -cdef char * get_datetimelike_format_for_readstat(dst_file_format file_format, pywriter_variable_type curtype): - """ - gives back a string with the format of the variable (according to the final application) to be used by readstat - """ - - if curtype == PYWRITER_DATE: - if file_format == FILE_FORMAT_DTA: - return "%td" - #elif file_format == FILE_FORMAT_SAV: - # return "DATE11" - else: - return "DATE" - elif curtype == PYWRITER_DATETIME or curtype == PYWRITER_DATETIME64_NS or curtype == PYWRITER_DATETIME64_US: - if file_format == FILE_FORMAT_DTA: - return "%tc" - #elif file_format == FILE_FORMAT_SAV: - # return "DATETIME20" - else: - return "DATETIME" - elif curtype == PYWRITER_TIME: - if file_format == FILE_FORMAT_DTA: - return "%tcHH:MM:SS" - else: - return "TIME" - else: - raise PyreadstatError("Unknown pywriter variable format") - - -cdef int get_pandas_str_series_max_length(object series, dict value_labels): - """ For a pandas string series get the max length of the strings. Assumes there is no NaN among the elements. - """ - values = series.values - cdef str val - cdef bytes temp - cdef int max_length = 1 - cdef int curlen - cdef list labels - for val in values: - temp = val.encode("utf-8") - curlen = len(temp) - if curlen > max_length: - max_length = curlen - if value_labels: - labels = list(value_labels.keys()) - for lab in labels: - curlen = len(str(lab)) - if curlen > max_length: - max_length = curlen - - return max_length - - -cdef int check_series_all_same_types(object series, object type_to_check): - """ - 1 if all elements in a series are of type type_to_check, 0 otherwise - """ - - values = series.values - for val in values: - if type(val) != type_to_check: - return 0 - return 1 - - -cdef list get_pandas_column_types(object df, dict missing_user_values, dict variable_value_labels, int dta_str_max_len): - """ - From a pandas data frame, get a list with tuples column types as first element, max_length as second and is_missing - as third. - max_lenght is the max length of a string or string representation of an object, 0 for numeric types. is_missing flags - wether the series has missing values (1) or not (0) - dta_str_max_len is the max length for a dta string, 0 if the file format is not dta - """ - - cdef int max_length - - cdef list types = df.dtypes.values.tolist() - cdef list columns = df.columns.values.tolist() - - cdef list result = list() - cdef int equal, is_missing - if variable_value_labels is None: - variable_value_labels = dict() - - for indx, (col_name, col_type) in enumerate(zip(columns, types)): - - max_length = 0 - curseries = df.iloc[:, indx] - curuser_missing = None - if missing_user_values: - curuser_missing = missing_user_values.get(col_name) - - # recover original type for categories - if type(col_type) is pd.core.dtypes.dtypes.CategoricalDtype: - col_type = np.asarray(curseries).dtype - if col_type in int_types: - result.append((PYWRITER_INTEGER, 0,0)) - elif col_type in float_types: - if np.any(pd.isna(curseries)): - result.append((PYWRITER_DOUBLE, 0, 1)) - else: - result.append((PYWRITER_DOUBLE, 0, 0)) - elif col_type == bool: - result.append((PYWRITER_LOGICAL, 0,0)) - # np.datetime64[ns] - elif is_datetime64_ns_dtype(df[col_name]): - if np.any(pd.isna(curseries)): - result.append((PYWRITER_DATETIME64_NS, 0,1)) - else: - result.append((PYWRITER_DATETIME64_NS, 0,0)) - elif col_type == np.dtype('= dta_str_max_len: - result.append((PYWRITER_DTA_STR_REF, max_length, 1)) - else: - result.append((PYWRITER_OBJECT, max_length, 1)) - continue - else: - if curuser_missing: - result.append((PYWRITER_DOUBLE, 0, 1)) - else: - result.append((PYWRITER_LOGICAL, 0, 1)) - continue - else: - if col_type in int_mixed_types: - result.append((PYWRITER_INTEGER, 0, 0)) - continue - curtype = type(curseries.iloc[0]) - equal = check_series_all_same_types(curseries, curtype) - #equal = curseries.apply(lambda x: type(x) == curtype) - #if not np.all(equal): - if not equal: - max_length = get_pandas_str_series_max_length(curseries.astype(str), variable_value_labels.get(col_name)) - if dta_str_max_len and max_length >= dta_str_max_len: - result.append((PYWRITER_DTA_STR_REF, max_length, 1)) - else: - result.append((PYWRITER_OBJECT, max_length, 0)) - continue - if curtype in int_types: - result.append((PYWRITER_INTEGER, 0, is_missing)) - elif curtype in float_types: - result.append((PYWRITER_DOUBLE, 0, is_missing)) - elif curtype == bool: - result.append((PYWRITER_LOGICAL, 0, is_missing)) - elif curtype == str: - if is_missing: - col = curseries.dropna().reset_index(drop=True) - max_length = get_pandas_str_series_max_length(col, variable_value_labels.get(col_name)) - max_length = max(1, max_length) - else: - max_length = get_pandas_str_series_max_length(curseries, variable_value_labels.get(col_name)) - if dta_str_max_len and max_length >= dta_str_max_len: - result.append((PYWRITER_DTA_STR_REF, max_length, is_missing)) - else: - result.append((PYWRITER_CHARACTER, max_length, is_missing)) - elif curtype == datetime.date: - result.append((PYWRITER_DATE, 0, is_missing)) - elif curtype == datetime.datetime: - result.append((PYWRITER_DATETIME, 0, is_missing)) - elif curtype == datetime.time: - result.append((PYWRITER_TIME, 0, is_missing)) - else: - curseries = curseries.astype(str) - if is_missing: - col = curseries.dropna().reset_index(drop=True) - max_length = get_pandas_str_series_max_length(col.astype(str), variable_value_labels.get(col_name)) - else: - max_length = get_pandas_str_series_max_length(curseries.astype(str), variable_value_labels.get(col_name)) - if dta_str_max_len and max_length >= dta_str_max_len: - result.append((PYWRITER_DTA_STR_REF, max_length, 1)) - else: - result.append((PYWRITER_OBJECT, max_length, is_missing)) - - else: - # generic object - max_length = get_pandas_str_series_max_length(curseries.astype(str), variable_value_labels.get(col_name)) - is_missing = 0 - if np.any(pd.isna(curseries)): - is_missing = 1 - if dta_str_max_len and max_length >= dta_str_max_len: - result.append((PYWRITER_DTA_STR_REF, max_length, 1)) - else: - result.append((PYWRITER_OBJECT, max_length, is_missing)) - return result - -cdef readstat_label_set_t *set_value_label(readstat_writer_t *writer, dict value_labels, str labelset_name, - pywriter_variable_type curpytype, dst_file_format file_format, str variable_name, - list user_missing_tags) except *: - """ - Sets value labels for normal values and also tagged missing values (user defined missing for stata and sas) - """ - - cdef readstat_label_set_t *label_set - cdef readstat_type_t curtype - cdef double double_val - - curtype = pandas_to_readstat_types[curpytype] - label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) - - 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) - - 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) - - readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) - continue - - - if curpytype == PYWRITER_DOUBLE: - if type(value) not in numeric_types: - 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: - 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")) - - 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")) - - 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")) - - elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME, PYWRITER_DATETIME64_NS, PYWRITER_DATETIME64_US): - 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 pandas 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")) - - return label_set - -cdef void add_missing_ranges(list cur_ranges, readstat_variable_t *variable, pywriter_variable_type vartype, str variablename) except *: - """ - Adding missing ranges, user defined missing discrete values both numeric and character, - this happens for SPSS - """ - - cdef int range_values = 0 - cdef int discrete_values = 0 - cdef int discrete_strings = 0 - - for cur_range in cur_ranges: - if isinstance(cur_range, dict): - hi = cur_range.get("hi") - 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" - raise PyreadstatError(msg) - if type(hi) in numeric_types and type(lo) in numeric_types: - 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: - check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) - discrete_values += 1 - else: - 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 - 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) - check_exit_status(readstat_variable_add_missing_string_value(variable, hi))#.encode("utf-8"))) - discrete_strings += 1 - 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" - raise PyreadstatError(msg) - else: - msg = "missing_ranges: hi and lo values must be both either of numeric or string type" - raise PyreadstatError(msg) - else: - if type(cur_range) in numeric_types: - 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)) - 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 - raise PyreadstatError(msg) - if len(cur_range) > 8: - 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: - msg = "missing_ranges: values must be both either of numeric or string type" - raise PyreadstatError(msg) - - if discrete_strings > 3: - msg = "missing_ranges: max 3 string values per variable allowed" - raise PyreadstatError(msg) - if range_values: - if range_values > 1: - msg = "missing_ranges: max 1 range value per variable allowed" - raise PyreadstatError(msg) - if discrete_values > 1: - msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" - raise PyreadstatError(msg) - if discrete_values >3: - msg = "missing_ranges: max 3 discrete numeric values per variable allowed" - raise PyreadstatError(msg) - -cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: - """ - Sets the variable alignment, ineffective on SPSS, STATA and XPORT (what about SAS7bdat?) - """ - - cdef readstat_alignment_t alignment - - if alignment_str == "right": - alignment = READSTAT_ALIGNMENT_RIGHT - elif alignment_str == "left": - alignment = READSTAT_ALIGNMENT_LEFT - elif alignment_str == "center": - alignment = READSTAT_ALIGNMENT_CENTER - elif alignment_str == "unknown": - 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) - raise PyreadstatError(msg) - - readstat_variable_set_alignment(variable, alignment) - -cdef void set_variable_display_width(readstat_variable_t *variable, int display_width, str var_name) except *: - """ - Sets the variable display width (SPSS). Not effective on STATA. (what about SAS7BDAT?) - """ - - readstat_variable_set_display_width(variable, display_width) - -cdef void set_variable_measure(readstat_variable_t *variable, str measure_str, str var_name) except *: - """ - sets the variable measure type (SPSS). Not effective on STATA. - """ - - cdef readstat_measure_t measure - - if measure_str == "nominal": - measure = READSTAT_MEASURE_NOMINAL - elif measure_str == "ordinal": - measure = READSTAT_MEASURE_ORDINAL - elif measure_str == "scale": - measure = READSTAT_MEASURE_SCALE - elif measure_str == "unknown": - 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) - raise PyreadstatError(msg) - - readstat_variable_set_measure(variable, measure); - - -cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx) noexcept: - """ - for the writer an explicit function to write must be defined - """ - cdef int fd - fd = (ctx)[0] - if os.name=='nt': - return _write(fd, data, _len) - else: - 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 - """ - - cdef char * err_readstat - cdef str err_message - if retcode != READSTAT_OK: - err_readstat = readstat_error_message(retcode) - err_message = err_readstat - raise ReadstatError(err_message) - -cdef int open_file(bytes filename_path): - - cdef int fd - cdef int flags - cdef Py_ssize_t length - - cdef bytes filename_bytes - cdef char *path - - if os.name == "nt": - filename_str = os.fsdecode(filename_path) - u16_path = PyUnicode_AsWideCharString(filename_str, &length) - flags = _O_WRONLY | _O_CREAT | _O_BINARY | _O_TRUNC - fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) - else: - #filename_bytes = filename_path.encode("utf-8") - path = filename_path - flags = O_WRONLY | O_CREAT | O_TRUNC - fd = open(path, flags, 0644) - - return fd - -cdef int close_file(int fd): - if os.name == "nt": - return _close(fd) - else: - return close(fd) - -cdef int run_write(df, object filename_path, dst_file_format file_format, str file_label, object column_labels, - int file_format_version, str note, str table_name, dict variable_value_labels, - dict missing_ranges, dict missing_user_values, dict variable_alignment, - dict variable_display_width, dict variable_measure, dict variable_format, bint row_compression) except *: - """ - main entry point for writing all formats. Some parameters are specific for certain file type - and are even incompatible between them. This function relies on the caller to select the right - combination of parameters, not checking them otherwise. - """ - - if not isinstance(df, pd.DataFrame): - raise PyreadstatError("first argument must be a pandas data frame") - - 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) - - if missing_user_values: - 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: - valid_user_missing = valid_user_missing_sas - 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" - 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) - - cdef readstat_error_t retcode - cdef char *err_readstat - cdef str err_message - - cdef readstat_writer_t *writer - - cdef bytes file_label_bytes - cdef char *file_labl - cdef int dta_str_max_len = 0 - - cdef list col_names = df.columns.values.tolist() - if len(col_names) != len(set(col_names)): - msg = "Non unique column names detected in the dataframe!" - raise PyreadstatError(msg) - - for variable_name in col_names: - if type(variable_name) != str: - 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 " " in variable_name: - raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) - - if file_format == FILE_FORMAT_POR: - col_names = [x.upper() for x in col_names] - - if file_format == FILE_FORMAT_DTA: - if file_format_version >= 117: - dta_str_max_len = dta_117_max_width - elif file_format_version >= 111: - dta_str_max_len = dta_111_max_width - else: - dta_str_max_len = dta_old_max_width - - cdef list col_types = get_pandas_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)} - - cdef readstat_variable_t *variable - cdef pywriter_variable_type curtype - cdef int max_length - cdef char *curformat - cdef str tempformat - cdef int col_indx - cdef bytes cur_col_label - cdef int col_label_count = 0 - - cdef readstat_variable_t *tempvar - cdef int row_indx - cdef str curvalstr - cdef double dtimelikeval - #cdef np.ndarray values - cdef object values - cdef dict value_labels - cdef int lblset_cnt = 0 - cdef readstat_label_set_t *label_set - cdef list col_label_temp - cdef bint hasdatetime64 - cdef list pywriter_types - cdef object df2 - cdef float mulfac, conv2secs - cdef readstat_string_ref_t* strref - cdef dict strref_map = dict() - cdef int strref_cnt - cdef object strref_indx - - if hasattr(os, 'fsencode'): - try: - filename_path = os.fsencode(filename_path) - except UnicodeError: - warnings.warn("file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly." % sys.getfilesystemencoding()) - filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") - else: - if type(filename_path) == str: - filename_bytes = filename_path.encode('utf-8') - elif type(filename_path) == bytes: - filename_bytes = filename_path - else: - raise PyreadstatError("path must be either str or bytes") - - filename_path = os.path.expanduser(filename_path) - dirname = os.path.dirname(filename_path) - if dirname and not os.path.isdir(dirname): - raise PyreadstatError(f"the destination folder {dirname} does not exist!") - - cdef int fd = open_file(filename_path) - writer = readstat_writer_init() - - try: - - check_exit_status(readstat_set_data_writer(writer, write_bytes)) - - if file_label: - file_label_bytes = file_label.encode("utf-8") - file_labl = file_label_bytes - check_exit_status(readstat_writer_set_file_label(writer, file_labl)) - - if note: - readstat_add_note(writer, note.encode("utf-8")) - - if file_format_version > -1: - check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) - - if row_compression: - check_exit_status(readstat_writer_set_compression(writer, READSTAT_COMPRESS_ROWS)) - - # table name is used only for xpt files - if table_name: - table_name_bytes = table_name.encode("utf-8") - tab_name = table_name_bytes - check_exit_status(readstat_writer_set_table_name(writer, tab_name)) - - # 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: - col_label_temp = list() - 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: - col_label_temp.append(None) - 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") - - strref_cnt = 0 - for col_indx in range(col_count): - curtype, max_length, _ = col_types[col_indx] - variable_name = col_names[col_indx] - variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) - if variable_format: - tempformat = variable_format.get(variable_name) - 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) - # 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) - strref = readstat_add_string_ref(writer, curvalstr.encode("utf-8")) - strref_map[curvalstr] = strref_cnt - strref_cnt += 1 - 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") - readstat_variable_set_label(variable, cur_col_label) - 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 - 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, - col_names_to_types[variable_name], file_format, variable_name, curuser_missing) - readstat_variable_set_label_set(variable, label_set) - if missing_ranges: - cur_ranges = missing_ranges.get(variable_name) - if cur_ranges: - 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: - # 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) - 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: - set_variable_display_width(variable, cur_display_width, variable_name) - if variable_measure: - cur_measure = variable_measure.get(variable_name) - if cur_measure: - set_variable_measure(variable, cur_measure, variable_name) - - # 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)) - 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)) - 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)) - else: - raise PyreadstatError("unknown file format") - - # validation - check_exit_status(readstat_validate_metadata(writer)) - 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 - pywriter_types = [x[0] for x in col_types] - hasdatetime64 = PYWRITER_DATETIME64_NS in pywriter_types or PYWRITER_DATETIME64_US in pywriter_types - if hasdatetime64: - if file_format == FILE_FORMAT_SAV or file_format == FILE_FORMAT_POR: - offset_secs = spss_offset_secs - else: - offset_secs = sas_offset_secs - mulfac = 1.0 - if file_format == FILE_FORMAT_DTA: - # stata stores in milliseconds - mulfac = 1000.0 - df2 = df.copy() - for col_indx in range(col_count): - if pywriter_types[col_indx] == PYWRITER_DATETIME64_NS: - df2[df2.columns[col_indx]] = (np.round(df2.iloc[:, col_indx].values.astype(object).astype(np.float64)/1e9) + offset_secs) * mulfac - #df2.iloc[:, col_indx] = (np.round(df2.iloc[:, col_indx].values.astype(object).astype(np.float64)/1e9) + offset_secs) * mulfac - elif pywriter_types[col_indx] == PYWRITER_DATETIME64_US: - df2[df2.columns[col_indx]] = (np.round(df2.iloc[:, col_indx].values.astype(np.float64)/1e6) + offset_secs) * mulfac - df2.loc[df2[df2.columns[col_indx]]==-9223056417655, df2.columns[col_indx]] = np.nan - - else: - df2 = df - - # inserting - rowcnt = 0 - - for row in df2.values: - check_exit_status(readstat_begin_row(writer)) - - for col_indx in range(col_count): - - 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 - if missing_user_values: - curuser_missing = missing_user_values.get(col_names[col_indx]) - - if is_missing: - #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): - if pd.isna(curval): - check_exit_status(readstat_insert_missing_value(writer, tempvar)) - 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))) - continue - - 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: - 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) - 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) - check_exit_status(readstat_insert_string_ref(writer, tempvar, strref)) - elif curtype == PYWRITER_DATETIME64_NS or curtype == PYWRITER_DATETIME64_US: - 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: - raise PyreadstatError("Unknown data format to insert") - - check_exit_status(readstat_end_row(writer)) - rowcnt += 1 - - check_exit_status(readstat_end_writing(writer)) - - except: - raise - finally: - readstat_writer_free(writer) - close_file(fd) - - return 0 diff --git a/pyreadstat/pyreadstat.c b/pyreadstat/pyreadstat.c deleted file mode 100644 index 8887f11..0000000 --- a/pyreadstat/pyreadstat.c +++ /dev/null @@ -1,21836 +0,0 @@ -/* Generated by Cython 3.1.2 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "pyreadstat/conditional_includes.h", - "src/readstat.h", - "src/readstat_io_unistd.h" - ], - "extra_compile_args": [ - "-Ireadstat", - "-DHAVE_ZLIB=1" - ], - "include_dirs": [ - "pyreadstat", - "src", - "src/sas", - "src/spss", - "src/stata", - "." - ], - "libraries": [ - "m", - "z", - "iconv" - ], - "name": "pyreadstat.pyreadstat", - "sources": [ - "pyreadstat/pyreadstat.pyx", - "./src/CKHashTable.c", - "./src/readstat_bits.c", - "./src/readstat_convert.c", - "./src/readstat_error.c", - "./src/readstat_io_unistd.c", - "./src/readstat_malloc.c", - "./src/readstat_metadata.c", - "./src/readstat_parser.c", - "./src/readstat_value.c", - "./src/readstat_variable.c", - "./src/readstat_writer.c", - "./src/sas/ieee.c", - "./src/sas/readstat_sas.c", - "./src/sas/readstat_sas7bcat_read.c", - "./src/sas/readstat_sas7bcat_write.c", - "./src/sas/readstat_sas7bdat_read.c", - "./src/sas/readstat_sas7bdat_write.c", - "./src/sas/readstat_sas_rle.c", - "./src/sas/readstat_xport.c", - "./src/sas/readstat_xport_parse_format.c", - "./src/sas/readstat_xport_read.c", - "./src/sas/readstat_xport_write.c", - "./src/spss/readstat_por.c", - "./src/spss/readstat_por_parse.c", - "./src/spss/readstat_por_read.c", - "./src/spss/readstat_por_write.c", - "./src/spss/readstat_sav.c", - "./src/spss/readstat_sav_compress.c", - "./src/spss/readstat_sav_parse.c", - "./src/spss/readstat_sav_parse_mr_name.c", - "./src/spss/readstat_sav_parse_timestamp.c", - "./src/spss/readstat_sav_read.c", - "./src/spss/readstat_sav_write.c", - "./src/spss/readstat_spss.c", - "./src/spss/readstat_spss_parse.c", - "./src/spss/readstat_zsav_compress.c", - "./src/spss/readstat_zsav_read.c", - "./src/spss/readstat_zsav_write.c", - "./src/stata/readstat_dta.c", - "./src/stata/readstat_dta_parse_timestamp.c", - "./src/stata/readstat_dta_read.c", - "./src/stata/readstat_dta_write.c" - ] - }, - "module_name": "pyreadstat.pyreadstat" -} -END: Cython Metadata */ - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ -/* InitLimitedAPI */ -#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) - #define CYTHON_LIMITED_API 1 -#endif - -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x03080000 - #error Cython requires Python 3.8+. -#else -#define __PYX_ABI_VERSION "3_1_2" -#define CYTHON_HEX_VERSION 0x030102F0 -#define CYTHON_FUTURE_DIVISION 0 -/* CModulePreamble */ -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX -#if defined(GRAALVM_PYTHON) - /* For very preliminary testing purposes. Most variables are set the same as PyPy. - The existence of this section does not imply that anything works or is even tested */ - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_ASSUME_SAFE_SIZE - #define CYTHON_ASSUME_SAFE_SIZE 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_SYS_MONITORING - #define CYTHON_USE_SYS_MONITORING 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #undef CYTHON_USE_AM_SEND - #define CYTHON_USE_AM_SEND 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 1 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(PYPY_VERSION) - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #undef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 1 - #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #ifndef CYTHON_ASSUME_SAFE_SIZE - #define CYTHON_ASSUME_SAFE_SIZE 1 - #endif - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #if PY_VERSION_HEX < 0x03090000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_SYS_MONITORING - #define CYTHON_USE_SYS_MONITORING 0 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) - #endif - #undef CYTHON_USE_AM_SEND - #define CYTHON_USE_AM_SEND 0 - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(CYTHON_LIMITED_API) - #ifdef Py_LIMITED_API - #undef __PYX_LIMITED_VERSION_HEX - #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API - #endif - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 1 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 - #undef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 1 - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #undef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #endif - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 - #endif - #undef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 0 - #undef CYTHON_ASSUME_SAFE_SIZE - #define CYTHON_ASSUME_SAFE_SIZE 0 - #undef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 0 - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #undef CYTHON_USE_SYS_MONITORING - #define CYTHON_USE_SYS_MONITORING 0 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #ifndef CYTHON_USE_AM_SEND - #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #ifdef Py_GIL_DISABLED - #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 - #else - #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #endif - #if PY_VERSION_HEX < 0x030A0000 - #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #elif !defined(CYTHON_USE_TYPE_SLOTS) - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #ifndef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 1 - #endif - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLIST_INTERNALS) - #define CYTHON_USE_PYLIST_INTERNALS 1 - #endif - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #elif !defined(CYTHON_USE_UNICODE_WRITER) - #define CYTHON_USE_UNICODE_WRITER 1 - #endif - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 - #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_ASSUME_SAFE_SIZE - #define CYTHON_ASSUME_SAFE_SIZE 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #ifndef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 1 - #endif - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #elif !defined(CYTHON_FAST_GIL) - #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) - #endif - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif - #ifndef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 1 - #endif - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #ifndef CYTHON_USE_SYS_MONITORING - #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #ifndef CYTHON_USE_AM_SEND - #define CYTHON_USE_AM_SEND 1 - #endif - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) - #endif - #ifndef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 1 - #endif - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) - #endif -#endif -#ifndef CYTHON_FAST_PYCCALL -#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL -#endif -#ifndef CYTHON_VECTORCALL -#if CYTHON_COMPILING_IN_LIMITED_API -#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) -#else -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) -#endif -#endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) -#if CYTHON_USE_PYLONG_INTERNALS - #undef SHIFT - #undef BASE - #undef MASK - #ifdef SIZEOF_VOID_P - enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; - #endif -#endif -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif -#ifndef __has_cpp_attribute - #define __has_cpp_attribute(x) 0 -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifndef CYTHON_UNUSED - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(maybe_unused) - #define CYTHON_UNUSED [[maybe_unused]] - #endif - #endif - #endif -#endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_UNUSED_VAR -# if defined(__cplusplus) - template void CYTHON_UNUSED_VAR( const T& ) { } -# else -# define CYTHON_UNUSED_VAR(x) (void)(x) -# endif -#endif -#ifndef CYTHON_MAYBE_UNUSED_VAR - #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_USE_CPP_STD_MOVE - #if defined(__cplusplus) && (\ - __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) - #define CYTHON_USE_CPP_STD_MOVE 1 - #else - #define CYTHON_USE_CPP_STD_MOVE 0 - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif -#ifndef CYTHON_FALLTHROUGH - #if defined(__cplusplus) - /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 - * but leads to warnings with -pedantic, since it is a C++17 feature */ - #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) - #if __has_cpp_attribute(fallthrough) - #define CYTHON_FALLTHROUGH [[fallthrough]] - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_cpp_attribute(clang::fallthrough) - #define CYTHON_FALLTHROUGH [[clang::fallthrough]] - #elif __has_cpp_attribute(gnu::fallthrough) - #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] - #endif - #endif - #endif - #ifndef CYTHON_FALLTHROUGH - #if __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #else - #define CYTHON_FALLTHROUGH - #endif - #endif - #if defined(__clang__) && defined(__apple_build_version__) - #if __apple_build_version__ < 7000000 - #undef CYTHON_FALLTHROUGH - #define CYTHON_FALLTHROUGH - #endif - #endif -#endif -#ifndef Py_UNREACHABLE - #define Py_UNREACHABLE() assert(0); abort() -#endif -#ifdef __cplusplus - template - struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; - #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) -#else - #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) -#endif -#if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) -#else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) -#endif -#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) - -/* CInitCode */ -#ifndef CYTHON_INLINE - #if defined(__clang__) - #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) - #elif defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -/* PythonCompatibility */ -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#define __Pyx_BUILTIN_MODULE_NAME "builtins" -#define __Pyx_DefaultClassType PyType_Type -#if CYTHON_COMPILING_IN_LIMITED_API - #ifndef CO_OPTIMIZED - static int CO_OPTIMIZED; - #endif - #ifndef CO_NEWLOCALS - static int CO_NEWLOCALS; - #endif - #ifndef CO_VARARGS - static int CO_VARARGS; - #endif - #ifndef CO_VARKEYWORDS - static int CO_VARKEYWORDS; - #endif - #ifndef CO_ASYNC_GENERATOR - static int CO_ASYNC_GENERATOR; - #endif - #ifndef CO_GENERATOR - static int CO_GENERATOR; - #endif - #ifndef CO_COROUTINE - static int CO_COROUTINE; - #endif -#else - #ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 - #endif - #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 - #endif -#endif -static int __Pyx_init_co_variables(void); -#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) - #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) -#else - #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) - #define __Pyx_Py_Is(x, y) Py_Is(x, y) -#else - #define __Pyx_Py_Is(x, y) ((x) == (y)) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) - #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) -#else - #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) - #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) -#else - #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) -#endif -#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) - #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) -#else - #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) -#endif -#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) -#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) -#else - #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#ifndef Py_TPFLAGS_SEQUENCE - #define Py_TPFLAGS_SEQUENCE 0 -#endif -#ifndef Py_TPFLAGS_MAPPING - #define Py_TPFLAGS_MAPPING 0 -#endif -#ifndef METH_STACKLESS - #define METH_STACKLESS 0 -#endif -#ifndef METH_FASTCALL - #ifndef METH_FASTCALL - #define METH_FASTCALL 0x80 - #endif - typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); - typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, - Py_ssize_t nargs, PyObject *kwnames); -#else - #if PY_VERSION_HEX >= 0x030d00A4 - # define __Pyx_PyCFunctionFast PyCFunctionFast - # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords - #else - # define __Pyx_PyCFunctionFast _PyCFunctionFast - # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords - #endif -#endif -#if CYTHON_METH_FASTCALL - #define __Pyx_METH_FASTCALL METH_FASTCALL - #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast - #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords -#else - #define __Pyx_METH_FASTCALL METH_VARARGS - #define __Pyx_PyCFunction_FastCall PyCFunction - #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords -#endif -#if CYTHON_VECTORCALL - #define __pyx_vectorcallfunc vectorcallfunc - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET - #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) -#else - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) -#endif -#if PY_VERSION_HEX >= 0x030900B1 -#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) -#else -#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) -#endif -#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) -#elif !CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) -#endif -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) -static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { - return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; -} -#endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { -#if CYTHON_COMPILING_IN_LIMITED_API - return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; -#else - return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; -#endif -} -#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x03090000 - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) - typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); -#else - #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) - #define __Pyx_PyCMethod PyCMethod -#endif -#ifndef METH_METHOD - #define METH_METHOD 0x200 -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) -#elif CYTHON_COMPILING_IN_GRAAL - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) -#else - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) - #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyThreadState_Current PyThreadState_Get() -#elif !CYTHON_FAST_THREAD_STATE - #define __Pyx_PyThreadState_Current PyThreadState_GET() -#elif PY_VERSION_HEX >= 0x030d00A1 - #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#else - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#endif -#if CYTHON_USE_MODULE_STATE -static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) -{ - void *result; - result = PyModule_GetState(op); - if (!result) - Py_FatalError("Couldn't find the module state"); - return result; -} -#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) -#else -#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) -#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) -#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) -#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) - #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) - #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) - #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) -#else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) - #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ - ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ - (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ - __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) - #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) - #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) -#endif -#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) -#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) -#else -#define __Pyx_PyDict_NewPresized(n) PyDict_New() -#endif -#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS -#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { - PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); - if (res == NULL) PyErr_Clear(); - return res; -} -#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 -#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#else -static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { -#if CYTHON_COMPILING_IN_PYPY - return PyDict_GetItem(dict, name); -#else - PyDictEntry *ep; - PyDictObject *mp = (PyDictObject*) dict; - long hash = ((PyStringObject *) name)->ob_shash; - assert(hash != -1); - ep = (mp->ma_lookup)(mp, name, hash); - if (ep == NULL) { - return NULL; - } - return ep->me_value; -#endif -} -#define __Pyx_PyDict_GetItemStr PyDict_GetItem -#endif -#if CYTHON_USE_TYPE_SLOTS - #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) - #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) -#else - #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) - #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) -#endif -#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 -#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE((PyObject*)obj);\ - assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ - PyObject_GC_Del(obj);\ - Py_DECREF(type);\ -} -#else -#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) - #define __Pyx_PyUnicode_DATA(u) ((void*)u) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#else - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_READY(op) (0) - #else - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #endif - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) - #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) - #if PY_VERSION_HEX >= 0x030C0000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) - #else - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #endif -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #if !defined(PyUnicode_DecodeUnicodeEscape) - #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) - #endif - #if !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) - #endif - #if !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) - #endif - #if !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) - #endif -#endif -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if CYTHON_COMPILING_IN_CPYTHON - #define __Pyx_PySequence_ListKeepNew(obj)\ - (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) -#else - #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) -#endif -#if PY_VERSION_HEX >= 0x030900A4 - #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) -#else - #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) - #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) -#endif -#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) - #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) - #else - #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) - #endif -#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) - #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) - #endif -#else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) -#endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 -#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) -#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS -static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { - *result = PyObject_GetItem(dict, key); - if (*result == NULL) { - if (PyErr_ExceptionMatches(PyExc_KeyError)) { - PyErr_Clear(); - return 0; - } - return -1; - } - return 1; -} -#else -static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { - *result = PyDict_GetItemWithError(dict, key); - if (*result == NULL) { - return PyErr_Occurred() ? -1 : 0; - } - Py_INCREF(*result); - return 1; -} -#endif -#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST - #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) -#else - #define __Pyx_VISIT_CONST(obj) -#endif -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) - #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) - #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) - #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) -#else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) - #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) -#endif -#if CYTHON_ASSUME_SAFE_SIZE - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) - #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) -#else - #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) - #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) - #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) - #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) - #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) - #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) -#endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) -#endif -#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t -#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t -#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 - #define __Pyx_PySendResult PySendResult -#else - typedef enum { - PYGEN_RETURN = 0, - PYGEN_ERROR = -1, - PYGEN_NEXT = 1, - } __Pyx_PySendResult; -#endif -#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 - typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); -#else - #define __Pyx_pyiter_sendfunc sendfunc -#endif -#if !CYTHON_USE_AM_SEND -#define __PYX_HAS_PY_AM_SEND 0 -#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 -#define __PYX_HAS_PY_AM_SEND 1 -#else -#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation -#endif -#if __PYX_HAS_PY_AM_SEND < 2 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#else - typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; - __Pyx_pyiter_sendfunc am_send; - } __Pyx_PyAsyncMethodsStruct; - #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) -#endif -#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 - #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) -#else - #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) -#endif -#if PY_VERSION_HEX >= 0x03090000 -#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() -#else -#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp -#endif -#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 -#ifdef __cplusplus -extern "C" -#endif -PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { - int value; - PyObject *py_value = PyObject_GetAttrString(inspect, name); - if (!py_value) return 0; - value = (int) PyLong_AsLong(py_value); - Py_DECREF(py_value); - *write_to = value; - return value != -1 || !PyErr_Occurred(); -} -static int __Pyx_init_co_variables(void) { - PyObject *inspect; - int result; - inspect = PyImport_ImportModule("inspect"); - result = -#if !defined(CO_OPTIMIZED) - __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && -#endif -#if !defined(CO_NEWLOCALS) - __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && -#endif -#if !defined(CO_VARARGS) - __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && -#endif -#if !defined(CO_VARKEYWORDS) - __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && -#endif -#if !defined(CO_ASYNC_GENERATOR) - __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && -#endif -#if !defined(CO_GENERATOR) - __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && -#endif -#if !defined(CO_COROUTINE) - __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && -#endif - 1; - Py_DECREF(inspect); - return result ? 0 : -1; -} -#else -static int __Pyx_init_co_variables(void) { - return 0; // It's a limited API-only feature -} -#endif - -/* MathInitCode */ -#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #ifndef _USE_MATH_DEFINES - #define _USE_MATH_DEFINES - #endif -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - -#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME -#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 -#endif -#ifndef CYTHON_CLINE_IN_TRACEBACK -#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME -#endif -#if CYTHON_CLINE_IN_TRACEBACK -#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } -#else -#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } -#endif -#define __PYX_ERR(f_index, lineno, Ln_error) \ - { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } - -#ifdef CYTHON_EXTERN_C - #undef __PYX_EXTERN_C - #define __PYX_EXTERN_C CYTHON_EXTERN_C -#elif defined(__PYX_EXTERN_C) - #ifdef _MSC_VER - #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") - #else - #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. - #endif -#else - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__pyreadstat__pyreadstat -#define __PYX_HAVE_API__pyreadstat__pyreadstat -/* Early includes */ -#include -#include -#include -#include "readstat.h" -#include "readstat_io_unistd.h" -#include "conditional_includes.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 1 -#define __Pyx_PyObject_FromString __Pyx_PyUnicode_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { - return (size_t) i < (size_t) limit; -} -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) - #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) - #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) - #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) - #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) - #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) - #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) - #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) -#else - #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) - #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) - #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) - #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) - #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) - #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) - #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) -#endif -#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) - return Py_NewRef(obj); -#else - Py_INCREF(obj); - return obj; -#endif -} -static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) - return Py_XNewRef(obj); -#else - Py_XINCREF(obj); - return obj; -#endif -} -static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); -#define __Pyx_PySequence_Tuple(obj)\ - (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); -#if CYTHON_ASSUME_SAFE_MACROS -#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) -#else -#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) -#endif -#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#if CYTHON_USE_PYLONG_INTERNALS - #if PY_VERSION_HEX >= 0x030C00A7 - #ifndef _PyLong_SIGN_MASK - #define _PyLong_SIGN_MASK 3 - #endif - #ifndef _PyLong_NON_SIZE_BITS - #define _PyLong_NON_SIZE_BITS 3 - #endif - #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) - #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) - #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) - #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) - #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_SignedDigitCount(x)\ - ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) - #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) - #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) - #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) - #else - #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) - #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) - #endif - typedef Py_ssize_t __Pyx_compact_pylong; - typedef size_t __Pyx_compact_upylong; - #else - #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) - #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) - #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) - #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) - #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) - #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) - #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) - #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) - #define __Pyx_PyLong_CompactValue(x)\ - ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) - typedef sdigit __Pyx_compact_pylong; - typedef digit __Pyx_compact_upylong; - #endif - #if PY_VERSION_HEX >= 0x030C00A5 - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) - #else - #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) - #endif -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 - #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) -#else - #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ -/* PretendToInitialize */ -#ifdef __cplusplus -#if __cplusplus > 201103L -#include -#endif -template -static void __Pyx_pretend_to_initialize(T* ptr) { -#if __cplusplus > 201103L - if ((std::is_trivially_default_constructible::value)) -#endif - *ptr = T(); - (void)ptr; -} -#else -static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } -#endif - - -#if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_m = NULL; -#endif -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * const __pyx_cfilenm = __FILE__; -static const char *__pyx_filename; - -/* #### Code section: filename_table ### */ - -static const char* const __pyx_f[] = { - "pyreadstat/pyreadstat.pyx", - "pyreadstat/_readstat_parser.pxd", -}; -/* #### Code section: utility_code_proto_before_types ### */ -/* Atomics.proto */ -#include -#ifndef CYTHON_ATOMICS - #define CYTHON_ATOMICS 1 -#endif -#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS -#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING -#define __pyx_atomic_int_type int -#define __pyx_nonatomic_int_type int -#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ - (__STDC_VERSION__ >= 201112L) &&\ - !defined(__STDC_NO_ATOMICS__)) - #include -#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ - (__cplusplus >= 201103L) ||\ - (defined(_MSC_VER) && _MSC_VER >= 1700))) - #include -#endif -#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ - (__STDC_VERSION__ >= 201112L) &&\ - !defined(__STDC_NO_ATOMICS__) &&\ - ATOMIC_INT_LOCK_FREE == 2) - #undef __pyx_atomic_int_type - #define __pyx_atomic_int_type atomic_int - #define __pyx_atomic_ptr_type atomic_uintptr_t - #define __pyx_nonatomic_ptr_type uintptr_t - #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) - #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) - #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) - #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) - #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) - #define __pyx_atomic_load(value) atomic_load(value) - #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) - #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) - #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) - #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) - #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) - #pragma message ("Using standard C atomics") - #elif defined(__PYX_DEBUG_ATOMICS) - #warning "Using standard C atomics" - #endif -#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ - (__cplusplus >= 201103L) ||\ -\ - (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ - ATOMIC_INT_LOCK_FREE == 2) - #undef __pyx_atomic_int_type - #define __pyx_atomic_int_type std::atomic_int - #define __pyx_atomic_ptr_type std::atomic_uintptr_t - #define __pyx_nonatomic_ptr_type uintptr_t - #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) - #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) - #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) - #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) - #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) - #define __pyx_atomic_load(value) std::atomic_load(value) - #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) - #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) - #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) - #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) - #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) - #pragma message ("Using standard C++ atomics") - #elif defined(__PYX_DEBUG_ATOMICS) - #warning "Using standard C++ atomics" - #endif -#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ - (__GNUC_MINOR__ > 1 ||\ - (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) - #define __pyx_atomic_ptr_type void* - #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) - #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) - #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) - #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) - static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { - __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); - int result = old == *expected; - *expected = old; - return result; - } - #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) - #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) - #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) - #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) - #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) - #ifdef __PYX_DEBUG_ATOMICS - #warning "Using GNU atomics" - #endif -#elif CYTHON_ATOMICS && defined(_MSC_VER) - #include - #undef __pyx_atomic_int_type - #define __pyx_atomic_int_type long - #define __pyx_atomic_ptr_type void* - #undef __pyx_nonatomic_int_type - #define __pyx_nonatomic_int_type long - #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) - #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) - #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) - #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) - #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) - static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { - __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); - int result = old == *expected; - *expected = old; - return result; - } - #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) - #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) - #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value - #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) - #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) - #ifdef __PYX_DEBUG_ATOMICS - #pragma message ("Using MSVC atomics") - #endif -#else - #undef CYTHON_ATOMICS - #define CYTHON_ATOMICS 0 - #ifdef __PYX_DEBUG_ATOMICS - #warning "Not using atomics" - #endif -#endif -#if CYTHON_ATOMICS - #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) -#else - #define __pyx_add_acquisition_count(memview)\ - __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) -#endif - -/* IncludeStructmemberH.proto */ -#include - -/* CriticalSections.proto */ -#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING -#define __Pyx_PyCriticalSection void* -#define __Pyx_PyCriticalSection2 void* -#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs -#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs -#define __Pyx_PyCriticalSection_End1(cs) -#define __Pyx_PyCriticalSection_End2(cs) -#else -#define __Pyx_PyCriticalSection PyCriticalSection -#define __Pyx_PyCriticalSection2 PyCriticalSection2 -#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin -#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin -#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End -#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End -#endif -#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_BEGIN_CRITICAL_SECTION(o) { -#define __Pyx_END_CRITICAL_SECTION() } -#else -#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION -#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION -#endif - -/* #### Code section: numeric_typedefs ### */ -/* #### Code section: complex_type_declarations ### */ -/* #### Code section: type_declarations ### */ - -/*--- Type declarations ---*/ -struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container; -struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks; - -/* "_readstat_parser.pxd":22 - * - * # Definitions of enum types - * ctypedef enum py_file_extension: # <<<<<<<<<<<<<< - * FILE_EXT_SAV - * FILE_EXT_SAS7BDAT -*/ -enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension { - __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV, - __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT, - __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA, - __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT, - __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR, - __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT -}; -typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension; - -/* "_readstat_parser.pxd":30 - * FILE_EXT_SAS7BCAT - * - * ctypedef enum py_file_format: # <<<<<<<<<<<<<< - * FILE_FORMAT_SAS - * FILE_FORMAT_SPSS -*/ -enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_format { - __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS, - __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS, - __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA -}; -typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_t_10pyreadstat_16_readstat_parser_py_file_format; - -/* "_readstat_parser.pxd":35 - * FILE_FORMAT_STATA - * - * ctypedef enum py_datetime_format: # <<<<<<<<<<<<<< - * DATE_FORMAT_NOTADATE - * DATE_FORMAT_DATE -*/ -enum __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format { - __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_NOTADATE, - __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE, - __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME, - __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME -}; -typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format; - -/* "_readstat_parser.pxd":41 - * DATE_FORMAT_TIME - * - * ctypedef enum py_variable_format: # <<<<<<<<<<<<<< - * VAR_FORMAT_STRING - * VAR_FORMAT_LONG -*/ -enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { - __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING, - __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG, - __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT, - __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_MISSING -}; -typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; - -/* "_readstat_writer.pxd":56 - * ssize_t write(int fd, const void *buf, size_t nbyte) - * - * ctypedef enum dst_file_format: # <<<<<<<<<<<<<< - * FILE_FORMAT_SAS7BDAT - * FILE_FORMAT_SAS7BCAT -*/ -enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format { - __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BDAT, - __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BCAT, - __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT, - __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV, - __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA, - __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR -}; -typedef enum __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format; - -/* "_readstat_writer.pxd":64 - * FILE_FORMAT_POR - * - * ctypedef enum pywriter_variable_type: # <<<<<<<<<<<<<< - * PYWRITER_DOUBLE - * PYWRITER_INTEGER -*/ -enum __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type { - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE64, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME64, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME64, - __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DTA_STR_REF -}; -typedef enum __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type __pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type; - -/* "_readstat_parser.pxd":49 - * # Definitions of extension types - * - * cdef class data_container: # <<<<<<<<<<<<<< - * """ - * This extension type holds all the data we need to get from our file from -*/ -struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container { - PyObject_HEAD - int n_obs; - int n_vars; - int max_n_obs; - PyObject *col_data; - PyObject *col_data_len; - PyObject *col_names; - PyObject *col_labels; - PyObject *col_dtypes; - PyObject *col_numpy_dtypes; - PyObject *col_dtypes_isobject; - PyObject *col_dytpes_isfloat; - PyObject *col_formats; - PyObject *col_formats_original; - PyObject *origin; - double unix_to_origin_secs; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format file_format; - int is_unkown_number_rows; - PyObject *file_label; - PyObject *file_encoding; - int metaonly; - int dates_as_pandas; - PyObject *label_to_var_name; - PyObject *labels_raw; - PyObject *notes; - PyObject *user_encoding; - PyObject *table_name; - int filter_cols; - PyObject *use_cols; - int usernan; - PyObject *missing_ranges; - PyObject *missing_user_values; - PyObject *variable_storage_width; - PyObject *variable_display_width; - PyObject *variable_alignment; - PyObject *variable_measure; - int no_datetime_conversion; - int ctime; - int mtime; - PyObject *mr_sets; - PyObject *output_format; -}; - - -/* "pyreadstat/pyreadstat.pyx":542 - * # convenience functions to read in chunks - * - * def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, # <<<<<<<<<<<<<< - * multiprocess=False, num_processes=4, num_rows=None, **kwargs): - * """ -*/ -struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks { - PyObject_HEAD - PyObject *__pyx_v__; - PyObject *__pyx_v_chunksize; - PyObject *__pyx_v_df; - PyObject *__pyx_v_file_path; - PyObject *__pyx_v_kwargs; - PyObject *__pyx_v_limit; - PyObject *__pyx_v_meta; - PyObject *__pyx_v_multiprocess; - PyObject *__pyx_v_num_processes; - PyObject *__pyx_v_num_rows; - PyObject *__pyx_v_numrows; - PyObject *__pyx_v_offset; - PyObject *__pyx_v_read_function; -}; - -/* #### Code section: utility_code_proto ### */ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, Py_ssize_t); - void (*DECREF)(void*, PyObject*, Py_ssize_t); - void (*GOTREF)(void*, PyObject*, Py_ssize_t); - void (*GIVEREF)(void*, PyObject*, Py_ssize_t); - void* (*SetupContext)(const char*, Py_ssize_t, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContextNogil() {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __Pyx_RefNannyFinishContext();\ - PyGILState_Release(__pyx_gilstate_save);\ - } - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) - #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContextNogil() - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_Py_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; Py_XDECREF(tmp);\ - } while (0) -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* TupleAndListFromArray.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); -#endif -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); -#endif - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* fastcall.proto */ -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) -#elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) -#else - #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) -#endif -#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) -#define __Pyx_KwValues_VARARGS(args, nargs) NULL -#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) -#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) -#if CYTHON_METH_FASTCALL - #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) - #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) - #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) - static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API - CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); - #else - #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) - #endif -#else - #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS - #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS - #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS - #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS - #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS -#endif -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) -#else -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) -#endif - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static CYTHON_INLINE int __Pyx_ParseKeywords( - PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], - PyObject *kwds2, PyObject *values[], - Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs -); - -/* CallCFunction.proto */ -#define __Pyx_CallCFunction(cfunc, self, args)\ - ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) -#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ - ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) -#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ - ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) -#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ - ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) - -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectFastCall.proto */ -#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); - -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS - __pyx_atomic_int_type initialized; -#endif - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING -static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { -#if !CYTHON_ATOMICS - return 1; -#else - __pyx_nonatomic_int_type expected = 0; - if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { - return 0; - } - return expected; -#endif -} -static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { -#if CYTHON_ATOMICS - __pyx_atomic_store(&cfunc->initialized, 2); -#endif -} -#else -#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 -#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) -#endif - -/* CallUnboundCMethod2.proto */ -CYTHON_UNUSED -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); -#else -#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) -#endif - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* ArgTypeTest.proto */ -#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ - __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* IterFinish.proto */ -static CYTHON_INLINE int __Pyx_IterFinish(void); - -/* UnpackItemEndCheck.proto */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - -/* PyObjectDelAttr.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 -#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) -#else -#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) -#endif - -/* PyObjectSetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); -#else -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif - -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) do {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} while(0) -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* PyObjectVectorCallKwBuilder.proto */ -CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); -#if CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03090000 -#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall -#else -#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall -#endif -#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) -static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); -static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); -#else -#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict -#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) -#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) -#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* PyDictContains.proto */ -static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { - int result = PyDict_Contains(dict, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* py_dict_pop.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); - -/* PyObjectCall2Args.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); - -/* CallUnboundCMethod1.proto */ -CYTHON_UNUSED -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); -#else -#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) -#endif - -/* PyObjectCallNoArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectGetMethod.proto */ -static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); - -/* PyObjectCallMethod0.proto */ -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -/* UnpackTupleError.proto */ -static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); - -/* UnpackTuple2.proto */ -static CYTHON_INLINE int __Pyx_unpack_tuple2( - PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); -static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( - PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); -static int __Pyx_unpack_tuple2_generic( - PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); - -/* dict_iter.proto */ -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_is_dict); -static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); - -/* MergeKeywords.proto */ -static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping); - -/* pybytes_as_double.proto */ -static double __Pyx_SlowPyString_AsDouble(PyObject *obj); -static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length); -static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) { - char* as_c_string; - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE - as_c_string = PyBytes_AS_STRING(obj); - size = PyBytes_GET_SIZE(obj); -#else - if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) { - return (double)-1; - } -#endif - return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); -} -static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) { - char* as_c_string; - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE - as_c_string = PyByteArray_AS_STRING(obj); - size = PyByteArray_GET_SIZE(obj); -#else - as_c_string = PyByteArray_AsString(obj); - if (as_c_string == NULL) { - return (double)-1; - } - size = PyByteArray_Size(obj); -#endif - return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); -} - -/* pyunicode_as_double.proto */ -#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS -static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) { - int last_was_punctuation; - Py_ssize_t i; - last_was_punctuation = 1; - for (i=start; i <= end; i++) { - Py_UCS4 chr = PyUnicode_READ(kind, data, i); - int is_punctuation = (chr == '_') | (chr == '.'); - *buffer = (char)chr; - buffer += (chr != '_'); - if (unlikely(chr > 127)) goto parse_failure; - if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; - last_was_punctuation = is_punctuation; - } - if (unlikely(last_was_punctuation)) goto parse_failure; - *buffer = '\0'; - return buffer; -parse_failure: - return NULL; -} -static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) { - int matches = 1; - Py_UCS4 chr; - Py_UCS4 sign = PyUnicode_READ(kind, data, start); - int is_signed = (sign == '-') | (sign == '+'); - start += is_signed; - length -= is_signed; - switch (PyUnicode_READ(kind, data, start)) { - #ifdef Py_NAN - case 'n': - case 'N': - if (unlikely(length != 3)) goto parse_failure; - chr = PyUnicode_READ(kind, data, start+1); - matches &= (chr == 'a') | (chr == 'A'); - chr = PyUnicode_READ(kind, data, start+2); - matches &= (chr == 'n') | (chr == 'N'); - if (unlikely(!matches)) goto parse_failure; - return (sign == '-') ? -Py_NAN : Py_NAN; - #endif - case 'i': - case 'I': - if (unlikely(length < 3)) goto parse_failure; - chr = PyUnicode_READ(kind, data, start+1); - matches &= (chr == 'n') | (chr == 'N'); - chr = PyUnicode_READ(kind, data, start+2); - matches &= (chr == 'f') | (chr == 'F'); - if (likely(length == 3 && matches)) - return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; - if (unlikely(length != 8)) goto parse_failure; - chr = PyUnicode_READ(kind, data, start+3); - matches &= (chr == 'i') | (chr == 'I'); - chr = PyUnicode_READ(kind, data, start+4); - matches &= (chr == 'n') | (chr == 'N'); - chr = PyUnicode_READ(kind, data, start+5); - matches &= (chr == 'i') | (chr == 'I'); - chr = PyUnicode_READ(kind, data, start+6); - matches &= (chr == 't') | (chr == 'T'); - chr = PyUnicode_READ(kind, data, start+7); - matches &= (chr == 'y') | (chr == 'Y'); - if (unlikely(!matches)) goto parse_failure; - return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; - case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - break; - default: - goto parse_failure; - } - return 0.0; -parse_failure: - return -1.0; -} -static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) { - double value; - const char *last; - char *end; - Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj); - const int kind = PyUnicode_KIND(obj); - const void* data = PyUnicode_DATA(obj); - start = 0; - while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start))) - start++; - while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1))) - length--; - length -= start; - if (unlikely(length <= 0)) goto fallback; - value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length); - if (unlikely(value == -1.0)) goto fallback; - if (value != 0.0) return value; - if (length < 40) { - char number[40]; - last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); - if (unlikely(!last)) goto fallback; - value = PyOS_string_to_double(number, &end, NULL); - } else { - char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char)); - if (unlikely(!number)) goto fallback; - last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); - if (unlikely(!last)) { - PyMem_Free(number); - goto fallback; - } - value = PyOS_string_to_double(number, &end, NULL); - PyMem_Free(number); - } - if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { - return value; - } -fallback: - return __Pyx_SlowPyString_AsDouble(obj); -} -#endif -static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) { -#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS - if (unlikely(__Pyx_PyUnicode_READY(obj) == -1)) - return (double)-1; - if (likely(PyUnicode_IS_ASCII(obj))) { - const char *s; - Py_ssize_t length; - s = PyUnicode_AsUTF8AndSize(obj, &length); - return __Pyx__PyBytes_AsDouble(obj, s, length); - } - return __Pyx_PyUnicode_AsDouble_WithSpaces(obj); -#else - return __Pyx_SlowPyString_AsDouble(obj); -#endif -} - -/* PyLongCompare.proto */ -static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); - -/* ListCompAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len)) { - Py_INCREF(x); - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - L->ob_item[len] = x; - #else - PyList_SET_ITEM(list, len, x); - #endif - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) -#endif - -/* PyLongBinop.proto */ -#if !CYTHON_COMPILING_IN_PYPY -static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); -#else -#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ - (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) -#endif - -/* ListAppend.proto */ -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - L->ob_item[len] = x; - #else - PyList_SET_ITEM(list, len, x); - #endif - __Pyx_SET_SIZE(list, len + 1); - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -/* PyObjectFastCallMethod.proto */ -#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 -#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL) -#else -static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); -#endif - -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* SwapException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* dict_getitem_default.proto */ -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); - -/* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ - (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ - __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ - (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ - (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* ObjectGetItem.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); -#else -#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) -#endif - -/* PyObjectVectorCallMethodKwBuilder.proto */ -#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 -#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod -#else -static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#endif - -/* py_dict_items.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); - -/* CallUnboundCMethod0.proto */ -CYTHON_UNUSED -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); -#else -#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) -#endif - -/* py_dict_keys.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); - -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -/* PyObject_Unicode.proto */ -#define __Pyx_PyObject_Unicode(obj)\ - (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) - -/* DictGetItem.proto */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); -#define __Pyx_PyObject_Dict_GetItem(obj, name)\ - (likely(PyDict_CheckExact(obj)) ?\ - __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) -#else -#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) -#endif - -/* RaiseUnexpectedTypeError.proto */ -static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); - -/* CallTypeTraverse.proto */ -#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) -#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 -#else -static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); -#endif - -/* LimitedApiGetTypeDict.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); -#endif - -/* SetItemOnTypeDict.proto */ -static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); -#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) - -/* FixUpExtensionType.proto */ -static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); - -/* ValidateBasesTuple.proto */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS -static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); -#endif - -/* PyType_Ready.proto */ -CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); - -/* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_2 -#define __PYX_HAVE_RT_ImportType_proto_3_1_2 -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#include -#endif -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) alignof(s) -#else -#define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) sizeof(void*) -#endif -enum __Pyx_ImportType_CheckSize_3_1_2 { - __Pyx_ImportType_CheckSize_Error_3_1_2 = 0, - __Pyx_ImportType_CheckSize_Warn_3_1_2 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_1_2 = 2 -}; -static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size); -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); - -/* ImportDottedModuleRelFirst.proto */ -static PyObject *__Pyx_ImportDottedModuleRelFirst(PyObject *name, PyObject *parts_tuple); - -/* ListPack.proto */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); - -/* dict_setdefault.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); - -/* FetchCommonType.proto */ -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); - -/* CommonTypesMetaclass.proto */ -static int __pyx_CommonTypesMetaclass_init(PyObject *module); -#define __Pyx_CommonTypesMetaclass_USED - -/* PyMethodNew.proto */ -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); - -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); -#endif - -/* CythonFunctionShared.proto */ -#define __Pyx_CyFunction_USED -#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 -#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 -#define __Pyx_CYFUNCTION_CCLASS 0x04 -#define __Pyx_CYFUNCTION_COROUTINE 0x08 -#define __Pyx_CyFunction_GetClosure(f)\ - (((__pyx_CyFunctionObject *) (f))->func_closure) -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_CyFunction_GetClassObj(f)\ - (((__pyx_CyFunctionObject *) (f))->func_classobj) -#else - #define __Pyx_CyFunction_GetClassObj(f)\ - ((PyObject*) ((PyCMethodObject *) (f))->mm_class) -#endif -#define __Pyx_CyFunction_SetClassObj(f, classobj)\ - __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) -#define __Pyx_CyFunction_Defaults(type, f)\ - ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) -#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ - ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) -typedef struct { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject_HEAD - PyObject *func; -#elif PY_VERSION_HEX < 0x030900B1 - PyCFunctionObject func; -#else - PyCMethodObject func; -#endif -#if CYTHON_BACKPORT_VECTORCALL ||\ - (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) - __pyx_vectorcallfunc func_vectorcall; -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_weakreflist; -#endif - PyObject *func_dict; - PyObject *func_name; - PyObject *func_qualname; - PyObject *func_doc; - PyObject *func_globals; - PyObject *func_code; - PyObject *func_closure; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - PyObject *func_classobj; -#endif - PyObject *defaults; - int flags; - PyObject *defaults_tuple; - PyObject *defaults_kwdict; - PyObject *(*defaults_getter)(PyObject *); - PyObject *func_annotations; - PyObject *func_is_coroutine; -} __pyx_CyFunctionObject; -#undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)); -#undef __Pyx_IsSameCFunction -#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, - PyTypeObject *defaults_type); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, - PyObject *tuple); -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, - PyObject *dict); -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, - PyObject *dict); -static int __pyx_CyFunction_init(PyObject *module); -#if CYTHON_METH_FASTCALL -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) -#else -#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) -#endif -#endif - -/* CythonFunction.proto */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, - int flags, PyObject* qualname, - PyObject *closure, - PyObject *module, PyObject *globals, - PyObject* code); - -/* CLineInTraceback.proto */ -#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); -#else -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#endif - -/* CodeObjectCache.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject __Pyx_CachedCodeObjectType; -#else -typedef PyCodeObject __Pyx_CachedCodeObjectType; -#endif -typedef struct { - __Pyx_CachedCodeObjectType* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - __pyx_atomic_int_type accessor_count; - #endif -}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* GCCDiagnostics.proto */ -#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define __Pyx_HAS_GCC_DIAGNOSTIC -#endif - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); - -/* FormatTypeName.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -typedef PyObject *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%U" -#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 -#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName -#else -static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); -#endif -#else // !LIMITED_API -typedef const char *__Pyx_TypeName; -#define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) -#define __Pyx_DECREF_TypeName(obj) -#endif - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); - -/* FastTypeChecks.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); -#else -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) -#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { - return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); -} -#endif -#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) -#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) -#ifdef PyExceptionInstance_Check - #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) -#else - #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) -#endif - -/* IterNextPlain.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 -static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); -#endif - -/* PyObjectCallMethod1.proto */ -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); - -/* ReturnWithStopIteration.proto */ -static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); - -/* CoroutineBase.proto */ -struct __pyx_CoroutineObject; -typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); -#if CYTHON_USE_EXC_INFO_STACK -#define __Pyx_ExcInfoStruct _PyErr_StackItem -#else -typedef struct { - PyObject *exc_type; - PyObject *exc_value; - PyObject *exc_traceback; -} __Pyx_ExcInfoStruct; -#endif -typedef struct __pyx_CoroutineObject { - PyObject_HEAD - __pyx_coroutine_body_t body; - PyObject *closure; - __Pyx_ExcInfoStruct gi_exc_state; - PyObject *gi_weakreflist; - PyObject *classobj; - PyObject *yieldfrom; - __Pyx_pyiter_sendfunc yieldfrom_am_send; - PyObject *gi_name; - PyObject *gi_qualname; - PyObject *gi_modulename; - PyObject *gi_code; - PyObject *gi_frame; -#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) - PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; - uint64_t __pyx_pymonitoring_version; -#endif - int resume_label; - char is_running; -} __pyx_CoroutineObject; -static __pyx_CoroutineObject *__Pyx__Coroutine_New( - PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name); -static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( - __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name); -static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); -static int __Pyx_Coroutine_clear(PyObject *self); -static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); -static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); -#if CYTHON_USE_EXC_INFO_STACK -#define __Pyx_Coroutine_SwapException(self) -#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) -#else -#define __Pyx_Coroutine_SwapException(self) {\ - __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ - __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ - } -#define __Pyx_Coroutine_ResetAndClearException(self) {\ - __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ - (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ - } -#endif -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ - __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) -#else -#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ - __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) -#endif -static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); -static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); -static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen); -static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen); -static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen); -static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure); -#if __PYX_HAS_PY_AM_SEND == 2 -static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send); -#endif -static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg); - -/* Generator.proto */ -#define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) -#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) -static PyObject *__Pyx_Generator_Next(PyObject *self); -static int __pyx_Generator_init(PyObject *module); -static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); - -/* GetRuntimeVersion.proto */ -static unsigned long __Pyx_get_runtime_version(void); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); - -/* VoidPtrImport.proto */ -static int __Pyx_ImportVoidPtr_3_1_2(PyObject *module, const char *name, void **p, const char *sig); - -/* FunctionImport.proto */ -static int __Pyx_ImportFunction_3_1_2(PyObject *module, const char *funcname, void (**f)(void), const char *sig); - -/* MultiPhaseInitModuleState.proto */ -#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE -static PyObject *__Pyx_State_FindModule(void*); -static int __Pyx_State_AddModule(PyObject* module, void*); -static int __Pyx_State_RemoveModule(void*); -#elif CYTHON_USE_MODULE_STATE -#define __Pyx_State_FindModule PyState_FindModule -#define __Pyx_State_AddModule PyState_AddModule -#define __Pyx_State_RemoveModule PyState_RemoveModule -#endif - -/* #### Code section: module_declarations ### */ -/* CythonABIVersion.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API - #if CYTHON_METH_FASTCALL - #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" - #else - #define __PYX_FASTCALL_ABI_SUFFIX - #endif - #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX -#else - #define __PYX_LIMITED_ABI_SUFFIX -#endif -#if __PYX_HAS_PY_AM_SEND == 1 - #define __PYX_AM_SEND_ABI_SUFFIX -#elif __PYX_HAS_PY_AM_SEND == 2 - #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" -#else - #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" -#endif -#ifndef __PYX_MONITORING_ABI_SUFFIX - #define __PYX_MONITORING_ABI_SUFFIX -#endif -#if CYTHON_USE_TP_FINALIZE - #define __PYX_TP_FINALIZE_ABI_SUFFIX -#else - #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" -#endif -#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) - #define __PYX_FREELISTS_ABI_SUFFIX -#else - #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" -#endif -#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." - - -/* Module declarations from "libc.stddef" */ - -/* Module declarations from "pyreadstat.readstat_api" */ - -/* 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) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_sas_date_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_sas_date_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_sas_datetime_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_sas_datetime_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_sas_time_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_sas_time_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_sas_all_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_sas_all_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_sas_origin = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_sas_origin (*__pyx_vp_10pyreadstat_16_readstat_parser_sas_origin) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_spss_datetime_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_spss_datetime_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_spss_date_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_spss_date_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_spss_time_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_spss_time_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_spss_all_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_spss_all_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_spss_origin = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_spss_origin (*__pyx_vp_10pyreadstat_16_readstat_parser_spss_origin) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_stata_datetime_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_stata_datetime_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_stata_date_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_stata_date_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_stata_time_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_stata_time_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_stata_all_formats = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats (*__pyx_vp_10pyreadstat_16_readstat_parser_stata_all_formats) -static PyObject **__pyx_vp_10pyreadstat_16_readstat_parser_stata_origin = 0; -#define __pyx_v_10pyreadstat_16_readstat_parser_stata_origin (*__pyx_vp_10pyreadstat_16_readstat_parser_stata_origin) -static PyObject *(*__pyx_f_10pyreadstat_16_readstat_parser_run_conversion)(PyObject *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format, __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension, PyObject *, int, int, PyObject *, int, int, long, long, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ - -/* Module declarations from "pyreadstat._readstat_writer" */ -static int (*__pyx_f_10pyreadstat_16_readstat_writer_run_write)(PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int); /*proto*/ - -/* Module declarations from "pyreadstat.pyreadstat" */ -/* #### Code section: typeinfo ### */ -/* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "pyreadstat.pyreadstat" -extern int __pyx_module_is_main_pyreadstat__pyreadstat; -int __pyx_module_is_main_pyreadstat__pyreadstat = 0; - -/* Implementation of "pyreadstat.pyreadstat" */ -/* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_max; -/* #### Code section: string_decls ### */ -static const char __pyx_k_[] = ""; -static const char __pyx_k_x[] = "x"; -static const char __pyx_k__2[] = "."; -static const char __pyx_k__3[] = "?"; -static const char __pyx_k__4[] = "_"; -static const char __pyx_k_df[] = "df"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_mp[] = "mp"; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_nw[] = "nw"; -static const char __pyx_k_v2[] = "v2"; -static const char __pyx_k_div[] = "div"; -static const char __pyx_k_dta[] = "dta"; -static const char __pyx_k_get[] = "get"; -static const char __pyx_k_how[] = "how"; -static const char __pyx_k_inf[] = "inf"; -static const char __pyx_k_key[] = "key"; -static const char __pyx_k_map[] = "map"; -static const char __pyx_k_max[] = "max"; -static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_por[] = "por"; -static const char __pyx_k_Pool[] = "Pool"; -static const char __pyx_k_dict[] = "dict"; -static const char __pyx_k_divs[] = "divs"; -static const char __pyx_k_drop[] = "drop"; -static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_indx[] = "indx"; -static const char __pyx_k_jobs[] = "jobs"; -static const char __pyx_k_keys[] = "keys"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_meta[] = "meta"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_next[] = "next"; -static const char __pyx_k_note[] = "note"; -static const char __pyx_k_pool[] = "pool"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_chunk[] = "chunk"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_final[] = "final"; -static const char __pyx_k_items[] = "items"; -static const char __pyx_k_limit[] = "limit"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_xport[] = "xport"; -static const char __pyx_k_chunks[] = "chunks"; -static const char __pyx_k_concat[] = "concat"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_format[] = "format"; -static const char __pyx_k_kwargs[] = "kwargs"; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_offset[] = "offset"; -static const char __pyx_k_stable[] = "stable"; -static const char __pyx_k_worker[] = "worker"; -static const char __pyx_k_22DJa_Q[] = "\320\0002\3202D\300J\310a\330\030,\320,=\270Q"; -static const char __pyx_k_catalog[] = "catalog"; -static const char __pyx_k_columns[] = "columns"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_integer[] = "integer"; -static const char __pyx_k_numrows[] = "numrows"; -static const char __pyx_k_offsets[] = "offsets"; -static const char __pyx_k_usecols[] = "usecols"; -static const char __pyx_k_usernan[] = "usernan"; -static const char __pyx_k_version[] = "version"; -static const char __pyx_k_add_note[] = "add_note"; -static const char __pyx_k_col_name[] = "col_name"; -static const char __pyx_k_compress[] = "compress"; -static const char __pyx_k_dst_path[] = "dst_path"; -static const char __pyx_k_encoding[] = "encoding"; -static const char __pyx_k_ispandas[] = "ispandas"; -static const char __pyx_k_metadata[] = "metadata"; -static const char __pyx_k_metaonly[] = "metaonly"; -static const char __pyx_k_narwhals[] = "narwhals"; -static const char __pyx_k_num_rows[] = "num_rows"; -static const char __pyx_k_prev_div[] = "prev_div"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_read_dta[] = "read_dta"; -static const char __pyx_k_read_por[] = "read_por"; -static const char __pyx_k_read_sav[] = "read_sav"; -static const char __pyx_k_sas7bcat[] = "sas7bcat"; -static const char __pyx_k_sas7bdat[] = "sas7bdat"; -static const char __pyx_k_sav_zsav[] = "sav/zsav"; -static const char __pyx_k_set_name[] = "__set_name__"; -static const char __pyx_k_vertical[] = "vertical"; -static const char __pyx_k_chunksize[] = "chunksize"; -static const char __pyx_k_cpu_count[] = "cpu_count"; -static const char __pyx_k_enumerate[] = "enumerate"; -static const char __pyx_k_file_path[] = "file_path"; -static const char __pyx_k_is_pandas[] = "is_pandas"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_processes[] = "processes"; -static const char __pyx_k_row_limit[] = "row_limit"; -static const char __pyx_k_to_native[] = "to_native"; -static const char __pyx_k_var_width[] = "var_width"; -static const char __pyx_k_write_dta[] = "write_dta"; -static const char __pyx_k_write_por[] = "write_por"; -static const char __pyx_k_write_sav[] = "write_sav"; -static const char __pyx_k_col_format[] = "col_format"; -static const char __pyx_k_data_frame[] = "data_frame"; -static const char __pyx_k_file_label[] = "file_label"; -static const char __pyx_k_read_xport[] = "read_xport"; -static const char __pyx_k_row_offset[] = "row_offset"; -static const char __pyx_k_table_name[] = "table_name"; -static const char __pyx_k_N_var_width[] = "N{var_width}"; -static const char __pyx_k_concatenate[] = "concatenate"; -static const char __pyx_k_file_format[] = "file_format"; -static const char __pyx_k_from_native[] = "from_native"; -static const char __pyx_k_number_rows[] = "number_rows"; -static const char __pyx_k_prev_offset[] = "prev_offset"; -static const char __pyx_k_pyfunctions[] = "pyfunctions"; -static const char __pyx_k_reset_index[] = "reset_index"; -static const char __pyx_k_write_xport[] = "write_xport"; -static const char __pyx_k_catalog_file[] = "catalog_file"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_metadataonly[] = "metadataonly"; -static const char __pyx_k_multiprocess[] = "multiprocess"; -static const char __pyx_k_row_compress[] = "row_compress"; -static const char __pyx_k_user_missing[] = "user_missing"; -static const char __pyx_k_F_var_width_0[] = "F{var_width}.0"; -static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_column_labels[] = "column_labels"; -static const char __pyx_k_filename_path[] = "filename_path"; -static const char __pyx_k_num_processes[] = "num_processes"; -static const char __pyx_k_output_format[] = "output_format"; -static const char __pyx_k_read_function[] = "read_function"; -static const char __pyx_k_read_sas7bcat[] = "read_sas7bcat"; -static const char __pyx_k_read_sas7bdat[] = "read_sas7bdat"; -static const char __pyx_k_file_extension[] = "file_extension"; -static const char __pyx_k_implementation[] = "implementation"; -static const char __pyx_k_missing_ranges[] = "missing_ranges"; -static const char __pyx_k_PyreadstatError[] = "PyreadstatError"; -static const char __pyx_k_dates_as_pandas[] = "dates_as_pandas"; -static const char __pyx_k_formats_presets[] = "formats_presets"; -static const char __pyx_k_multiprocessing[] = "multiprocessing"; -static const char __pyx_k_readstat_parser[] = "_readstat_parser"; -static const char __pyx_k_row_compression[] = "row_compression"; -static const char __pyx_k_variable_format[] = "variable_format"; -static const char __pyx_k_set_value_labels[] = "set_value_labels"; -static const char __pyx_k_variable_measure[] = "variable_measure"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_extra_date_formats[] = "extra_date_formats"; -static const char __pyx_k_extra_time_formats[] = "extra_time_formats"; -static const char __pyx_k_narwhals_stable_v2[] = "narwhals.stable.v2"; -static const char __pyx_k_restricted_integer[] = "restricted_integer"; -static const char __pyx_k_set_catalog_to_sas[] = "set_catalog_to_sas"; -static const char __pyx_k_variable_alignment[] = "variable_alignment"; -static const char __pyx_k_apply_value_formats[] = "apply_value_formats"; -static const char __pyx_k_file_format_version[] = "file_format_version"; -static const char __pyx_k_formats_as_category[] = "formats_as_category"; -static const char __pyx_k_missing_user_values[] = "missing_user_values"; -static const char __pyx_k_read_file_in_chunks[] = "read_file_in_chunks"; -static const char __pyx_k_Version_not_supported[] = "Version not supported"; -static const char __pyx_k_pyreadstat_pyreadstat[] = "pyreadstat.pyreadstat"; -static const char __pyx_k_variable_value_labels[] = "variable_value_labels"; -static const char __pyx_k_extra_datetime_formats[] = "extra_datetime_formats"; -static const char __pyx_k_no_datetime_conversion[] = "no_datetime_conversion"; -static const char __pyx_k_variable_display_width[] = "variable_display_width"; -static const char __pyx_k_dates_as_pandas_datetime[] = "dates_as_pandas_datetime"; -static const char __pyx_k_pyreadstat_pyreadstat_pyx[] = "pyreadstat/pyreadstat.pyx"; -static const char __pyx_k_read_file_multiprocessing[] = "read_file_multiprocessing"; -static const char __pyx_k_disable_datetime_conversion[] = "disable_datetime_conversion"; -static const char __pyx_k_formats_as_ordered_category[] = "formats_as_ordered_category"; -static const char __pyx_k_read_sas7bcat_not_supported[] = "read_sas7bcat not supported"; -static const char __pyx_k_00PPQ_JJ_ppq_00AASSkkl_1_q_1_q[] = "\320\000\034\320\0340\3200P\320PQ\330\r'\320'J\320J]\320]p\320pq\330\r0\3200A\320AS\320Sk\320kl\330\r+\2501\360|\001\000\005\032\230\021\330\004\007\200q\330\010\023\2201\340\004 \240\001\330\004\007\200q\330\010\032\230!\340\004\030\230\001\330\004\007\200q\330\010\022\220!\340\004'\240q\330\004\007\200q\330\010!\240\021\340\0046\260a\330\004<\270A\330\004\020\220\013\230>\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\330\004\014\210O\2301\340\004\007\200q\330\010\025\320\025%\240Q\240l\260*\320\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\330\004\014\210O\2301\340\004\013\210<\220q"; -static const char __pyx_k_55UUV_OObbuuv_55FFXXY_44RRSH_q[] = "\320\000!\320!5\3205U\320UV\330\022,\320,O\320Ob\320bu\320uv\330\0225\3205F\320FX\320XY\330\0224\3204R\320RS\360H\002\000\005\032\230\021\330\004\007\200q\330\010\023\2201\340\004 \240\001\330\004\007\200q\330\010\032\230!\340\004\030\230\001\330\004\007\200q\330\010\022\220!\340\004'\240q\330\004\007\200q\330\010!\240\021\340\0046\260a\330\004<\270A\330\004\020\220\013\230>\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\330\004\014\210O\2301\340\004\007\200q\330\010\014\210J\220m\2401\240N\260)\2701\330\010\024\220K\320\0371\260\021\260,\270j\310\t\320Qe\320ef\330 <\270A\340\004\013\210<\220q"; -static const char __pyx_k_88LA_T_iq_S_Yc_iq_t1_1Bj_A_d_1[] = "\320\0008\3208L\310A\360<\000\005\010\200~\220T\230\021\330\010\016\210i\220q\230\001\340\004\007\200~\220S\230\t\240\024\240Y\250c\260\021\330\010\016\210i\220q\230\001\340\004\007\200t\2101\340\010\033\2301\230B\230j\250\004\250A\330\004\010\210\006\210d\220!\320\023#\2401\330\004\021\220\026\220t\2301\230N\250!\330\004\020\220\006\220d\230!\230=\250\005\250Q\250a\330\004\007\200w\210m\2301\230K\240}\260H\270A\330\004\016\210d\220!\340\004\007\200x\210s\220!\330\010\013\2109\220C\220q\330\014\022\220)\2301\230A\330\010\022\220!\330\t\021\220\023\220A\330\010\017\210w\220m\2401\240M\260\021\340\004\021\220\025\220h\230b\240\014\250D\260\001\330\004\013\2101\210H\220C\220~\240S\250\005\250R\250r\260\030\270\022\320;N\310d\320RV\320V[\320[a\320ab\320bc\330\004\022\220!\330\004\022\220!\330\004\017\210q\330\004\010\210\006\210g\220Y\230a\230q\330\010\021\220\034\230R\230q\330\010\026\220a\330\010\023\2201\330\010\017\210w\220b\230\010\240\001\330\004\013\2102\210_\230K\240x\250{\270(\300$\300h\310m\320[\\\330\004\013\2102\210U\220!\220:\230Q\330\004\005\330\010\021\220\024\220T\230\021\230(\240!\340\010\t\340\010\014\210F\220!\330\004\024\220F\230$\230a\230q\330\004\007\200~\220S\230\001\330\010\017\210v\220Q\220b\230\005\230Q\330\010\024\220A\330\010\014\210G\2201\330\014\021\220\021\220'\230\022\230<\240q\250\001\250\025\250a\250u\260D\270\t\300\021\360\006\000\t\022\220\021\220\"\220L\240\001\240\023\240D\250\005\250Q\330\010\020\220\002\220'\230\021\230(\240$\240a\330\010\023\2201\330\010\013\2105\220\017\230z\250\021\330\014\027\220q\330\010\020\220\005\220Z\230q\330\010\013\2101\330\014\024\220E\230\034\240Q\240e\2501\330\004\013\2107\220!"; -static const char __pyx_k_JJZZnno_11K1_A_1_y_A_oQa_q_a_q[] = "\320\000\034\320\034/\320/J\320JZ\320Zn\320no\330\0201\3201K\3101\330\020,\250A\360^\001\000\005$\2401\340\004 \240\001\330\004\007\200y\220\004\220A\330\010\016\210o\230Q\230a\330\004\007\200q\330\010\036\230a\330\004\007\200q\330\010\032\230!\330\004\026\220a\330\004$\240A\330\004#\2401\360\010\000\005\030\320\027,\320,<\270J\300a\330\004\007\200q\330\010\014\210J\220n\240O\2606\270\021\330\014\017\210{\230#\230_\250E\260\023\260D\270\t\300\023\300B\300a\330\020\034\230C\230q\240\003\2401\240C\240q\250\003\2501\250B\250a\250q\330\020\037\230q\240\014\250O\2701\270K\300w\310a\310z\320YZ\340\004\r\210Q\210d\320\022,\320,>\270l\310!\330\010\035\230V\240<\320/F\320FV\320VW\330\010\034\320\0344\3204F\320FW\320WX"; -static const char __pyx_k_J_LAB_xs_a_A_a_A_a_A_a_T_a_S_a[] = "\320\000\034\320\034/\320/J\310!\330\014-\320-L\310A\360B\001\000\005\010\200x\210s\220!\330\010\036\230a\330\t\021\220\023\220A\330\010\036\230a\330\t\021\220\023\220A\330\010\036\230a\330\t\021\220\023\220A\330\010\036\230a\330\t\021\220\024\220T\230\021\330\010\036\230a\330\t\021\220\024\220S\230\001\330\010\036\230a\340\010\016\210i\220q\230\001\340\004\024\220A\330\004\032\230!\330\004\037\230q\330\004#\2401\330\004'\240q\330\004!\240\021\340\004 \240\001\340\004\r\210Q\210d\320\022,\320,>\270l\310/\320YZ\330\005\013\210<\320\027.\320.>\320>S\320ST\330\005\035\320\035/\320/@\300\001"; -static const char __pyx_k_read_sas7bcat_is_not_supported[] = "read_sas7bcat is not supported"; -static const char __pyx_k_00PPQ_JJ_ppq_00AASST_MQ_q_1_q_q[] = "\320\000\034\320\0340\3200P\320PQ\330\r'\320'J\320J]\320]p\320pq\330\r0\3200A\320AS\320ST\330\r/\320/M\310Q\360|\001\000\005\032\230\021\330\004\007\200q\330\010\023\2201\340\004 \240\001\330\004\007\200q\330\010\032\230!\340\004\030\230\001\330\004\007\200q\330\010\022\220!\340\004'\240q\330\004\007\200q\330\010!\240\021\340\0046\260a\330\004<\270A\330\004\020\220\013\230>\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\330\004\014\210O\2301\340\004\007\200q\330\010\025\320\025%\240Q\240l\260*\320 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif - -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif - PyTypeObject *__pyx_ptype_10pyreadstat_16_readstat_parser_data_container; - PyObject *__pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks; - PyTypeObject *__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks; - __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; - __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; - __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys; - __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; - PyObject *__pyx_tuple[5]; - PyObject *__pyx_codeobj_tab[12]; - PyObject *__pyx_string_tab[172]; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_4; - PyObject *__pyx_int_100000; -/* #### Code section: module_state_contents ### */ - -#if CYTHON_USE_FREELISTS -struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *__pyx_freelist_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks[8]; -int __pyx_freecount_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks; -#endif -/* CommonTypesMetaclass.module_state_decls */ -PyTypeObject *__pyx_CommonTypesMetaclassType; - -/* CachedMethodType.module_state_decls */ -#if CYTHON_COMPILING_IN_LIMITED_API -PyObject *__Pyx_CachedMethodType; -#endif - -/* CodeObjectCache.module_state_decls */ -struct __Pyx_CodeObjectCache __pyx_code_cache; - -/* IterNextPlain.module_state_decls */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 -PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; -#endif - -/* #### Code section: module_state_end ### */ -} __pyx_mstatetype; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { -extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) - -#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstatetype __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -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_F_var_width_0 __pyx_string_tab[1] -#define __pyx_kp_u_N_var_width __pyx_string_tab[2] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[3] -#define __pyx_n_u_Pool __pyx_string_tab[4] -#define __pyx_n_u_PyreadstatError __pyx_string_tab[5] -#define __pyx_kp_u_The_number_of_rows_of_the_file_c __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_n_u__4 __pyx_string_tab[10] -#define __pyx_kp_u_add_note __pyx_string_tab[11] -#define __pyx_n_u_apply_value_formats __pyx_string_tab[12] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[13] -#define __pyx_n_u_catalog __pyx_string_tab[14] -#define __pyx_n_u_catalog_file __pyx_string_tab[15] -#define __pyx_n_u_chunk __pyx_string_tab[16] -#define __pyx_n_u_chunks __pyx_string_tab[17] -#define __pyx_n_u_chunksize __pyx_string_tab[18] -#define __pyx_n_u_class_getitem __pyx_string_tab[19] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[20] -#define __pyx_n_u_close __pyx_string_tab[21] -#define __pyx_n_u_col_format __pyx_string_tab[22] -#define __pyx_n_u_col_name __pyx_string_tab[23] -#define __pyx_n_u_column_labels __pyx_string_tab[24] -#define __pyx_n_u_columns __pyx_string_tab[25] -#define __pyx_n_u_compress __pyx_string_tab[26] -#define __pyx_kp_u_compress_and_row_compress_cannot __pyx_string_tab[27] -#define __pyx_n_u_concat __pyx_string_tab[28] -#define __pyx_n_u_concatenate __pyx_string_tab[29] -#define __pyx_n_u_cpu_count __pyx_string_tab[30] -#define __pyx_n_u_data_frame __pyx_string_tab[31] -#define __pyx_n_u_dates_as_pandas __pyx_string_tab[32] -#define __pyx_n_u_dates_as_pandas_datetime __pyx_string_tab[33] -#define __pyx_n_u_df __pyx_string_tab[34] -#define __pyx_n_u_dict __pyx_string_tab[35] -#define __pyx_kp_u_disable __pyx_string_tab[36] -#define __pyx_n_u_disable_datetime_conversion __pyx_string_tab[37] -#define __pyx_n_u_div __pyx_string_tab[38] -#define __pyx_n_u_divs __pyx_string_tab[39] -#define __pyx_n_u_drop __pyx_string_tab[40] -#define __pyx_n_u_dst_path __pyx_string_tab[41] -#define __pyx_n_u_dta __pyx_string_tab[42] -#define __pyx_kp_u_enable __pyx_string_tab[43] -#define __pyx_n_u_encoding __pyx_string_tab[44] -#define __pyx_n_u_enumerate __pyx_string_tab[45] -#define __pyx_n_u_extra_date_formats __pyx_string_tab[46] -#define __pyx_n_u_extra_datetime_formats __pyx_string_tab[47] -#define __pyx_n_u_extra_time_formats __pyx_string_tab[48] -#define __pyx_n_u_file_extension __pyx_string_tab[49] -#define __pyx_n_u_file_format __pyx_string_tab[50] -#define __pyx_n_u_file_format_version __pyx_string_tab[51] -#define __pyx_n_u_file_label __pyx_string_tab[52] -#define __pyx_n_u_file_path __pyx_string_tab[53] -#define __pyx_n_u_filename_path __pyx_string_tab[54] -#define __pyx_n_u_final __pyx_string_tab[55] -#define __pyx_n_u_format __pyx_string_tab[56] -#define __pyx_n_u_formats_as_category __pyx_string_tab[57] -#define __pyx_n_u_formats_as_ordered_category __pyx_string_tab[58] -#define __pyx_n_u_formats_presets __pyx_string_tab[59] -#define __pyx_n_u_from_native __pyx_string_tab[60] -#define __pyx_n_u_func __pyx_string_tab[61] -#define __pyx_kp_u_gc __pyx_string_tab[62] -#define __pyx_n_u_get __pyx_string_tab[63] -#define __pyx_n_u_how __pyx_string_tab[64] -#define __pyx_n_u_implementation __pyx_string_tab[65] -#define __pyx_n_u_indx __pyx_string_tab[66] -#define __pyx_n_u_inf __pyx_string_tab[67] -#define __pyx_n_u_initializing __pyx_string_tab[68] -#define __pyx_n_u_integer __pyx_string_tab[69] -#define __pyx_n_u_is_coroutine __pyx_string_tab[70] -#define __pyx_n_u_is_pandas __pyx_string_tab[71] -#define __pyx_kp_u_isenabled __pyx_string_tab[72] -#define __pyx_n_u_ispandas __pyx_string_tab[73] -#define __pyx_n_u_items __pyx_string_tab[74] -#define __pyx_n_u_jobs __pyx_string_tab[75] -#define __pyx_n_u_key __pyx_string_tab[76] -#define __pyx_n_u_keys __pyx_string_tab[77] -#define __pyx_n_u_kwargs __pyx_string_tab[78] -#define __pyx_n_u_limit __pyx_string_tab[79] -#define __pyx_n_u_main __pyx_string_tab[80] -#define __pyx_n_u_map __pyx_string_tab[81] -#define __pyx_n_u_max __pyx_string_tab[82] -#define __pyx_n_u_meta __pyx_string_tab[83] -#define __pyx_n_u_metadata __pyx_string_tab[84] -#define __pyx_n_u_metadataonly __pyx_string_tab[85] -#define __pyx_n_u_metaonly __pyx_string_tab[86] -#define __pyx_n_u_missing_ranges __pyx_string_tab[87] -#define __pyx_n_u_missing_user_values __pyx_string_tab[88] -#define __pyx_n_u_module __pyx_string_tab[89] -#define __pyx_n_u_mp __pyx_string_tab[90] -#define __pyx_n_u_multiprocess __pyx_string_tab[91] -#define __pyx_n_u_multiprocessing __pyx_string_tab[92] -#define __pyx_n_u_name __pyx_string_tab[93] -#define __pyx_n_u_narwhals __pyx_string_tab[94] -#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[95] -#define __pyx_n_u_next __pyx_string_tab[96] -#define __pyx_n_u_no_datetime_conversion __pyx_string_tab[97] -#define __pyx_n_u_note __pyx_string_tab[98] -#define __pyx_n_u_np __pyx_string_tab[99] -#define __pyx_n_u_num_processes __pyx_string_tab[100] -#define __pyx_n_u_num_rows __pyx_string_tab[101] -#define __pyx_kp_u_num_rows_must_be_specified_for_r __pyx_string_tab[102] -#define __pyx_n_u_number_rows __pyx_string_tab[103] -#define __pyx_n_u_numpy __pyx_string_tab[104] -#define __pyx_n_u_numrows __pyx_string_tab[105] -#define __pyx_n_u_nw __pyx_string_tab[106] -#define __pyx_n_u_offset __pyx_string_tab[107] -#define __pyx_n_u_offsets __pyx_string_tab[108] -#define __pyx_n_u_output_format __pyx_string_tab[109] -#define __pyx_n_u_pool __pyx_string_tab[110] -#define __pyx_n_u_pop __pyx_string_tab[111] -#define __pyx_n_u_por __pyx_string_tab[112] -#define __pyx_n_u_prev_div __pyx_string_tab[113] -#define __pyx_n_u_prev_offset __pyx_string_tab[114] -#define __pyx_n_u_processes __pyx_string_tab[115] -#define __pyx_n_u_pyfunctions __pyx_string_tab[116] -#define __pyx_n_u_pyreadstat_pyreadstat __pyx_string_tab[117] -#define __pyx_kp_u_pyreadstat_pyreadstat_pyx __pyx_string_tab[118] -#define __pyx_n_u_qualname __pyx_string_tab[119] -#define __pyx_n_u_range __pyx_string_tab[120] -#define __pyx_n_u_read_dta __pyx_string_tab[121] -#define __pyx_n_u_read_file_in_chunks __pyx_string_tab[122] -#define __pyx_n_u_read_file_multiprocessing __pyx_string_tab[123] -#define __pyx_n_u_read_function __pyx_string_tab[124] -#define __pyx_n_u_read_por __pyx_string_tab[125] -#define __pyx_n_u_read_sas7bcat __pyx_string_tab[126] -#define __pyx_kp_u_read_sas7bcat_is_not_supported __pyx_string_tab[127] -#define __pyx_kp_u_read_sas7bcat_not_supported __pyx_string_tab[128] -#define __pyx_n_u_read_sas7bdat __pyx_string_tab[129] -#define __pyx_n_u_read_sav __pyx_string_tab[130] -#define __pyx_n_u_read_xport __pyx_string_tab[131] -#define __pyx_n_u_readstat_parser __pyx_string_tab[132] -#define __pyx_n_u_reset_index __pyx_string_tab[133] -#define __pyx_n_u_restricted_integer __pyx_string_tab[134] -#define __pyx_n_u_row_compress __pyx_string_tab[135] -#define __pyx_n_u_row_compression __pyx_string_tab[136] -#define __pyx_n_u_row_limit __pyx_string_tab[137] -#define __pyx_n_u_row_offset __pyx_string_tab[138] -#define __pyx_n_u_sas7bcat __pyx_string_tab[139] -#define __pyx_n_u_sas7bdat __pyx_string_tab[140] -#define __pyx_kp_u_sav_zsav __pyx_string_tab[141] -#define __pyx_n_u_send __pyx_string_tab[142] -#define __pyx_n_u_set_catalog_to_sas __pyx_string_tab[143] -#define __pyx_n_u_set_name __pyx_string_tab[144] -#define __pyx_n_u_set_value_labels __pyx_string_tab[145] -#define __pyx_n_u_spec __pyx_string_tab[146] -#define __pyx_n_u_stable __pyx_string_tab[147] -#define __pyx_n_u_table_name __pyx_string_tab[148] -#define __pyx_n_u_test __pyx_string_tab[149] -#define __pyx_n_u_throw __pyx_string_tab[150] -#define __pyx_n_u_to_native __pyx_string_tab[151] -#define __pyx_n_u_usecols __pyx_string_tab[152] -#define __pyx_n_u_user_missing __pyx_string_tab[153] -#define __pyx_n_u_usernan __pyx_string_tab[154] -#define __pyx_n_u_v2 __pyx_string_tab[155] -#define __pyx_n_u_value __pyx_string_tab[156] -#define __pyx_n_u_var_width __pyx_string_tab[157] -#define __pyx_n_u_variable_alignment __pyx_string_tab[158] -#define __pyx_n_u_variable_display_width __pyx_string_tab[159] -#define __pyx_n_u_variable_format __pyx_string_tab[160] -#define __pyx_n_u_variable_measure __pyx_string_tab[161] -#define __pyx_n_u_variable_value_labels __pyx_string_tab[162] -#define __pyx_n_u_version __pyx_string_tab[163] -#define __pyx_n_u_vertical __pyx_string_tab[164] -#define __pyx_n_u_worker __pyx_string_tab[165] -#define __pyx_n_u_write_dta __pyx_string_tab[166] -#define __pyx_n_u_write_por __pyx_string_tab[167] -#define __pyx_n_u_write_sav __pyx_string_tab[168] -#define __pyx_n_u_write_xport __pyx_string_tab[169] -#define __pyx_n_u_x __pyx_string_tab[170] -#define __pyx_n_u_xport __pyx_string_tab[171] -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { - __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - #if CYTHON_PEP489_MULTI_PHASE_INIT - __Pyx_State_RemoveModule(NULL); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); - Py_CLEAR(clear_module_state->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks); - Py_CLEAR(clear_module_state->__pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks); - for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<12; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<172; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_4); - Py_CLEAR(clear_module_state->__pyx_int_100000); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif - Py_VISIT(traverse_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container); - Py_VISIT(traverse_module_state->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks); - Py_VISIT(traverse_module_state->__pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks); - for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<12; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<172; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_4); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_100000); - return 0; -} -#endif -/* #### Code section: module_code ### */ - -/* "pyreadstat/pyreadstat.pyx":37 - * # Parsing functions - * - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_1read_sas7bdat(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_read_sas7bdat, "\n Read a SAS sas7bdat file.\n It accepts the path to a sas7bcat.\n \n Parameters\n ----------\n filename_path : str, bytes, Path-like object or file-like object\n path to the file or file-like object. In python 2.7 the string is assumed to be utf-8 encoded.\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date, effective only for pandas.\n catalog_file : str, optional\n path to a sas7bcat file. By default is None. If not None, will parse the catalog file and replace the values\n by the formats in the catalog, if any appropiate is found. If this is not the behavior you are looking for,\n Use read_sas7bcat to parse the catalog independently\n of the sas7bdat and set_catalog_to_sas to apply the resulting format into sas7bdat files.\n formats_as_category : bool, optional\n Will take effect only if the catalog_file was specified. If True the variables whose values were replaced\n by the formats will be transformed into categories.\n formats_as_ordered_category : bool, optional\n defaults to False. If True the variables having formats will be transformed into ordered categories/enums.\n it has precedence over formats_as_category, meaning if this is True, it will take effect irrespective of\n the value of formats_as_category.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with c""olumn names to read from the file. Only those columns will be imported. Case sensitive!\n user_missing : bool, optional\n by default False, in this case user defined missing values are delivered as nan. If true, the missing values\n will be deliver as is, and an extra piece of information will be set in the metadata (missing_user_values)\n to be able to interpret those values as missing.\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n output_format : str, optional\n one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the\n user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a \n dataframe is avoided.\n extra_datetime_formats: list of str, optional\n formats to be parsed as python datetime objects\n extra_date_formats: list of str, optional\n formats to be parsed as python date objects\n ex""tra_time_formats: list of str, optional\n formats to be parsed as python time objects\n \n\n Returns\n -------\n data_frame : dataframe or dict\n a dataframe or dict with the data.\n metadata\n object with metadata. The members variables_value_labels will be empty unless a valid catalog file is\n supplied.\n Look at the documentation for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_1read_sas7bdat = {"read_sas7bdat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_1read_sas7bdat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_read_sas7bdat}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_1read_sas7bdat(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_filename_path = 0; - PyObject *__pyx_v_metadataonly = 0; - PyObject *__pyx_v_dates_as_pandas_datetime = 0; - PyObject *__pyx_v_catalog_file = 0; - PyObject *__pyx_v_formats_as_category = 0; - PyObject *__pyx_v_formats_as_ordered_category = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_usecols = 0; - PyObject *__pyx_v_user_missing = 0; - PyObject *__pyx_v_disable_datetime_conversion = 0; - int __pyx_v_row_limit; - int __pyx_v_row_offset; - PyObject *__pyx_v_output_format = 0; - PyObject *__pyx_v_extra_datetime_formats = 0; - PyObject *__pyx_v_extra_date_formats = 0; - PyObject *__pyx_v_extra_time_formats = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_sas7bdat (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_catalog_file,&__pyx_mstate_global->__pyx_n_u_formats_as_category,&__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_user_missing,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,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, 37, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 16: - values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, "read_sas7bdat", 0) < 0) __PYX_ERR(0, 37, __pyx_L3_error) - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":38 - * - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":39 - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":40 - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS sas7bdat file. -*/ - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_sas7bdat", 0, 1, 16, i); __PYX_ERR(0, 37, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 16: - values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __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, 37, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":37 - * # Parsing functions - * - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":38 - * - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":39 - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":40 - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS sas7bdat file. -*/ - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_filename_path = values[0]; - __pyx_v_metadataonly = values[1]; - __pyx_v_dates_as_pandas_datetime = values[2]; - __pyx_v_catalog_file = values[3]; - __pyx_v_formats_as_category = values[4]; - __pyx_v_formats_as_ordered_category = values[5]; - __pyx_v_encoding = ((PyObject*)values[6]); - __pyx_v_usecols = ((PyObject*)values[7]); - __pyx_v_user_missing = values[8]; - __pyx_v_disable_datetime_conversion = values[9]; - if (values[10]) { - __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) - } else { - __pyx_v_row_limit = ((int)((int)0)); - } - if (values[11]) { - __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) - } else { - __pyx_v_row_offset = ((int)((int)0)); - } - __pyx_v_output_format = ((PyObject*)values[12]); - __pyx_v_extra_datetime_formats = ((PyObject*)values[13]); - __pyx_v_extra_date_formats = ((PyObject*)values[14]); - __pyx_v_extra_time_formats = ((PyObject*)values[15]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_sas7bdat", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 37, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_sas7bdat", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 38, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 38, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 39, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 40, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 40, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 40, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_read_sas7bdat(__pyx_self, __pyx_v_filename_path, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_catalog_file, __pyx_v_formats_as_category, __pyx_v_formats_as_ordered_category, __pyx_v_encoding, __pyx_v_usecols, __pyx_v_user_missing, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); - - /* "pyreadstat/pyreadstat.pyx":37 - * # Parsing functions - * - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_read_sas7bdat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, PyObject *__pyx_v_catalog_file, PyObject *__pyx_v_formats_as_category, PyObject *__pyx_v_formats_as_ordered_category, PyObject *__pyx_v_encoding, PyObject *__pyx_v_usecols, PyObject *__pyx_v_user_missing, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats) { - int __pyx_v_metaonly; - int __pyx_v_dates_as_pandas; - int __pyx_v_usernan; - int __pyx_v_no_datetime_conversion; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_v_file_extension; - PyObject *__pyx_v_data_frame = NULL; - PyObject *__pyx_v_metadata = NULL; - CYTHON_UNUSED PyObject *__pyx_v__ = NULL; - PyObject *__pyx_v_catalog = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - size_t __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_sas7bdat", 0); - - /* "pyreadstat/pyreadstat.pyx":108 - * """ - * - * cdef bint metaonly = 0 # <<<<<<<<<<<<<< - * if metadataonly: - * metaonly = 1 -*/ - __pyx_v_metaonly = 0; - - /* "pyreadstat/pyreadstat.pyx":109 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 109, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":110 - * cdef bint metaonly = 0 - * if metadataonly: - * metaonly = 1 # <<<<<<<<<<<<<< - * - * cdef bint dates_as_pandas = 0 -*/ - __pyx_v_metaonly = 1; - - /* "pyreadstat/pyreadstat.pyx":109 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":112 - * metaonly = 1 - * - * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 -*/ - __pyx_v_dates_as_pandas = 0; - - /* "pyreadstat/pyreadstat.pyx":113 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 113, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":114 - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 # <<<<<<<<<<<<<< - * - * cdef bint usernan = 0 -*/ - __pyx_v_dates_as_pandas = 1; - - /* "pyreadstat/pyreadstat.pyx":113 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":116 - * dates_as_pandas = 1 - * - * cdef bint usernan = 0 # <<<<<<<<<<<<<< - * if user_missing: - * usernan = 1 -*/ - __pyx_v_usernan = 0; - - /* "pyreadstat/pyreadstat.pyx":117 - * - * cdef bint usernan = 0 - * if user_missing: # <<<<<<<<<<<<<< - * usernan = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":118 - * cdef bint usernan = 0 - * if user_missing: - * usernan = 1 # <<<<<<<<<<<<<< - * - * cdef bint no_datetime_conversion = 0 -*/ - __pyx_v_usernan = 1; - - /* "pyreadstat/pyreadstat.pyx":117 - * - * cdef bint usernan = 0 - * if user_missing: # <<<<<<<<<<<<<< - * usernan = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":120 - * usernan = 1 - * - * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< - * if disable_datetime_conversion: - * no_datetime_conversion = 1 -*/ - __pyx_v_no_datetime_conversion = 0; - - /* "pyreadstat/pyreadstat.pyx":121 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 121, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":122 - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: - * no_datetime_conversion = 1 # <<<<<<<<<<<<<< - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS -*/ - __pyx_v_no_datetime_conversion = 1; - - /* "pyreadstat/pyreadstat.pyx":121 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":124 - * no_datetime_conversion = 1 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS # <<<<<<<<<<<<<< - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BDAT - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, -*/ - __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - - /* "pyreadstat/pyreadstat.pyx":125 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BDAT # <<<<<<<<<<<<<< - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, -*/ - __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT; - - /* "pyreadstat/pyreadstat.pyx":126 - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BDAT - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) -*/ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 126, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_L8_unpacking_done:; - } - __pyx_v_data_frame = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_metadata = __pyx_t_4; - __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":129 - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "sas7bdat" # <<<<<<<<<<<<<< - * - * if catalog_file: -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_format, __pyx_mstate_global->__pyx_n_u_sas7bdat) < 0) __PYX_ERR(0, 129, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":131 - * metadata.file_format = "sas7bdat" - * - * if catalog_file: # <<<<<<<<<<<<<< - * _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) - * data_frame, metadata = set_catalog_to_sas(data_frame, metadata, catalog, formats_as_category=formats_as_category, -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_catalog_file); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 131, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":132 - * - * if catalog_file: - * _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) # <<<<<<<<<<<<<< - * data_frame, metadata = set_catalog_to_sas(data_frame, metadata, catalog, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) -*/ - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_read_sas7bcat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = 1; - #if CYTHON_UNPACK_METHODS - 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_3, __pyx__function); - __pyx_t_7 = 0; - } - #endif - { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_catalog_file}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_encoding, __pyx_v_encoding, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 132, __pyx_L1_error) - __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 132, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_5); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); - index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(0, 132, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L11_unpacking_done; - __pyx_L10_unpacking_failed:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 132, __pyx_L1_error) - __pyx_L11_unpacking_done:; - } - __pyx_v__ = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_catalog = __pyx_t_5; - __pyx_t_5 = 0; - - /* "pyreadstat/pyreadstat.pyx":133 - * if catalog_file: - * _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) - * data_frame, metadata = set_catalog_to_sas(data_frame, metadata, catalog, formats_as_category=formats_as_category, # <<<<<<<<<<<<<< - * formats_as_ordered_category=formats_as_ordered_category) - * -*/ - __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_catalog_to_sas); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "pyreadstat/pyreadstat.pyx":134 - * _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) - * data_frame, metadata = set_catalog_to_sas(data_frame, metadata, catalog, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) # <<<<<<<<<<<<<< - * - * return data_frame, metadata -*/ - __pyx_t_7 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_5); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_7 = 0; - } - #endif - { - PyObject *__pyx_callargs[4 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_5, __pyx_v_data_frame, __pyx_v_metadata, __pyx_v_catalog}; - __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_formats_as_category, __pyx_v_formats_as_category, __pyx_t_4, __pyx_callargs+4, 0) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category, __pyx_v_formats_as_ordered_category, __pyx_t_4, __pyx_callargs+4, 1) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 133, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L13_unpacking_done; - __pyx_L12_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 133, __pyx_L1_error) - __pyx_L13_unpacking_done:; - } - - /* "pyreadstat/pyreadstat.pyx":133 - * if catalog_file: - * _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) - * data_frame, metadata = set_catalog_to_sas(data_frame, metadata, catalog, formats_as_category=formats_as_category, # <<<<<<<<<<<<<< - * formats_as_ordered_category=formats_as_ordered_category) - * -*/ - __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_metadata, __pyx_t_4); - __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":131 - * metadata.file_format = "sas7bdat" - * - * if catalog_file: # <<<<<<<<<<<<<< - * _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) - * data_frame, metadata = set_catalog_to_sas(data_frame, metadata, catalog, formats_as_category=formats_as_category, -*/ - } - - /* "pyreadstat/pyreadstat.pyx":136 - * formats_as_ordered_category=formats_as_ordered_category) - * - * return data_frame, metadata # <<<<<<<<<<<<<< - * - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_data_frame); - __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 136, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_metadata); - __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 136, __pyx_L1_error); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "pyreadstat/pyreadstat.pyx":37 - * # Parsing functions - * - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_sas7bdat", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_data_frame); - __Pyx_XDECREF(__pyx_v_metadata); - __Pyx_XDECREF(__pyx_v__); - __Pyx_XDECREF(__pyx_v_catalog); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":139 - * - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, # <<<<<<<<<<<<<< - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_3read_xport(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_2read_xport, "\n Read a SAS xport file.\n\n Parameters\n ----------\n filename_path : str, bytes, Path-like object or file-like object\n path to the file or file-like object. In python 2.7 the string is assumed to be utf-8 encoded.\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date, effective only for pandas.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not sk""ipping anything.\n output_format : str, optional\n one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the\n user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a \n dataframe is avoided.\n extra_datetime_formats: list of str, optional\n formats to be parsed as python datetime objects\n extra_date_formats: list of str, optional\n formats to be parsed as python date objects\n extra_time_formats: list of str, optional\n formats to be parsed as python time objects\n\n Returns\n -------\n data_frame : dataframe or dict\n a dataframe or dict with the data.\n metadata :\n object with metadata. Look at the documentation for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_3read_xport = {"read_xport", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_3read_xport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_2read_xport}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_3read_xport(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_filename_path = 0; - PyObject *__pyx_v_metadataonly = 0; - PyObject *__pyx_v_dates_as_pandas_datetime = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_usecols = 0; - PyObject *__pyx_v_disable_datetime_conversion = 0; - int __pyx_v_row_limit; - int __pyx_v_row_offset; - PyObject *__pyx_v_output_format = 0; - PyObject *__pyx_v_extra_datetime_formats = 0; - PyObject *__pyx_v_extra_date_formats = 0; - PyObject *__pyx_v_extra_time_formats = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_xport (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,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, 139, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 12: - values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, "read_xport", 0) < 0) __PYX_ERR(0, 139, __pyx_L3_error) - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":140 - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, # <<<<<<<<<<<<<< - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":141 - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS xport file. -*/ - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_xport", 0, 1, 12, i); __PYX_ERR(0, 139, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 12: - values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":139 - * - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, # <<<<<<<<<<<<<< - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":140 - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, # <<<<<<<<<<<<<< - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":141 - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS xport file. -*/ - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_filename_path = values[0]; - __pyx_v_metadataonly = values[1]; - __pyx_v_dates_as_pandas_datetime = values[2]; - __pyx_v_encoding = ((PyObject*)values[3]); - __pyx_v_usecols = ((PyObject*)values[4]); - __pyx_v_disable_datetime_conversion = values[5]; - if (values[6]) { - __pyx_v_row_limit = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error) - } else { - __pyx_v_row_limit = ((int)((int)0)); - } - if (values[7]) { - __pyx_v_row_offset = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error) - } else { - __pyx_v_row_offset = ((int)((int)0)); - } - __pyx_v_output_format = ((PyObject*)values[8]); - __pyx_v_extra_datetime_formats = ((PyObject*)values[9]); - __pyx_v_extra_date_formats = ((PyObject*)values[10]); - __pyx_v_extra_time_formats = ((PyObject*)values[11]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_xport", 0, 1, 12, __pyx_nargs); __PYX_ERR(0, 139, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_xport", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 139, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 140, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 141, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 141, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 141, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 141, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_2read_xport(__pyx_self, __pyx_v_filename_path, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_encoding, __pyx_v_usecols, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); - - /* "pyreadstat/pyreadstat.pyx":139 - * - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, # <<<<<<<<<<<<<< - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_2read_xport(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, PyObject *__pyx_v_encoding, PyObject *__pyx_v_usecols, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats) { - int __pyx_v_metaonly; - int __pyx_v_dates_as_pandas; - int __pyx_v_usernan; - int __pyx_v_no_datetime_conversion; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_v_file_extension; - PyObject *__pyx_v_data_frame = NULL; - PyObject *__pyx_v_metadata = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_xport", 0); - - /* "pyreadstat/pyreadstat.pyx":189 - * """ - * - * cdef bint metaonly = 0 # <<<<<<<<<<<<<< - * if metadataonly: - * metaonly = 1 -*/ - __pyx_v_metaonly = 0; - - /* "pyreadstat/pyreadstat.pyx":190 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":191 - * cdef bint metaonly = 0 - * if metadataonly: - * metaonly = 1 # <<<<<<<<<<<<<< - * - * cdef bint dates_as_pandas = 0 -*/ - __pyx_v_metaonly = 1; - - /* "pyreadstat/pyreadstat.pyx":190 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":193 - * metaonly = 1 - * - * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 -*/ - __pyx_v_dates_as_pandas = 0; - - /* "pyreadstat/pyreadstat.pyx":194 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 194, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":195 - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 # <<<<<<<<<<<<<< - * - * cdef bint usernan = 0 -*/ - __pyx_v_dates_as_pandas = 1; - - /* "pyreadstat/pyreadstat.pyx":194 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":197 - * dates_as_pandas = 1 - * - * cdef bint usernan = 0 # <<<<<<<<<<<<<< - * - * cdef bint no_datetime_conversion = 0 -*/ - __pyx_v_usernan = 0; - - /* "pyreadstat/pyreadstat.pyx":199 - * cdef bint usernan = 0 - * - * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< - * if disable_datetime_conversion: - * no_datetime_conversion = 1 -*/ - __pyx_v_no_datetime_conversion = 0; - - /* "pyreadstat/pyreadstat.pyx":200 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":201 - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: - * no_datetime_conversion = 1 # <<<<<<<<<<<<<< - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS -*/ - __pyx_v_no_datetime_conversion = 1; - - /* "pyreadstat/pyreadstat.pyx":200 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":203 - * no_datetime_conversion = 1 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS # <<<<<<<<<<<<<< - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_XPORT - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, -*/ - __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - - /* "pyreadstat/pyreadstat.pyx":204 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_XPORT # <<<<<<<<<<<<<< - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, -*/ - __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT; - - /* "pyreadstat/pyreadstat.pyx":205 - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_XPORT - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) -*/ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 205, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 205, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L7_unpacking_done; - __pyx_L6_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 205, __pyx_L1_error) - __pyx_L7_unpacking_done:; - } - __pyx_v_data_frame = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_metadata = __pyx_t_4; - __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":208 - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "xport" # <<<<<<<<<<<<<< - * - * return data_frame, metadata -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_format, __pyx_mstate_global->__pyx_n_u_xport) < 0) __PYX_ERR(0, 208, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":210 - * metadata.file_format = "xport" - * - * return data_frame, metadata # <<<<<<<<<<<<<< - * - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_data_frame); - __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 210, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_metadata); - __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 210, __pyx_L1_error); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "pyreadstat/pyreadstat.pyx":139 - * - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, # <<<<<<<<<<<<<< - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_xport", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_data_frame); - __Pyx_XDECREF(__pyx_v_metadata); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":213 - * - * - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_5read_dta(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_4read_dta, "\n Read a STATA dta file\n\n Parameters\n ----------\n filename_path : str, bytes, Path-like object or file-like object\n path to the file or file-like object. In python 2.7 the string is assumed to be utf-8 encoded.\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date, effective only for pandas.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed\n for their formatted version will be transformed into categories.\n formats_as_ordered_category : bool, optional\n defaults to False. If True the variables having formats will be transformed into ordered categories/enum.\n it has precedence over formats_as_category, meaning if this is True, it will take effect irrespective of\n the value of formats_as_category.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n user_missing : bool, optional\n by default False, in this case user defined missing values are delivered as nan. If true, the missing values\n will be deliver as ""is, and an extra piece of information will be set in the metadata (missing_user_values)\n to be able to interpret those values as missing.\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n output_format : str, optional\n one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the\n user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a \n dataframe is avoided.\n extra_datetime_formats: list of str, optional\n formats to be parsed as python datetime objects\n extra_date_formats: list of str, optional\n formats to be parsed as python date objects\n extra_time_formats: list of str, optional\n formats to be parsed as python time objects\n\n Returns\n -------\n data_frame : dataframe or dict\n a dataframe or dict with the data.\n metadata :\n object with metadata. Look at the d""ocumentation for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_5read_dta = {"read_dta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_5read_dta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_4read_dta}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_5read_dta(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_filename_path = 0; - PyObject *__pyx_v_metadataonly = 0; - PyObject *__pyx_v_dates_as_pandas_datetime = 0; - PyObject *__pyx_v_apply_value_formats = 0; - PyObject *__pyx_v_formats_as_category = 0; - PyObject *__pyx_v_formats_as_ordered_category = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_usecols = 0; - PyObject *__pyx_v_user_missing = 0; - PyObject *__pyx_v_disable_datetime_conversion = 0; - int __pyx_v_row_limit; - int __pyx_v_row_offset; - PyObject *__pyx_v_output_format = 0; - PyObject *__pyx_v_extra_datetime_formats = 0; - PyObject *__pyx_v_extra_date_formats = 0; - PyObject *__pyx_v_extra_time_formats = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_dta (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_apply_value_formats,&__pyx_mstate_global->__pyx_n_u_formats_as_category,&__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_user_missing,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,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, 213, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 16: - values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, "read_dta", 0) < 0) __PYX_ERR(0, 213, __pyx_L3_error) - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":214 - * - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":215 - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":216 - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a STATA dta file -*/ - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_dta", 0, 1, 16, i); __PYX_ERR(0, 213, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 16: - values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":214 - * - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":215 - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":216 - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a STATA dta file -*/ - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_filename_path = values[0]; - __pyx_v_metadataonly = values[1]; - __pyx_v_dates_as_pandas_datetime = values[2]; - __pyx_v_apply_value_formats = values[3]; - __pyx_v_formats_as_category = values[4]; - __pyx_v_formats_as_ordered_category = values[5]; - __pyx_v_encoding = ((PyObject*)values[6]); - __pyx_v_usecols = ((PyObject*)values[7]); - __pyx_v_user_missing = values[8]; - __pyx_v_disable_datetime_conversion = values[9]; - if (values[10]) { - __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) - } else { - __pyx_v_row_limit = ((int)((int)0)); - } - if (values[11]) { - __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error) - } else { - __pyx_v_row_offset = ((int)((int)0)); - } - __pyx_v_output_format = ((PyObject*)values[12]); - __pyx_v_extra_datetime_formats = ((PyObject*)values[13]); - __pyx_v_extra_date_formats = ((PyObject*)values[14]); - __pyx_v_extra_time_formats = ((PyObject*)values[15]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_dta", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 213, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_dta", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 214, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 214, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 215, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 216, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 216, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 216, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_4read_dta(__pyx_self, __pyx_v_filename_path, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_apply_value_formats, __pyx_v_formats_as_category, __pyx_v_formats_as_ordered_category, __pyx_v_encoding, __pyx_v_usecols, __pyx_v_user_missing, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); - - /* "pyreadstat/pyreadstat.pyx":213 - * - * - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_4read_dta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, PyObject *__pyx_v_apply_value_formats, PyObject *__pyx_v_formats_as_category, PyObject *__pyx_v_formats_as_ordered_category, PyObject *__pyx_v_encoding, PyObject *__pyx_v_usecols, PyObject *__pyx_v_user_missing, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats) { - int __pyx_v_metaonly; - int __pyx_v_dates_as_pandas; - int __pyx_v_usernan; - int __pyx_v_no_datetime_conversion; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_v_file_extension; - PyObject *__pyx_v_data_frame = NULL; - PyObject *__pyx_v_metadata = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - size_t __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_dta", 0); - - /* "pyreadstat/pyreadstat.pyx":278 - * """ - * - * cdef bint metaonly = 0 # <<<<<<<<<<<<<< - * if metadataonly: - * metaonly = 1 -*/ - __pyx_v_metaonly = 0; - - /* "pyreadstat/pyreadstat.pyx":279 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 279, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":280 - * cdef bint metaonly = 0 - * if metadataonly: - * metaonly = 1 # <<<<<<<<<<<<<< - * - * cdef bint dates_as_pandas = 0 -*/ - __pyx_v_metaonly = 1; - - /* "pyreadstat/pyreadstat.pyx":279 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":282 - * metaonly = 1 - * - * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 -*/ - __pyx_v_dates_as_pandas = 0; - - /* "pyreadstat/pyreadstat.pyx":283 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 283, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":284 - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 # <<<<<<<<<<<<<< - * - * cdef bint usernan = 0 -*/ - __pyx_v_dates_as_pandas = 1; - - /* "pyreadstat/pyreadstat.pyx":283 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":286 - * dates_as_pandas = 1 - * - * cdef bint usernan = 0 # <<<<<<<<<<<<<< - * if user_missing: - * usernan = 1 -*/ - __pyx_v_usernan = 0; - - /* "pyreadstat/pyreadstat.pyx":287 - * - * cdef bint usernan = 0 - * if user_missing: # <<<<<<<<<<<<<< - * usernan = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":288 - * cdef bint usernan = 0 - * if user_missing: - * usernan = 1 # <<<<<<<<<<<<<< - * - * cdef bint no_datetime_conversion = 0 -*/ - __pyx_v_usernan = 1; - - /* "pyreadstat/pyreadstat.pyx":287 - * - * cdef bint usernan = 0 - * if user_missing: # <<<<<<<<<<<<<< - * usernan = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":290 - * usernan = 1 - * - * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< - * if disable_datetime_conversion: - * no_datetime_conversion = 1 -*/ - __pyx_v_no_datetime_conversion = 0; - - /* "pyreadstat/pyreadstat.pyx":291 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 291, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":292 - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: - * no_datetime_conversion = 1 # <<<<<<<<<<<<<< - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_STATA -*/ - __pyx_v_no_datetime_conversion = 1; - - /* "pyreadstat/pyreadstat.pyx":291 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":294 - * no_datetime_conversion = 1 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_STATA # <<<<<<<<<<<<<< - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_DTA - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, -*/ - __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA; - - /* "pyreadstat/pyreadstat.pyx":295 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_STATA - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_DTA # <<<<<<<<<<<<<< - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, -*/ - __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA; - - /* "pyreadstat/pyreadstat.pyx":296 - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_STATA - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_DTA - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) -*/ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 296, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 296, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 296, __pyx_L1_error) - __pyx_L8_unpacking_done:; - } - __pyx_v_data_frame = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_metadata = __pyx_t_4; - __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":299 - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "dta" # <<<<<<<<<<<<<< - * - * if apply_value_formats: -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_format, __pyx_mstate_global->__pyx_n_u_dta) < 0) __PYX_ERR(0, 299, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":301 - * metadata.file_format = "dta" - * - * if apply_value_formats: # <<<<<<<<<<<<<< - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_apply_value_formats); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":302 - * - * if apply_value_formats: - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, # <<<<<<<<<<<<<< - * formats_as_ordered_category=formats_as_ordered_category) - * -*/ - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_value_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "pyreadstat/pyreadstat.pyx":303 - * if apply_value_formats: - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) # <<<<<<<<<<<<<< - * - * return data_frame, metadata -*/ - __pyx_t_7 = 1; - #if CYTHON_UNPACK_METHODS - 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_3, __pyx__function); - __pyx_t_7 = 0; - } - #endif - { - PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, __pyx_v_data_frame, __pyx_v_metadata}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_formats_as_category, __pyx_v_formats_as_category, __pyx_t_5, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 302, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category, __pyx_v_formats_as_ordered_category, __pyx_t_5, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 302, __pyx_L1_error) - __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":301 - * metadata.file_format = "dta" - * - * if apply_value_formats: # <<<<<<<<<<<<<< - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) -*/ - } - - /* "pyreadstat/pyreadstat.pyx":305 - * formats_as_ordered_category=formats_as_ordered_category) - * - * return data_frame, metadata # <<<<<<<<<<<<<< - * - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_data_frame); - __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 305, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_metadata); - __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 305, __pyx_L1_error); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "pyreadstat/pyreadstat.pyx":213 - * - * - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_dta", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_data_frame); - __Pyx_XDECREF(__pyx_v_metadata); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":308 - * - * - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_7read_sav(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_6read_sav, "\n Read a SPSS sav or zsav (compressed) files\n\n Parameters\n ----------\n filename_path : str, bytes, Path-like object or file-like object\n path to the file or file-like object. In python 2.7 the string is assumed to be utf-8 encoded.\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date, effective only for pandas.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed\n for their formatted version will be transformed into categories.\n formats_as_ordered_category : bool, optional\n defaults to False. If True the variables having formats will be transformed into ordered categories/enum.\n it has precedence over formats_as_category, meaning if this is True, it will take effect irrespective of\n the value of formats_as_category.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n user_missing : bool, optional\n by default False, in this case user defined missing values are delivered as nan. If true, the missing values\n "" will be deliver as is, and an extra piece of information will be set in the metadata (missing_ranges)\n to be able to interpret those values as missing.\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n will remain as numbers. In order to convert them later to an appropiate python object, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n output_format : str, optional\n one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the\n user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a \n dataframe is avoided.\n extra_datetime_formats: list of str, optional\n formats to be parsed as python datetime objects\n extra_date_formats: list of str, optional\n formats to be parsed as python date objects\n extra_time_formats: list of str, optional\n formats to be parsed as python time objects\n\n Returns\n -------\n data_frame : dataframe or dict\n a dataframe or dict with the data.\n metadata :\n object with metadat""a. Look at the documentation for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_7read_sav = {"read_sav", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_7read_sav, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_6read_sav}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_7read_sav(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_filename_path = 0; - PyObject *__pyx_v_metadataonly = 0; - PyObject *__pyx_v_dates_as_pandas_datetime = 0; - PyObject *__pyx_v_apply_value_formats = 0; - PyObject *__pyx_v_formats_as_category = 0; - PyObject *__pyx_v_formats_as_ordered_category = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_usecols = 0; - PyObject *__pyx_v_user_missing = 0; - PyObject *__pyx_v_disable_datetime_conversion = 0; - int __pyx_v_row_limit; - int __pyx_v_row_offset; - PyObject *__pyx_v_output_format = 0; - PyObject *__pyx_v_extra_datetime_formats = 0; - PyObject *__pyx_v_extra_date_formats = 0; - PyObject *__pyx_v_extra_time_formats = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_sav (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_apply_value_formats,&__pyx_mstate_global->__pyx_n_u_formats_as_category,&__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_user_missing,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,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, 308, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 16: - values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, "read_sav", 0) < 0) __PYX_ERR(0, 308, __pyx_L3_error) - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":309 - * - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, - * list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":310 - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< - * list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":311 - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, - * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SPSS sav or zsav (compressed) files -*/ - if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_sav", 0, 1, 16, i); __PYX_ERR(0, 308, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 16: - values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __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, 308, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":309 - * - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, - * list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":310 - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< - * list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":311 - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, - * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SPSS sav or zsav (compressed) files -*/ - if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_filename_path = values[0]; - __pyx_v_metadataonly = values[1]; - __pyx_v_dates_as_pandas_datetime = values[2]; - __pyx_v_apply_value_formats = values[3]; - __pyx_v_formats_as_category = values[4]; - __pyx_v_formats_as_ordered_category = values[5]; - __pyx_v_encoding = ((PyObject*)values[6]); - __pyx_v_usecols = ((PyObject*)values[7]); - __pyx_v_user_missing = values[8]; - __pyx_v_disable_datetime_conversion = values[9]; - if (values[10]) { - __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error) - } else { - __pyx_v_row_limit = ((int)((int)0)); - } - if (values[11]) { - __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error) - } else { - __pyx_v_row_offset = ((int)((int)0)); - } - __pyx_v_output_format = ((PyObject*)values[12]); - __pyx_v_extra_datetime_formats = ((PyObject*)values[13]); - __pyx_v_extra_date_formats = ((PyObject*)values[14]); - __pyx_v_extra_time_formats = ((PyObject*)values[15]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_sav", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 308, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_sav", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 309, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 309, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 310, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 310, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 311, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 311, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_6read_sav(__pyx_self, __pyx_v_filename_path, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_apply_value_formats, __pyx_v_formats_as_category, __pyx_v_formats_as_ordered_category, __pyx_v_encoding, __pyx_v_usecols, __pyx_v_user_missing, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); - - /* "pyreadstat/pyreadstat.pyx":308 - * - * - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_6read_sav(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, PyObject *__pyx_v_apply_value_formats, PyObject *__pyx_v_formats_as_category, PyObject *__pyx_v_formats_as_ordered_category, PyObject *__pyx_v_encoding, PyObject *__pyx_v_usecols, PyObject *__pyx_v_user_missing, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats) { - int __pyx_v_metaonly; - int __pyx_v_dates_as_pandas; - int __pyx_v_usernan; - int __pyx_v_no_datetime_conversion; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_v_file_extension; - PyObject *__pyx_v_data_frame = NULL; - PyObject *__pyx_v_metadata = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - size_t __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_sav", 0); - - /* "pyreadstat/pyreadstat.pyx":373 - * """ - * - * cdef bint metaonly = 0 # <<<<<<<<<<<<<< - * if metadataonly: - * metaonly = 1 -*/ - __pyx_v_metaonly = 0; - - /* "pyreadstat/pyreadstat.pyx":374 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 374, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":375 - * cdef bint metaonly = 0 - * if metadataonly: - * metaonly = 1 # <<<<<<<<<<<<<< - * - * cdef bint dates_as_pandas = 0 -*/ - __pyx_v_metaonly = 1; - - /* "pyreadstat/pyreadstat.pyx":374 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":377 - * metaonly = 1 - * - * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 -*/ - __pyx_v_dates_as_pandas = 0; - - /* "pyreadstat/pyreadstat.pyx":378 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 378, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":379 - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 # <<<<<<<<<<<<<< - * - * cdef bint usernan = 0 -*/ - __pyx_v_dates_as_pandas = 1; - - /* "pyreadstat/pyreadstat.pyx":378 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":381 - * dates_as_pandas = 1 - * - * cdef bint usernan = 0 # <<<<<<<<<<<<<< - * if user_missing: - * usernan = 1 -*/ - __pyx_v_usernan = 0; - - /* "pyreadstat/pyreadstat.pyx":382 - * - * cdef bint usernan = 0 - * if user_missing: # <<<<<<<<<<<<<< - * usernan = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 382, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":383 - * cdef bint usernan = 0 - * if user_missing: - * usernan = 1 # <<<<<<<<<<<<<< - * - * cdef bint no_datetime_conversion = 0 -*/ - __pyx_v_usernan = 1; - - /* "pyreadstat/pyreadstat.pyx":382 - * - * cdef bint usernan = 0 - * if user_missing: # <<<<<<<<<<<<<< - * usernan = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":385 - * usernan = 1 - * - * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< - * if disable_datetime_conversion: - * no_datetime_conversion = 1 -*/ - __pyx_v_no_datetime_conversion = 0; - - /* "pyreadstat/pyreadstat.pyx":386 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 386, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":387 - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: - * no_datetime_conversion = 1 # <<<<<<<<<<<<<< - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS -*/ - __pyx_v_no_datetime_conversion = 1; - - /* "pyreadstat/pyreadstat.pyx":386 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":389 - * no_datetime_conversion = 1 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS # <<<<<<<<<<<<<< - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAV - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, -*/ - __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; - - /* "pyreadstat/pyreadstat.pyx":390 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAV # <<<<<<<<<<<<<< - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, -*/ - __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV; - - /* "pyreadstat/pyreadstat.pyx":391 - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAV - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) -*/ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 391, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 391, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 391, __pyx_L1_error) - __pyx_L8_unpacking_done:; - } - __pyx_v_data_frame = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_metadata = __pyx_t_4; - __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":394 - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "sav/zsav" # <<<<<<<<<<<<<< - * - * if apply_value_formats: -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_format, __pyx_mstate_global->__pyx_kp_u_sav_zsav) < 0) __PYX_ERR(0, 394, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":396 - * metadata.file_format = "sav/zsav" - * - * if apply_value_formats: # <<<<<<<<<<<<<< - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_apply_value_formats); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 396, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":397 - * - * if apply_value_formats: - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, # <<<<<<<<<<<<<< - * formats_as_ordered_category=formats_as_ordered_category) - * -*/ - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_value_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "pyreadstat/pyreadstat.pyx":398 - * if apply_value_formats: - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) # <<<<<<<<<<<<<< - * - * return data_frame, metadata -*/ - __pyx_t_7 = 1; - #if CYTHON_UNPACK_METHODS - 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_3, __pyx__function); - __pyx_t_7 = 0; - } - #endif - { - PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, __pyx_v_data_frame, __pyx_v_metadata}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_formats_as_category, __pyx_v_formats_as_category, __pyx_t_5, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 397, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category, __pyx_v_formats_as_ordered_category, __pyx_t_5, __pyx_callargs+3, 1) < 0) __PYX_ERR(0, 397, __pyx_L1_error) - __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":396 - * metadata.file_format = "sav/zsav" - * - * if apply_value_formats: # <<<<<<<<<<<<<< - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - * formats_as_ordered_category=formats_as_ordered_category) -*/ - } - - /* "pyreadstat/pyreadstat.pyx":400 - * formats_as_ordered_category=formats_as_ordered_category) - * - * return data_frame, metadata # <<<<<<<<<<<<<< - * - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_data_frame); - __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 400, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_metadata); - __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 400, __pyx_L1_error); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "pyreadstat/pyreadstat.pyx":308 - * - * - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_sav", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_data_frame); - __Pyx_XDECREF(__pyx_v_metadata); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":403 - * - * - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_9read_por(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_8read_por, "\n Read a SPSS por file. Files are assumed to be UTF-8 encoded, the encoding cannot be set to other.\n\n Parameters\n ----------\n filename_path : str, bytes, Path-like object or file-like object\n path to the file or file-like object. In python 2.7 the string is assumed to be utf-8 encoded.\n metadataonly : bool, optional\n by default False. IF true, no data will be read but only metadata, so that you can get all elements in the\n metadata object. The data frame will be set with the correct column names but no data.\n Notice that number_rows will be None as por files do not have the number of rows recorded in the file metadata.\n dates_as_pandas_datetime : bool, optional\n by default False. If true dates will be transformed to pandas datetime64 instead of date, effective only for pandas.\n apply_value_formats : bool, optional\n by default False. If true it will change values in the dataframe for they value labels in the metadata,\n if any appropiate are found.\n formats_as_category : bool, optional\n by default True. Takes effect only if apply_value_formats is True. If True, variables with values changed\n for their formatted version will be transformed into categories.\n formats_as_ordered_category : bool, optional\n defaults to False. If True the variables having formats will be transformed into ordered categories/enum.\n it has precedence over formats_as_category, meaning if this is True, it will take effect irrespective of\n the value of formats_as_category.\n usecols : list, optional\n a list with column names to read from the file. Only those columns will be imported. Case sensitive!\n disable_datetime_conversion : bool, optional\n if True pyreadstat will not attempt to convert dates, datetimes and times to python objects but those columns\n "" will remain as numbers. In order to convert them later to an appropiate python object, the user can use the\n information about the original variable format stored in the metadata object in original_variable_types.\n Disabling datetime conversion speeds up reading files. In addition it helps to overcome situations where\n there are datetimes that are beyond the limits of python datetime (which is limited to year 10,000, dates\n beyond that will rise an Overflow error in pyreadstat).\n row_limit : int, optional\n maximum number of rows to read. The default is 0 meaning unlimited.\n row_offset : int, optional\n start reading rows after this offset. By default 0, meaning start with the first row not skipping anything.\n output_format : str, optional\n one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the\n user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a \n dataframe is avoided.\n extra_datetime_formats: list of str, optional\n formats to be parsed as python datetime objects\n extra_date_formats: list of str, optional\n formats to be parsed as python date objects\n extra_time_formats: list of str, optional\n formats to be parsed as python time objects\n\n Returns\n -------\n data_frame : dataframe or dict\n a dataframe or dict with the data.\n metadata :\n object with metadata. Look at the documentation for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_9read_por = {"read_por", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_9read_por, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_8read_por}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_9read_por(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_filename_path = 0; - PyObject *__pyx_v_metadataonly = 0; - PyObject *__pyx_v_dates_as_pandas_datetime = 0; - PyObject *__pyx_v_apply_value_formats = 0; - PyObject *__pyx_v_formats_as_category = 0; - CYTHON_UNUSED PyObject *__pyx_v_formats_as_ordered_category = 0; - PyObject *__pyx_v_usecols = 0; - PyObject *__pyx_v_disable_datetime_conversion = 0; - int __pyx_v_row_limit; - int __pyx_v_row_offset; - PyObject *__pyx_v_output_format = 0; - PyObject *__pyx_v_extra_datetime_formats = 0; - PyObject *__pyx_v_extra_date_formats = 0; - PyObject *__pyx_v_extra_time_formats = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_por (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_apply_value_formats,&__pyx_mstate_global->__pyx_n_u_formats_as_category,&__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,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, 403, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 14: - values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, "read_por", 0) < 0) __PYX_ERR(0, 403, __pyx_L3_error) - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":404 - * - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":405 - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":406 - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SPSS por file. Files are assumed to be UTF-8 encoded, the encoding cannot be set to other. -*/ - if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_por", 0, 1, 14, i); __PYX_ERR(0, 403, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 14: - values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __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, 403, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":404 - * - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, # <<<<<<<<<<<<<< - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - - /* "pyreadstat/pyreadstat.pyx":405 - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":406 - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< - * r""" - * Read a SPSS por file. Files are assumed to be UTF-8 encoded, the encoding cannot be set to other. -*/ - if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_filename_path = values[0]; - __pyx_v_metadataonly = values[1]; - __pyx_v_dates_as_pandas_datetime = values[2]; - __pyx_v_apply_value_formats = values[3]; - __pyx_v_formats_as_category = values[4]; - __pyx_v_formats_as_ordered_category = values[5]; - __pyx_v_usecols = ((PyObject*)values[6]); - __pyx_v_disable_datetime_conversion = values[7]; - if (values[8]) { - __pyx_v_row_limit = __Pyx_PyLong_As_int(values[8]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L3_error) - } else { - __pyx_v_row_limit = ((int)((int)0)); - } - if (values[9]) { - __pyx_v_row_offset = __Pyx_PyLong_As_int(values[9]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L3_error) - } else { - __pyx_v_row_offset = ((int)((int)0)); - } - __pyx_v_output_format = ((PyObject*)values[10]); - __pyx_v_extra_datetime_formats = ((PyObject*)values[11]); - __pyx_v_extra_date_formats = ((PyObject*)values[12]); - __pyx_v_extra_time_formats = ((PyObject*)values[13]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_por", 0, 1, 14, __pyx_nargs); __PYX_ERR(0, 403, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_por", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 404, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 405, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 406, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 406, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 406, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_8read_por(__pyx_self, __pyx_v_filename_path, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_apply_value_formats, __pyx_v_formats_as_category, __pyx_v_formats_as_ordered_category, __pyx_v_usecols, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); - - /* "pyreadstat/pyreadstat.pyx":403 - * - * - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_8read_por(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, PyObject *__pyx_v_apply_value_formats, PyObject *__pyx_v_formats_as_category, CYTHON_UNUSED PyObject *__pyx_v_formats_as_ordered_category, PyObject *__pyx_v_usecols, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats) { - int __pyx_v_metaonly; - int __pyx_v_dates_as_pandas; - int __pyx_v_usernan; - int __pyx_v_no_datetime_conversion; - PyObject *__pyx_v_encoding = 0; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_v_file_extension; - PyObject *__pyx_v_data_frame = NULL; - PyObject *__pyx_v_metadata = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - size_t __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_por", 0); - - /* "pyreadstat/pyreadstat.pyx":462 - * """ - * - * cdef bint metaonly = 0 # <<<<<<<<<<<<<< - * if metadataonly: - * metaonly = 1 -*/ - __pyx_v_metaonly = 0; - - /* "pyreadstat/pyreadstat.pyx":463 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":464 - * cdef bint metaonly = 0 - * if metadataonly: - * metaonly = 1 # <<<<<<<<<<<<<< - * - * cdef bint dates_as_pandas = 0 -*/ - __pyx_v_metaonly = 1; - - /* "pyreadstat/pyreadstat.pyx":463 - * - * cdef bint metaonly = 0 - * if metadataonly: # <<<<<<<<<<<<<< - * metaonly = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":466 - * metaonly = 1 - * - * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 -*/ - __pyx_v_dates_as_pandas = 0; - - /* "pyreadstat/pyreadstat.pyx":467 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 467, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":468 - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: - * dates_as_pandas = 1 # <<<<<<<<<<<<<< - * - * cdef bint usernan = 0 -*/ - __pyx_v_dates_as_pandas = 1; - - /* "pyreadstat/pyreadstat.pyx":467 - * - * cdef bint dates_as_pandas = 0 - * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< - * dates_as_pandas = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":470 - * dates_as_pandas = 1 - * - * cdef bint usernan = 0 # <<<<<<<<<<<<<< - * - * cdef bint no_datetime_conversion = 0 -*/ - __pyx_v_usernan = 0; - - /* "pyreadstat/pyreadstat.pyx":472 - * cdef bint usernan = 0 - * - * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< - * if disable_datetime_conversion: - * no_datetime_conversion = 1 -*/ - __pyx_v_no_datetime_conversion = 0; - - /* "pyreadstat/pyreadstat.pyx":473 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 473, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":474 - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: - * no_datetime_conversion = 1 # <<<<<<<<<<<<<< - * - * cdef str encoding = None -*/ - __pyx_v_no_datetime_conversion = 1; - - /* "pyreadstat/pyreadstat.pyx":473 - * - * cdef bint no_datetime_conversion = 0 - * if disable_datetime_conversion: # <<<<<<<<<<<<<< - * no_datetime_conversion = 1 - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":476 - * no_datetime_conversion = 1 - * - * cdef str encoding = None # <<<<<<<<<<<<<< - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS -*/ - __Pyx_INCREF(Py_None); - __pyx_v_encoding = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":478 - * cdef str encoding = None - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS # <<<<<<<<<<<<<< - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_POR - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, -*/ - __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; - - /* "pyreadstat/pyreadstat.pyx":479 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_POR # <<<<<<<<<<<<<< - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, -*/ - __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR; - - /* "pyreadstat/pyreadstat.pyx":480 - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_POR - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) -*/ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 480, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 480, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L7_unpacking_done; - __pyx_L6_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 480, __pyx_L1_error) - __pyx_L7_unpacking_done:; - } - __pyx_v_data_frame = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_metadata = __pyx_t_4; - __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":483 - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "por" # <<<<<<<<<<<<<< - * if apply_value_formats: - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category) -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_format, __pyx_mstate_global->__pyx_n_u_por) < 0) __PYX_ERR(0, 483, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":484 - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "por" - * if apply_value_formats: # <<<<<<<<<<<<<< - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category) - * -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_apply_value_formats); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 484, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":485 - * metadata.file_format = "por" - * if apply_value_formats: - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category) # <<<<<<<<<<<<<< - * - * return data_frame, metadata -*/ - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_value_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = 1; - #if CYTHON_UNPACK_METHODS - 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_3, __pyx__function); - __pyx_t_7 = 0; - } - #endif - { - PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_data_frame, __pyx_v_metadata}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_formats_as_category, __pyx_v_formats_as_category, __pyx_t_5, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 485, __pyx_L1_error) - __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":484 - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "por" - * if apply_value_formats: # <<<<<<<<<<<<<< - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category) - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":487 - * data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category) - * - * return data_frame, metadata # <<<<<<<<<<<<<< - * - * -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_data_frame); - __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 487, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_metadata); - __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 487, __pyx_L1_error); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "pyreadstat/pyreadstat.pyx":403 - * - * - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_por", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_encoding); - __Pyx_XDECREF(__pyx_v_data_frame); - __Pyx_XDECREF(__pyx_v_metadata); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":490 - * - * - * def read_sas7bcat(filename_path, str encoding=None, str output_format=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_11read_sas7bcat(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_10read_sas7bcat, "\n Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary\n value_labels that contains the formats. When parsing the sas7bdat file, in the metadata, the dictionary\n variable_to_label contains a map from variable name to the formats.\n In order to apply the catalog to the sas7bdat file use set_catalog_to_sas or pass the catalog file as an argument\n to read_sas7bdat directly.\n SAS catalog files are difficult ones, some of them can be read only in specific SAS version, may contain strange\n encodings etc. Therefore it may be that many catalog files are not readable from this application.\n\n Parameters\n ----------\n filename_path : str, bytes, Path-like object or file-like object\n path to the file or file-like object. In python 2.7 the string is assumed to be utf-8 encoded.\n encoding : str, optional\n Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an\n iconv-compatible name\n output_format : str, optional\n one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned. \n Notice that for this function the resulting object is always empty, this is done for consistency with other functions\n but has no impact on performance.\n\n Returns\n -------\n data_frame : dataframe or dict\n a dataframe with the data (no data in this case, so will be always empty).\n metadata :\n object with metadata. The member value_labels is the one that contains the formats.\n Look at the documentation for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_11read_sas7bcat = {"read_sas7bcat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_11read_sas7bcat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_10read_sas7bcat}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_11read_sas7bcat(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_filename_path = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_output_format = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_sas7bcat (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_output_format,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, 490, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 3: - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 490, __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, 490, __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, 490, __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, "read_sas7bcat", 0) < 0) __PYX_ERR(0, 490, __pyx_L3_error) - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_sas7bcat", 0, 1, 3, i); __PYX_ERR(0, 490, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 3: - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 490, __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, 490, __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, 490, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_filename_path = values[0]; - __pyx_v_encoding = ((PyObject*)values[1]); - __pyx_v_output_format = ((PyObject*)values[2]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_sas7bcat", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 490, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_sas7bcat", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 490, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 490, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_10read_sas7bcat(__pyx_self, __pyx_v_filename_path, __pyx_v_encoding, __pyx_v_output_format); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_10read_sas7bcat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_encoding, PyObject *__pyx_v_output_format) { - int __pyx_v_metaonly; - int __pyx_v_dates_as_pandas; - PyObject *__pyx_v_usecols = 0; - int __pyx_v_usernan; - int __pyx_v_no_datetime_conversion; - long __pyx_v_row_limit; - long __pyx_v_row_offset; - PyObject *__pyx_v_extra_datetime_formats = 0; - PyObject *__pyx_v_extra_date_formats = 0; - PyObject *__pyx_v_extra_time_formats = 0; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format; - __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_v_file_extension; - PyObject *__pyx_v_data_frame = NULL; - PyObject *__pyx_v_metadata = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *(*__pyx_t_5)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_sas7bcat", 0); - - /* "pyreadstat/pyreadstat.pyx":520 - * Look at the documentation for more information. - * """ - * cdef bint metaonly = 1 # <<<<<<<<<<<<<< - * cdef bint dates_as_pandas = 0 - * cdef list usecols = None -*/ - __pyx_v_metaonly = 1; - - /* "pyreadstat/pyreadstat.pyx":521 - * """ - * cdef bint metaonly = 1 - * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< - * cdef list usecols = None - * cdef bint usernan = 0 -*/ - __pyx_v_dates_as_pandas = 0; - - /* "pyreadstat/pyreadstat.pyx":522 - * cdef bint metaonly = 1 - * cdef bint dates_as_pandas = 0 - * cdef list usecols = None # <<<<<<<<<<<<<< - * cdef bint usernan = 0 - * cdef bint no_datetime_conversion = 0 -*/ - __Pyx_INCREF(Py_None); - __pyx_v_usecols = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":523 - * cdef bint dates_as_pandas = 0 - * cdef list usecols = None - * cdef bint usernan = 0 # <<<<<<<<<<<<<< - * cdef bint no_datetime_conversion = 0 - * cdef long row_limit=0 -*/ - __pyx_v_usernan = 0; - - /* "pyreadstat/pyreadstat.pyx":524 - * cdef list usecols = None - * cdef bint usernan = 0 - * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< - * cdef long row_limit=0 - * cdef long row_offset=0 -*/ - __pyx_v_no_datetime_conversion = 0; - - /* "pyreadstat/pyreadstat.pyx":525 - * cdef bint usernan = 0 - * cdef bint no_datetime_conversion = 0 - * cdef long row_limit=0 # <<<<<<<<<<<<<< - * cdef long row_offset=0 - * cdef list extra_datetime_formats=None -*/ - __pyx_v_row_limit = 0; - - /* "pyreadstat/pyreadstat.pyx":526 - * cdef bint no_datetime_conversion = 0 - * cdef long row_limit=0 - * cdef long row_offset=0 # <<<<<<<<<<<<<< - * cdef list extra_datetime_formats=None - * cdef list extra_date_formats=None -*/ - __pyx_v_row_offset = 0; - - /* "pyreadstat/pyreadstat.pyx":527 - * cdef long row_limit=0 - * cdef long row_offset=0 - * cdef list extra_datetime_formats=None # <<<<<<<<<<<<<< - * cdef list extra_date_formats=None - * cdef list extra_time_formats=None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_extra_datetime_formats = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":528 - * cdef long row_offset=0 - * cdef list extra_datetime_formats=None - * cdef list extra_date_formats=None # <<<<<<<<<<<<<< - * cdef list extra_time_formats=None - * -*/ - __Pyx_INCREF(Py_None); - __pyx_v_extra_date_formats = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":529 - * cdef list extra_datetime_formats=None - * cdef list extra_date_formats=None - * cdef list extra_time_formats=None # <<<<<<<<<<<<<< - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS -*/ - __Pyx_INCREF(Py_None); - __pyx_v_extra_time_formats = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":531 - * cdef list extra_time_formats=None - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS # <<<<<<<<<<<<<< - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BCAT - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, -*/ - __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - - /* "pyreadstat/pyreadstat.pyx":532 - * - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BCAT # <<<<<<<<<<<<<< - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, -*/ - __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT; - - /* "pyreadstat/pyreadstat.pyx":533 - * cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - * cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BCAT - * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) -*/ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 533, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - } - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); - index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 533, __pyx_L1_error) - __pyx_t_5 = NULL; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 533, __pyx_L1_error) - __pyx_L4_unpacking_done:; - } - __pyx_v_data_frame = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v_metadata = __pyx_t_3; - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":536 - * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - * metadata.file_format = "sas7bcat" # <<<<<<<<<<<<<< - * - * return data_frame, metadata -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_format, __pyx_mstate_global->__pyx_n_u_sas7bcat) < 0) __PYX_ERR(0, 536, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":538 - * metadata.file_format = "sas7bcat" - * - * return data_frame, metadata # <<<<<<<<<<<<<< - * - * # convenience functions to read in chunks -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_data_frame); - __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 538, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_metadata); - __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 538, __pyx_L1_error); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "pyreadstat/pyreadstat.pyx":490 - * - * - * def read_sas7bcat(filename_path, str encoding=None, str output_format=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_sas7bcat", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_usecols); - __Pyx_XDECREF(__pyx_v_extra_datetime_formats); - __Pyx_XDECREF(__pyx_v_extra_date_formats); - __Pyx_XDECREF(__pyx_v_extra_time_formats); - __Pyx_XDECREF(__pyx_v_data_frame); - __Pyx_XDECREF(__pyx_v_metadata); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_10pyreadstat_10pyreadstat_14generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "pyreadstat/pyreadstat.pyx":542 - * # convenience functions to read in chunks - * - * def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, # <<<<<<<<<<<<<< - * multiprocess=False, num_processes=4, num_rows=None, **kwargs): - * """ -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_13read_file_in_chunks(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_12read_file_in_chunks, "\n Returns a generator that will allow to read a file in chunks.\n\n If using multiprocessing, for Xport, Por and some defective sav files where the number of rows in the dataset canot be obtained from the metadata, \n the parameter num_rows must be set to a number equal or larger than the number of rows in the dataset. That information must\n be obtained by the user before running this function.\n\n Parameters\n ----------\n read_function : pyreadstat function\n a pyreadstat reading function\n file_path : string\n path to the file to be read\n chunksize : integer, optional\n size of the chunks to read\n offset : integer, optional\n start reading the file after certain number of rows\n limit : integer, optional\n stop reading the file after certain number of rows, will be added to offset\n multiprocess: bool, optional\n use multiprocessing to read each chunk?\n num_processes: integer, optional\n in case multiprocess is true, how many workers/processes to spawn?\n num_rows: integer, optional\n number of rows in the dataset. If using multiprocessing it is obligatory for files where\n the number of rows cannot be obtained from the medatata, such as por and \n some defective xport and sav files. The user must obtain this value by reading the file without multiprocessing first or any other means. A number\n larger than the actual number of rows will work as well. Discarded if the number of rows can be obtained from the metadata or not using\n multiprocessing.\n kwargs : dict, optional\n any other keyword argument to pass to the read_function. row_limit and row_offset will be discarded if present.\n\n Yields\n -------\n data_frame : dataframe\n a dataframe with the data\n metadata :\n object with metadata. ""\n Look at the documentation for more information.\n\n it : generator\n A generator that reads the file in chunks.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_13read_file_in_chunks = {"read_file_in_chunks", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_13read_file_in_chunks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_12read_file_in_chunks}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_13read_file_in_chunks(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_read_function = 0; - PyObject *__pyx_v_file_path = 0; - PyObject *__pyx_v_chunksize = 0; - PyObject *__pyx_v_offset = 0; - PyObject *__pyx_v_limit = 0; - PyObject *__pyx_v_multiprocess = 0; - PyObject *__pyx_v_num_processes = 0; - PyObject *__pyx_v_num_rows = 0; - PyObject *__pyx_v_kwargs = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_file_in_chunks (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_read_function,&__pyx_mstate_global->__pyx_n_u_file_path,&__pyx_mstate_global->__pyx_n_u_chunksize,&__pyx_mstate_global->__pyx_n_u_offset,&__pyx_mstate_global->__pyx_n_u_limit,&__pyx_mstate_global->__pyx_n_u_multiprocess,&__pyx_mstate_global->__pyx_n_u_num_processes,&__pyx_mstate_global->__pyx_n_u_num_rows,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, 542, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 8: - values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "read_file_in_chunks", 1) < 0) __PYX_ERR(0, 542, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_100000))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0))); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0))); - - /* "pyreadstat/pyreadstat.pyx":543 - * - * def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, - * multiprocess=False, num_processes=4, num_rows=None, **kwargs): # <<<<<<<<<<<<<< - * """ - * Returns a generator that will allow to read a file in chunks. -*/ - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_4))); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_file_in_chunks", 0, 2, 8, i); __PYX_ERR(0, 542, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 8: - values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __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, 542, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 542, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_100000))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0))); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_4))); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None)); - } - __pyx_v_read_function = values[0]; - __pyx_v_file_path = values[1]; - __pyx_v_chunksize = values[2]; - __pyx_v_offset = values[3]; - __pyx_v_limit = values[4]; - __pyx_v_multiprocess = values[5]; - __pyx_v_num_processes = values[6]; - __pyx_v_num_rows = values[7]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_file_in_chunks", 0, 2, 8, __pyx_nargs); __PYX_ERR(0, 542, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_CLEAR(__pyx_v_kwargs); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_file_in_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_12read_file_in_chunks(__pyx_self, __pyx_v_read_function, __pyx_v_file_path, __pyx_v_chunksize, __pyx_v_offset, __pyx_v_limit, __pyx_v_multiprocess, __pyx_v_num_processes, __pyx_v_num_rows, __pyx_v_kwargs); - - /* "pyreadstat/pyreadstat.pyx":542 - * # convenience functions to read in chunks - * - * def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, # <<<<<<<<<<<<<< - * multiprocess=False, num_processes=4, num_rows=None, **kwargs): - * """ -*/ - - /* function exit code */ - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_12read_file_in_chunks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_function, PyObject *__pyx_v_file_path, PyObject *__pyx_v_chunksize, PyObject *__pyx_v_offset, PyObject *__pyx_v_limit, PyObject *__pyx_v_multiprocess, PyObject *__pyx_v_num_processes, PyObject *__pyx_v_num_rows, PyObject *__pyx_v_kwargs) { - struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_file_in_chunks", 0); - __pyx_cur_scope = (struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *)__pyx_tp_new_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks(__pyx_mstate_global->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 542, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_read_function = __pyx_v_read_function; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_read_function); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_read_function); - __pyx_cur_scope->__pyx_v_file_path = __pyx_v_file_path; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_file_path); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_file_path); - __pyx_cur_scope->__pyx_v_chunksize = __pyx_v_chunksize; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_chunksize); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_chunksize); - __pyx_cur_scope->__pyx_v_offset = __pyx_v_offset; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_offset); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_offset); - __pyx_cur_scope->__pyx_v_limit = __pyx_v_limit; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_limit); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_limit); - __pyx_cur_scope->__pyx_v_multiprocess = __pyx_v_multiprocess; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_multiprocess); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_multiprocess); - __pyx_cur_scope->__pyx_v_num_processes = __pyx_v_num_processes; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_num_processes); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_num_processes); - __pyx_cur_scope->__pyx_v_num_rows = __pyx_v_num_rows; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_num_rows); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_num_rows); - __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10pyreadstat_10pyreadstat_14generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_read_file_in_chunks, __pyx_mstate_global->__pyx_n_u_read_file_in_chunks, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat); if (unlikely(!gen)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_file_in_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_10pyreadstat_10pyreadstat_14generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *__pyx_cur_scope = ((struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - Py_ssize_t __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_file_in_chunks", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L24_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(__pyx_sent_value != Py_None)) { - if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); - __PYX_ERR(0, 542, __pyx_L1_error) - } - - /* "pyreadstat/pyreadstat.pyx":588 - * """ - * - * if read_function == read_sas7bcat: # <<<<<<<<<<<<<< - * raise Exception("read_sas7bcat not supported") - * -*/ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_read_sas7bcat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_read_function, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__pyx_t_3)) { - - /* "pyreadstat/pyreadstat.pyx":589 - * - * if read_function == read_sas7bcat: - * raise Exception("read_sas7bcat not supported") # <<<<<<<<<<<<<< - * - * if "row_offset" in kwargs: -*/ - __pyx_t_1 = NULL; - __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_4 = ((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_5 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_read_sas7bcat_not_supported}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __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, 589, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":588 - * """ - * - * if read_function == read_sas7bcat: # <<<<<<<<<<<<<< - * raise Exception("read_sas7bcat not supported") - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":591 - * raise Exception("read_sas7bcat not supported") - * - * if "row_offset" in kwargs: # <<<<<<<<<<<<<< - * _ = kwargs.pop("row_offset") - * -*/ - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_mstate_global->__pyx_n_u_row_offset, __pyx_cur_scope->__pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) - if (__pyx_t_3) { - - /* "pyreadstat/pyreadstat.pyx":592 - * - * if "row_offset" in kwargs: - * _ = kwargs.pop("row_offset") # <<<<<<<<<<<<<< - * - * if "row_limit" in kwargs: -*/ - __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_cur_scope->__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_row_offset, ((PyObject *)NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v__ = __pyx_t_2; - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":591 - * raise Exception("read_sas7bcat not supported") - * - * if "row_offset" in kwargs: # <<<<<<<<<<<<<< - * _ = kwargs.pop("row_offset") - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":594 - * _ = kwargs.pop("row_offset") - * - * if "row_limit" in kwargs: # <<<<<<<<<<<<<< - * _ = kwargs.pop("row_limit") - * -*/ - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_mstate_global->__pyx_n_u_row_limit, __pyx_cur_scope->__pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 594, __pyx_L1_error) - if (__pyx_t_3) { - - /* "pyreadstat/pyreadstat.pyx":595 - * - * if "row_limit" in kwargs: - * _ = kwargs.pop("row_limit") # <<<<<<<<<<<<<< - * - * if "num_processes" in kwargs: -*/ - __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_cur_scope->__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_row_limit, ((PyObject *)NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":594 - * _ = kwargs.pop("row_offset") - * - * if "row_limit" in kwargs: # <<<<<<<<<<<<<< - * _ = kwargs.pop("row_limit") - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":597 - * _ = kwargs.pop("row_limit") - * - * if "num_processes" in kwargs: # <<<<<<<<<<<<<< - * _ = kwargs.pop("num_processes") - * -*/ - __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_mstate_global->__pyx_n_u_num_processes, __pyx_cur_scope->__pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 597, __pyx_L1_error) - if (__pyx_t_3) { - - /* "pyreadstat/pyreadstat.pyx":598 - * - * if "num_processes" in kwargs: - * _ = kwargs.pop("num_processes") # <<<<<<<<<<<<<< - * - * _, meta = read_function(file_path, metadataonly=True) -*/ - __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_cur_scope->__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_num_processes, ((PyObject *)NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":597 - * _ = kwargs.pop("row_limit") - * - * if "num_processes" in kwargs: # <<<<<<<<<<<<<< - * _ = kwargs.pop("num_processes") - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":600 - * _ = kwargs.pop("num_processes") - * - * _, meta = read_function(file_path, metadataonly=True) # <<<<<<<<<<<<<< - * numrows = meta.number_rows - * if numrows: -*/ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_read_function); - __pyx_t_1 = __pyx_cur_scope->__pyx_v_read_function; - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __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_4); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_file_path}; - __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_metadataonly, Py_True, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 600, __pyx_L1_error) - __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 600, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_6); - } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_6); - } - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); - index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(0, 600, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_unpacking_failed:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 600, __pyx_L1_error) - __pyx_L9_unpacking_done:; - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_6); - __pyx_cur_scope->__pyx_v_meta = __pyx_t_6; - __pyx_t_6 = 0; - - /* "pyreadstat/pyreadstat.pyx":601 - * - * _, meta = read_function(file_path, metadataonly=True) - * numrows = meta.number_rows # <<<<<<<<<<<<<< - * if numrows: - * if not limit: -*/ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_meta, __pyx_mstate_global->__pyx_n_u_number_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_numrows = __pyx_t_2; - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":602 - * _, meta = read_function(file_path, metadataonly=True) - * numrows = meta.number_rows - * if numrows: # <<<<<<<<<<<<<< - * if not limit: - * limit = numrows -*/ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_numrows); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) - if (__pyx_t_3) { - - /* "pyreadstat/pyreadstat.pyx":603 - * numrows = meta.number_rows - * if numrows: - * if not limit: # <<<<<<<<<<<<<< - * limit = numrows - * else: -*/ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_limit); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_3); - if (__pyx_t_8) { - - /* "pyreadstat/pyreadstat.pyx":604 - * if numrows: - * if not limit: - * limit = numrows # <<<<<<<<<<<<<< - * else: - * limit = min(offset+limit, numrows) -*/ - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_numrows); - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_limit); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_limit, __pyx_cur_scope->__pyx_v_numrows); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_numrows); - - /* "pyreadstat/pyreadstat.pyx":603 - * numrows = meta.number_rows - * if numrows: - * if not limit: # <<<<<<<<<<<<<< - * limit = numrows - * else: -*/ - goto __pyx_L11; - } - - /* "pyreadstat/pyreadstat.pyx":606 - * limit = numrows - * else: - * limit = min(offset+limit, numrows) # <<<<<<<<<<<<<< - * else: - * if limit: -*/ - /*else*/ { - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_numrows); - __pyx_t_2 = __pyx_cur_scope->__pyx_v_numrows; - __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_limit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_8) { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - } else { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_1 = __pyx_t_6; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_t_1; - __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_limit); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_limit, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - } - __pyx_L11:; - - /* "pyreadstat/pyreadstat.pyx":602 - * _, meta = read_function(file_path, metadataonly=True) - * numrows = meta.number_rows - * if numrows: # <<<<<<<<<<<<<< - * if not limit: - * limit = numrows -*/ - goto __pyx_L10; - } - - /* "pyreadstat/pyreadstat.pyx":608 - * limit = min(offset+limit, numrows) - * else: - * if limit: # <<<<<<<<<<<<<< - * limit = offset + limit - * df = [0] -*/ - /*else*/ { - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_limit); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 608, __pyx_L1_error) - if (__pyx_t_8) { - - /* "pyreadstat/pyreadstat.pyx":609 - * else: - * if limit: - * limit = offset + limit # <<<<<<<<<<<<<< - * df = [0] - * while len(df): -*/ - __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_limit); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_limit, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":608 - * limit = min(offset+limit, numrows) - * else: - * if limit: # <<<<<<<<<<<<<< - * limit = offset + limit - * df = [0] -*/ - } - } - __pyx_L10:; - - /* "pyreadstat/pyreadstat.pyx":610 - * if limit: - * limit = offset + limit - * df = [0] # <<<<<<<<<<<<<< - * while len(df): - * if limit and (offset >= limit): -*/ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 610, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_cur_scope->__pyx_v_df = __pyx_t_2; - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":611 - * limit = offset + limit - * df = [0] - * while len(df): # <<<<<<<<<<<<<< - * if limit and (offset >= limit): - * break -*/ - while (1) { - __pyx_t_9 = PyObject_Length(__pyx_cur_scope->__pyx_v_df); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 611, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_9 != 0); - if (!__pyx_t_8) break; - - /* "pyreadstat/pyreadstat.pyx":612 - * df = [0] - * while len(df): - * if limit and (offset >= limit): # <<<<<<<<<<<<<< - * break - * if multiprocess: -*/ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_limit); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 612, __pyx_L1_error) - if (__pyx_t_3) { - } else { - __pyx_t_8 = __pyx_t_3; - goto __pyx_L16_bool_binop_done; - } - __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_limit, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 612, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __pyx_t_3; - __pyx_L16_bool_binop_done:; - if (__pyx_t_8) { - - /* "pyreadstat/pyreadstat.pyx":613 - * while len(df): - * if limit and (offset >= limit): - * break # <<<<<<<<<<<<<< - * if multiprocess: - * df, meta = read_file_multiprocessing(read_function, file_path, num_processes=num_processes, -*/ - goto __pyx_L14_break; - - /* "pyreadstat/pyreadstat.pyx":612 - * df = [0] - * while len(df): - * if limit and (offset >= limit): # <<<<<<<<<<<<<< - * break - * if multiprocess: -*/ - } - - /* "pyreadstat/pyreadstat.pyx":614 - * if limit and (offset >= limit): - * break - * if multiprocess: # <<<<<<<<<<<<<< - * df, meta = read_file_multiprocessing(read_function, file_path, num_processes=num_processes, - * row_offset=offset, row_limit=chunksize, num_rows=num_rows, **kwargs) -*/ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_multiprocess); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 614, __pyx_L1_error) - if (__pyx_t_8) { - - /* "pyreadstat/pyreadstat.pyx":615 - * break - * if multiprocess: - * df, meta = read_file_multiprocessing(read_function, file_path, num_processes=num_processes, # <<<<<<<<<<<<<< - * row_offset=offset, row_limit=chunksize, num_rows=num_rows, **kwargs) - * else: -*/ - __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_read_file_multiprocessing); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_num_processes, __pyx_cur_scope->__pyx_v_num_processes) < 0) __PYX_ERR(0, 615, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":616 - * if multiprocess: - * df, meta = read_file_multiprocessing(read_function, file_path, num_processes=num_processes, - * row_offset=offset, row_limit=chunksize, num_rows=num_rows, **kwargs) # <<<<<<<<<<<<<< - * else: - * df, meta = read_function(file_path, row_offset=offset, row_limit=chunksize, **kwargs) -*/ - if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_row_offset, __pyx_cur_scope->__pyx_v_offset) < 0) __PYX_ERR(0, 615, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_row_limit, __pyx_cur_scope->__pyx_v_chunksize) < 0) __PYX_ERR(0, 615, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_num_rows, __pyx_cur_scope->__pyx_v_num_rows) < 0) __PYX_ERR(0, 615, __pyx_L1_error) - __pyx_t_4 = __pyx_t_10; - __pyx_t_10 = 0; - if (__Pyx_MergeKeywords(__pyx_t_4, __pyx_cur_scope->__pyx_v_kwargs) < 0) __PYX_ERR(0, 616, __pyx_L1_error) - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); - assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_read_function, __pyx_cur_scope->__pyx_v_file_path}; - __pyx_t_2 = __Pyx_PyObject_FastCallDict(__pyx_t_6, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 615, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_6); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_4); - } else { - __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - } - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_6)) goto __pyx_L19_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L19_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_1), 2) < 0) __PYX_ERR(0, 615, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L20_unpacking_done; - __pyx_L19_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 615, __pyx_L1_error) - __pyx_L20_unpacking_done:; - } - - /* "pyreadstat/pyreadstat.pyx":615 - * break - * if multiprocess: - * df, meta = read_file_multiprocessing(read_function, file_path, num_processes=num_processes, # <<<<<<<<<<<<<< - * row_offset=offset, row_limit=chunksize, num_rows=num_rows, **kwargs) - * else: -*/ - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_df); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_df, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_meta); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_meta, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":614 - * if limit and (offset >= limit): - * break - * if multiprocess: # <<<<<<<<<<<<<< - * df, meta = read_file_multiprocessing(read_function, file_path, num_processes=num_processes, - * row_offset=offset, row_limit=chunksize, num_rows=num_rows, **kwargs) -*/ - goto __pyx_L18; - } - - /* "pyreadstat/pyreadstat.pyx":618 - * row_offset=offset, row_limit=chunksize, num_rows=num_rows, **kwargs) - * else: - * df, meta = read_function(file_path, row_offset=offset, row_limit=chunksize, **kwargs) # <<<<<<<<<<<<<< - * if len(df): - * yield df, meta -*/ - /*else*/ { - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_read_function); - __pyx_t_6 = __pyx_cur_scope->__pyx_v_read_function; - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_row_offset, __pyx_cur_scope->__pyx_v_offset) < 0) __PYX_ERR(0, 618, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_row_limit, __pyx_cur_scope->__pyx_v_chunksize) < 0) __PYX_ERR(0, 618, __pyx_L1_error) - __pyx_t_1 = __pyx_t_10; - __pyx_t_10 = 0; - if (__Pyx_MergeKeywords(__pyx_t_1, __pyx_cur_scope->__pyx_v_kwargs) < 0) __PYX_ERR(0, 618, __pyx_L1_error) - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); - __pyx_t_5 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_file_path}; - __pyx_t_2 = __Pyx_PyObject_FastCallDict(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 618, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_6); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_1); - } else { - __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); - } - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); - index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L21_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(0, 618, __pyx_L1_error) - __pyx_t_7 = NULL; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L22_unpacking_done; - __pyx_L21_unpacking_failed:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 618, __pyx_L1_error) - __pyx_L22_unpacking_done:; - } - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_df); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_df, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_meta); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_meta, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - } - __pyx_L18:; - - /* "pyreadstat/pyreadstat.pyx":619 - * else: - * df, meta = read_function(file_path, row_offset=offset, row_limit=chunksize, **kwargs) - * if len(df): # <<<<<<<<<<<<<< - * yield df, meta - * offset += chunksize -*/ - __pyx_t_9 = PyObject_Length(__pyx_cur_scope->__pyx_v_df); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 619, __pyx_L1_error) - __pyx_t_8 = (__pyx_t_9 != 0); - if (__pyx_t_8) { - - /* "pyreadstat/pyreadstat.pyx":620 - * df, meta = read_function(file_path, row_offset=offset, row_limit=chunksize, **kwargs) - * if len(df): - * yield df, meta # <<<<<<<<<<<<<< - * offset += chunksize - * -*/ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_df); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_df); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_df) != (0)) __PYX_ERR(0, 620, __pyx_L1_error); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_meta) != (0)) __PYX_ERR(0, 620, __pyx_L1_error); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L24_resume_from_yield:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 620, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":621 - * if len(df): - * yield df, meta - * offset += chunksize # <<<<<<<<<<<<<< - * - * def read_file_multiprocessing(read_function, file_path, num_processes=None, num_rows=None, **kwargs): -*/ - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_chunksize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_offset); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_offset, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":619 - * else: - * df, meta = read_function(file_path, row_offset=offset, row_limit=chunksize, **kwargs) - * if len(df): # <<<<<<<<<<<<<< - * yield df, meta - * offset += chunksize -*/ - } - } - __pyx_L14_break:; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* "pyreadstat/pyreadstat.pyx":542 - * # convenience functions to read in chunks - * - * def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, # <<<<<<<<<<<<<< - * multiprocess=False, num_processes=4, num_rows=None, **kwargs): - * """ -*/ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_10); - if (__Pyx_PyErr_Occurred()) { - __Pyx_AddTraceback("read_file_in_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":623 - * offset += chunksize - * - * def read_file_multiprocessing(read_function, file_path, num_processes=None, num_rows=None, **kwargs): # <<<<<<<<<<<<<< - * """ - * Reads a file in parallel using multiprocessing. -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_16read_file_multiprocessing(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_15read_file_multiprocessing, "\n Reads a file in parallel using multiprocessing.\n For Xport, Por and some defective sav files where the number of rows in the dataset canot be obtained from the metadata, \n the parameter num_rows must be set to a number equal or larger than the number of rows in the dataset. That information must\n be obtained by the user before running this function.\n\n Parameters\n ----------\n read_function : pyreadstat function\n a pyreadstat reading function\n file_path : string\n path to the file to be read\n num_processes : integer, optional\n number of processes to spawn, by default the min 4 and the max cores on the computer\n num_rows: integer, optional\n number of rows in the dataset. Obligatory for files where the number of rows cannot be obtained from the medatata, such as por and \n some defective xport and sav files. The user must obtain this value by reading the file without multiprocessing first or any other means. A number\n larger than the actual number of rows will work as well. Discarded if the number of rows can be obtained from the metadata.\n kwargs : dict, optional\n any other keyword argument to pass to the read_function. \n\n Returns\n -------\n data_frame : dataframe\n a dataframe with the data\n metadata :\n object with metadata. Look at the documentation for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_16read_file_multiprocessing = {"read_file_multiprocessing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_16read_file_multiprocessing, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_15read_file_multiprocessing}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_16read_file_multiprocessing(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_read_function = 0; - PyObject *__pyx_v_file_path = 0; - PyObject *__pyx_v_num_processes = 0; - PyObject *__pyx_v_num_rows = 0; - PyObject *__pyx_v_kwargs = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("read_file_multiprocessing (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; - __Pyx_GOTREF(__pyx_v_kwargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_read_function,&__pyx_mstate_global->__pyx_n_u_file_path,&__pyx_mstate_global->__pyx_n_u_num_processes,&__pyx_mstate_global->__pyx_n_u_num_rows,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, 623, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 4: - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 623, __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, 623, __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, 623, __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, 623, __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, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "read_file_multiprocessing", 1) < 0) __PYX_ERR(0, 623, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_file_multiprocessing", 0, 2, 4, i); __PYX_ERR(0, 623, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 4: - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 623, __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, 623, __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, 623, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 623, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - } - __pyx_v_read_function = values[0]; - __pyx_v_file_path = values[1]; - __pyx_v_num_processes = values[2]; - __pyx_v_num_rows = values[3]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_file_multiprocessing", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 623, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_file_multiprocessing", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_15read_file_multiprocessing(__pyx_self, __pyx_v_read_function, __pyx_v_file_path, __pyx_v_num_processes, __pyx_v_num_rows, __pyx_v_kwargs); - - /* function exit code */ - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_DECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_15read_file_multiprocessing(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_function, PyObject *__pyx_v_file_path, PyObject *__pyx_v_num_processes, PyObject *__pyx_v_num_rows, PyObject *__pyx_v_kwargs) { - CYTHON_UNUSED PyObject *__pyx_v__ = NULL; - PyObject *__pyx_v_row_offset = NULL; - PyObject *__pyx_v_row_limit = NULL; - PyObject *__pyx_v_meta = NULL; - PyObject *__pyx_v_numrows = NULL; - PyObject *__pyx_v_final = NULL; - PyObject *__pyx_v_divs = NULL; - PyObject *__pyx_v_offsets = NULL; - PyObject *__pyx_v_prev_offset = NULL; - PyObject *__pyx_v_prev_div = NULL; - CYTHON_UNUSED PyObject *__pyx_v_indx = NULL; - PyObject *__pyx_v_div = NULL; - PyObject *__pyx_v_offset = NULL; - PyObject *__pyx_v_jobs = NULL; - PyObject *__pyx_v_pool = NULL; - PyObject *__pyx_v_chunks = NULL; - PyObject *__pyx_v_output_format = NULL; - PyObject *__pyx_v_keys = NULL; - PyObject *__pyx_v_key = NULL; - int __pyx_v_ispandas; - PyObject *__pyx_v_x = NULL; - PyObject *__pyx_v_chunksize = NULL; - PyObject *__pyx_v_chunk = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - size_t __pyx_t_6; - long __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - double __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *(*__pyx_t_11)(PyObject *); - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - PyObject *__pyx_t_14 = NULL; - int __pyx_t_15; - PyObject *__pyx_t_16 = NULL; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - int __pyx_t_19; - int __pyx_t_20; - char const *__pyx_t_21; - PyObject *__pyx_t_22 = NULL; - PyObject *__pyx_t_23 = NULL; - PyObject *__pyx_t_24 = NULL; - Py_ssize_t __pyx_t_25; - PyObject *(*__pyx_t_26)(PyObject *); - PyObject *__pyx_t_27 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("read_file_multiprocessing", 0); - __Pyx_INCREF(__pyx_v_num_processes); - - /* "pyreadstat/pyreadstat.pyx":653 - * """ - * - * if read_function in (read_sas7bcat,): # <<<<<<<<<<<<<< - * raise Exception("read_sas7bcat is not supported") - * -*/ - __Pyx_INCREF(__pyx_v_read_function); - __pyx_t_1 = __pyx_v_read_function; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_read_sas7bcat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __pyx_t_4; - if (unlikely(__pyx_t_5)) { - - /* "pyreadstat/pyreadstat.pyx":654 - * - * if read_function in (read_sas7bcat,): - * raise Exception("read_sas7bcat is not supported") # <<<<<<<<<<<<<< - * - * if read_function == read_por and num_rows is None: -*/ - __pyx_t_3 = NULL; - __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_2 = ((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_6 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_read_sas7bcat_is_not_supported}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__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_1)) __PYX_ERR(0, 654, __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, 654, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":653 - * """ - * - * if read_function in (read_sas7bcat,): # <<<<<<<<<<<<<< - * raise Exception("read_sas7bcat is not supported") - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":656 - * raise Exception("read_sas7bcat is not supported") - * - * if read_function == read_por and num_rows is None: # <<<<<<<<<<<<<< - * raise Exception("num_rows must be specified for read_por to be a number equal or larger than the number of rows in the dataset.") - * -*/ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_read_por); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_read_function, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_4) { - } else { - __pyx_t_5 = __pyx_t_4; - goto __pyx_L5_bool_binop_done; - } - __pyx_t_4 = (__pyx_v_num_rows == Py_None); - __pyx_t_5 = __pyx_t_4; - __pyx_L5_bool_binop_done:; - if (unlikely(__pyx_t_5)) { - - /* "pyreadstat/pyreadstat.pyx":657 - * - * if read_function == read_por and num_rows is None: - * raise Exception("num_rows must be specified for read_por to be a number equal or larger than the number of rows in the dataset.") # <<<<<<<<<<<<<< - * - * if not num_processes: -*/ - __pyx_t_1 = NULL; - __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_3 = ((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_6 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_num_rows_must_be_specified_for_r}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __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_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __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, 657, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":656 - * raise Exception("read_sas7bcat is not supported") - * - * if read_function == read_por and num_rows is None: # <<<<<<<<<<<<<< - * raise Exception("num_rows must be specified for read_por to be a number equal or larger than the number of rows in the dataset.") - * -*/ - } - - /* "pyreadstat/pyreadstat.pyx":659 - * raise Exception("num_rows must be specified for read_por to be a number equal or larger than the number of rows in the dataset.") - * - * if not num_processes: # <<<<<<<<<<<<<< - * # let's be conservative with the number of workers - * num_processes = min(mp.cpu_count(), 4) -*/ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_num_processes); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) - __pyx_t_4 = (!__pyx_t_5); - if (__pyx_t_4) { - - /* "pyreadstat/pyreadstat.pyx":661 - * if not num_processes: - * # let's be conservative with the number of workers - * num_processes = min(mp.cpu_count(), 4) # <<<<<<<<<<<<<< - * _ = kwargs.pop('metadataonly', None) - * row_offset = kwargs.pop("row_offset", 0) -*/ - __pyx_t_7 = 4; - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_mp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cpu_count); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - __pyx_t_3 = __Pyx_PyLong_From_long(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_8 = __pyx_t_2; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_t_8; - __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_num_processes, __pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":659 - * raise Exception("num_rows must be specified for read_por to be a number equal or larger than the number of rows in the dataset.") - * - * if not num_processes: # <<<<<<<<<<<<<< - * # let's be conservative with the number of workers - * num_processes = min(mp.cpu_count(), 4) -*/ - } - - /* "pyreadstat/pyreadstat.pyx":662 - * # let's be conservative with the number of workers - * num_processes = min(mp.cpu_count(), 4) - * _ = kwargs.pop('metadataonly', None) # <<<<<<<<<<<<<< - * row_offset = kwargs.pop("row_offset", 0) - * row_limit = kwargs.pop("row_limit", float('inf')) -*/ - __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_metadataonly, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__ = __pyx_t_2; - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":663 - * num_processes = min(mp.cpu_count(), 4) - * _ = kwargs.pop('metadataonly', None) - * row_offset = kwargs.pop("row_offset", 0) # <<<<<<<<<<<<<< - * row_limit = kwargs.pop("row_limit", float('inf')) - * _, meta = read_function(file_path, metadataonly=True, **kwargs) -*/ - __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_row_offset, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_row_offset = __pyx_t_2; - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":664 - * _ = kwargs.pop('metadataonly', None) - * row_offset = kwargs.pop("row_offset", 0) - * row_limit = kwargs.pop("row_limit", float('inf')) # <<<<<<<<<<<<<< - * _, meta = read_function(file_path, metadataonly=True, **kwargs) - * numrows = meta.number_rows -*/ - __pyx_t_9 = __Pyx_PyUnicode_AsDouble(__pyx_mstate_global->__pyx_n_u_inf); if (unlikely(__pyx_t_9 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyDict_Pop(__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_row_limit, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_row_limit = __pyx_t_8; - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":665 - * row_offset = kwargs.pop("row_offset", 0) - * row_limit = kwargs.pop("row_limit", float('inf')) - * _, meta = read_function(file_path, metadataonly=True, **kwargs) # <<<<<<<<<<<<<< - * numrows = meta.number_rows - * -*/ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_v_read_function); - __pyx_t_1 = __pyx_v_read_function; - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_metadataonly, Py_True) < 0) __PYX_ERR(0, 665, __pyx_L1_error) - __pyx_t_3 = __pyx_t_10; - __pyx_t_10 = 0; - if (__Pyx_MergeKeywords(__pyx_t_3, __pyx_v_kwargs) < 0) __PYX_ERR(0, 665, __pyx_L1_error) - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_file_path}; - __pyx_t_8 = __Pyx_PyObject_FastCallDict(__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - } - if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { - PyObject* sequence = __pyx_t_8; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 665, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - } - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); - index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_2), 2) < 0) __PYX_ERR(0, 665, __pyx_L1_error) - __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_unpacking_failed:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_11 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 665, __pyx_L1_error) - __pyx_L9_unpacking_done:; - } - __Pyx_DECREF_SET(__pyx_v__, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_meta = __pyx_t_3; - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":666 - * row_limit = kwargs.pop("row_limit", float('inf')) - * _, meta = read_function(file_path, metadataonly=True, **kwargs) - * numrows = meta.number_rows # <<<<<<<<<<<<<< - * - * if numrows is None: -*/ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_meta, __pyx_mstate_global->__pyx_n_u_number_rows); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_numrows = __pyx_t_8; - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":668 - * numrows = meta.number_rows - * - * if numrows is None: # <<<<<<<<<<<<<< - * if num_rows is None: - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") -*/ - __pyx_t_4 = (__pyx_v_numrows == Py_None); - if (__pyx_t_4) { - - /* "pyreadstat/pyreadstat.pyx":669 - * - * if numrows is None: - * if num_rows is None: # <<<<<<<<<<<<<< - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") - * numrows = num_rows -*/ - __pyx_t_4 = (__pyx_v_num_rows == Py_None); - if (unlikely(__pyx_t_4)) { - - /* "pyreadstat/pyreadstat.pyx":670 - * if numrows is None: - * if num_rows is None: - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") # <<<<<<<<<<<<<< - * numrows = num_rows - * elif numrows == 0: -*/ - __pyx_t_3 = NULL; - __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_1 = ((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_6 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_The_number_of_rows_of_the_file_c}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __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, 670, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":669 - * - * if numrows is None: - * if num_rows is None: # <<<<<<<<<<<<<< - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") - * numrows = num_rows -*/ - } - - /* "pyreadstat/pyreadstat.pyx":671 - * if num_rows is None: - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") - * numrows = num_rows # <<<<<<<<<<<<<< - * elif numrows == 0: - * final, meta = read_function(file_path, **kwargs) -*/ - __Pyx_INCREF(__pyx_v_num_rows); - __Pyx_DECREF_SET(__pyx_v_numrows, __pyx_v_num_rows); - - /* "pyreadstat/pyreadstat.pyx":668 - * numrows = meta.number_rows - * - * if numrows is None: # <<<<<<<<<<<<<< - * if num_rows is None: - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") -*/ - goto __pyx_L10; - } - - /* "pyreadstat/pyreadstat.pyx":672 - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") - * numrows = num_rows - * elif numrows == 0: # <<<<<<<<<<<<<< - * final, meta = read_function(file_path, **kwargs) - * -*/ - __pyx_t_4 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_numrows, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 672, __pyx_L1_error) - if (__pyx_t_4) { - - /* "pyreadstat/pyreadstat.pyx":673 - * numrows = num_rows - * elif numrows == 0: - * final, meta = read_function(file_path, **kwargs) # <<<<<<<<<<<<<< - * - * numrows = min(max(numrows - row_offset, 0), row_limit) -*/ - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_v_read_function); - __pyx_t_3 = __pyx_v_read_function; - __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_file_path}; - __pyx_t_8 = __Pyx_PyObject_FastCallDict(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - } - if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { - PyObject* sequence = __pyx_t_8; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 673, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_2); - } - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_1), 2) < 0) __PYX_ERR(0, 673, __pyx_L1_error) - __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L13_unpacking_done; - __pyx_L12_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 673, __pyx_L1_error) - __pyx_L13_unpacking_done:; - } - __pyx_v_final = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_meta, __pyx_t_2); - __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":672 - * raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") - * numrows = num_rows - * elif numrows == 0: # <<<<<<<<<<<<<< - * final, meta = read_function(file_path, **kwargs) - * -*/ - } - __pyx_L10:; - - /* "pyreadstat/pyreadstat.pyx":675 - * final, meta = read_function(file_path, **kwargs) - * - * numrows = min(max(numrows - row_offset, 0), row_limit) # <<<<<<<<<<<<<< - * divs = [numrows // num_processes + (1 if x < numrows % num_processes else 0) for x in range (num_processes)] - * offsets = list() -*/ - __Pyx_INCREF(__pyx_v_row_limit); - __pyx_t_8 = __pyx_v_row_limit; - __pyx_t_7 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_v_numrows, __pyx_v_row_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_4) { - __pyx_t_10 = __Pyx_PyLong_From_long(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __pyx_t_10; - __pyx_t_10 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 675, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_4) { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_3 = __pyx_t_8; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_numrows, __pyx_t_8); - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":676 - * - * numrows = min(max(numrows - row_offset, 0), row_limit) - * divs = [numrows // num_processes + (1 if x < numrows % num_processes else 0) for x in range (num_processes)] # <<<<<<<<<<<<<< - * offsets = list() - * prev_offset = row_offset -*/ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_range); - __pyx_t_10 = __pyx_builtin_range; - __pyx_t_6 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_num_processes}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__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_3)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 676, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_10))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 676, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_12); - ++__pyx_t_12; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 676, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_12); - #endif - ++__pyx_t_12; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error) - } else { - __pyx_t_3 = __pyx_t_13(__pyx_t_10); - 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, 676, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_FloorDivide(__pyx_v_numrows, __pyx_v_num_processes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Remainder(__pyx_v_numrows, __pyx_v_num_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_4) { - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); - __pyx_t_2 = __pyx_mstate_global->__pyx_int_1; - } else { - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_t_2 = __pyx_mstate_global->__pyx_int_0; - } - __pyx_t_14 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_divs = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":677 - * numrows = min(max(numrows - row_offset, 0), row_limit) - * divs = [numrows // num_processes + (1 if x < numrows % num_processes else 0) for x in range (num_processes)] - * offsets = list() # <<<<<<<<<<<<<< - * prev_offset = row_offset - * prev_div = 0 -*/ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_offsets = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":678 - * divs = [numrows // num_processes + (1 if x < numrows % num_processes else 0) for x in range (num_processes)] - * offsets = list() - * prev_offset = row_offset # <<<<<<<<<<<<<< - * prev_div = 0 - * for indx, div in enumerate(divs): -*/ - __Pyx_INCREF(__pyx_v_row_offset); - __pyx_v_prev_offset = __pyx_v_row_offset; - - /* "pyreadstat/pyreadstat.pyx":679 - * offsets = list() - * prev_offset = row_offset - * prev_div = 0 # <<<<<<<<<<<<<< - * for indx, div in enumerate(divs): - * offset = prev_offset + prev_div -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_v_prev_div = __pyx_mstate_global->__pyx_int_0; - - /* "pyreadstat/pyreadstat.pyx":680 - * prev_offset = row_offset - * prev_div = 0 - * for indx, div in enumerate(divs): # <<<<<<<<<<<<<< - * offset = prev_offset + prev_div - * prev_offset = offset -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); - __pyx_t_8 = __pyx_mstate_global->__pyx_int_0; - __pyx_t_10 = __pyx_v_divs; __Pyx_INCREF(__pyx_t_10); - __pyx_t_12 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 680, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_12); - ++__pyx_t_12; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_XDECREF_SET(__pyx_v_div, __pyx_t_14); - __pyx_t_14 = 0; - __Pyx_INCREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_8); - __pyx_t_14 = __Pyx_PyLong_AddObjC(__pyx_t_8, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_8); - __pyx_t_8 = __pyx_t_14; - __pyx_t_14 = 0; - - /* "pyreadstat/pyreadstat.pyx":681 - * prev_div = 0 - * for indx, div in enumerate(divs): - * offset = prev_offset + prev_div # <<<<<<<<<<<<<< - * prev_offset = offset - * prev_div = div -*/ - __pyx_t_14 = PyNumber_Add(__pyx_v_prev_offset, __pyx_v_prev_div); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 681, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_XDECREF_SET(__pyx_v_offset, __pyx_t_14); - __pyx_t_14 = 0; - - /* "pyreadstat/pyreadstat.pyx":682 - * for indx, div in enumerate(divs): - * offset = prev_offset + prev_div - * prev_offset = offset # <<<<<<<<<<<<<< - * prev_div = div - * offsets.append((offset, div)) -*/ - __Pyx_INCREF(__pyx_v_offset); - __Pyx_DECREF_SET(__pyx_v_prev_offset, __pyx_v_offset); - - /* "pyreadstat/pyreadstat.pyx":683 - * offset = prev_offset + prev_div - * prev_offset = offset - * prev_div = div # <<<<<<<<<<<<<< - * offsets.append((offset, div)) - * jobs = [(read_function, file_path, offset, chunksize, kwargs) for offset, chunksize in offsets] -*/ - __Pyx_INCREF(__pyx_v_div); - __Pyx_DECREF_SET(__pyx_v_prev_div, __pyx_v_div); - - /* "pyreadstat/pyreadstat.pyx":684 - * prev_offset = offset - * prev_div = div - * offsets.append((offset, div)) # <<<<<<<<<<<<<< - * jobs = [(read_function, file_path, offset, chunksize, kwargs) for offset, chunksize in offsets] - * pool = mp.Pool(processes=num_processes) -*/ - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_INCREF(__pyx_v_offset); - __Pyx_GIVEREF(__pyx_v_offset); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_offset) != (0)) __PYX_ERR(0, 684, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_div); - __Pyx_GIVEREF(__pyx_v_div); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_div) != (0)) __PYX_ERR(0, 684, __pyx_L1_error); - __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_offsets, __pyx_t_14); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - - /* "pyreadstat/pyreadstat.pyx":680 - * prev_offset = row_offset - * prev_div = 0 - * for indx, div in enumerate(divs): # <<<<<<<<<<<<<< - * offset = prev_offset + prev_div - * prev_offset = offset -*/ - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":685 - * prev_div = div - * offsets.append((offset, div)) - * jobs = [(read_function, file_path, offset, chunksize, kwargs) for offset, chunksize in offsets] # <<<<<<<<<<<<<< - * pool = mp.Pool(processes=num_processes) - * try: -*/ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __pyx_v_offsets; __Pyx_INCREF(__pyx_t_10); - __pyx_t_12 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 685, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - __pyx_t_14 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_12); - ++__pyx_t_12; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { - PyObject* sequence = __pyx_t_14; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 685, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - } - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L22_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L22_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_1), 2) < 0) __PYX_ERR(0, 685, __pyx_L1_error) - __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L23_unpacking_done; - __pyx_L22_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 685, __pyx_L1_error) - __pyx_L23_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_offset, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_chunksize, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_INCREF(__pyx_v_read_function); - __Pyx_GIVEREF(__pyx_v_read_function); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_read_function) != (0)) __PYX_ERR(0, 685, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_file_path); - __Pyx_GIVEREF(__pyx_v_file_path); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_file_path) != (0)) __PYX_ERR(0, 685, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_offset); - __Pyx_GIVEREF(__pyx_v_offset); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_offset) != (0)) __PYX_ERR(0, 685, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_chunksize); - __Pyx_GIVEREF(__pyx_v_chunksize); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_v_chunksize) != (0)) __PYX_ERR(0, 685, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_kwargs); - __Pyx_GIVEREF(__pyx_v_kwargs); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_v_kwargs) != (0)) __PYX_ERR(0, 685, __pyx_L1_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_jobs = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":686 - * offsets.append((offset, div)) - * jobs = [(read_function, file_path, offset, chunksize, kwargs) for offset, chunksize in offsets] - * pool = mp.Pool(processes=num_processes) # <<<<<<<<<<<<<< - * try: - * chunks = pool.map(worker, jobs) -*/ - __pyx_t_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mp); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_Pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); - assert(__pyx_t_10); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, NULL}; - __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_processes, __pyx_v_num_processes, __pyx_t_14, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 686, __pyx_L1_error) - __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - } - __pyx_v_pool = __pyx_t_8; - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":687 - * jobs = [(read_function, file_path, offset, chunksize, kwargs) for offset, chunksize in offsets] - * pool = mp.Pool(processes=num_processes) - * try: # <<<<<<<<<<<<<< - * chunks = pool.map(worker, jobs) - * except: -*/ - /*try:*/ { - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_18); - /*try:*/ { - - /* "pyreadstat/pyreadstat.pyx":688 - * pool = mp.Pool(processes=num_processes) - * try: - * chunks = pool.map(worker, jobs) # <<<<<<<<<<<<<< - * except: - * raise -*/ - __pyx_t_3 = __pyx_v_pool; - __Pyx_INCREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_worker); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 688, __pyx_L28_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_14, __pyx_v_jobs}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_map, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L28_error) - __Pyx_GOTREF(__pyx_t_8); - } - __pyx_v_chunks = __pyx_t_8; - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":687 - * jobs = [(read_function, file_path, offset, chunksize, kwargs) for offset, chunksize in offsets] - * pool = mp.Pool(processes=num_processes) - * try: # <<<<<<<<<<<<<< - * chunks = pool.map(worker, jobs) - * except: -*/ - } - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; - goto __pyx_L33_try_end; - __pyx_L28_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":689 - * try: - * chunks = pool.map(worker, jobs) - * except: # <<<<<<<<<<<<<< - * raise - * finally: -*/ - /*except:*/ { - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_file_multiprocessing", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_14, &__pyx_t_3) < 0) __PYX_ERR(0, 689, __pyx_L30_except_error) - __Pyx_XGOTREF(__pyx_t_8); - __Pyx_XGOTREF(__pyx_t_14); - __Pyx_XGOTREF(__pyx_t_3); - - /* "pyreadstat/pyreadstat.pyx":690 - * chunks = pool.map(worker, jobs) - * except: - * raise # <<<<<<<<<<<<<< - * finally: - * pool.close() -*/ - __Pyx_GIVEREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_14); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_14, __pyx_t_3); - __pyx_t_8 = 0; __pyx_t_14 = 0; __pyx_t_3 = 0; - __PYX_ERR(0, 690, __pyx_L30_except_error) - } - - /* "pyreadstat/pyreadstat.pyx":687 - * jobs = [(read_function, file_path, offset, chunksize, kwargs) for offset, chunksize in offsets] - * pool = mp.Pool(processes=num_processes) - * try: # <<<<<<<<<<<<<< - * chunks = pool.map(worker, jobs) - * except: -*/ - __pyx_L30_except_error:; - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); - goto __pyx_L26_error; - __pyx_L33_try_end:; - } - } - - /* "pyreadstat/pyreadstat.pyx":692 - * raise - * finally: - * pool.close() # <<<<<<<<<<<<<< - * output_format = kwargs.get("output_format") - * if output_format == 'dict': -*/ - /*finally:*/ { - /*normal exit:*/{ - __pyx_t_14 = __pyx_v_pool; - __Pyx_INCREF(__pyx_t_14); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L27; - } - __pyx_L26_error:; - /*exception exit:*/{ - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); - if ( unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_18); - __Pyx_XGOTREF(__pyx_t_17); - __Pyx_XGOTREF(__pyx_t_16); - __Pyx_XGOTREF(__pyx_t_22); - __Pyx_XGOTREF(__pyx_t_23); - __Pyx_XGOTREF(__pyx_t_24); - __pyx_t_19 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; - { - __pyx_t_14 = __pyx_v_pool; - __Pyx_INCREF(__pyx_t_14); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L37_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_XGIVEREF(__pyx_t_22); - __Pyx_XGIVEREF(__pyx_t_23); - __Pyx_XGIVEREF(__pyx_t_24); - __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_XGIVEREF(__pyx_t_17); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16); - __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; - __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; - goto __pyx_L1_error; - __pyx_L37_error:; - __Pyx_XGIVEREF(__pyx_t_22); - __Pyx_XGIVEREF(__pyx_t_23); - __Pyx_XGIVEREF(__pyx_t_24); - __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); - __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; - __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; - goto __pyx_L1_error; - } - __pyx_L27:; - } - - /* "pyreadstat/pyreadstat.pyx":693 - * finally: - * pool.close() - * output_format = kwargs.get("output_format") # <<<<<<<<<<<<<< - * if output_format == 'dict': - * keys = chunks[0].keys() -*/ - __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_output_format, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_output_format = __pyx_t_3; - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":694 - * pool.close() - * output_format = kwargs.get("output_format") - * if output_format == 'dict': # <<<<<<<<<<<<<< - * keys = chunks[0].keys() - * final = dict() -*/ - __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_dict, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 694, __pyx_L1_error) - if (__pyx_t_4) { - - /* "pyreadstat/pyreadstat.pyx":695 - * output_format = kwargs.get("output_format") - * if output_format == 'dict': - * keys = chunks[0].keys() # <<<<<<<<<<<<<< - * final = dict() - * for key in keys: -*/ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_chunks, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = __pyx_t_8; - __Pyx_INCREF(__pyx_t_14); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_keys, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_v_keys = __pyx_t_3; - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":696 - * if output_format == 'dict': - * keys = chunks[0].keys() - * final = dict() # <<<<<<<<<<<<<< - * for key in keys: - * final[key] = np.concatenate([chunk[key] for chunk in chunks]) -*/ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_final, __pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":697 - * keys = chunks[0].keys() - * final = dict() - * for key in keys: # <<<<<<<<<<<<<< - * final[key] = np.concatenate([chunk[key] for chunk in chunks]) - * else: -*/ - if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { - __pyx_t_3 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_3); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 697, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - 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, 697, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); - ++__pyx_t_12; - } else { - { - 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, 697, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); - #endif - ++__pyx_t_12; - } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error) - } else { - __pyx_t_8 = __pyx_t_13(__pyx_t_3); - 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, 697, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_8); - __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":698 - * final = dict() - * for key in keys: - * final[key] = np.concatenate([chunk[key] for chunk in chunks]) # <<<<<<<<<<<<<< - * else: - * #final = pd.concat(chunks, axis=0, ignore_index=True) -*/ - __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (likely(PyList_CheckExact(__pyx_v_chunks)) || PyTuple_CheckExact(__pyx_v_chunks)) { - __pyx_t_1 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_1); - __pyx_t_25 = 0; - __pyx_t_26 = NULL; - } else { - __pyx_t_25 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_26 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 698, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_26)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - 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, 698, __pyx_L1_error) - #endif - if (__pyx_t_25 >= __pyx_temp) break; - } - __pyx_t_27 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_25); - ++__pyx_t_25; - } 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, 698, __pyx_L1_error) - #endif - if (__pyx_t_25 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_27 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_25)); - #else - __pyx_t_27 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_25); - #endif - ++__pyx_t_25; - } - if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 698, __pyx_L1_error) - } else { - __pyx_t_27 = __pyx_t_26(__pyx_t_1); - if (unlikely(!__pyx_t_27)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 698, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_27); - __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_27); - __pyx_t_27 = 0; - __pyx_t_27 = __Pyx_PyObject_GetItem(__pyx_v_chunk, __pyx_v_key); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_27); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_27))) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_14); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_10}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - } - if (unlikely((PyObject_SetItem(__pyx_v_final, __pyx_v_key, __pyx_t_8) < 0))) __PYX_ERR(0, 698, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "pyreadstat/pyreadstat.pyx":697 - * keys = chunks[0].keys() - * final = dict() - * for key in keys: # <<<<<<<<<<<<<< - * final[key] = np.concatenate([chunk[key] for chunk in chunks]) - * else: -*/ - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":694 - * pool.close() - * output_format = kwargs.get("output_format") - * if output_format == 'dict': # <<<<<<<<<<<<<< - * keys = chunks[0].keys() - * final = dict() -*/ - goto __pyx_L38; - } - - /* "pyreadstat/pyreadstat.pyx":701 - * else: - * #final = pd.concat(chunks, axis=0, ignore_index=True) - * chunks = [nw.from_native(x) for x in chunks] # <<<<<<<<<<<<<< - * final = nw.concat(chunks, how='vertical') - * ispandas = False -*/ - /*else*/ { - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_v_chunks)) || PyTuple_CheckExact(__pyx_v_chunks)) { - __pyx_t_8 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_8); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_chunks); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 701, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 701, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_12); - ++__pyx_t_12; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 701, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12)); - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12); - #endif - ++__pyx_t_12; - } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) - } else { - __pyx_t_2 = __pyx_t_13(__pyx_t_8); - 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, 701, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_10 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_from_native); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_10); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_x}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __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_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_chunks, __pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":702 - * #final = pd.concat(chunks, axis=0, ignore_index=True) - * chunks = [nw.from_native(x) for x in chunks] - * final = nw.concat(chunks, how='vertical') # <<<<<<<<<<<<<< - * ispandas = False - * if final.implementation.is_pandas(): -*/ - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_concat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); - assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_1, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_v_chunks}; - __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_how, __pyx_mstate_global->__pyx_n_u_vertical, __pyx_t_2, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 702, __pyx_L1_error) - __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_final, __pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":703 - * chunks = [nw.from_native(x) for x in chunks] - * final = nw.concat(chunks, how='vertical') - * ispandas = False # <<<<<<<<<<<<<< - * if final.implementation.is_pandas(): - * ispandas = True -*/ - __pyx_v_ispandas = 0; - - /* "pyreadstat/pyreadstat.pyx":704 - * final = nw.concat(chunks, how='vertical') - * ispandas = False - * if final.implementation.is_pandas(): # <<<<<<<<<<<<<< - * ispandas = True - * final = final.to_native() -*/ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_final, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_pandas, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "pyreadstat/pyreadstat.pyx":705 - * ispandas = False - * if final.implementation.is_pandas(): - * ispandas = True # <<<<<<<<<<<<<< - * final = final.to_native() - * if ispandas: -*/ - __pyx_v_ispandas = 1; - - /* "pyreadstat/pyreadstat.pyx":704 - * final = nw.concat(chunks, how='vertical') - * ispandas = False - * if final.implementation.is_pandas(): # <<<<<<<<<<<<<< - * ispandas = True - * final = final.to_native() -*/ - } - - /* "pyreadstat/pyreadstat.pyx":706 - * if final.implementation.is_pandas(): - * ispandas = True - * final = final.to_native() # <<<<<<<<<<<<<< - * if ispandas: - * final = final.reset_index(drop=True) -*/ - __pyx_t_2 = __pyx_v_final; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_native, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF_SET(__pyx_v_final, __pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":707 - * ispandas = True - * final = final.to_native() - * if ispandas: # <<<<<<<<<<<<<< - * final = final.reset_index(drop=True) - * return final, meta -*/ - if (__pyx_v_ispandas) { - - /* "pyreadstat/pyreadstat.pyx":708 - * final = final.to_native() - * if ispandas: - * final = final.reset_index(drop=True) # <<<<<<<<<<<<<< - * return final, meta - * -*/ - __pyx_t_2 = __pyx_v_final; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_drop, Py_True, __pyx_t_1, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_reset_index, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF_SET(__pyx_v_final, __pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":707 - * ispandas = True - * final = final.to_native() - * if ispandas: # <<<<<<<<<<<<<< - * final = final.reset_index(drop=True) - * return final, meta -*/ - } - } - __pyx_L38:; - - /* "pyreadstat/pyreadstat.pyx":709 - * if ispandas: - * final = final.reset_index(drop=True) - * return final, meta # <<<<<<<<<<<<<< - * - * # Write API -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_final); - __Pyx_GIVEREF(__pyx_v_final); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_final) != (0)) __PYX_ERR(0, 709, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_meta); - __Pyx_GIVEREF(__pyx_v_meta); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_meta) != (0)) __PYX_ERR(0, 709, __pyx_L1_error); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "pyreadstat/pyreadstat.pyx":623 - * offset += chunksize - * - * def read_file_multiprocessing(read_function, file_path, num_processes=None, num_rows=None, **kwargs): # <<<<<<<<<<<<<< - * """ - * Reads a file in parallel using multiprocessing. -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_27); - __Pyx_AddTraceback("pyreadstat.pyreadstat.read_file_multiprocessing", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v__); - __Pyx_XDECREF(__pyx_v_row_offset); - __Pyx_XDECREF(__pyx_v_row_limit); - __Pyx_XDECREF(__pyx_v_meta); - __Pyx_XDECREF(__pyx_v_numrows); - __Pyx_XDECREF(__pyx_v_final); - __Pyx_XDECREF(__pyx_v_divs); - __Pyx_XDECREF(__pyx_v_offsets); - __Pyx_XDECREF(__pyx_v_prev_offset); - __Pyx_XDECREF(__pyx_v_prev_div); - __Pyx_XDECREF(__pyx_v_indx); - __Pyx_XDECREF(__pyx_v_div); - __Pyx_XDECREF(__pyx_v_offset); - __Pyx_XDECREF(__pyx_v_jobs); - __Pyx_XDECREF(__pyx_v_pool); - __Pyx_XDECREF(__pyx_v_chunks); - __Pyx_XDECREF(__pyx_v_output_format); - __Pyx_XDECREF(__pyx_v_keys); - __Pyx_XDECREF(__pyx_v_key); - __Pyx_XDECREF(__pyx_v_x); - __Pyx_XDECREF(__pyx_v_chunksize); - __Pyx_XDECREF(__pyx_v_chunk); - __Pyx_XDECREF(__pyx_v_num_processes); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":713 - * # Write API - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_18write_sav(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_17write_sav, "\n Writes a dataframe to a SPSS sav or zsav file.\n\n Parameters\n ----------\n df : dataframe\n dataframe to write to sav or zsav\n dst_path : str or pathlib.Path\n full path to the result sav or zsav file\n file_label : str, optional\n a label for the file\n column_labels : list or dict, optional\n labels for columns (variables), if list must be the same length as the number of columns. Variables with no\n labels must be represented by None. If dict values must be variable names and values variable labels.\n In such case there is no need to include all variables; labels for non existent\n variables will be ignored with no warning or error.\n compress : boolean, optional\n if true a zsav will be written, by default False, a sav is written\n row_compress : boolean, optional\n if true it applies row compression, by default False, compress and row_compress cannot be both true at the same time\n note : str or list of str, optional\n a note or list of notes to add to the file\n variable_value_labels : dict, optional\n value labels, a dictionary with key variable name and value a dictionary with key values and\n values labels. Variable names must match variable names in the dataframe otherwise will be\n ignored. Value types must match the type of the column in the dataframe.\n missing_ranges : dict, optional\n user defined missing values. Must be a dictionary with keys as variable names matching variable\n names in the dataframe. The values must be a list. Each element in that list can either be\n either a discrete numeric or string value (max 3 per variable) or a dictionary with keys 'hi' and 'lo' to\n indicate the upper and lower range for numeric values (max 1 range value + 1 discrete value per\n variable). hi and lo may also be the same value in which case it will be interpreted as a discrete\n missin""g value.\n For this to be effective, values in the dataframe must be the same as reported here and not NaN.\n variable_display_width : dict, optional\n set the display width for variables. Must be a dictonary with keys being variable names and\n values being integers.\n variable_measure: dict, optional\n sets the measure type for a variable. Must be a dictionary with keys being variable names and\n values being strings one of \"nominal\", \"ordinal\", \"scale\" or \"unknown\" (default).\n variable_format: dict, optional\n sets the format of a variable. Must be a dictionary with keys being the variable names and \n values being strings defining the format. See README, setting variable formats section,\n for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_18write_sav = {"write_sav", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_18write_sav, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_17write_sav}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_18write_sav(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_df = 0; - PyObject *__pyx_v_dst_path = 0; - PyObject *__pyx_v_file_label = 0; - PyObject *__pyx_v_column_labels = 0; - PyObject *__pyx_v_compress = 0; - PyObject *__pyx_v_row_compress = 0; - PyObject *__pyx_v_note = 0; - PyObject *__pyx_v_variable_value_labels = 0; - PyObject *__pyx_v_missing_ranges = 0; - PyObject *__pyx_v_variable_display_width = 0; - PyObject *__pyx_v_variable_measure = 0; - PyObject *__pyx_v_variable_format = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("write_sav (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - 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_file_label,&__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_variable_format,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, 713, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 12: - values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, "write_sav", 0) < 0) __PYX_ERR(0, 713, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":714 - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): - * """ -*/ - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":715 - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SPSS sav or zsav file. -*/ - if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_sav", 0, 2, 12, i); __PYX_ERR(0, 713, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 12: - values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __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, 713, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 713, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - - /* "pyreadstat/pyreadstat.pyx":713 - * # Write API - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): -*/ - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":714 - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): - * """ -*/ - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[8]) values[8] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[9]) values[9] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":715 - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SPSS sav or zsav file. -*/ - if (!values[10]) values[10] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[11]) values[11] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_df = values[0]; - __pyx_v_dst_path = values[1]; - __pyx_v_file_label = ((PyObject*)values[2]); - __pyx_v_column_labels = values[3]; - __pyx_v_compress = values[4]; - __pyx_v_row_compress = values[5]; - __pyx_v_note = values[6]; - __pyx_v_variable_value_labels = ((PyObject*)values[7]); - __pyx_v_missing_ranges = ((PyObject*)values[8]); - __pyx_v_variable_display_width = ((PyObject*)values[9]); - __pyx_v_variable_measure = ((PyObject*)values[10]); - __pyx_v_variable_format = ((PyObject*)values[11]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_sav", 0, 2, 12, __pyx_nargs); __PYX_ERR(0, 713, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_sav", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 713, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_value_labels), (&PyDict_Type), 1, "variable_value_labels", 1))) __PYX_ERR(0, 714, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_ranges), (&PyDict_Type), 1, "missing_ranges", 1))) __PYX_ERR(0, 714, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_display_width), (&PyDict_Type), 1, "variable_display_width", 1))) __PYX_ERR(0, 714, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_measure), (&PyDict_Type), 1, "variable_measure", 1))) __PYX_ERR(0, 715, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 715, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_17write_sav(__pyx_self, __pyx_v_df, __pyx_v_dst_path, __pyx_v_file_label, __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_variable_format); - - /* "pyreadstat/pyreadstat.pyx":713 - * # Write API - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_17write_sav(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_file_label, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_compress, PyObject *__pyx_v_row_compress, PyObject *__pyx_v_note, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_ranges, PyObject *__pyx_v_variable_display_width, PyObject *__pyx_v_variable_measure, PyObject *__pyx_v_variable_format) { - int __pyx_v_file_format_version; - PyObject *__pyx_v_var_width = 0; - int __pyx_v_row_compression; - PyObject *__pyx_v_table_name = 0; - PyObject *__pyx_v_missing_user_values = 0; - PyObject *__pyx_v_variable_alignment = 0; - PyObject *__pyx_v_formats_presets = NULL; - PyObject *__pyx_v_col_name = NULL; - PyObject *__pyx_v_col_format = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *(*__pyx_t_11)(PyObject *); - Py_ssize_t __pyx_t_12; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("write_sav", 0); - - /* "pyreadstat/pyreadstat.pyx":762 - * """ - * - * cdef int file_format_version = 2 # <<<<<<<<<<<<<< - * cdef str var_width - * cdef bint row_compression = 0 -*/ - __pyx_v_file_format_version = 2; - - /* "pyreadstat/pyreadstat.pyx":764 - * cdef int file_format_version = 2 - * cdef str var_width - * cdef bint row_compression = 0 # <<<<<<<<<<<<<< - * if compress and row_compress: - * raise PyreadstatError("compress and row_compress cannot be both True") -*/ - __pyx_v_row_compression = 0; - - /* "pyreadstat/pyreadstat.pyx":765 - * cdef str var_width - * cdef bint row_compression = 0 - * 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, 765, __pyx_L1_error) - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 765, __pyx_L1_error) - __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (unlikely(__pyx_t_1)) { - - /* "pyreadstat/pyreadstat.pyx":766 - * cdef bint row_compression = 0 - * if compress and row_compress: - * raise PyreadstatError("compress and row_compress cannot be both True") # <<<<<<<<<<<<<< - * if compress: - * 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, 766, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); - __pyx_t_6 = 0; - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_compress_and_row_compress_cannot}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__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, 766, __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, 766, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":765 - * cdef str var_width - * cdef bint row_compression = 0 - * if compress and row_compress: # <<<<<<<<<<<<<< - * raise PyreadstatError("compress and row_compress cannot be both True") - * if compress: -*/ - } - - /* "pyreadstat/pyreadstat.pyx":767 - * 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, 767, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":768 - * raise PyreadstatError("compress and row_compress cannot be both True") - * if compress: - * file_format_version = 3 # <<<<<<<<<<<<<< - * if row_compress: - * row_compression = 1 -*/ - __pyx_v_file_format_version = 3; - - /* "pyreadstat/pyreadstat.pyx":767 - * if compress and row_compress: - * raise PyreadstatError("compress and row_compress cannot be both True") - * if compress: # <<<<<<<<<<<<<< - * file_format_version = 3 - * if row_compress: -*/ - } - - /* "pyreadstat/pyreadstat.pyx":769 - * if compress: - * file_format_version = 3 - * if row_compress: # <<<<<<<<<<<<<< - * row_compression = 1 - * cdef table_name = "" -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_row_compress); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 769, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":770 - * file_format_version = 3 - * if row_compress: - * row_compression = 1 # <<<<<<<<<<<<<< - * cdef table_name = "" - * cdef dict missing_user_values = None -*/ - __pyx_v_row_compression = 1; - - /* "pyreadstat/pyreadstat.pyx":769 - * if compress: - * file_format_version = 3 - * if row_compress: # <<<<<<<<<<<<<< - * row_compression = 1 - * cdef table_name = "" -*/ - } - - /* "pyreadstat/pyreadstat.pyx":771 - * if row_compress: - * row_compression = 1 - * cdef table_name = "" # <<<<<<<<<<<<<< - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_); - __pyx_v_table_name = __pyx_mstate_global->__pyx_kp_u_; - - /* "pyreadstat/pyreadstat.pyx":772 - * row_compression = 1 - * cdef table_name = "" - * cdef dict missing_user_values = None # <<<<<<<<<<<<<< - * cdef dict variable_alignment = None - * -*/ - __Pyx_INCREF(Py_None); - __pyx_v_missing_user_values = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":773 - * cdef table_name = "" - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None # <<<<<<<<<<<<<< - * - * -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_alignment = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":777 - * - * # formats - * formats_presets = {'restricted_integer':'N{var_width}', 'integer':'F{var_width}.0'} # <<<<<<<<<<<<<< - * if variable_format: - * for col_name, col_format in variable_format.items(): -*/ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_restricted_integer, __pyx_mstate_global->__pyx_kp_u_N_var_width) < 0) __PYX_ERR(0, 777, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_integer, __pyx_mstate_global->__pyx_kp_u_F_var_width_0) < 0) __PYX_ERR(0, 777, __pyx_L1_error) - __pyx_v_formats_presets = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":778 - * # formats - * formats_presets = {'restricted_integer':'N{var_width}', 'integer':'F{var_width}.0'} - * if variable_format: # <<<<<<<<<<<<<< - * for col_name, col_format in variable_format.items(): - * if col_format in formats_presets.keys() and col_name in df.columns: -*/ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variable_format); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":779 - * formats_presets = {'restricted_integer':'N{var_width}', 'integer':'F{var_width}.0'} - * if variable_format: - * for col_name, col_format in variable_format.items(): # <<<<<<<<<<<<<< - * if col_format in formats_presets.keys() and col_name in df.columns: - * var_width = str(len(str(max(df[col_name])))) -*/ - if (unlikely(__pyx_v_variable_format == Py_None)) { - PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 779, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_variable_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __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, 779, __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, 779, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - { - 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, 779, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_7); - ++__pyx_t_7; - } else { - { - 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, 779, __pyx_L1_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_5, __pyx_t_7)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); - #endif - ++__pyx_t_7; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __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, 779, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_3); - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 779, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_4); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_9); - } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 779, __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, 779, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 779, __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, 779, __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); - index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 779, __pyx_L1_error) - __pyx_t_11 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L12_unpacking_done; - __pyx_L11_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_11 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 779, __pyx_L1_error) - __pyx_L12_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_v_col_name, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_col_format, __pyx_t_9); - __pyx_t_9 = 0; - - /* "pyreadstat/pyreadstat.pyx":780 - * if variable_format: - * for col_name, col_format in variable_format.items(): - * if col_format in formats_presets.keys() and col_name in df.columns: # <<<<<<<<<<<<<< - * var_width = str(len(str(max(df[col_name])))) - * variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) -*/ - __pyx_t_3 = __Pyx_PyDict_Keys(__pyx_v_formats_presets); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_format, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_2; - __pyx_L14_bool_binop_done:; - if (__pyx_t_1) { - - /* "pyreadstat/pyreadstat.pyx":781 - * for col_name, col_format in variable_format.items(): - * if col_format in formats_presets.keys() and col_name in df.columns: - * var_width = str(len(str(max(df[col_name])))) # <<<<<<<<<<<<<< - * variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) - * -*/ - __pyx_t_9 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_4 = __pyx_builtin_max; - __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_df, __pyx_v_col_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __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_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_12 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_var_width, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":782 - * if col_format in formats_presets.keys() and col_name in df.columns: - * var_width = str(len(str(max(df[col_name])))) - * variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) # <<<<<<<<<<<<<< - * - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_SAV, file_label, column_labels, -*/ - __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_formats_presets, __pyx_v_col_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __pyx_t_10; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, NULL}; - __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_var_width, __pyx_v_var_width, __pyx_t_9, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 782, __pyx_L1_error) - __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - if (unlikely(__pyx_v_variable_format == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 782, __pyx_L1_error) - } - if (unlikely((PyDict_SetItem(__pyx_v_variable_format, __pyx_v_col_name, __pyx_t_3) < 0))) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":780 - * if variable_format: - * for col_name, col_format in variable_format.items(): - * if col_format in formats_presets.keys() and col_name in df.columns: # <<<<<<<<<<<<<< - * var_width = str(len(str(max(df[col_name])))) - * variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) -*/ - } - - /* "pyreadstat/pyreadstat.pyx":779 - * formats_presets = {'restricted_integer':'N{var_width}', 'integer':'F{var_width}.0'} - * if variable_format: - * for col_name, col_format in variable_format.items(): # <<<<<<<<<<<<<< - * if col_format in formats_presets.keys() and col_name in df.columns: - * var_width = str(len(str(max(df[col_name])))) -*/ - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "pyreadstat/pyreadstat.pyx":778 - * # formats - * formats_presets = {'restricted_integer':'N{var_width}', 'integer':'F{var_width}.0'} - * if variable_format: # <<<<<<<<<<<<<< - * for col_name, col_format in variable_format.items(): - * if col_format in formats_presets.keys() and col_name in df.columns: -*/ - } - - /* "pyreadstat/pyreadstat.pyx":785 - * - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_SAV, 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) - * -*/ - if (!(likely(PyUnicode_CheckExact(__pyx_v_table_name)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_table_name))) __PYX_ERR(0, 785, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":784 - * variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) - * - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_SAV, 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_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_file_format_version, __pyx_v_note, ((PyObject*)__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(PyErr_Occurred())) __PYX_ERR(0, 784, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":713 - * # Write API - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): -*/ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_sav", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_var_width); - __Pyx_XDECREF(__pyx_v_table_name); - __Pyx_XDECREF(__pyx_v_missing_user_values); - __Pyx_XDECREF(__pyx_v_variable_alignment); - __Pyx_XDECREF(__pyx_v_formats_presets); - __Pyx_XDECREF(__pyx_v_col_name); - __Pyx_XDECREF(__pyx_v_col_format); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":788 - * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, # <<<<<<<<<<<<<< - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): - * """ -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_20write_dta(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_19write_dta, "\n Writes a dataframe to a STATA dta file\n\n Parameters\n ----------\n df : dataframe\n dataframe to write to sav or zsav\n dst_path : str or pathlib.Path\n full path to the result dta file\n file_label : str, optional\n a label for the file\n column_labels : list or dict, optional\n labels for columns (variables), if list must be the same length as the number of columns. Variables with no\n labels must be represented by None. If dict values must be variable names and values variable labels.\n In such case there is no need to include all variables; labels for non existent\n variables will be ignored with no warning or error.\n version : int, optional\n dta file version, supported from 8 to 15, default is 15\n variable_value_labels : dict, optional\n value labels, a dictionary with key variable name and value a dictionary with key values and\n values labels. Variable names must match variable names in the dataframe otherwise will be\n ignored. Value types must match the type of the column in the dataframe.\n missing_user_values : dict, optional\n user defined missing values for numeric variables. Must be a dictionary with keys being variable\n names and values being a list of missing values. Missing values must be a single character\n between a and z.\n variable_format: dict, optional\n sets the format of a variable. Must be a dictionary with keys being the variable names and \n values being strings defining the format. See README, setting variable formats section,\n for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_20write_dta = {"write_dta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_20write_dta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_19write_dta}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_20write_dta(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_df = 0; - PyObject *__pyx_v_dst_path = 0; - PyObject *__pyx_v_file_label = 0; - PyObject *__pyx_v_column_labels = 0; - int __pyx_v_version; - PyObject *__pyx_v_variable_value_labels = 0; - PyObject *__pyx_v_missing_user_values = 0; - PyObject *__pyx_v_variable_format = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("write_dta (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - 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_file_label,&__pyx_mstate_global->__pyx_n_u_column_labels,&__pyx_mstate_global->__pyx_n_u_version,&__pyx_mstate_global->__pyx_n_u_variable_value_labels,&__pyx_mstate_global->__pyx_n_u_missing_user_values,&__pyx_mstate_global->__pyx_n_u_variable_format,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, 788, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 8: - values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 788, __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, 788, __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, 788, __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, 788, __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, 788, __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, 788, __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, 788, __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, 788, __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, "write_dta", 0) < 0) __PYX_ERR(0, 788, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":789 - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a STATA dta file -*/ - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_dta", 0, 2, 8, i); __PYX_ERR(0, 788, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 8: - values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 788, __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, 788, __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, 788, __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, 788, __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, 788, __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, 788, __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, 788, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 788, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - - /* "pyreadstat/pyreadstat.pyx":788 - * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, # <<<<<<<<<<<<<< - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): - * """ -*/ - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":789 - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a STATA dta file -*/ - if (!values[5]) values[5] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_df = values[0]; - __pyx_v_dst_path = values[1]; - __pyx_v_file_label = ((PyObject*)values[2]); - __pyx_v_column_labels = 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, 788, __pyx_L3_error) - } else { - __pyx_v_version = ((int)((int)15)); - } - __pyx_v_variable_value_labels = ((PyObject*)values[5]); - __pyx_v_missing_user_values = ((PyObject*)values[6]); - __pyx_v_variable_format = ((PyObject*)values[7]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_dta", 0, 2, 8, __pyx_nargs); __PYX_ERR(0, 788, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_dta", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 788, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_value_labels), (&PyDict_Type), 1, "variable_value_labels", 1))) __PYX_ERR(0, 789, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_missing_user_values), (&PyDict_Type), 1, "missing_user_values", 1))) __PYX_ERR(0, 789, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 789, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_19write_dta(__pyx_self, __pyx_v_df, __pyx_v_dst_path, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_version, __pyx_v_variable_value_labels, __pyx_v_missing_user_values, __pyx_v_variable_format); - - /* "pyreadstat/pyreadstat.pyx":788 - * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, # <<<<<<<<<<<<<< - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): - * """ -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_19write_dta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_file_label, PyObject *__pyx_v_column_labels, int __pyx_v_version, PyObject *__pyx_v_variable_value_labels, PyObject *__pyx_v_missing_user_values, PyObject *__pyx_v_variable_format) { - long __pyx_v_file_format_version; - PyObject *__pyx_v_note = 0; - PyObject *__pyx_v_table_name = 0; - PyObject *__pyx_v_missing_ranges = 0; - PyObject *__pyx_v_variable_alignment = 0; - PyObject *__pyx_v_variable_display_width = 0; - PyObject *__pyx_v_variable_measure = 0; - int __pyx_v_row_compression; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("write_dta", 0); - - /* "pyreadstat/pyreadstat.pyx":822 - * """ - * - * if version == 15: # <<<<<<<<<<<<<< - * file_format_version = 119 - * elif version == 14: -*/ - switch (__pyx_v_version) { - case 15: - - /* "pyreadstat/pyreadstat.pyx":823 - * - * if version == 15: - * file_format_version = 119 # <<<<<<<<<<<<<< - * elif version == 14: - * file_format_version = 118 -*/ - __pyx_v_file_format_version = 0x77; - - /* "pyreadstat/pyreadstat.pyx":822 - * """ - * - * if version == 15: # <<<<<<<<<<<<<< - * file_format_version = 119 - * elif version == 14: -*/ - break; - case 14: - - /* "pyreadstat/pyreadstat.pyx":825 - * file_format_version = 119 - * elif version == 14: - * file_format_version = 118 # <<<<<<<<<<<<<< - * elif version == 13: - * file_format_version = 117 -*/ - __pyx_v_file_format_version = 0x76; - - /* "pyreadstat/pyreadstat.pyx":824 - * if version == 15: - * file_format_version = 119 - * elif version == 14: # <<<<<<<<<<<<<< - * file_format_version = 118 - * elif version == 13: -*/ - break; - case 13: - - /* "pyreadstat/pyreadstat.pyx":827 - * file_format_version = 118 - * elif version == 13: - * file_format_version = 117 # <<<<<<<<<<<<<< - * elif version == 12: - * file_format_version = 115 -*/ - __pyx_v_file_format_version = 0x75; - - /* "pyreadstat/pyreadstat.pyx":826 - * elif version == 14: - * file_format_version = 118 - * elif version == 13: # <<<<<<<<<<<<<< - * file_format_version = 117 - * elif version == 12: -*/ - break; - case 12: - - /* "pyreadstat/pyreadstat.pyx":829 - * file_format_version = 117 - * elif version == 12: - * file_format_version = 115 # <<<<<<<<<<<<<< - * elif version in {10, 11}: - * file_format_version = 114 -*/ - __pyx_v_file_format_version = 0x73; - - /* "pyreadstat/pyreadstat.pyx":828 - * elif version == 13: - * file_format_version = 117 - * elif version == 12: # <<<<<<<<<<<<<< - * file_format_version = 115 - * elif version in {10, 11}: -*/ - break; - case 10: - - /* "pyreadstat/pyreadstat.pyx":830 - * elif version == 12: - * file_format_version = 115 - * elif version in {10, 11}: # <<<<<<<<<<<<<< - * file_format_version = 114 - * elif version in {8, 9}: -*/ - case 11: - - /* "pyreadstat/pyreadstat.pyx":831 - * file_format_version = 115 - * elif version in {10, 11}: - * file_format_version = 114 # <<<<<<<<<<<<<< - * elif version in {8, 9}: - * file_format_version = 113 -*/ - __pyx_v_file_format_version = 0x72; - - /* "pyreadstat/pyreadstat.pyx":830 - * elif version == 12: - * file_format_version = 115 - * elif version in {10, 11}: # <<<<<<<<<<<<<< - * file_format_version = 114 - * elif version in {8, 9}: -*/ - break; - case 8: - - /* "pyreadstat/pyreadstat.pyx":832 - * elif version in {10, 11}: - * file_format_version = 114 - * elif version in {8, 9}: # <<<<<<<<<<<<<< - * file_format_version = 113 - * else: -*/ - case 9: - - /* "pyreadstat/pyreadstat.pyx":833 - * file_format_version = 114 - * elif version in {8, 9}: - * file_format_version = 113 # <<<<<<<<<<<<<< - * else: - * raise Exception("Version not supported") -*/ - __pyx_v_file_format_version = 0x71; - - /* "pyreadstat/pyreadstat.pyx":832 - * elif version in {10, 11}: - * file_format_version = 114 - * elif version in {8, 9}: # <<<<<<<<<<<<<< - * file_format_version = 113 - * else: -*/ - break; - default: - - /* "pyreadstat/pyreadstat.pyx":835 - * file_format_version = 113 - * else: - * raise Exception("Version not supported") # <<<<<<<<<<<<<< - * - * cdef str note = "" -*/ - __pyx_t_2 = NULL; - __Pyx_INCREF((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_3 = ((PyObject *)(((PyTypeObject*)PyExc_Exception))); - __pyx_t_4 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Version_not_supported}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __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, 835, __pyx_L1_error) - break; - } - - /* "pyreadstat/pyreadstat.pyx":837 - * raise Exception("Version not supported") - * - * cdef str note = "" # <<<<<<<<<<<<<< - * cdef str table_name = "" - * cdef dict missing_ranges = None -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_); - __pyx_v_note = __pyx_mstate_global->__pyx_kp_u_; - - /* "pyreadstat/pyreadstat.pyx":838 - * - * cdef str note = "" - * cdef str table_name = "" # <<<<<<<<<<<<<< - * cdef dict missing_ranges = None - * cdef dict variable_alignment = None -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_); - __pyx_v_table_name = __pyx_mstate_global->__pyx_kp_u_; - - /* "pyreadstat/pyreadstat.pyx":839 - * cdef str note = "" - * cdef str table_name = "" - * cdef dict missing_ranges = None # <<<<<<<<<<<<<< - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_missing_ranges = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":840 - * cdef str table_name = "" - * cdef dict missing_ranges = None - * cdef dict variable_alignment = None # <<<<<<<<<<<<<< - * cdef dict variable_display_width = None - * cdef dict variable_measure = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_alignment = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":841 - * cdef dict missing_ranges = None - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None # <<<<<<<<<<<<<< - * cdef dict variable_measure = None - * #cdef dict variable_format = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_display_width = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":842 - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None - * cdef dict variable_measure = None # <<<<<<<<<<<<<< - * #cdef dict variable_format = None - * cdef bint row_compression = 0 -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_measure = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":844 - * cdef dict variable_measure = None - * #cdef dict variable_format = None - * cdef bint row_compression = 0 # <<<<<<<<<<<<<< - * - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_DTA, file_label, column_labels, file_format_version, -*/ - __pyx_v_row_compression = 0; - - /* "pyreadstat/pyreadstat.pyx":846 - * cdef bint row_compression = 0 - * - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_DTA, 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_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA, __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(PyErr_Occurred())) __PYX_ERR(0, 846, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":788 - * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, # <<<<<<<<<<<<<< - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): - * """ -*/ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_dta", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_note); - __Pyx_XDECREF(__pyx_v_table_name); - __Pyx_XDECREF(__pyx_v_missing_ranges); - __Pyx_XDECREF(__pyx_v_variable_alignment); - __Pyx_XDECREF(__pyx_v_variable_display_width); - __Pyx_XDECREF(__pyx_v_variable_measure); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":850 - * variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, # <<<<<<<<<<<<<< - * dict variable_format=None): - * """ -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_22write_xport(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_21write_xport, "\n Writes a dataframe to a SAS Xport (xpt) file.\n If no table_name is specified the dataset has by default the name DATASET (take it into account if\n reading the file from SAS.)\n Versions 5 and 8 are supported, default is 8.\n\n Parameters\n ----------\n df : dataframe\n dataframe to write to xport\n dst_path : str or pathlib.Path\n full path to the result xport file\n file_label : str, optional\n a label for the file\n column_labels : list or dict, optional\n labels for columns (variables), if list must be the same length as the number of columns. Variables with no\n labels must be represented by None. If dict values must be variable names and values variable labels.\n In such case there is no need to include all variables; labels for non existent\n variables will be ignored with no warning or error.\n table_name : str, optional\n name of the dataset, by default DATASET\n file_format_version : int, optional\n XPORT file version, either 8 or 5, default is 8\n variable_format: dict, optional\n sets the format of a variable. Must be a dictionary with keys being the variable names and \n values being strings defining the format. See README, setting variable formats section,\n for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_22write_xport = {"write_xport", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_22write_xport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_21write_xport}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_22write_xport(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_df = 0; - PyObject *__pyx_v_dst_path = 0; - PyObject *__pyx_v_file_label = 0; - PyObject *__pyx_v_column_labels = 0; - PyObject *__pyx_v_table_name = 0; - int __pyx_v_file_format_version; - PyObject *__pyx_v_variable_format = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[7] = {0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("write_xport (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - 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_file_label,&__pyx_mstate_global->__pyx_n_u_column_labels,&__pyx_mstate_global->__pyx_n_u_table_name,&__pyx_mstate_global->__pyx_n_u_file_format_version,&__pyx_mstate_global->__pyx_n_u_variable_format,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, 850, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 7: - values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 850, __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, 850, __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, 850, __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, 850, __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, 850, __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, 850, __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, 850, __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, "write_xport", 0) < 0) __PYX_ERR(0, 850, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":851 - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, - * dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SAS Xport (xpt) file. -*/ - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_xport", 0, 2, 7, i); __PYX_ERR(0, 850, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 7: - values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 850, __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, 850, __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, 850, __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, 850, __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, 850, __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, 850, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 850, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - - /* "pyreadstat/pyreadstat.pyx":850 - * variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, # <<<<<<<<<<<<<< - * dict variable_format=None): - * """ -*/ - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)Py_None)); - - /* "pyreadstat/pyreadstat.pyx":851 - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, - * dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SAS Xport (xpt) file. -*/ - if (!values[6]) values[6] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_df = values[0]; - __pyx_v_dst_path = values[1]; - __pyx_v_file_label = ((PyObject*)values[2]); - __pyx_v_column_labels = values[3]; - __pyx_v_table_name = ((PyObject*)values[4]); - if (values[5]) { - __pyx_v_file_format_version = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_file_format_version == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L3_error) - } else { - __pyx_v_file_format_version = ((int)((int)8)); - } - __pyx_v_variable_format = ((PyObject*)values[6]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_xport", 0, 2, 7, __pyx_nargs); __PYX_ERR(0, 850, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_xport", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 850, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table_name), (&PyUnicode_Type), 1, "table_name", 1))) __PYX_ERR(0, 850, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 851, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_21write_xport(__pyx_self, __pyx_v_df, __pyx_v_dst_path, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_table_name, __pyx_v_file_format_version, __pyx_v_variable_format); - - /* "pyreadstat/pyreadstat.pyx":850 - * variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, # <<<<<<<<<<<<<< - * dict variable_format=None): - * """ -*/ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_21write_xport(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_file_label, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_table_name, int __pyx_v_file_format_version, PyObject *__pyx_v_variable_format) { - PyObject *__pyx_v_variable_value_labels = 0; - PyObject *__pyx_v_note = 0; - PyObject *__pyx_v_missing_ranges = 0; - PyObject *__pyx_v_missing_user_values = 0; - PyObject *__pyx_v_variable_alignment = 0; - PyObject *__pyx_v_variable_display_width = 0; - PyObject *__pyx_v_variable_measure = 0; - int __pyx_v_row_compression; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("write_xport", 0); - - /* "pyreadstat/pyreadstat.pyx":881 - * """ - * - * cdef dict variable_value_labels = None # <<<<<<<<<<<<<< - * cdef str note = "" - * cdef dict missing_ranges = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_value_labels = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":882 - * - * cdef dict variable_value_labels = None - * cdef str note = "" # <<<<<<<<<<<<<< - * cdef dict missing_ranges = None - * cdef dict missing_user_values = None -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_); - __pyx_v_note = __pyx_mstate_global->__pyx_kp_u_; - - /* "pyreadstat/pyreadstat.pyx":883 - * cdef dict variable_value_labels = None - * cdef str note = "" - * cdef dict missing_ranges = None # <<<<<<<<<<<<<< - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_missing_ranges = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":884 - * cdef str note = "" - * cdef dict missing_ranges = None - * cdef dict missing_user_values = None # <<<<<<<<<<<<<< - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_missing_user_values = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":885 - * cdef dict missing_ranges = None - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None # <<<<<<<<<<<<<< - * cdef dict variable_display_width = None - * cdef dict variable_measure = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_alignment = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":886 - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None # <<<<<<<<<<<<<< - * cdef dict variable_measure = None - * #cdef dict variable_format = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_display_width = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":887 - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None - * cdef dict variable_measure = None # <<<<<<<<<<<<<< - * #cdef dict variable_format = None - * cdef bint row_compression = 0 -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_measure = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":889 - * cdef dict variable_measure = None - * #cdef dict variable_format = None - * cdef bint row_compression = 0 # <<<<<<<<<<<<<< - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_XPORT, file_label, column_labels, - * file_format_version, note, table_name, variable_value_labels, missing_ranges,missing_user_values, -*/ - __pyx_v_row_compression = 0; - - /* "pyreadstat/pyreadstat.pyx":890 - * #cdef dict variable_format = None - * cdef bint row_compression = 0 - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_XPORT, 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_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT, __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(PyErr_Occurred())) __PYX_ERR(0, 890, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":850 - * variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, # <<<<<<<<<<<<<< - * dict variable_format=None): - * """ -*/ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_xport", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable_value_labels); - __Pyx_XDECREF(__pyx_v_note); - __Pyx_XDECREF(__pyx_v_missing_ranges); - __Pyx_XDECREF(__pyx_v_missing_user_values); - __Pyx_XDECREF(__pyx_v_variable_alignment); - __Pyx_XDECREF(__pyx_v_variable_display_width); - __Pyx_XDECREF(__pyx_v_variable_measure); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/pyreadstat.pyx":894 - * variable_alignment,variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_por(df, dst_path, str file_label="", object column_labels=None, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SPSS POR file. -*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_24write_por(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10pyreadstat_10pyreadstat_23write_por, "\n Writes a dataframe to a SPSS POR file.\n\n Parameters\n ----------\n df : dataframe\n data frame to write to por\n dst_path : str or pathlib.Path\n full path to the result por file\n file_label : str, optional\n a label for the file\n column_labels : list or dict, optional\n labels for columns (variables), if list must be the same length as the number of columns. Variables with no\n labels must be represented by None. If dict values must be variable names and values variable labels.\n In such case there is no need to include all variables; labels for non existent\n variables will be ignored with no warning or error.\n variable_format: dict, optional\n sets the format of a variable. Must be a dictionary with keys being the variable names and \n values being strings defining the format. See README, setting variable formats section,\n for more information.\n "); -static PyMethodDef __pyx_mdef_10pyreadstat_10pyreadstat_24write_por = {"write_por", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_10pyreadstat_24write_por, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10pyreadstat_10pyreadstat_23write_por}; -static PyObject *__pyx_pw_10pyreadstat_10pyreadstat_24write_por(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_df = 0; - PyObject *__pyx_v_dst_path = 0; - PyObject *__pyx_v_file_label = 0; - PyObject *__pyx_v_column_labels = 0; - PyObject *__pyx_v_variable_format = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[5] = {0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("write_por (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - 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_file_label,&__pyx_mstate_global->__pyx_n_u_column_labels,&__pyx_mstate_global->__pyx_n_u_variable_format,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, 894, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 5: - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 894, __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, 894, __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, 894, __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, 894, __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, 894, __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, "write_por", 0) < 0) __PYX_ERR(0, 894, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)Py_None)); - for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_por", 0, 2, 5, i); __PYX_ERR(0, 894, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 5: - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 894, __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, 894, __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, 894, __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, 894, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 894, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject*)((PyObject*)__pyx_mstate_global->__pyx_kp_u_))); - if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject*)Py_None)); - } - __pyx_v_df = values[0]; - __pyx_v_dst_path = values[1]; - __pyx_v_file_label = ((PyObject*)values[2]); - __pyx_v_column_labels = values[3]; - __pyx_v_variable_format = ((PyObject*)values[4]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_por", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 894, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_por", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_label), (&PyUnicode_Type), 1, "file_label", 1))) __PYX_ERR(0, 894, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_variable_format), (&PyDict_Type), 1, "variable_format", 1))) __PYX_ERR(0, 894, __pyx_L1_error) - __pyx_r = __pyx_pf_10pyreadstat_10pyreadstat_23write_por(__pyx_self, __pyx_v_df, __pyx_v_dst_path, __pyx_v_file_label, __pyx_v_column_labels, __pyx_v_variable_format); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_10pyreadstat_23write_por(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_dst_path, PyObject *__pyx_v_file_label, PyObject *__pyx_v_column_labels, PyObject *__pyx_v_variable_format) { - PyObject *__pyx_v_note = 0; - int __pyx_v_file_format_version; - PyObject *__pyx_v_variable_value_labels = 0; - PyObject *__pyx_v_missing_ranges = 0; - PyObject *__pyx_v_missing_user_values = 0; - PyObject *__pyx_v_variable_alignment = 0; - PyObject *__pyx_v_variable_display_width = 0; - PyObject *__pyx_v_variable_measure = 0; - PyObject *__pyx_v_table_name = 0; - int __pyx_v_row_compression; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("write_por", 0); - - /* "pyreadstat/pyreadstat.pyx":918 - * - * # atm version 5 and 8 are supported by readstat but only 5 can be later be read by SAS - * cdef str note=None # <<<<<<<<<<<<<< - * cdef int file_format_version = 0 - * cdef dict variable_value_labels=None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_note = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":919 - * # atm version 5 and 8 are supported by readstat but only 5 can be later be read by SAS - * cdef str note=None - * cdef int file_format_version = 0 # <<<<<<<<<<<<<< - * cdef dict variable_value_labels=None - * cdef dict missing_ranges = None -*/ - __pyx_v_file_format_version = 0; - - /* "pyreadstat/pyreadstat.pyx":920 - * cdef str note=None - * cdef int file_format_version = 0 - * cdef dict variable_value_labels=None # <<<<<<<<<<<<<< - * cdef dict missing_ranges = None - * cdef dict missing_user_values = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_value_labels = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":921 - * cdef int file_format_version = 0 - * cdef dict variable_value_labels=None - * cdef dict missing_ranges = None # <<<<<<<<<<<<<< - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_missing_ranges = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":922 - * cdef dict variable_value_labels=None - * cdef dict missing_ranges = None - * cdef dict missing_user_values = None # <<<<<<<<<<<<<< - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_missing_user_values = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":923 - * cdef dict missing_ranges = None - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None # <<<<<<<<<<<<<< - * cdef dict variable_display_width = None - * cdef dict variable_measure = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_alignment = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":924 - * cdef dict missing_user_values = None - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None # <<<<<<<<<<<<<< - * cdef dict variable_measure = None - * cdef str table_name = "" -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_display_width = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":925 - * cdef dict variable_alignment = None - * cdef dict variable_display_width = None - * cdef dict variable_measure = None # <<<<<<<<<<<<<< - * cdef str table_name = "" - * #cdef dict variable_format = None -*/ - __Pyx_INCREF(Py_None); - __pyx_v_variable_measure = ((PyObject*)Py_None); - - /* "pyreadstat/pyreadstat.pyx":926 - * cdef dict variable_display_width = None - * cdef dict variable_measure = None - * cdef str table_name = "" # <<<<<<<<<<<<<< - * #cdef dict variable_format = None - * cdef bint row_compression = 0 -*/ - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_); - __pyx_v_table_name = __pyx_mstate_global->__pyx_kp_u_; - - /* "pyreadstat/pyreadstat.pyx":928 - * cdef str table_name = "" - * #cdef dict variable_format = None - * cdef bint row_compression = 0 # <<<<<<<<<<<<<< - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_POR, file_label, column_labels, - * file_format_version, note, table_name, variable_value_labels, missing_ranges,missing_user_values, -*/ - __pyx_v_row_compression = 0; - - /* "pyreadstat/pyreadstat.pyx":929 - * #cdef dict variable_format = None - * cdef bint row_compression = 0 - * run_write(df, dst_path, _readstat_writer.FILE_FORMAT_POR, 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_f_10pyreadstat_16_readstat_writer_run_write(__pyx_v_df, __pyx_v_dst_path, __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR, __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(PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L1_error) - - /* "pyreadstat/pyreadstat.pyx":894 - * variable_alignment,variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_por(df, dst_path, str file_label="", object column_labels=None, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SPSS POR file. -*/ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("pyreadstat.pyreadstat.write_por", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_note); - __Pyx_XDECREF(__pyx_v_variable_value_labels); - __Pyx_XDECREF(__pyx_v_missing_ranges); - __Pyx_XDECREF(__pyx_v_missing_user_values); - __Pyx_XDECREF(__pyx_v_variable_alignment); - __Pyx_XDECREF(__pyx_v_variable_display_width); - __Pyx_XDECREF(__pyx_v_variable_measure); - __Pyx_XDECREF(__pyx_v_table_name); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -/* #### Code section: module_exttypes ### */ - -static PyObject *__pyx_tp_new_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks[--__pyx_mstate_global->__pyx_freecount_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks]; - memset(o, 0, sizeof(struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else - #endif - { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} - -static void __pyx_tp_dealloc_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks(PyObject *o) { - struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *p = (struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } - #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v__); - Py_CLEAR(p->__pyx_v_chunksize); - Py_CLEAR(p->__pyx_v_df); - Py_CLEAR(p->__pyx_v_file_path); - Py_CLEAR(p->__pyx_v_kwargs); - Py_CLEAR(p->__pyx_v_limit); - Py_CLEAR(p->__pyx_v_meta); - Py_CLEAR(p->__pyx_v_multiprocess); - Py_CLEAR(p->__pyx_v_num_processes); - Py_CLEAR(p->__pyx_v_num_rows); - Py_CLEAR(p->__pyx_v_numrows); - Py_CLEAR(p->__pyx_v_offset); - Py_CLEAR(p->__pyx_v_read_function); - #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks)))) { - __pyx_mstate_global->__pyx_freelist_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks[__pyx_mstate_global->__pyx_freecount_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks++] = ((struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *)o); - } else - #endif - { - #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); - #else - { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); - if (tp_free) tp_free(o); - } - #endif - } -} - -static int __pyx_tp_traverse_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *p = (struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks *)o; - { - e = __Pyx_call_type_traverse(o, 1, v, a); - if (e) return e; - } - if (p->__pyx_v__) { - e = (*v)(p->__pyx_v__, a); if (e) return e; - } - if (p->__pyx_v_chunksize) { - e = (*v)(p->__pyx_v_chunksize, a); if (e) return e; - } - if (p->__pyx_v_df) { - e = (*v)(p->__pyx_v_df, a); if (e) return e; - } - if (p->__pyx_v_file_path) { - e = (*v)(p->__pyx_v_file_path, a); if (e) return e; - } - if (p->__pyx_v_kwargs) { - e = (*v)(p->__pyx_v_kwargs, a); if (e) return e; - } - if (p->__pyx_v_limit) { - e = (*v)(p->__pyx_v_limit, a); if (e) return e; - } - if (p->__pyx_v_meta) { - e = (*v)(p->__pyx_v_meta, a); if (e) return e; - } - if (p->__pyx_v_multiprocess) { - e = (*v)(p->__pyx_v_multiprocess, a); if (e) return e; - } - if (p->__pyx_v_num_processes) { - e = (*v)(p->__pyx_v_num_processes, a); if (e) return e; - } - if (p->__pyx_v_num_rows) { - e = (*v)(p->__pyx_v_num_rows, a); if (e) return e; - } - if (p->__pyx_v_numrows) { - e = (*v)(p->__pyx_v_numrows, a); if (e) return e; - } - if (p->__pyx_v_offset) { - e = (*v)(p->__pyx_v_offset, a); if (e) return e; - } - if (p->__pyx_v_read_function) { - e = (*v)(p->__pyx_v_read_function, a); if (e) return e; - } - return 0; -} -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks}, - {Py_tp_new, (void *)__pyx_tp_new_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks}, - {0, 0}, -}; -static PyType_Spec __pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks_spec = { - "pyreadstat.pyreadstat.__pyx_scope_struct__read_file_in_chunks", - sizeof(struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks_slots, -}; -#else - -static PyTypeObject __pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks = { - PyVarObject_HEAD_INIT(0, 0) - "pyreadstat.pyreadstat.""__pyx_scope_struct__read_file_in_chunks", /*tp_name*/ - sizeof(struct __pyx_obj_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ - #endif - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_as_async*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - #if !CYTHON_USE_TYPE_SPECS - 0, /*tp_dictoffset*/ - #endif - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - 0, /*tp_version_tag*/ - #if CYTHON_USE_TP_FINALIZE - 0, /*tp_finalize*/ - #else - NULL, /*tp_finalize*/ - #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) - 0, /*tp_vectorcall*/ - #endif - #if __PYX_NEED_TP_PRINT_SLOT == 1 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030C0000 - 0, /*tp_watched*/ - #endif - #if PY_VERSION_HEX >= 0x030d00A4 - 0, /*tp_versions_used*/ - #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 - 0, /*tp_pypy_flags*/ - #endif -}; -#endif - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; -/* #### Code section: initfunc_declarations ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ -/* #### Code section: init_module ### */ - -static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); - /*--- Type init code ---*/ - #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks)) __PYX_ERR(0, 542, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks_spec, __pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks) < 0) __PYX_ERR(0, 542, __pyx_L1_error) - #else - __pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks = &__pyx_type_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks; - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - #endif - #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks) < 0) __PYX_ERR(0, 542, __pyx_L1_error) - #endif - #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks->tp_dictoffset && __pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10pyreadstat_10pyreadstat___pyx_scope_struct__read_file_in_chunks->tp_getattro = PyObject_GenericGetAttr; - } - #endif - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); - /*--- Type import code ---*/ - __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = __Pyx_ImportType_3_1_2(__pyx_t_1, "pyreadstat._readstat_parser", "data_container", - #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), - #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), - #else - sizeof(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), __PYX_GET_STRUCT_ALIGNMENT_3_1_2(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container), - #endif - __Pyx_ImportType_CheckSize_Warn_3_1_2); if (!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) __PYX_ERR(1, 49, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); - /*--- Variable import code ---*/ - __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "readstat_to_numpy_types", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "sas_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_sas_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "spss_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_spss_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_datetime_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_datetime_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_date_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_date_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_time_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_time_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_all_formats", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_all_formats, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportVoidPtr_3_1_2(__pyx_t_1, "stata_origin", (void **)&__pyx_vp_10pyreadstat_16_readstat_parser_stata_origin, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); - /*--- Function import code ---*/ - __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "run_conversion", (void (**)(void))&__pyx_f_10pyreadstat_16_readstat_parser_run_conversion, "PyObject *(PyObject *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format, __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension, PyObject *, int, int, PyObject *, int, int, long, long, PyObject *, PyObject *, PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule("pyreadstat._readstat_writer"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction_3_1_2(__pyx_t_1, "run_write", (void (**)(void))&__pyx_f_10pyreadstat_16_readstat_writer_run_write, "int (PyObject *, PyObject *, __pyx_t_10pyreadstat_16_readstat_writer_dst_file_format, PyObject *, PyObject *, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_RefNannyFinishContext(); - return -1; -} - -#if CYTHON_PEP489_MULTI_PHASE_INIT -static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ -static int __pyx_pymod_exec_pyreadstat(PyObject* module); /*proto*/ -static PyModuleDef_Slot __pyx_moduledef_slots[] = { - {Py_mod_create, (void*)__pyx_pymod_create}, - {Py_mod_exec, (void*)__pyx_pymod_exec_pyreadstat}, - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - {Py_mod_gil, Py_MOD_GIL_USED}, - #endif - #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE - {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, - #endif - {0, NULL} -}; -#endif - -#ifdef __cplusplus -namespace { - struct PyModuleDef __pyx_moduledef = - #else - static struct PyModuleDef __pyx_moduledef = - #endif - { - PyModuleDef_HEAD_INIT, - "pyreadstat", - 0, /* m_doc */ - #if CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstatetype), /* m_size */ - #else - (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ - #endif - __pyx_methods /* m_methods */, - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_moduledef_slots, /* m_slots */ - #else - NULL, /* m_reload */ - #endif - #if CYTHON_USE_MODULE_STATE - __pyx_m_traverse, /* m_traverse */ - __pyx_m_clear, /* m_clear */ - NULL /* m_free */ - #else - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ - #endif - }; - #ifdef __cplusplus -} /* anonymous namespace */ -#endif - -/* PyModInitFuncType */ -#ifndef CYTHON_NO_PYINIT_EXPORT - #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#else - #ifdef __cplusplus - #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * - #else - #define __Pyx_PyMODINIT_FUNC PyObject * - #endif -#endif - -__Pyx_PyMODINIT_FUNC PyInit_pyreadstat(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC PyInit_pyreadstat(void) -#if CYTHON_PEP489_MULTI_PHASE_INIT -{ - return PyModuleDef_Init(&__pyx_moduledef); -} -/* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 -static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { - { - PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think - if (!module) { - PyErr_Clear(); // just try the 3.8-3.12 version - module = PyImport_ImportModule("_xxsubinterpreters"); - if (!module) goto bad; - } - PyObject *current = PyObject_CallMethod(module, "get_current", NULL); - Py_DECREF(module); - if (!current) goto bad; - if (PyTuple_Check(current)) { - PyObject *new_current = PySequence_GetItem(current, 0); - Py_DECREF(current); - current = new_current; - if (!new_current) goto bad; - } - long long as_c_int = PyLong_AsLongLong(current); - Py_DECREF(current); - return as_c_int; - } - bad: - PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); - return -1; -} -#endif -#if !CYTHON_USE_MODULE_STATE -static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL - PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API - PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); -#else - PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); -#endif - if (unlikely(current_id == -1)) { - return -1; - } - if (main_interpreter_id == -1) { - main_interpreter_id = current_id; - return 0; - } else if (unlikely(main_interpreter_id != current_id)) { - PyErr_SetString( - PyExc_ImportError, - "Interpreter change detected - this module can only be loaded into one interpreter per process."); - return -1; - } - return 0; -} -#endif -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) -{ - PyObject *value = PyObject_GetAttrString(spec, from_name); - int result = 0; - if (likely(value)) { - if (allow_none || value != Py_None) { - result = PyDict_SetItemString(moddict, to_name, value); - } - Py_DECREF(value); - } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - } else { - result = -1; - } - return result; -} -static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { - PyObject *module = NULL, *moddict, *modname; - CYTHON_UNUSED_VAR(def); - #if !CYTHON_USE_MODULE_STATE - if (__Pyx_check_single_interpreter()) - return NULL; - #endif - if (__pyx_m) - return __Pyx_NewRef(__pyx_m); - modname = PyObject_GetAttrString(spec, "name"); - if (unlikely(!modname)) goto bad; - module = PyModule_NewObject(modname); - Py_DECREF(modname); - if (unlikely(!module)) goto bad; - moddict = PyModule_GetDict(module); - if (unlikely(!moddict)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; - if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; - return module; -bad: - Py_XDECREF(module); - return NULL; -} - - -static CYTHON_SMALL_CODE int __pyx_pymod_exec_pyreadstat(PyObject *__pyx_pyinit_module) -#endif -{ - int stringtab_initialized = 0; - #if CYTHON_USE_MODULE_STATE - int pystate_addmodule_run = 0; - #endif - __pyx_mstatetype *__pyx_mstate = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_PEP489_MULTI_PHASE_INIT - if (__pyx_m) { - if (__pyx_m == __pyx_pyinit_module) return 0; - PyErr_SetString(PyExc_RuntimeError, "Module 'pyreadstat' has already been imported. Re-initialisation is not supported."); - return -1; - } - #else - if (__pyx_m) return __Pyx_NewRef(__pyx_m); - #endif - /*--- Module creation code ---*/ - #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_t_1 = __pyx_pyinit_module; - Py_INCREF(__pyx_t_1); - #else - __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #if CYTHON_USE_MODULE_STATE - { - int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "pyreadstat" pseudovariable */ - if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - pystate_addmodule_run = 1; - } - #else - __pyx_m = __pyx_t_1; - #endif - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); - #endif - __pyx_mstate = __pyx_mstate_global; - CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_mstate->__pyx_d); - __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /* ImportRefnannyAPI */ - #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - -__Pyx_RefNannySetupContext("PyInit_pyreadstat", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); - #endif - __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - if (__pyx_module_is_main_pyreadstat__pyreadstat) { - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "pyreadstat.pyreadstat")) { - if (unlikely((PyDict_SetItemString(modules, "pyreadstat.pyreadstat", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(__pyx_mstate); - (void)__Pyx_modinit_variable_export_code(__pyx_mstate); - (void)__Pyx_modinit_function_export_code(__pyx_mstate); - if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - if (unlikely((__Pyx_modinit_variable_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Execution code ---*/ - - /* "pyreadstat/pyreadstat.pyx":21 - * ## if want to profile: # cython: profile=True - * - * import multiprocessing as mp # <<<<<<<<<<<<<< - * - * import narwhals.stable.v2 as nw -*/ - __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_multiprocessing, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_mp, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":23 - * import multiprocessing as mp - * - * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< - * import numpy as np - * -*/ - __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_narwhals_stable_v2, __pyx_mstate_global->__pyx_tuple[0]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_nw, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":24 - * - * import narwhals.stable.v2 as nw - * import numpy as np # <<<<<<<<<<<<<< - * - * from _readstat_parser cimport py_file_format, py_file_extension, run_conversion -*/ - __pyx_t_2 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":27 - * - * from _readstat_parser cimport py_file_format, py_file_extension, run_conversion - * from _readstat_parser import PyreadstatError # <<<<<<<<<<<<<< - * from _readstat_writer cimport run_write - * cimport _readstat_parser, _readstat_writer -*/ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_readstat_parser, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":30 - * from _readstat_writer cimport run_write - * cimport _readstat_parser, _readstat_writer - * from worker import worker # <<<<<<<<<<<<<< - * from pyfunctions import set_value_labels, set_catalog_to_sas - * -*/ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_worker); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_worker, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_worker); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_worker, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":31 - * cimport _readstat_parser, _readstat_writer - * from worker import worker - * from pyfunctions import set_value_labels, set_catalog_to_sas # <<<<<<<<<<<<<< - * - * # Public interface -*/ - __pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_set_value_labels, __pyx_mstate_global->__pyx_n_u_set_catalog_to_sas); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyfunctions, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_set_value_labels, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_catalog_to_sas); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_set_catalog_to_sas, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":39 - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - __pyx_t_3 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "pyreadstat/pyreadstat.pyx":37 - * # Parsing functions - * - * def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - __pyx_t_4 = PyTuple_Pack(15, ((PyObject*)Py_False), ((PyObject*)Py_False), Py_None, ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_3, __pyx_t_2, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_1read_sas7bdat, 0, __pyx_mstate_global->__pyx_n_u_read_sas7bdat, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_sas7bdat, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":140 - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, # <<<<<<<<<<<<<< - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - __pyx_t_2 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "pyreadstat/pyreadstat.pyx":139 - * - * - * def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, # <<<<<<<<<<<<<< - * list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - * str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): -*/ - __pyx_t_3 = PyTuple_Pack(11, ((PyObject*)Py_False), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), __pyx_t_2, __pyx_t_4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_3read_xport, 0, __pyx_mstate_global->__pyx_n_u_read_xport, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_xport, __pyx_t_4) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":215 - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - __pyx_t_4 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "pyreadstat/pyreadstat.pyx":213 - * - * - * def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - __pyx_t_2 = PyTuple_Pack(15, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_4, __pyx_t_3, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_5read_dta, 0, __pyx_mstate_global->__pyx_n_u_read_dta, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_dta, __pyx_t_3) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "pyreadstat/pyreadstat.pyx":310 - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< - * list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - __pyx_t_3 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "pyreadstat/pyreadstat.pyx":308 - * - * - * def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, -*/ - __pyx_t_4 = PyTuple_Pack(15, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_3, __pyx_t_2, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_7read_sav, 0, __pyx_mstate_global->__pyx_n_u_read_sav, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_sav, __pyx_t_2) < 0) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/pyreadstat.pyx":405 - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, # <<<<<<<<<<<<<< - * list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): - * r""" -*/ - __pyx_t_2 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "pyreadstat/pyreadstat.pyx":403 - * - * - * def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, # <<<<<<<<<<<<<< - * formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, -*/ - __pyx_t_3 = PyTuple_Pack(13, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, ((PyObject*)Py_False), __pyx_t_2, __pyx_t_4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_9read_por, 0, __pyx_mstate_global->__pyx_n_u_read_por, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_por, __pyx_t_4) < 0) __PYX_ERR(0, 403, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":490 - * - * - * def read_sas7bcat(filename_path, str encoding=None, str output_format=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_11read_sas7bcat, 0, __pyx_mstate_global->__pyx_n_u_read_sas7bcat, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_sas7bcat, __pyx_t_4) < 0) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":542 - * # convenience functions to read in chunks - * - * def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, # <<<<<<<<<<<<<< - * multiprocess=False, num_processes=4, num_rows=None, **kwargs): - * """ -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_13read_file_in_chunks, 0, __pyx_mstate_global->__pyx_n_u_read_file_in_chunks, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_file_in_chunks, __pyx_t_4) < 0) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":623 - * offset += chunksize - * - * def read_file_multiprocessing(read_function, file_path, num_processes=None, num_rows=None, **kwargs): # <<<<<<<<<<<<<< - * """ - * Reads a file in parallel using multiprocessing. -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_16read_file_multiprocessing, 0, __pyx_mstate_global->__pyx_n_u_read_file_multiprocessing, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_file_multiprocessing, __pyx_t_4) < 0) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":713 - * # Write API - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_18write_sav, 0, __pyx_mstate_global->__pyx_n_u_write_sav, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_write_sav, __pyx_t_4) < 0) __PYX_ERR(0, 713, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":788 - * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, # <<<<<<<<<<<<<< - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): - * """ -*/ - __pyx_t_4 = __Pyx_PyLong_From_int(((int)15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "pyreadstat/pyreadstat.pyx":789 - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a STATA dta file -*/ - __pyx_t_3 = PyTuple_Pack(6, ((PyObject*)__pyx_mstate_global->__pyx_kp_u_), Py_None, __pyx_t_4, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":788 - * variable_alignment, variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, # <<<<<<<<<<<<<< - * dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): - * """ -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_20write_dta, 0, __pyx_mstate_global->__pyx_n_u_write_dta, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_write_dta, __pyx_t_4) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":850 - * variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, # <<<<<<<<<<<<<< - * dict variable_format=None): - * """ -*/ - __pyx_t_4 = __Pyx_PyLong_From_int(((int)8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - - /* "pyreadstat/pyreadstat.pyx":851 - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, - * dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SAS Xport (xpt) file. -*/ - __pyx_t_3 = PyTuple_Pack(5, ((PyObject*)__pyx_mstate_global->__pyx_kp_u_), Py_None, Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":850 - * variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, # <<<<<<<<<<<<<< - * dict variable_format=None): - * """ -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_22write_xport, 0, __pyx_mstate_global->__pyx_n_u_write_xport, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_write_xport, __pyx_t_4) < 0) __PYX_ERR(0, 850, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":894 - * variable_alignment,variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_por(df, dst_path, str file_label="", object column_labels=None, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SPSS POR file. -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_10pyreadstat_24write_por, 0, __pyx_mstate_global->__pyx_n_u_write_por, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat_pyreadstat, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_write_por, __pyx_t_4) < 0) __PYX_ERR(0, 894, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/pyreadstat.pyx":1 - * # cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 # <<<<<<<<<<<<<< - * - * # ############################################################################# -*/ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - if (__pyx_m) { - if (__pyx_mstate->__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init pyreadstat.pyreadstat", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - #if !CYTHON_USE_MODULE_STATE - Py_CLEAR(__pyx_m); - #else - Py_DECREF(__pyx_m); - if (pystate_addmodule_run) { - PyObject *tp, *value, *tb; - PyErr_Fetch(&tp, &value, &tb); - PyState_RemoveModule(&__pyx_moduledef); - PyErr_Restore(tp, value, tb); - } - #endif - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init pyreadstat.pyreadstat"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #else - return __pyx_m; - #endif -} -/* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 192 <= 65535 - const unsigned short n; -#elif 192 / 2 < INT_MAX - const unsigned int n; -#elif 192 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; -#endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_F_var_width_0, sizeof(__pyx_k_F_var_width_0), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_F_var_width_0 */ - {__pyx_k_N_var_width, sizeof(__pyx_k_N_var_width), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_N_var_width */ - {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ - {__pyx_k_Pool, sizeof(__pyx_k_Pool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Pool */ - {__pyx_k_PyreadstatError, sizeof(__pyx_k_PyreadstatError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PyreadstatError */ - {__pyx_k_The_number_of_rows_of_the_file_c, sizeof(__pyx_k_The_number_of_rows_of_the_file_c), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_The_number_of_rows_of_the_file_c */ - {__pyx_k_Version_not_supported, sizeof(__pyx_k_Version_not_supported), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Version_not_supported */ - {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ - {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ - {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 1}, /* PyObject cname: __pyx_n_u__4 */ - {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ - {__pyx_k_apply_value_formats, sizeof(__pyx_k_apply_value_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_apply_value_formats */ - {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ - {__pyx_k_catalog, sizeof(__pyx_k_catalog), 0, 1, 1}, /* PyObject cname: __pyx_n_u_catalog */ - {__pyx_k_catalog_file, sizeof(__pyx_k_catalog_file), 0, 1, 1}, /* PyObject cname: __pyx_n_u_catalog_file */ - {__pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 1, 1}, /* PyObject cname: __pyx_n_u_chunk */ - {__pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_chunks */ - {__pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_chunksize */ - {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ - {__pyx_k_col_format, sizeof(__pyx_k_col_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_col_format */ - {__pyx_k_col_name, sizeof(__pyx_k_col_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_col_name */ - {__pyx_k_column_labels, sizeof(__pyx_k_column_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_column_labels */ - {__pyx_k_columns, sizeof(__pyx_k_columns), 0, 1, 1}, /* PyObject cname: __pyx_n_u_columns */ - {__pyx_k_compress, sizeof(__pyx_k_compress), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compress */ - {__pyx_k_compress_and_row_compress_cannot, sizeof(__pyx_k_compress_and_row_compress_cannot), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_compress_and_row_compress_cannot */ - {__pyx_k_concat, sizeof(__pyx_k_concat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_concat */ - {__pyx_k_concatenate, sizeof(__pyx_k_concatenate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_concatenate */ - {__pyx_k_cpu_count, sizeof(__pyx_k_cpu_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cpu_count */ - {__pyx_k_data_frame, sizeof(__pyx_k_data_frame), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data_frame */ - {__pyx_k_dates_as_pandas, sizeof(__pyx_k_dates_as_pandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dates_as_pandas */ - {__pyx_k_dates_as_pandas_datetime, sizeof(__pyx_k_dates_as_pandas_datetime), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dates_as_pandas_datetime */ - {__pyx_k_df, sizeof(__pyx_k_df), 0, 1, 1}, /* PyObject cname: __pyx_n_u_df */ - {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ - {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ - {__pyx_k_disable_datetime_conversion, sizeof(__pyx_k_disable_datetime_conversion), 0, 1, 1}, /* PyObject cname: __pyx_n_u_disable_datetime_conversion */ - {__pyx_k_div, sizeof(__pyx_k_div), 0, 1, 1}, /* PyObject cname: __pyx_n_u_div */ - {__pyx_k_divs, sizeof(__pyx_k_divs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_divs */ - {__pyx_k_drop, sizeof(__pyx_k_drop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_drop */ - {__pyx_k_dst_path, sizeof(__pyx_k_dst_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dst_path */ - {__pyx_k_dta, sizeof(__pyx_k_dta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dta */ - {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ - {__pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encoding */ - {__pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enumerate */ - {__pyx_k_extra_date_formats, sizeof(__pyx_k_extra_date_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extra_date_formats */ - {__pyx_k_extra_datetime_formats, sizeof(__pyx_k_extra_datetime_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extra_datetime_formats */ - {__pyx_k_extra_time_formats, sizeof(__pyx_k_extra_time_formats), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extra_time_formats */ - {__pyx_k_file_extension, sizeof(__pyx_k_file_extension), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_extension */ - {__pyx_k_file_format, sizeof(__pyx_k_file_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_format */ - {__pyx_k_file_format_version, sizeof(__pyx_k_file_format_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_format_version */ - {__pyx_k_file_label, sizeof(__pyx_k_file_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_label */ - {__pyx_k_file_path, sizeof(__pyx_k_file_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_file_path */ - {__pyx_k_filename_path, sizeof(__pyx_k_filename_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_filename_path */ - {__pyx_k_final, sizeof(__pyx_k_final), 0, 1, 1}, /* PyObject cname: __pyx_n_u_final */ - {__pyx_k_format, sizeof(__pyx_k_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format */ - {__pyx_k_formats_as_category, sizeof(__pyx_k_formats_as_category), 0, 1, 1}, /* PyObject cname: __pyx_n_u_formats_as_category */ - {__pyx_k_formats_as_ordered_category, sizeof(__pyx_k_formats_as_ordered_category), 0, 1, 1}, /* PyObject cname: __pyx_n_u_formats_as_ordered_category */ - {__pyx_k_formats_presets, sizeof(__pyx_k_formats_presets), 0, 1, 1}, /* PyObject cname: __pyx_n_u_formats_presets */ - {__pyx_k_from_native, sizeof(__pyx_k_from_native), 0, 1, 1}, /* PyObject cname: __pyx_n_u_from_native */ - {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ - {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ - {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */ - {__pyx_k_how, sizeof(__pyx_k_how), 0, 1, 1}, /* PyObject cname: __pyx_n_u_how */ - {__pyx_k_implementation, sizeof(__pyx_k_implementation), 0, 1, 1}, /* PyObject cname: __pyx_n_u_implementation */ - {__pyx_k_indx, sizeof(__pyx_k_indx), 0, 1, 1}, /* PyObject cname: __pyx_n_u_indx */ - {__pyx_k_inf, sizeof(__pyx_k_inf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inf */ - {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ - {__pyx_k_integer, sizeof(__pyx_k_integer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_integer */ - {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ - {__pyx_k_is_pandas, sizeof(__pyx_k_is_pandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_pandas */ - {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ - {__pyx_k_ispandas, sizeof(__pyx_k_ispandas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ispandas */ - {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */ - {__pyx_k_jobs, sizeof(__pyx_k_jobs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_jobs */ - {__pyx_k_key, sizeof(__pyx_k_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_key */ - {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ - {__pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_kwargs */ - {__pyx_k_limit, sizeof(__pyx_k_limit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_limit */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_map, sizeof(__pyx_k_map), 0, 1, 1}, /* PyObject cname: __pyx_n_u_map */ - {__pyx_k_max, sizeof(__pyx_k_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max */ - {__pyx_k_meta, sizeof(__pyx_k_meta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_meta */ - {__pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata */ - {__pyx_k_metadataonly, sizeof(__pyx_k_metadataonly), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadataonly */ - {__pyx_k_metaonly, sizeof(__pyx_k_metaonly), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaonly */ - {__pyx_k_missing_ranges, sizeof(__pyx_k_missing_ranges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_ranges */ - {__pyx_k_missing_user_values, sizeof(__pyx_k_missing_user_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_user_values */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_mp, sizeof(__pyx_k_mp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mp */ - {__pyx_k_multiprocess, sizeof(__pyx_k_multiprocess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multiprocess */ - {__pyx_k_multiprocessing, sizeof(__pyx_k_multiprocessing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multiprocessing */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_narwhals, sizeof(__pyx_k_narwhals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals */ - {__pyx_k_narwhals_stable_v2, sizeof(__pyx_k_narwhals_stable_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_narwhals_stable_v2 */ - {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ - {__pyx_k_no_datetime_conversion, sizeof(__pyx_k_no_datetime_conversion), 0, 1, 1}, /* PyObject cname: __pyx_n_u_no_datetime_conversion */ - {__pyx_k_note, sizeof(__pyx_k_note), 0, 1, 1}, /* PyObject cname: __pyx_n_u_note */ - {__pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, /* PyObject cname: __pyx_n_u_np */ - {__pyx_k_num_processes, sizeof(__pyx_k_num_processes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_processes */ - {__pyx_k_num_rows, sizeof(__pyx_k_num_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_rows */ - {__pyx_k_num_rows_must_be_specified_for_r, sizeof(__pyx_k_num_rows_must_be_specified_for_r), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_num_rows_must_be_specified_for_r */ - {__pyx_k_number_rows, sizeof(__pyx_k_number_rows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number_rows */ - {__pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numpy */ - {__pyx_k_numrows, sizeof(__pyx_k_numrows), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numrows */ - {__pyx_k_nw, sizeof(__pyx_k_nw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nw */ - {__pyx_k_offset, sizeof(__pyx_k_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_offset */ - {__pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 1, 1}, /* PyObject cname: __pyx_n_u_offsets */ - {__pyx_k_output_format, sizeof(__pyx_k_output_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_format */ - {__pyx_k_pool, sizeof(__pyx_k_pool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pool */ - {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ - {__pyx_k_por, sizeof(__pyx_k_por), 0, 1, 1}, /* PyObject cname: __pyx_n_u_por */ - {__pyx_k_prev_div, sizeof(__pyx_k_prev_div), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prev_div */ - {__pyx_k_prev_offset, sizeof(__pyx_k_prev_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prev_offset */ - {__pyx_k_processes, sizeof(__pyx_k_processes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_processes */ - {__pyx_k_pyfunctions, sizeof(__pyx_k_pyfunctions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyfunctions */ - {__pyx_k_pyreadstat_pyreadstat, sizeof(__pyx_k_pyreadstat_pyreadstat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyreadstat_pyreadstat */ - {__pyx_k_pyreadstat_pyreadstat_pyx, sizeof(__pyx_k_pyreadstat_pyreadstat_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_pyreadstat_pyreadstat_pyx */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ - {__pyx_k_read_dta, sizeof(__pyx_k_read_dta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_dta */ - {__pyx_k_read_file_in_chunks, sizeof(__pyx_k_read_file_in_chunks), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_file_in_chunks */ - {__pyx_k_read_file_multiprocessing, sizeof(__pyx_k_read_file_multiprocessing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_file_multiprocessing */ - {__pyx_k_read_function, sizeof(__pyx_k_read_function), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_function */ - {__pyx_k_read_por, sizeof(__pyx_k_read_por), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_por */ - {__pyx_k_read_sas7bcat, sizeof(__pyx_k_read_sas7bcat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_sas7bcat */ - {__pyx_k_read_sas7bcat_is_not_supported, sizeof(__pyx_k_read_sas7bcat_is_not_supported), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_read_sas7bcat_is_not_supported */ - {__pyx_k_read_sas7bcat_not_supported, sizeof(__pyx_k_read_sas7bcat_not_supported), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_read_sas7bcat_not_supported */ - {__pyx_k_read_sas7bdat, sizeof(__pyx_k_read_sas7bdat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_sas7bdat */ - {__pyx_k_read_sav, sizeof(__pyx_k_read_sav), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_sav */ - {__pyx_k_read_xport, sizeof(__pyx_k_read_xport), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_xport */ - {__pyx_k_readstat_parser, sizeof(__pyx_k_readstat_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_readstat_parser */ - {__pyx_k_reset_index, sizeof(__pyx_k_reset_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reset_index */ - {__pyx_k_restricted_integer, sizeof(__pyx_k_restricted_integer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restricted_integer */ - {__pyx_k_row_compress, sizeof(__pyx_k_row_compress), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_compress */ - {__pyx_k_row_compression, sizeof(__pyx_k_row_compression), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_compression */ - {__pyx_k_row_limit, sizeof(__pyx_k_row_limit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_limit */ - {__pyx_k_row_offset, sizeof(__pyx_k_row_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_row_offset */ - {__pyx_k_sas7bcat, sizeof(__pyx_k_sas7bcat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas7bcat */ - {__pyx_k_sas7bdat, sizeof(__pyx_k_sas7bdat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sas7bdat */ - {__pyx_k_sav_zsav, sizeof(__pyx_k_sav_zsav), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_sav_zsav */ - {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ - {__pyx_k_set_catalog_to_sas, sizeof(__pyx_k_set_catalog_to_sas), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_catalog_to_sas */ - {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ - {__pyx_k_set_value_labels, sizeof(__pyx_k_set_value_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_value_labels */ - {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ - {__pyx_k_stable, sizeof(__pyx_k_stable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stable */ - {__pyx_k_table_name, sizeof(__pyx_k_table_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_table_name */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ - {__pyx_k_to_native, sizeof(__pyx_k_to_native), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_native */ - {__pyx_k_usecols, sizeof(__pyx_k_usecols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_usecols */ - {__pyx_k_user_missing, sizeof(__pyx_k_user_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_user_missing */ - {__pyx_k_usernan, sizeof(__pyx_k_usernan), 0, 1, 1}, /* PyObject cname: __pyx_n_u_usernan */ - {__pyx_k_v2, sizeof(__pyx_k_v2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v2 */ - {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ - {__pyx_k_var_width, sizeof(__pyx_k_var_width), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var_width */ - {__pyx_k_variable_alignment, sizeof(__pyx_k_variable_alignment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_alignment */ - {__pyx_k_variable_display_width, sizeof(__pyx_k_variable_display_width), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_display_width */ - {__pyx_k_variable_format, sizeof(__pyx_k_variable_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_format */ - {__pyx_k_variable_measure, sizeof(__pyx_k_variable_measure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_measure */ - {__pyx_k_variable_value_labels, sizeof(__pyx_k_variable_value_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_value_labels */ - {__pyx_k_version, sizeof(__pyx_k_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_version */ - {__pyx_k_vertical, sizeof(__pyx_k_vertical), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertical */ - {__pyx_k_worker, sizeof(__pyx_k_worker), 0, 1, 1}, /* PyObject cname: __pyx_n_u_worker */ - {__pyx_k_write_dta, sizeof(__pyx_k_write_dta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write_dta */ - {__pyx_k_write_por, sizeof(__pyx_k_write_por), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write_por */ - {__pyx_k_write_sav, sizeof(__pyx_k_write_sav), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write_sav */ - {__pyx_k_write_xport, sizeof(__pyx_k_write_xport), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write_xport */ - {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */ - {__pyx_k_xport, sizeof(__pyx_k_xport), 0, 1, 1}, /* PyObject cname: __pyx_n_u_xport */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); - -/* #### Code section: cached_builtins ### */ - -static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { - CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 676, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 680, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 781, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { - __Pyx_RefNannyDeclarations - CYTHON_UNUSED_VAR(__pyx_mstate); - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "pyreadstat/pyreadstat.pyx":23 - * import multiprocessing as mp - * - * import narwhals.stable.v2 as nw # <<<<<<<<<<<<<< - * import numpy as np - * -*/ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_narwhals, __pyx_mstate_global->__pyx_n_u_stable, __pyx_mstate_global->__pyx_n_u_v2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - - /* "pyreadstat/pyreadstat.pyx":490 - * - * - * def read_sas7bcat(filename_path, str encoding=None, str output_format=None): # <<<<<<<<<<<<<< - * r""" - * Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary -*/ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - - /* "pyreadstat/pyreadstat.pyx":542 - * # convenience functions to read in chunks - * - * def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, # <<<<<<<<<<<<<< - * multiprocess=False, num_processes=4, num_rows=None, **kwargs): - * """ -*/ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(6, ((PyObject*)__pyx_mstate_global->__pyx_int_100000), ((PyObject*)__pyx_mstate_global->__pyx_int_0), ((PyObject*)__pyx_mstate_global->__pyx_int_0), ((PyObject*)Py_False), ((PyObject*)__pyx_mstate_global->__pyx_int_4), Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - - /* "pyreadstat/pyreadstat.pyx":713 - * # Write API - * - * def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): -*/ - __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(10, ((PyObject*)__pyx_mstate_global->__pyx_kp_u_), Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 713, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - - /* "pyreadstat/pyreadstat.pyx":894 - * variable_alignment,variable_display_width, variable_measure, variable_format, row_compression) - * - * def write_por(df, dst_path, str file_label="", object column_labels=None, dict variable_format=None): # <<<<<<<<<<<<<< - * """ - * Writes a dataframe to a SPSS POR file. -*/ - __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(3, ((PyObject*)__pyx_mstate_global->__pyx_kp_u_), Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 894, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { - CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; - __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; - __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_4 = PyLong_FromLong(4); if (unlikely(!__pyx_mstate->__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_100000 = PyLong_FromLong(100000L); if (unlikely(!__pyx_mstate->__pyx_int_100000)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_codeobjects ### */ -\ - typedef struct { - unsigned int argcount : 5; - unsigned int num_posonly_args : 1; - unsigned int num_kwonly_args : 1; - unsigned int nlocals : 5; - unsigned int flags : 10; - unsigned int first_line : 10; - unsigned int line_table_length : 14; - } __Pyx_PyCode_New_function_description; -/* NewCodeObj.proto */ -static PyObject* __Pyx_PyCode_New( - const __Pyx_PyCode_New_function_description descr, - PyObject * const *varnames, - PyObject *filename, - PyObject *funcname, - const char *line_table, - PyObject *tuple_dedup_map -); - - -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 = {8, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS|CO_GENERATOR), 542, 18}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_read_function, __pyx_mstate->__pyx_n_u_file_path, __pyx_mstate->__pyx_n_u_chunksize, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_multiprocess, __pyx_mstate->__pyx_n_u_num_processes, __pyx_mstate->__pyx_n_u_num_rows, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u__4, __pyx_mstate->__pyx_n_u_meta, __pyx_mstate->__pyx_n_u_numrows, __pyx_mstate->__pyx_n_u_df}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_file_in_chunks, __pyx_k_22DJa_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 26, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 37, 238}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_catalog_file, __pyx_mstate->__pyx_n_u_formats_as_category, __pyx_mstate->__pyx_n_u_formats_as_ordered_category, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_user_missing, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata, __pyx_mstate->__pyx_n_u__4, __pyx_mstate->__pyx_n_u_catalog}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_sas7bdat, __pyx_k_55UUV_OObbuuv_55FFXXY_44RRSH_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {12, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139, 169}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_xport, __pyx_k_22RRS_EEVVW_IIggh_q_1_q_q_q_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213, 218}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_apply_value_formats, __pyx_mstate->__pyx_n_u_formats_as_category, __pyx_mstate->__pyx_n_u_formats_as_ordered_category, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_user_missing, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_dta, __pyx_k_00PPQ_JJ_ppq_00AASST_MQ_q_1_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 308, 218}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_apply_value_formats, __pyx_mstate->__pyx_n_u_formats_as_category, __pyx_mstate->__pyx_n_u_formats_as_ordered_category, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_user_missing, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_sav, __pyx_k_00PPQ_JJ_ppq_00AASSkkl_1_q_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {14, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 403, 201}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_apply_value_formats, __pyx_mstate->__pyx_n_u_formats_as_category, __pyx_mstate->__pyx_n_u_formats_as_ordered_category, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_por, __pyx_k_00PPQ_J_00AASST_MQp_q_1_q_q_q_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 490, 134}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_sas7bcat, __pyx_k_4A_q_Q_6a_A_FVV_a_9IMeeppq_99QQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 28, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 623, 536}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_read_function, __pyx_mstate->__pyx_n_u_file_path, __pyx_mstate->__pyx_n_u_num_processes, __pyx_mstate->__pyx_n_u_num_rows, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u__4, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_meta, __pyx_mstate->__pyx_n_u_numrows, __pyx_mstate->__pyx_n_u_final, __pyx_mstate->__pyx_n_u_divs, __pyx_mstate->__pyx_n_u_offsets, __pyx_mstate->__pyx_n_u_prev_offset, __pyx_mstate->__pyx_n_u_prev_div, __pyx_mstate->__pyx_n_u_indx, __pyx_mstate->__pyx_n_u_div, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_jobs, __pyx_mstate->__pyx_n_u_pool, __pyx_mstate->__pyx_n_u_chunks, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_keys, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_ispandas, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_chunksize, __pyx_mstate->__pyx_n_u_chunk}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_read_file_multiprocessing, __pyx_k_88LA_T_iq_S_Yc_iq_t1_1Bj_A_d_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {12, 0, 0, 21, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 713, 248}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_dst_path, __pyx_mstate->__pyx_n_u_file_label, __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_variable_format, __pyx_mstate->__pyx_n_u_file_format_version, __pyx_mstate->__pyx_n_u_var_width, __pyx_mstate->__pyx_n_u_row_compression, __pyx_mstate->__pyx_n_u_table_name, __pyx_mstate->__pyx_n_u_missing_user_values, __pyx_mstate->__pyx_n_u_variable_alignment, __pyx_mstate->__pyx_n_u_formats_presets, __pyx_mstate->__pyx_n_u_col_name, __pyx_mstate->__pyx_n_u_col_format}; - __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_write_sav, __pyx_k_JJZZnno_11K1_A_1_y_A_oQa_q_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 788, 192}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_dst_path, __pyx_mstate->__pyx_n_u_file_label, __pyx_mstate->__pyx_n_u_column_labels, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_variable_value_labels, __pyx_mstate->__pyx_n_u_missing_user_values, __pyx_mstate->__pyx_n_u_variable_format, __pyx_mstate->__pyx_n_u_file_format_version, __pyx_mstate->__pyx_n_u_note, __pyx_mstate->__pyx_n_u_table_name, __pyx_mstate->__pyx_n_u_missing_ranges, __pyx_mstate->__pyx_n_u_variable_alignment, __pyx_mstate->__pyx_n_u_variable_display_width, __pyx_mstate->__pyx_n_u_variable_measure, __pyx_mstate->__pyx_n_u_row_compression}; - __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_write_dta, __pyx_k_J_LAB_xs_a_A_a_A_a_A_a_T_a_S_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 850, 107}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_dst_path, __pyx_mstate->__pyx_n_u_file_label, __pyx_mstate->__pyx_n_u_column_labels, __pyx_mstate->__pyx_n_u_table_name, __pyx_mstate->__pyx_n_u_file_format_version, __pyx_mstate->__pyx_n_u_variable_format, __pyx_mstate->__pyx_n_u_variable_value_labels, __pyx_mstate->__pyx_n_u_note, __pyx_mstate->__pyx_n_u_missing_ranges, __pyx_mstate->__pyx_n_u_missing_user_values, __pyx_mstate->__pyx_n_u_variable_alignment, __pyx_mstate->__pyx_n_u_variable_display_width, __pyx_mstate->__pyx_n_u_variable_measure, __pyx_mstate->__pyx_n_u_row_compression}; - __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_write_xport, __pyx_k_11LLaab_a_A_q_A_1_q_Qd_A_V_FoUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 894, 110}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_df, __pyx_mstate->__pyx_n_u_dst_path, __pyx_mstate->__pyx_n_u_file_label, __pyx_mstate->__pyx_n_u_column_labels, __pyx_mstate->__pyx_n_u_variable_format, __pyx_mstate->__pyx_n_u_note, __pyx_mstate->__pyx_n_u_file_format_version, __pyx_mstate->__pyx_n_u_variable_value_labels, __pyx_mstate->__pyx_n_u_missing_ranges, __pyx_mstate->__pyx_n_u_missing_user_values, __pyx_mstate->__pyx_n_u_variable_alignment, __pyx_mstate->__pyx_n_u_variable_display_width, __pyx_mstate->__pyx_n_u_variable_measure, __pyx_mstate->__pyx_n_u_table_name, __pyx_mstate->__pyx_n_u_row_compression}; - __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat_pyreadstat_pyx, __pyx_mstate->__pyx_n_u_write_por, __pyx_k_J_0_1_A_q_A_1_q_Qd_l_V_FoUV_33E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; - } - Py_DECREF(tuple_dedup_map); - return 0; - bad: - Py_DECREF(tuple_dedup_map); - return -1; -} -/* #### Code section: init_globals ### */ - -static int __Pyx_InitGlobals(void) { - /* PythonCompatibility.init */ - if (likely(__Pyx_init_co_variables() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - - /* CachedMethodType.init */ - #if CYTHON_COMPILING_IN_LIMITED_API -{ - PyObject *typesModule=NULL; - typesModule = PyImport_ImportModule("types"); - if (typesModule) { - __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - } -} // error handling follows -#endif - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cleanup_globals ### */ -/* #### Code section: cleanup_module ### */ -/* #### Code section: main_method ### */ -/* #### Code section: utility_code_pragmas ### */ -#ifdef _MSC_VER -#pragma warning( push ) -/* Warning 4127: conditional expression is constant - * Cython uses constant conditional expressions to allow in inline functions to be optimized at - * compile-time, so this warning is not useful - */ -#pragma warning( disable : 4127 ) -#endif - - - -/* #### Code section: utility_code_def ### */ - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule(modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, "RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - (void) PyObject_GetOptionalAttr(obj, attr_name, &result); - return result; -#else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -#endif -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, - "name '%U' is not defined", name); - } - return result; -} - -/* TupleAndListFromArray */ -#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - Py_ssize_t i; - if (n <= 0) { - return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - for (i = 0; i < n; i++) { - if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { - Py_DECREF(res); - return NULL; - } - Py_INCREF(src[i]); - } - return res; -} -#elif CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} -static CYTHON_INLINE PyObject * -__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return PyList_New(0); - } - res = PyList_New(n); - if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); - return res; -} -#endif - -/* BytesEquals */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ - !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result; -#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) - Py_hash_t hash1, hash2; - hash1 = ((PyBytesObject*)s1)->ob_shash; - hash2 = ((PyBytesObject*)s2)->ob_shash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - return (equals == Py_NE); - } -#endif - result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL - return PyObject_RichCompareBool(s1, s2, equals); -#else - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length, length2; - int kind; - void *data1, *data2; - #if !CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - #endif - length = __Pyx_PyUnicode_GET_LENGTH(s1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(length < 0)) return -1; - #endif - length2 = __Pyx_PyUnicode_GET_LENGTH(s2); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(length2 < 0)) return -1; - #endif - if (length != length2) { - goto return_ne; - } -#if CYTHON_USE_UNICODE_INTERNALS - { - Py_hash_t hash1, hash2; - hash1 = ((PyASCIIObject*)s1)->hash; - hash2 = ((PyASCIIObject*)s2)->hash; - if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { - goto return_ne; - } - } -#endif - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - return (equals == Py_EQ); -return_ne: - return (equals == Py_NE); -#endif -} - -/* fastcall */ -#if CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) -{ - Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(n == -1)) return NULL; - #endif - for (i = 0; i < n; i++) - { - PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely(!namei)) return NULL; - #endif - if (s == namei) return kwvalues[i]; - } - for (i = 0; i < n; i++) - { - PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely(!namei)) return NULL; - #endif - int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); - if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; - return kwvalues[i]; - } - } - return NULL; -} -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API -CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs; - PyObject *dict; -#if !CYTHON_ASSUME_SAFE_SIZE - nkwargs = PyTuple_Size(kwnames); - if (unlikely(nkwargs < 0)) return NULL; -#else - nkwargs = PyTuple_GET_SIZE(kwnames); -#endif - dict = PyDict_New(); - if (unlikely(!dict)) - return NULL; - for (i=0; irecursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = Py_TYPE(func)->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallMethO */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); - self = __Pyx_CyOrPyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectFastCall */ -#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { - PyObject *argstuple; - PyObject *result = 0; - size_t i; - argstuple = PyTuple_New((Py_ssize_t)nargs); - if (unlikely(!argstuple)) return NULL; - for (i = 0; i < nargs; i++) { - Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; - } - result = __Pyx_PyObject_Call(func, argstuple, kwargs); - bad: - Py_DECREF(argstuple); - return result; -} -#endif -#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - #if PY_VERSION_HEX < 0x03090000 - #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) - #elif CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { - PyTypeObject *tp = Py_TYPE(callable); - #if defined(__Pyx_CyFunction_USED) - if (__Pyx_CyFunction_CheckExact(callable)) { - return __Pyx_CyFunction_func_vectorcall(callable); - } - #endif - if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { - return NULL; - } - assert(PyCallable_Check(callable)); - Py_ssize_t offset = tp->tp_vectorcall_offset; - assert(offset > 0); - vectorcallfunc ptr; - memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); - return ptr; -} - #else - #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) - #endif -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { - Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); -#if CYTHON_COMPILING_IN_CPYTHON - if (nargs == 0 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) - return __Pyx_PyObject_CallMethO(func, NULL); - } - else if (nargs == 1 && kwargs == NULL) { - if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) - return __Pyx_PyObject_CallMethO(func, args[0]); - } -#endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif - if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); - #endif - } - if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); - } - #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API - return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); - #else - return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); - #endif -} - -/* UnpackUnboundCMethod */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { - return _PyObject_Vectorcall - (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); -} -#else -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - return -#if PY_VERSION_HEX < 0x03090000 - _PyObject_Vectorcall -#else - PyObject_Vectorcall -#endif - (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); -} -#endif -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 - METH_VARARGS | METH_KEYWORDS, -#else - METH_FASTCALL | METH_KEYWORDS, -#endif - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method, *result=NULL; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - result = method; -#if CYTHON_COMPILING_IN_CPYTHON - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); -#endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - result = unbound_method; - } - } -#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - if (unlikely(target->method)) { - Py_DECREF(result); - } else -#endif - target->method = result; - return 0; -} - -/* CallUnboundCMethod2 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - PyObject *args[2] = {arg1, arg2}; - if (cfunc->flag == METH_FASTCALL) { - return __Pyx_CallCFunctionFast(cfunc, self, args, 2); - } - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); - } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 -#endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); - } -#endif - PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; -} -#endif -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - PyObject *result = NULL; - PyObject *args = PyTuple_New(2); - if (unlikely(!args)) return NULL; - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 0, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 1, arg2); - if (cfunc->flag & METH_KEYWORDS) - result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); - else - result = __Pyx_CallCFunction(cfunc, self, args); - Py_DECREF(args); - return result; - } -#endif - { - PyObject *args[4] = {NULL, self, arg1, arg2}; - return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); - } -} - -/* ParseKeywords */ -static int __Pyx_ValidateDuplicatePosArgs( - PyObject *kwds, - PyObject ** const argnames[], - PyObject ** const *first_kw_arg, - const char* function_name) -{ - PyObject ** const *name = argnames; - while (name != first_kw_arg) { - PyObject *key = **name; - int found = PyDict_Contains(kwds, key); - if (unlikely(found)) { - if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; - } - name++; - } - return 0; -bad: - return -1; -} -#if CYTHON_USE_UNICODE_INTERNALS -static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { - int kind; - Py_ssize_t len = PyUnicode_GET_LENGTH(s1); - if (len != PyUnicode_GET_LENGTH(s2)) return 0; - kind = PyUnicode_KIND(s1); - if (kind != PyUnicode_KIND(s2)) return 0; - const void *data1 = PyUnicode_DATA(s1); - const void *data2 = PyUnicode_DATA(s2); - return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); -} -#endif -static int __Pyx_MatchKeywordArg_str( - PyObject *key, - PyObject ** const argnames[], - PyObject ** const *first_kw_arg, - size_t *index_found, - const char *function_name) -{ - PyObject ** const *name; - #if CYTHON_USE_UNICODE_INTERNALS - Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; - if (unlikely(key_hash == -1)) { - key_hash = PyObject_Hash(key); - if (unlikely(key_hash == -1)) - goto bad; - } - #endif - name = first_kw_arg; - while (*name) { - PyObject *name_str = **name; - #if CYTHON_USE_UNICODE_INTERNALS - if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { - *index_found = (size_t) (name - argnames); - return 1; - } - #else - #if CYTHON_ASSUME_SAFE_SIZE - if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) - #endif - { - int cmp = PyUnicode_Compare(name_str, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - *index_found = (size_t) (name - argnames); - return 1; - } - } - #endif - name++; - } - name = argnames; - while (name != first_kw_arg) { - PyObject *name_str = **name; - #if CYTHON_USE_UNICODE_INTERNALS - if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { - if (__Pyx_UnicodeKeywordsEqual(name_str, key)) - goto arg_passed_twice; - } - #else - #if CYTHON_ASSUME_SAFE_SIZE - if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) - #endif - { - if (unlikely(name_str == key)) goto arg_passed_twice; - int cmp = PyUnicode_Compare(name_str, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - } - #endif - name++; - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -bad: - return -1; -} -static int __Pyx_MatchKeywordArg_nostr( - PyObject *key, - PyObject ** const argnames[], - PyObject ** const *first_kw_arg, - size_t *index_found, - const char *function_name) -{ - PyObject ** const *name; - if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; - name = first_kw_arg; - while (*name) { - int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); - if (cmp == 1) { - *index_found = (size_t) (name - argnames); - return 1; - } - if (unlikely(cmp == -1)) goto bad; - name++; - } - name = argnames; - while (name != first_kw_arg) { - int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); - if (unlikely(cmp != 0)) { - if (cmp == 1) goto arg_passed_twice; - else goto bad; - } - name++; - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -bad: - return -1; -} -static CYTHON_INLINE int __Pyx_MatchKeywordArg( - PyObject *key, - PyObject ** const argnames[], - PyObject ** const *first_kw_arg, - size_t *index_found, - const char *function_name) -{ - return likely(PyUnicode_CheckExact(key)) ? - __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : - __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); -} -static void __Pyx_RejectUnknownKeyword( - PyObject *kwds, - PyObject ** const argnames[], - PyObject ** const *first_kw_arg, - const char *function_name) -{ - Py_ssize_t pos = 0; - PyObject *key = NULL; - __Pyx_BEGIN_CRITICAL_SECTION(kwds); - while (PyDict_Next(kwds, &pos, &key, NULL)) { - PyObject** const *name = first_kw_arg; - while (*name && (**name != key)) name++; - if (!*name) { - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); - #endif - size_t index_found = 0; - int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); - if (cmp != 1) { - if (cmp == 0) { - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif - break; - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif - } - } - __Pyx_END_CRITICAL_SECTION(); - assert(PyErr_Occurred()); -} -static int __Pyx_ParseKeywordDict( - PyObject *kwds, - PyObject ** const argnames[], - PyObject *values[], - Py_ssize_t num_pos_args, - Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs) -{ - PyObject** const *name; - PyObject** const *first_kw_arg = argnames + num_pos_args; - Py_ssize_t extracted = 0; -#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) - if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; -#endif - name = first_kw_arg; - while (*name && num_kwargs > extracted) { - PyObject * key = **name; - PyObject *value; - int found = 0; - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - found = PyDict_GetItemRef(kwds, key, &value); - #else - value = PyDict_GetItemWithError(kwds, key); - if (value) { - Py_INCREF(value); - found = 1; - } else { - if (unlikely(PyErr_Occurred())) goto bad; - } - #endif - if (found) { - if (unlikely(found < 0)) goto bad; - values[name-argnames] = value; - extracted++; - } - name++; - } - if (num_kwargs > extracted) { - if (ignore_unknown_kwargs) { - if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) - goto bad; - } else { - __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); - goto bad; - } - } - return 0; -bad: - return -1; -} -static int __Pyx_ParseKeywordDictToDict( - PyObject *kwds, - PyObject ** const argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject** const *name; - PyObject** const *first_kw_arg = argnames + num_pos_args; - Py_ssize_t len; -#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) - if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; -#endif - if (PyDict_Update(kwds2, kwds) < 0) goto bad; - name = first_kw_arg; - while (*name) { - PyObject *key = **name; - PyObject *value; -#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) - int found = PyDict_Pop(kwds2, key, &value); - if (found) { - if (unlikely(found < 0)) goto bad; - values[name-argnames] = value; - } -#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - int found = PyDict_GetItemRef(kwds2, key, &value); - if (found) { - if (unlikely(found < 0)) goto bad; - values[name-argnames] = value; - if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; - } -#else - #if CYTHON_COMPILING_IN_CPYTHON - value = _PyDict_Pop(kwds2, key, kwds2); - #else - value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); - #endif - if (value == kwds2) { - Py_DECREF(value); - } else { - if (unlikely(!value)) goto bad; - values[name-argnames] = value; - } -#endif - name++; - } - len = PyDict_Size(kwds2); - if (len > 0) { - return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); - } else if (unlikely(len == -1)) { - goto bad; - } - return 0; -bad: - return -1; -} -static int __Pyx_ParseKeywordsTuple( - PyObject *kwds, - PyObject * const *kwvalues, - PyObject ** const argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs) -{ - PyObject *key = NULL; - PyObject** const * name; - PyObject** const *first_kw_arg = argnames + num_pos_args; - for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); -#else - key = __Pyx_PyTuple_GET_ITEM(kwds, pos); -#endif -#if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely(!key)) goto bad; -#endif - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - PyObject *value = kwvalues[pos]; - values[name-argnames] = __Pyx_NewRef(value); - } else { - size_t index_found = 0; - int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); - if (cmp == 1) { - PyObject *value = kwvalues[pos]; - values[index_found] = __Pyx_NewRef(value); - } else { - if (unlikely(cmp == -1)) goto bad; - if (kwds2) { - PyObject *value = kwvalues[pos]; - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else if (!ignore_unknown_kwargs) { - goto invalid_keyword; - } - } - } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - key = NULL; - #endif - } - return 0; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - "%s() got an unexpected keyword argument '%U'", - function_name, key); - goto bad; -bad: - #if CYTHON_AVOID_BORROWED_REFS - Py_XDECREF(key); - #endif - return -1; -} -static int __Pyx_ParseKeywords( - PyObject *kwds, - PyObject * const *kwvalues, - PyObject ** const argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs) -{ - if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) - return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); - else if (kwds2) - return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); - else - return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); -} - -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* ArgTypeTest */ -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) -{ - __Pyx_TypeName type_name; - __Pyx_TypeName obj_type_name; - PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; - int from_annotation_subclass = 0; - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - else if (!exact) { - if (likely(__Pyx_TypeCheck(obj, type))) return 1; - } else if (exact == 2) { - if (__Pyx_TypeCheck(obj, type)) { - from_annotation_subclass = 1; - extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; - } - } - type_name = __Pyx_PyType_GetFullyQualifiedName(type); - obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")" -#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 - "%s%U" -#endif - , name, type_name, obj_type_name -#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 - , (from_annotation_subclass ? ". " : ""), extra_info -#endif - ); -#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 - if (exact == 2 && from_annotation_subclass) { - PyObject *res; - PyObject *vargs[2]; - vargs[0] = PyErr_GetRaisedException(); - vargs[1] = extra_info; - res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); - Py_XDECREF(res); - PyErr_SetRaisedException(vargs[0]); - } -#endif - __Pyx_DECREF_TypeName(type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* RaiseTooManyValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* IterFinish */ -static CYTHON_INLINE int __Pyx_IterFinish(void) { - PyObject* exc_type; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - exc_type = __Pyx_PyErr_CurrentExceptionType(); - if (unlikely(exc_type)) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) - return -1; - __Pyx_PyErr_Clear(); - return 0; - } - return 0; -} - -/* UnpackItemEndCheck */ -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } - return __Pyx_IterFinish(); -} - -/* PyObjectSetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); - return PyObject_SetAttr(obj, attr_name, value); -} -#endif - -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!__pyx_m)) { - if (!PyErr_Occurred()) - PyErr_SetNone(PyExc_NameError); - return NULL; - } - result = PyObject_GetAttr(__pyx_m, name); - if (likely(result)) { - return result; - } - PyErr_Clear(); -#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); - __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return result; - } -#else - result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* PyObjectVectorCallKwBuilder */ -#if CYTHON_VECTORCALL -static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - (void)__Pyx_PyObject_FastCallDict; - if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; - Py_INCREF(key); - args[n] = value; - return 0; -} -CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - (void)__Pyx_VectorcallBuilder_AddArgStr; - if (unlikely(!PyUnicode_Check(key))) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - return -1; - } - return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); -} -static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { - PyObject *pyKey = PyUnicode_FromString(key); - if (!pyKey) return -1; - return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); -} -#else // CYTHON_VECTORCALL -CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { - if (unlikely(!PyUnicode_Check(key))) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - return -1; - } - return PyDict_SetItem(builder, key, value); -} -#endif - -/* RaiseException */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); -#elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} - -/* PyObjectCall2Args */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { - PyObject *args[3] = {NULL, arg1, arg2}; - return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* CallUnboundCMethod1 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - int flag = cfunc->flag; - if (flag == METH_O) { - return __Pyx_CallCFunction(cfunc, self, arg); - } else if (flag == METH_FASTCALL) { - return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1); - } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL); - } - } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 -#endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg); - } -#endif - PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; -} -#endif -static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - if (cfunc->flag & METH_KEYWORDS) - result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); - else - result = __Pyx_CallCFunction(cfunc, self, args); - Py_DECREF(args); - } else -#endif - { - result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); - } - return result; -} - -/* py_dict_pop */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop) - PyObject *value; - if (PyDict_Pop(d, key, &value) == 0) { - if (default_value) { - Py_INCREF(default_value); - } else { - PyErr_SetObject(PyExc_KeyError, key); - } - value = default_value; - } - return value; -#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 - return _PyDict_Pop(d, key, default_value); -#else - if (default_value) { - return __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key, default_value); - } else { - return __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key); - } -#endif -} - -/* PyObjectCallNoArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg[2] = {NULL, NULL}; - return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectGetMethod */ -static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { - PyObject *attr; -#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP - __Pyx_TypeName type_name; - PyTypeObject *tp = Py_TYPE(obj); - PyObject *descr; - descrgetfunc f = NULL; - PyObject **dictptr, *dict; - int meth_found = 0; - assert (*method == NULL); - if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { - attr = __Pyx_PyObject_GetAttrStr(obj, name); - goto try_unpack; - } - if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { - return 0; - } - descr = _PyType_Lookup(tp, name); - if (likely(descr != NULL)) { - Py_INCREF(descr); -#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR - if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) - #endif -#endif - { - meth_found = 1; - } else { - f = Py_TYPE(descr)->tp_descr_get; - if (f != NULL && PyDescr_IsData(descr)) { - attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); - Py_DECREF(descr); - goto try_unpack; - } - } - } - dictptr = _PyObject_GetDictPtr(obj); - if (dictptr != NULL && (dict = *dictptr) != NULL) { - Py_INCREF(dict); - attr = __Pyx_PyDict_GetItemStr(dict, name); - if (attr != NULL) { - Py_INCREF(attr); - Py_DECREF(dict); - Py_XDECREF(descr); - goto try_unpack; - } - Py_DECREF(dict); - } - if (meth_found) { - *method = descr; - return 1; - } - if (f != NULL) { - attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); - Py_DECREF(descr); - goto try_unpack; - } - if (likely(descr != NULL)) { - *method = descr; - return 0; - } - type_name = __Pyx_PyType_GetFullyQualifiedName(tp); - PyErr_Format(PyExc_AttributeError, - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, name); - __Pyx_DECREF_TypeName(type_name); - return 0; -#else - attr = __Pyx_PyObject_GetAttrStr(obj, name); - goto try_unpack; -#endif -try_unpack: -#if CYTHON_UNPACK_METHODS - if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { - PyObject *function = PyMethod_GET_FUNCTION(attr); - Py_INCREF(function); - Py_DECREF(attr); - *method = function; - return 1; - } -#endif - *method = attr; - return 0; -} - -/* PyObjectCallMethod0 */ -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { - PyObject *method = NULL, *result = NULL; - int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); - if (likely(is_method)) { - result = __Pyx_PyObject_CallOneArg(method, obj); - Py_DECREF(method); - return result; - } - if (unlikely(!method)) goto bad; - result = __Pyx_PyObject_CallNoArg(method); - Py_DECREF(method); -bad: - return result; -} - -/* RaiseNoneIterError */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* UnpackTupleError */ -static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { - if (t == Py_None) { - __Pyx_RaiseNoneNotIterableError(); - } else { - Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(size < 0)) return; - #endif - if (size < index) { - __Pyx_RaiseNeedMoreValuesError(size); - } else { - __Pyx_RaiseTooManyValuesError(index); - } - } -} - -/* UnpackTuple2 */ -static CYTHON_INLINE int __Pyx_unpack_tuple2( - PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { - if (likely(is_tuple || PyTuple_Check(tuple))) { - Py_ssize_t size; - if (has_known_size) { - return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); - } - size = __Pyx_PyTuple_GET_SIZE(tuple); - if (likely(size == 2)) { - return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); - } - if (size >= 0) { - __Pyx_UnpackTupleError(tuple, 2); - } - return -1; - } else { - return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); - } -} -static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( - PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { - PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS - value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = __Pyx_PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; -#else - value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); - value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); -#endif - if (decref_tuple) { - Py_DECREF(tuple); - } - *pvalue1 = value1; - *pvalue2 = value2; - return 0; -#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS -bad: - Py_XDECREF(value1); - Py_XDECREF(value2); - if (decref_tuple) { Py_XDECREF(tuple); } - return -1; -#endif -} -static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, - int has_known_size, int decref_tuple) { - Py_ssize_t index; - PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; - iternextfunc iternext; - iter = PyObject_GetIter(tuple); - if (unlikely(!iter)) goto bad; - if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } - iternext = __Pyx_PyObject_GetIterNextFunc(iter); - value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } - value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } - if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; - Py_DECREF(iter); - *pvalue1 = value1; - *pvalue2 = value2; - return 0; -unpacking_failed: - if (!has_known_size && __Pyx_IterFinish() == 0) - __Pyx_RaiseNeedMoreValuesError(index); -bad: - Py_XDECREF(iter); - Py_XDECREF(value1); - Py_XDECREF(value2); - if (decref_tuple) { Py_XDECREF(tuple); } - return -1; -} - -/* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY -#include -#endif -static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, - Py_ssize_t* p_orig_length, int* p_source_is_dict) { - is_dict = is_dict || likely(PyDict_CheckExact(iterable)); - *p_source_is_dict = is_dict; - if (is_dict) { -#if !CYTHON_COMPILING_IN_PYPY - *p_orig_length = PyDict_Size(iterable); - Py_INCREF(iterable); - return iterable; -#else - static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; - PyObject **pp = NULL; - if (method_name) { - const char *name = PyUnicode_AsUTF8(method_name); - if (strcmp(name, "iteritems") == 0) pp = &py_items; - else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; - else if (strcmp(name, "itervalues") == 0) pp = &py_values; - if (pp) { - if (!*pp) { - *pp = PyUnicode_FromString(name + 4); - if (!*pp) - return NULL; - } - method_name = *pp; - } - } -#endif - } - *p_orig_length = 0; - if (method_name) { - PyObject* iter; - iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); - if (!iterable) - return NULL; -#if !CYTHON_COMPILING_IN_PYPY - if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) - return iterable; -#endif - iter = PyObject_GetIter(iterable); - Py_DECREF(iterable); - return iter; - } - return PyObject_GetIter(iterable); -} -#if !CYTHON_COMPILING_IN_PYPY -static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict( - PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem) { - PyObject *key, *value; - if (unlikely(orig_length != PyDict_Size(iter_obj))) { - PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); - return -1; - } - if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { - return 0; - } - if (pitem) { - PyObject* tuple = PyTuple_New(2); - if (unlikely(!tuple)) { - return -1; - } - Py_INCREF(key); - Py_INCREF(value); - #if CYTHON_ASSUME_SAFE_MACROS - PyTuple_SET_ITEM(tuple, 0, key); - PyTuple_SET_ITEM(tuple, 1, value); - #else - if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { - Py_DECREF(value); - Py_DECREF(tuple); - return -1; - } - if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { - Py_DECREF(tuple); - return -1; - } - #endif - *pitem = tuple; - } else { - if (pkey) { - Py_INCREF(key); - *pkey = key; - } - if (pvalue) { - Py_INCREF(value); - *pvalue = value; - } - } - return 1; -} -#endif -static CYTHON_INLINE int __Pyx_dict_iter_next( - PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, - PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { - PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY - if (source_is_dict) { - int result; -#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(iter_obj); -#endif - result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem); -#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); -#endif - return result; - } else if (PyTuple_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(tuple_size < 0)) return -1; - #endif - if (unlikely(pos >= tuple_size)) return 0; - *ppos = pos + 1; - #if CYTHON_ASSUME_SAFE_MACROS - next_item = PyTuple_GET_ITEM(iter_obj, pos); - #else - next_item = PyTuple_GetItem(iter_obj, pos); - if (unlikely(!next_item)) return -1; - #endif - Py_INCREF(next_item); - } else if (PyList_CheckExact(iter_obj)) { - Py_ssize_t pos = *ppos; - Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(list_size < 0)) return -1; - #endif - if (unlikely(pos >= list_size)) return 0; - *ppos = pos + 1; - #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - next_item = PyList_GetItemRef(iter_obj, pos); - if (unlikely(!next_item)) return -1; - #elif CYTHON_ASSUME_SAFE_MACROS - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - #else - next_item = PyList_GetItem(iter_obj, pos); - if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif - } else -#endif - { - next_item = PyIter_Next(iter_obj); - if (unlikely(!next_item)) { - return __Pyx_IterFinish(); - } - } - if (pitem) { - *pitem = next_item; - } else if (pkey && pvalue) { - if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) - return -1; - } else if (pkey) { - *pkey = next_item; - } else { - *pvalue = next_item; - } - return 1; -} - -/* MergeKeywords */ -static int __Pyx_MergeKeywords_dict(PyObject *kwdict, PyObject *source_dict) { - Py_ssize_t len1, len2; - len2 = PyDict_Size(source_dict); - if (unlikely(len2 == -1)) return -1; - if (len2 == 0) { - return 0; - } - len1 = PyDict_Size(kwdict); - if (unlikely(len1 == -1)) return -1; - if (len1 > 0) { - PyObject *key, *smaller_dict, *larger_dict; - Py_ssize_t ppos = 0; - int duplicates_found = 0; - if (len1 <= len2) { - smaller_dict = kwdict; - larger_dict = source_dict; - } else { - smaller_dict = source_dict; - larger_dict = kwdict; - } - __Pyx_BEGIN_CRITICAL_SECTION(smaller_dict); - while (PyDict_Next(smaller_dict, &ppos, &key, NULL)) { - #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - Py_INCREF(key); - #endif - if (unlikely(PyDict_Contains(larger_dict, key))) { - __Pyx_RaiseDoubleKeywordsError("function", key); - #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - Py_DECREF(key); - #endif - duplicates_found = 1; - break; - }; - #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - Py_DECREF(key); - #endif - } - __Pyx_END_CRITICAL_SECTION(); - if (unlikely(duplicates_found)) - return -1; - } - return PyDict_Update(kwdict, source_dict); -} -static int __Pyx_MergeKeywords_any(PyObject *kwdict, PyObject *source_mapping) { - PyObject *iter, *key = NULL, *value = NULL; - int source_is_dict, result; - Py_ssize_t orig_length, ppos = 0; - iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_mstate_global->__pyx_n_u_items, &orig_length, &source_is_dict); - if (unlikely(!iter)) { - PyObject *args; - if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) goto bad; - PyErr_Clear(); - args = PyTuple_Pack(1, source_mapping); - if (likely(args)) { - PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL); - Py_DECREF(args); - if (likely(fallback)) { - result = __Pyx_MergeKeywords_dict(kwdict, fallback); - Py_DECREF(fallback); - return result; - } - } - if (unlikely(!iter)) goto bad; - } - while (1) { - result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict); - if (unlikely(result < 0)) goto bad; - if (!result) break; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - { - int inserted = PyDict_SetDefaultRef(kwdict, key, value, NULL); - if (unlikely(inserted != 0)) { - if (inserted == 1) __Pyx_RaiseDoubleKeywordsError("function", key); - result = -1; - } - } - #else - if (unlikely(PyDict_Contains(kwdict, key))) { - __Pyx_RaiseDoubleKeywordsError("function", key); - result = -1; - } else { - result = PyDict_SetItem(kwdict, key, value); - } - #endif - Py_DECREF(key); - Py_DECREF(value); - if (unlikely(result < 0)) goto bad; - } - Py_XDECREF(iter); - return 0; -bad: - Py_XDECREF(iter); - return -1; -} -static CYTHON_INLINE int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) { - assert(PyDict_Check(kwdict)); - if (likely(PyDict_Check(source_mapping))) { - return __Pyx_MergeKeywords_dict(kwdict, source_mapping); - } else { - return __Pyx_MergeKeywords_any(kwdict, source_mapping); - } -} - -/* pybytes_as_double */ -static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { - PyObject *float_value = PyFloat_FromString(obj); - if (likely(float_value)) { - double value = __Pyx_PyFloat_AS_DOUBLE(float_value); - Py_DECREF(float_value); - return value; - } - return (double)-1; -} -static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) { - int last_was_punctuation = 1; - int parse_error_found = 0; - Py_ssize_t i; - for (i=0; i < length; i++) { - char chr = start[i]; - int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E'); - *buffer = chr; - buffer += (chr != '_'); - parse_error_found |= last_was_punctuation & is_punctuation; - last_was_punctuation = is_punctuation; - } - parse_error_found |= last_was_punctuation; - *buffer = '\0'; - return unlikely(parse_error_found) ? NULL : buffer; -} -static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) { - int matches = 1; - char sign = start[0]; - int is_signed = (sign == '+') | (sign == '-'); - start += is_signed; - length -= is_signed; - switch (start[0]) { - #ifdef Py_NAN - case 'n': - case 'N': - if (unlikely(length != 3)) goto parse_failure; - matches &= (start[1] == 'a' || start[1] == 'A'); - matches &= (start[2] == 'n' || start[2] == 'N'); - if (unlikely(!matches)) goto parse_failure; - return (sign == '-') ? -Py_NAN : Py_NAN; - #endif - case 'i': - case 'I': - if (unlikely(length < 3)) goto parse_failure; - matches &= (start[1] == 'n' || start[1] == 'N'); - matches &= (start[2] == 'f' || start[2] == 'F'); - if (likely(length == 3 && matches)) - return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; - if (unlikely(length != 8)) goto parse_failure; - matches &= (start[3] == 'i' || start[3] == 'I'); - matches &= (start[4] == 'n' || start[4] == 'N'); - matches &= (start[5] == 'i' || start[5] == 'I'); - matches &= (start[6] == 't' || start[6] == 'T'); - matches &= (start[7] == 'y' || start[7] == 'Y'); - if (unlikely(!matches)) goto parse_failure; - return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; - case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - break; - default: - goto parse_failure; - } - return 0.0; -parse_failure: - return -1.0; -} -static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) { - return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd)); -} -CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) { - double value; - Py_ssize_t i, digits; - const char *last = start + length; - char *end; - while (__Pyx__PyBytes_AsDouble_IsSpace(*start)) - start++; - while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1])) - last--; - length = last - start; - if (unlikely(length <= 0)) goto fallback; - value = __Pyx__PyBytes_AsDouble_inf_nan(start, length); - if (unlikely(value == -1.0)) goto fallback; - if (value != 0.0) return value; - digits = 0; - for (i=0; i < length; digits += start[i++] != '_'); - if (likely(digits == length)) { - value = PyOS_string_to_double(start, &end, NULL); - } else if (digits < 40) { - char number[40]; - last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); - if (unlikely(!last)) goto fallback; - value = PyOS_string_to_double(number, &end, NULL); - } else { - char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char)); - if (unlikely(!number)) goto fallback; - last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); - if (unlikely(!last)) { - PyMem_Free(number); - goto fallback; - } - value = PyOS_string_to_double(number, &end, NULL); - PyMem_Free(number); - } - if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { - return value; - } -fallback: - return __Pyx_SlowPyString_AsDouble(obj); -} - -/* PyLongCompare */ -static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(inplace); - if (op1 == op2) { - return 1; - } - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - int unequal; - unsigned long uintval; - Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); - const digit* digits = __Pyx_PyLong_Digits(op1); - if (intval == 0) { - return (__Pyx_PyLong_IsZero(op1) == 1); - } else if (intval < 0) { - if (__Pyx_PyLong_IsNonNeg(op1)) - return 0; - intval = -intval; - } else { - if (__Pyx_PyLong_IsNeg(op1)) - return 0; - } - uintval = (unsigned long) intval; -#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 4)) { - unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 3)) { - unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 2)) { - unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif -#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 - if (uintval >> (PyLong_SHIFT * 1)) { - unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) - | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); - } else -#endif - unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); - return (unequal == 0); - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; - double a = __Pyx_PyFloat_AS_DOUBLE(op1); - return ((double)a == (double)b); - } - return __Pyx_PyObject_IsTrueAndDecref( - PyObject_RichCompare(op1, op2, Py_EQ)); -} - -/* PyLongBinop */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) { - return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); -} -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(inplace); - CYTHON_UNUSED_VAR(zerodivision_check); - const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG - const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - return __Pyx_NewRef(op2); - } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - } - x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: - llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); - - -} -#endif -static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) { - CYTHON_UNUSED_VAR(zerodivision_check); - const long b = intval; - double a = __Pyx_PyFloat_AS_DOUBLE(float_val); - double result; - - result = ((double)a) + (double)b; - return PyFloat_FromDouble(result); -} -static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_UNUSED_VAR(zerodivision_check); - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check); - } - #endif - if (PyFloat_CheckExact(op1)) { - return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check); - } - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); -} -#endif - -/* PyObjectFastCallMethod */ -#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 -static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) { - PyObject *result; - PyObject *attr = PyObject_GetAttr(args[0], name); - if (unlikely(!attr)) - return NULL; - result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1); - Py_DECREF(attr); - return result; -} -#endif - -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C0000 - local_value = tstate->current_exception; - tstate->current_exception = 0; - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 - local_value = PyErr_GetRaisedException(); -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif -#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } -#else - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } -#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - PyErr_SetHandledException(local_value); - Py_XDECREF(local_value); - Py_XDECREF(local_type); - Py_XDECREF(local_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -#endif -} - -/* SwapException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_value = exc_info->exc_value; - exc_info->exc_value = *value; - if (tmp_value == NULL || tmp_value == Py_None) { - Py_XDECREF(tmp_value); - tmp_value = NULL; - tmp_type = NULL; - tmp_tb = NULL; - } else { - tmp_type = (PyObject*) Py_TYPE(tmp_value); - Py_INCREF(tmp_type); - #if CYTHON_COMPILING_IN_CPYTHON - tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; - Py_XINCREF(tmp_tb); - #else - tmp_tb = PyException_GetTraceback(tmp_value); - #endif - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = *type; - exc_info->exc_value = *value; - exc_info->exc_traceback = *tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - #endif - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); - PyErr_SetExcInfo(*type, *value, *tb); - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#endif - -/* dict_getitem_default */ -static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { - PyObject* value; -#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (unlikely(PyErr_Occurred())) - return NULL; - value = default_value; - } - Py_INCREF(value); - if ((1)); -#else - if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { - value = PyDict_GetItem(d, key); - if (unlikely(!value)) { - value = default_value; - } - Py_INCREF(value); - } -#endif - else { - if (default_value == Py_None) - value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); - else - value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); - } - return value; -} - -/* GetItemInt */ -static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (unlikely(!j)) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS - Py_ssize_t wrapped_i = i; - if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); - } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_PyList_GetItemRef(o, n); - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; - PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { - PyObject *r, *key = PyLong_FromSsize_t(i); - if (unlikely(!key)) return NULL; - r = mm->mp_subscript(o, key); - Py_DECREF(key); - return r; - } - if (likely(sm && sm->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { - Py_ssize_t l = sm->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - return NULL; - PyErr_Clear(); - } - } - return sm->sq_item(o, i); - } - } -#else - if (is_list || !PyMapping_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); -} - -/* ObjectGetItem */ -#if CYTHON_USE_TYPE_SLOTS -static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { - PyObject *runerr = NULL; - Py_ssize_t key_value; - key_value = __Pyx_PyIndex_AsSsize_t(index); - if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); - } - if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); - PyErr_Clear(); - PyErr_Format(PyExc_IndexError, - "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); - __Pyx_DECREF_TypeName(index_type_name); - } - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { - __Pyx_TypeName obj_type_name; - if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); - if (!meth) { - PyErr_Clear(); - } else { - PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); - Py_DECREF(meth); - return result; - } - } - obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { - PyTypeObject *tp = Py_TYPE(obj); - PyMappingMethods *mm = tp->tp_as_mapping; - PySequenceMethods *sm = tp->tp_as_sequence; - if (likely(mm && mm->mp_subscript)) { - return mm->mp_subscript(obj, key); - } - if (likely(sm && sm->sq_item)) { - return __Pyx_PyObject_GetIndex(obj, key); - } - return __Pyx_PyObject_GetItem_Slow(obj, key); -} -#endif - -/* PyObjectVectorCallMethodKwBuilder */ -#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000 -static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { - PyObject *result; - PyObject *obj = PyObject_GetAttr(args[0], name); - if (unlikely(!obj)) - return NULL; - result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames); - Py_DECREF(obj); - return result; -} -#endif - -/* CallUnboundCMethod0 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - if (likely(cfunc->flag == METH_NOARGS)) - return __Pyx_CallCFunction(cfunc, self, NULL); - if (likely(cfunc->flag == METH_FASTCALL)) - return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); - if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) - return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (cfunc->flag == METH_VARARGS) - return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); - return __Pyx__CallUnboundCMethod0(cfunc, self); - } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 -#endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); - } -#endif - PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; -} -#endif -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *result; - if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; - result = __Pyx_PyObject_CallOneArg(cfunc->method, self); - return result; -} - -/* py_dict_items */ -static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { - return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); -} - -/* py_dict_keys */ -static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { - return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); -} - -/* DictGetItem */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error - if (unlikely(PyTuple_Check(key))) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) { - PyErr_SetObject(PyExc_KeyError, args); - Py_DECREF(args); - } - } else { - PyErr_SetObject(PyExc_KeyError, key); - } - } - return value; -} -#endif - -/* RaiseUnexpectedTypeError */ -static int -__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) -{ - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, - expected, obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return 0; -} - -/* CallTypeTraverse */ -#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) -#else -static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { - #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 - if (__Pyx_get_runtime_version() < 0x03090000) return 0; - #endif - if (!always_call) { - PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); - unsigned long flags = PyType_GetFlags(base); - if (flags & Py_TPFLAGS_HEAPTYPE) { - return 0; - } - } - Py_VISIT((PyObject*)Py_TYPE(o)); - return 0; -} -#endif - -/* LimitedApiGetTypeDict */ -#if CYTHON_COMPILING_IN_LIMITED_API -static Py_ssize_t __Pyx_GetTypeDictOffset(void) { - PyObject *tp_dictoffset_o; - Py_ssize_t tp_dictoffset; - tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__"); - if (unlikely(!tp_dictoffset_o)) return -1; - tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o); - Py_DECREF(tp_dictoffset_o); - if (unlikely(tp_dictoffset == 0)) { - PyErr_SetString( - PyExc_TypeError, - "'type' doesn't have a dictoffset"); - return -1; - } else if (unlikely(tp_dictoffset < 0)) { - PyErr_SetString( - PyExc_TypeError, - "'type' has an unexpected negative dictoffset. " - "Please report this as Cython bug"); - return -1; - } - return tp_dictoffset; -} -static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { - static Py_ssize_t tp_dictoffset = 0; - if (unlikely(tp_dictoffset == 0)) { - tp_dictoffset = __Pyx_GetTypeDictOffset(); - if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) { - tp_dictoffset = 0; // try again next time? - return NULL; - } - } - return *(PyObject**)((char*)tp + tp_dictoffset); -} -#endif - -/* SetItemOnTypeDict */ -static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { - int result; - PyObject *tp_dict; -#if CYTHON_COMPILING_IN_LIMITED_API - tp_dict = __Pyx_GetTypeDict(tp); - if (unlikely(!tp_dict)) return -1; -#else - tp_dict = tp->tp_dict; -#endif - result = PyDict_SetItem(tp_dict, k, v); - if (likely(!result)) { - PyType_Modified(tp); - if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) { - PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL); - if (!setNameResult) return -1; - Py_DECREF(setNameResult); - } - } - return result; -} - -/* FixUpExtensionType */ -static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { -#if __PYX_LIMITED_VERSION_HEX > 0x030900B1 - CYTHON_UNUSED_VAR(spec); - CYTHON_UNUSED_VAR(type); - CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); -#else - const PyType_Slot *slot = spec->slots; - int changed = 0; -#if !CYTHON_COMPILING_IN_LIMITED_API - while (slot && slot->slot && slot->slot != Py_tp_members) - slot++; - if (slot && slot->slot == Py_tp_members) { -#if !CYTHON_COMPILING_IN_CPYTHON - const -#endif // !CYTHON_COMPILING_IN_CPYTHON) - PyMemberDef *memb = (PyMemberDef*) slot->pfunc; - while (memb && memb->name) { - if (memb->name[0] == '_' && memb->name[1] == '_') { - if (strcmp(memb->name, "__weaklistoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_weaklistoffset = memb->offset; - changed = 1; - } - else if (strcmp(memb->name, "__dictoffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); - type->tp_dictoffset = memb->offset; - changed = 1; - } -#if CYTHON_METH_FASTCALL - else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { - assert(memb->type == T_PYSSIZET); - assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 - type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif - changed = 1; - } -#endif // CYTHON_METH_FASTCALL - else if (strcmp(memb->name, "__module__") == 0) { - PyObject *descr; - assert(memb->type == T_OBJECT); - assert(memb->flags == 0 || memb->flags == READONLY); - descr = PyDescr_NewMember(type, memb); - if (unlikely(!descr)) - return -1; - int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); - Py_DECREF(descr); - if (unlikely(set_item_result < 0)) { - return -1; - } - changed = 1; - } - } - memb++; - } - } -#endif // !CYTHON_COMPILING_IN_LIMITED_API - slot = spec->slots; - while (slot && slot->slot && slot->slot != Py_tp_getset) - slot++; - if (slot && slot->slot == Py_tp_getset) { - PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc; - while (getset && getset->name) { - if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) { - PyObject *descr = PyDescr_NewGetSet(type, getset); - if (unlikely(!descr)) - return -1; - #if CYTHON_COMPILING_IN_LIMITED_API - PyObject *pyname = PyUnicode_FromString(getset->name); - if (unlikely(!pyname)) { - Py_DECREF(descr); - return -1; - } - int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr); - Py_DECREF(pyname); - #else - CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); - int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr); - #endif - Py_DECREF(descr); - if (unlikely(set_item_result < 0)) { - return -1; - } - changed = 1; - } - ++getset; - } - } - if (changed) - PyType_Modified(type); -#endif // PY_VERSION_HEX > 0x030900B1 - return 0; -} - -/* ValidateBasesTuple */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS -static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { - Py_ssize_t i, n; -#if CYTHON_ASSUME_SAFE_SIZE - n = PyTuple_GET_SIZE(bases); -#else - n = PyTuple_Size(bases); - if (unlikely(n < 0)) return -1; -#endif - for (i = 1; i < n; i++) - { - PyTypeObject *b; -#if CYTHON_AVOID_BORROWED_REFS - PyObject *b0 = PySequence_GetItem(bases, i); - if (!b0) return -1; -#elif CYTHON_ASSUME_SAFE_MACROS - PyObject *b0 = PyTuple_GET_ITEM(bases, i); -#else - PyObject *b0 = PyTuple_GetItem(bases, i); - if (!b0) return -1; -#endif - b = (PyTypeObject*) b0; - if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) - { - __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); - PyErr_Format(PyExc_TypeError, - "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); - __Pyx_DECREF_TypeName(b_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } - if (dictoffset == 0) - { - Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS - b_dictoffset = b->tp_dictoffset; -#else - PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); - if (!py_b_dictoffset) goto dictoffset_return; - b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); - Py_DECREF(py_b_dictoffset); - if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; -#endif - if (b_dictoffset) { - { - __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); - } -#if !CYTHON_USE_TYPE_SLOTS - dictoffset_return: -#endif -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } - } -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - } - return 0; -} -#endif - -/* PyType_Ready */ -CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) { - while (t) { - PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); - if (bases) { - return 1; - } - t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*); - } - return 0; -} -static int __Pyx_PyType_Ready(PyTypeObject *t) { -#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION) - (void)__Pyx_PyObject_CallMethod0; -#if CYTHON_USE_TYPE_SPECS - (void)__Pyx_validate_bases_tuple; -#endif - return PyType_Ready(t); -#else - int r; - if (!__Pyx_PyType_HasMultipleInheritance(t)) { - return PyType_Ready(t); - } - PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); - if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) - return -1; -#if !defined(PYSTON_MAJOR_VERSION) - { - int gc_was_enabled; - #if PY_VERSION_HEX >= 0x030A00b1 - gc_was_enabled = PyGC_Disable(); - (void)__Pyx_PyObject_CallMethod0; - #else - PyObject *ret, *py_status; - PyObject *gc = NULL; - #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ - !CYTHON_COMPILING_IN_GRAAL - gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); - #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); - if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); - if (unlikely(!py_status)) { - Py_DECREF(gc); - return -1; - } - gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); - Py_DECREF(py_status); - if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); - if (unlikely(!ret)) { - Py_DECREF(gc); - return -1; - } - Py_DECREF(ret); - } else if (unlikely(gc_was_enabled == -1)) { - Py_DECREF(gc); - return -1; - } - #endif - t->tp_flags |= Py_TPFLAGS_HEAPTYPE; -#if PY_VERSION_HEX >= 0x030A0000 - t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; -#endif -#else - (void)__Pyx_PyObject_CallMethod0; -#endif - r = PyType_Ready(t); -#if !defined(PYSTON_MAJOR_VERSION) - t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; - #if PY_VERSION_HEX >= 0x030A00b1 - if (gc_was_enabled) - PyGC_Enable(); - #else - if (gc_was_enabled) { - PyObject *tp, *v, *tb; - PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); - if (likely(ret || r == -1)) { - Py_XDECREF(ret); - PyErr_Restore(tp, v, tb); - } else { - Py_XDECREF(tp); - Py_XDECREF(v); - Py_XDECREF(tb); - r = -1; - } - } - Py_DECREF(gc); - #endif - } -#endif - return r; -#endif -} - -/* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_1_2 -#define __PYX_HAVE_RT_ImportType_3_1_2 -static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size) -{ - PyObject *result = 0; - Py_ssize_t basicsize; - Py_ssize_t itemsize; -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - PyObject *py_itemsize; -#endif - result = PyObject_GetAttrString(module, class_name); - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#if !CYTHON_COMPILING_IN_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; - itemsize = ((PyTypeObject *)result)->tp_itemsize; -#else - if (size == 0) { - return (PyTypeObject *)result; - } - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; - py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); - if (!py_itemsize) - goto bad; - itemsize = PyLong_AsSsize_t(py_itemsize); - Py_DECREF(py_itemsize); - py_itemsize = 0; - if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (itemsize) { - if (size % alignment) { - alignment = size % alignment; - } - if (itemsize < (Py_ssize_t)alignment) - itemsize = (Py_ssize_t)alignment; - } - if ((size_t)(basicsize + itemsize) < size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize+itemsize); - goto bad; - } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_2 && - ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd-%zd from PyObject", - module_name, class_name, size, basicsize, basicsize+itemsize); - goto bad; - } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_2 && (size_t)basicsize > size) { - if (PyErr_WarnFormat(NULL, 0, - "%.200s.%.200s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize) < 0) { - goto bad; - } - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(result); - return NULL; -} -#endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *module = 0; - PyObject *empty_dict = 0; - PyObject *empty_list = 0; - empty_dict = PyDict_New(); - if (unlikely(!empty_dict)) - goto bad; - if (level == -1) { - const char* package_sep = strchr(__Pyx_MODULE_NAME, '.'); - if (package_sep != (0)) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - if (!module) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); - } -bad: - Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - return module; -} - -/* ImportDottedModule */ -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - Py_ssize_t size; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } -#if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(parts_tuple); -#else - size = PyTuple_Size(parts_tuple); - if (size < 0) goto bad; -#endif - if (likely(size == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( - PyExc_ModuleNotFoundError, - "No module named '%U'", partial_name); -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; -#if CYTHON_ASSUME_SAFE_SIZE - nparts = PyTuple_GET_SIZE(parts_tuple); -#else - nparts = PyTuple_Size(parts_tuple); - if (nparts < 0) return NULL; -#endif - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = __Pyx_PySequence_ITEM(parts_tuple, i); - if (!part) return NULL; -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } - return module; -} -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} - -/* ImportDottedModuleRelFirst */ -static PyObject *__Pyx_ImportDottedModuleRelFirst(PyObject *name, PyObject *parts_tuple) { - PyObject *module; - PyObject *from_list = NULL; - module = __Pyx_Import(name, from_list, -1); - Py_XDECREF(from_list); - if (module) { - if (parts_tuple) { - module = __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); - } - return module; - } - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - return NULL; - PyErr_Clear(); - return __Pyx_ImportDottedModule(name, parts_tuple); -} - -/* ListPack */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { - va_list va; - PyObject *l = PyList_New(n); - va_start(va, n); - if (unlikely(!l)) goto end; - for (Py_ssize_t i=0; i__pyx_kp_u__2); - if (unlikely(!module_dot)) { goto modbad; } - full_name = PyUnicode_Concat(module_dot, name); - if (unlikely(!full_name)) { goto modbad; } - #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - { - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - goto modbad; - value = PyObject_GetItem(modules, full_name); - } - #else - value = PyImport_GetModule(full_name); - #endif - modbad: - Py_XDECREF(full_name); - Py_XDECREF(module_dot); - Py_XDECREF(module_name); - } - if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, "cannot import name %S", name); - } - return value; -} - -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); -} - -/* dict_setdefault */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, - int is_safe_type) { - PyObject* value; - CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if CYTHON_COMPILING_IN_LIMITED_API - value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value); -#elif PY_VERSION_HEX >= 0x030d0000 - PyDict_SetDefaultRef(d, key, default_value, &value); -#else - value = PyDict_SetDefault(d, key, default_value); - if (unlikely(!value)) return NULL; - Py_INCREF(value); -#endif - return value; -} - -/* FetchCommonType */ -#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 -static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); - if (result && metaclass) { - PyObject *old_tp = (PyObject*)Py_TYPE(result); - Py_INCREF((PyObject*)metaclass); -#if __PYX_LIMITED_VERSION_HEX >= 0x03090000 - Py_SET_TYPE(result, metaclass); -#else - result->ob_type = metaclass; -#endif - Py_DECREF(old_tp); - } - return result; -} -#else -#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b) -#endif -static int __Pyx_VerifyCachedType(PyObject *cached_type, - const char *name, - Py_ssize_t expected_basicsize) { - Py_ssize_t basicsize; - if (!PyType_Check(cached_type)) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s is not a type object", name); - return -1; - } - if (expected_basicsize == 0) { - return 0; // size is inherited, nothing useful to check - } -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_basicsize; - py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); - if (unlikely(!py_basicsize)) return -1; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = NULL; - if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1; -#else - basicsize = ((PyTypeObject*) cached_type)->tp_basicsize; -#endif - if (basicsize != expected_basicsize) { - PyErr_Format(PyExc_TypeError, - "Shared Cython type %.200s has the wrong size, try recompiling", - name); - return -1; - } - return 0; -} -static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { - PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name; - int get_item_ref_result; - const char* object_name = strrchr(spec->name, '.'); - object_name = object_name ? object_name+1 : spec->name; - py_object_name = PyUnicode_FromString(object_name); - if (!py_object_name) return NULL; - abi_module = __Pyx_FetchSharedCythonABIModule(); - if (!abi_module) goto done; - abi_module_dict = PyModule_GetDict(abi_module); - if (!abi_module_dict) goto done; - get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type); - if (get_item_ref_result == 1) { - if (__Pyx_VerifyCachedType( - cached_type, - object_name, - spec->basicsize) < 0) { - goto bad; - } - goto done; - } else if (unlikely(get_item_ref_result == -1)) { - goto bad; - } - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); - if (unlikely(!cached_type)) goto bad; - if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); - if (unlikely(new_cached_type != cached_type)) { - if (unlikely(!new_cached_type)) goto bad; - Py_DECREF(cached_type); - cached_type = new_cached_type; - if (__Pyx_VerifyCachedType( - cached_type, - object_name, - spec->basicsize) < 0) { - goto bad; - } - goto done; - } else { - Py_DECREF(new_cached_type); - } -done: - Py_XDECREF(abi_module); - Py_DECREF(py_object_name); - assert(cached_type == NULL || PyType_Check(cached_type)); - return (PyTypeObject *) cached_type; -bad: - Py_XDECREF(cached_type); - cached_type = NULL; - goto done; -} - -/* CommonTypesMetaclass */ -PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { - return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); -} -static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { - {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, - {0, 0, 0, 0, 0} -}; -static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { - {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, - {0, 0} -}; -static PyType_Spec __pyx_CommonTypesMetaclass_spec = { - __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", - 0, - 0, -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | - Py_TPFLAGS_DISALLOW_INSTANTIATION | -#endif - Py_TPFLAGS_DEFAULT, - __pyx_CommonTypesMetaclass_slots -}; -static int __pyx_CommonTypesMetaclass_init(PyObject *module) { - __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - PyObject *bases = PyTuple_Pack(1, &PyType_Type); - if (unlikely(!bases)) { - return -1; - } - mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); - if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { - return -1; - } - return 0; -} - -/* PyMethodNew */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *result; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 - { - PyObject *args[] = {func, self}; - result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); - } - #else - result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); - #endif - return result; -} -#else -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#endif - -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) -static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - PyObject *res = NULL; - PyObject *kwnames; - PyObject **newargs; - PyObject **kwvalues; - Py_ssize_t i, pos; - size_t j; - PyObject *key, *value; - unsigned long keys_are_strings; - #if !CYTHON_ASSUME_SAFE_SIZE - Py_ssize_t nkw = PyDict_Size(kw); - if (unlikely(nkw == -1)) return NULL; - #else - Py_ssize_t nkw = PyDict_GET_SIZE(kw); - #endif - newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); - if (unlikely(newargs == NULL)) { - PyErr_NoMemory(); - return NULL; - } - for (j = 0; j < nargs; j++) newargs[j] = args[j]; - kwnames = PyTuple_New(nkw); - if (unlikely(kwnames == NULL)) { - PyMem_Free(newargs); - return NULL; - } - kwvalues = newargs + nargs; - pos = i = 0; - keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= - #if CYTHON_COMPILING_IN_LIMITED_API - PyType_GetFlags(Py_TYPE(key)); - #else - Py_TYPE(key)->tp_flags; - #endif - Py_INCREF(key); - Py_INCREF(value); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; - #else - PyTuple_SET_ITEM(kwnames, i, key); - #endif - kwvalues[i] = value; - i++; - } - if (unlikely(!keys_are_strings)) { - PyErr_SetString(PyExc_TypeError, "keywords must be strings"); - goto cleanup; - } - res = vc(func, newargs, nargs, kwnames); -cleanup: - Py_DECREF(kwnames); - for (i = 0; i < nkw; i++) - Py_DECREF(kwvalues[i]); - PyMem_Free(newargs); - return res; -} -static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) -{ - Py_ssize_t kw_size = - likely(kw == NULL) ? - 0 : -#if !CYTHON_ASSUME_SAFE_SIZE - PyDict_Size(kw); -#else - PyDict_GET_SIZE(kw); -#endif - if (kw_size == 0) { - return vc(func, args, nargs, NULL); - } -#if !CYTHON_ASSUME_SAFE_SIZE - else if (unlikely(kw_size == -1)) { - return NULL; - } -#endif - return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); -} -#endif - -/* CythonFunctionShared */ -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { - if (__Pyx_CyFunction_Check(func)) { - return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; - } else if (PyCFunction_Check(func)) { - return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; - } - return 0; -} -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { - if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { - int result; - PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); - if (unlikely(!newFunc)) { - PyErr_Clear(); // It's only an optimization, so don't throw an error - return 0; - } - result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); - Py_DECREF(newFunc); - return result; - } - return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); -} -#else -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) { - if (PyMethod_Check(func)) { - func = PyMethod_GET_FUNCTION(func); - } - return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; -} -#endif -static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - __Pyx_Py_XDECREF_SET( - __Pyx_CyFunction_GetClassObj(f), - ((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#else - __Pyx_Py_XDECREF_SET( - ((PyCMethodObject *) (f))->mm_class, - (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); -#endif -} -static PyObject * -__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_doc == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); - if (unlikely(!op->func_doc)) return NULL; -#else - if (((PyCFunctionObject*)op)->m_ml->ml_doc) { - op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); - if (unlikely(op->func_doc == NULL)) - return NULL; - } else { - Py_INCREF(Py_None); - return Py_None; - } -#endif - } - Py_INCREF(op->func_doc); - return op->func_doc; -} -static PyObject * -__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { - PyObject *result; - CYTHON_UNUSED_VAR(closure); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_doc_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (value == NULL) { - value = Py_None; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_doc, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_name == NULL)) { -#if CYTHON_COMPILING_IN_LIMITED_API - op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#else - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); -#endif - if (unlikely(op->func_name == NULL)) - return NULL; - } - Py_INCREF(op->func_name); - return op->func_name; -} -static PyObject * -__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) -{ - PyObject *result = NULL; - CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_name_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL || !PyUnicode_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_name, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - Py_INCREF(op->func_qualname); - result = op->func_qualname; - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL || !PyUnicode_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_qualname, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) -{ - if (unlikely(op->func_dict == NULL)) { - op->func_dict = PyDict_New(); - if (unlikely(op->func_dict == NULL)) - return NULL; - } - Py_INCREF(op->func_dict); - return op->func_dict; -} -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_dict_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - Py_INCREF(op->func_globals); - return op->func_globals; -} -static PyObject * -__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(op); - CYTHON_UNUSED_VAR(context); - Py_INCREF(Py_None); - return Py_None; -} -static PyObject * -__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) -{ - PyObject* result = (op->func_code) ? op->func_code : Py_None; - CYTHON_UNUSED_VAR(context); - Py_INCREF(result); - return result; -} -static int -__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { - int result = 0; - PyObject *res = op->defaults_getter((PyObject *) op); - if (unlikely(!res)) - return -1; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - op->defaults_tuple = PyTuple_GET_ITEM(res, 0); - Py_INCREF(op->defaults_tuple); - op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); - Py_INCREF(op->defaults_kwdict); - #else - op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); - if (unlikely(!op->defaults_tuple)) result = -1; - else { - op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); - if (unlikely(!op->defaults_kwdict)) result = -1; - } - #endif - Py_DECREF(res); - return result; -} -static int -__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__defaults__ must be set to a tuple object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_tuple; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_tuple; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result = NULL; - CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_defaults_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value) { - value = Py_None; - } else if (unlikely(value != Py_None && !PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__kwdefaults__ must be set to a dict object"); - return -1; - } - PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " - "currently affect the values used in function calls", 1); - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) { - PyObject* result = op->defaults_kwdict; - if (unlikely(!result)) { - if (op->defaults_getter) { - if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; - result = op->defaults_kwdict; - } else { - result = Py_None; - } - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { - PyObject* result; - CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_kwdefaults_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - if (!value || value == Py_None) { - value = NULL; - } else if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__annotations__ must be set to a dict object"); - return -1; - } - Py_XINCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_annotations, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} -static PyObject * -__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { - PyObject* result = op->func_annotations; - if (unlikely(!result)) { - result = PyDict_New(); - if (unlikely(!result)) return NULL; - op->func_annotations = result; - } - Py_INCREF(result); - return result; -} -static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject *result; - CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_annotations_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static PyObject * -__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { - int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; - if (is_coroutine) { - PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; - fromlist = PyList_New(1); - if (unlikely(!fromlist)) return NULL; - Py_INCREF(marker); -#if CYTHON_ASSUME_SAFE_MACROS - PyList_SET_ITEM(fromlist, 0, marker); -#else - if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); - Py_DECREF(fromlist); - return NULL; - } -#endif - module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); - Py_DECREF(fromlist); - if (unlikely(!module)) goto ignore; - is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker); - Py_DECREF(module); - if (likely(is_coroutine_value)) { - return is_coroutine_value; - } -ignore: - PyErr_Clear(); - } - return __Pyx_PyBool_FromLong(is_coroutine); -} -static PyObject * -__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { - PyObject *result; - CYTHON_UNUSED_VAR(context); - if (op->func_is_coroutine) { - return __Pyx_NewRef(op->func_is_coroutine); - } - result = __Pyx_CyFunction_get_is_coroutine_value(op); - if (unlikely(!result)) - return NULL; - __Pyx_BEGIN_CRITICAL_SECTION(op); - if (op->func_is_coroutine) { - Py_DECREF(result); - result = __Pyx_NewRef(op->func_is_coroutine); - } else { - op->func_is_coroutine = __Pyx_NewRef(result); - } - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); - if (!py_name) return; - PyErr_Format(PyExc_TypeError, - "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, message, size); - Py_DECREF(py_name); -#else - const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; - PyErr_Format(PyExc_TypeError, - "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", - name, message, size); -#endif -} -static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); - if (!py_name) return; - PyErr_Format(PyExc_TypeError, - "%.200S() %s", - py_name, message); - Py_DECREF(py_name); -#else - const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; - PyErr_Format(PyExc_TypeError, - "%.200s() %s", - name, message); -#endif -} -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject * -__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_GetAttrString(op->func, "__module__"); -} -static int -__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { - CYTHON_UNUSED_VAR(context); - return PyObject_SetAttrString(op->func, "__module__", value); -} -#endif -static PyGetSetDef __pyx_CyFunction_getsets[] = { - {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, -#if CYTHON_COMPILING_IN_LIMITED_API - {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, -#endif - {0, 0, 0, 0, 0} -}; -static PyMemberDef __pyx_CyFunction_members[] = { -#if !CYTHON_COMPILING_IN_LIMITED_API - {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, -#endif - {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, -#if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API - {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, -#else - {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, -#else - {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, -#endif -#endif - {0, 0, 0, 0, 0} -}; -static PyObject * -__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) -{ - PyObject *result = NULL; - CYTHON_UNUSED_VAR(args); - __Pyx_BEGIN_CRITICAL_SECTION(m); - Py_INCREF(m->func_qualname); - result = m->func_qualname; - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static PyMethodDef __pyx_CyFunction_methods[] = { - {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, - {0, 0, 0, 0} -}; -#if CYTHON_COMPILING_IN_LIMITED_API -#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) -#else -#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) -#endif -static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { -#if !CYTHON_COMPILING_IN_LIMITED_API - PyCFunctionObject *cf = (PyCFunctionObject*) op; -#endif - if (unlikely(op == NULL)) - return NULL; -#if CYTHON_COMPILING_IN_LIMITED_API - op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); - if (unlikely(!op->func)) return NULL; -#endif - op->flags = flags; - __Pyx_CyFunction_weakreflist(op) = NULL; -#if !CYTHON_COMPILING_IN_LIMITED_API - cf->m_ml = ml; - cf->m_self = (PyObject *) op; -#endif - Py_XINCREF(closure); - op->func_closure = closure; -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_XINCREF(module); - cf->m_module = module; -#endif - op->func_dict = NULL; - op->func_name = NULL; - Py_INCREF(qualname); - op->func_qualname = qualname; - op->func_doc = NULL; -#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API - op->func_classobj = NULL; -#else - ((PyCMethodObject*)op)->mm_class = NULL; -#endif - op->func_globals = globals; - Py_INCREF(op->func_globals); - Py_XINCREF(code); - op->func_code = code; - op->defaults = NULL; - op->defaults_tuple = NULL; - op->defaults_kwdict = NULL; - op->defaults_getter = NULL; - op->func_annotations = NULL; - op->func_is_coroutine = NULL; -#if CYTHON_METH_FASTCALL - switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { - case METH_NOARGS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; - break; - case METH_O: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; - break; - case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; - break; - case METH_FASTCALL | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; - break; - case METH_VARARGS | METH_KEYWORDS: - __Pyx_CyFunction_func_vectorcall(op) = NULL; - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - Py_DECREF(op); - return NULL; - } -#endif - return (PyObject *) op; -} -static int -__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) -{ - Py_CLEAR(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_CLEAR(m->func); -#else - Py_CLEAR(((PyCFunctionObject*)m)->m_module); -#endif - Py_CLEAR(m->func_dict); - Py_CLEAR(m->func_name); - Py_CLEAR(m->func_qualname); - Py_CLEAR(m->func_doc); - Py_CLEAR(m->func_globals); - Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 - Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); -#else - { - PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; - ((PyCMethodObject *) (m))->mm_class = NULL; - Py_XDECREF(cls); - } -#endif -#endif - Py_CLEAR(m->defaults_tuple); - Py_CLEAR(m->defaults_kwdict); - Py_CLEAR(m->func_annotations); - Py_CLEAR(m->func_is_coroutine); - Py_CLEAR(m->defaults); - return 0; -} -static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - if (__Pyx_CyFunction_weakreflist(m) != NULL) - PyObject_ClearWeakRefs((PyObject *) m); - __Pyx_CyFunction_clear(m); - __Pyx_PyHeapTypeObject_GC_Del(m); -} -static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) -{ - PyObject_GC_UnTrack(m); - __Pyx__CyFunction_dealloc(m); -} -static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) -{ - { - int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); - if (e) return e; - } - Py_VISIT(m->func_closure); -#if CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(m->func); -#else - Py_VISIT(((PyCFunctionObject*)m)->m_module); -#endif - Py_VISIT(m->func_dict); - __Pyx_VISIT_CONST(m->func_name); - __Pyx_VISIT_CONST(m->func_qualname); - Py_VISIT(m->func_doc); - Py_VISIT(m->func_globals); - __Pyx_VISIT_CONST(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API - Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif - Py_VISIT(m->defaults_tuple); - Py_VISIT(m->defaults_kwdict); - Py_VISIT(m->func_is_coroutine); - Py_VISIT(m->defaults); - return 0; -} -static PyObject* -__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) -{ - PyObject *repr; - __Pyx_BEGIN_CRITICAL_SECTION(op); - repr = PyUnicode_FromFormat("", - op->func_qualname, (void *)op); - __Pyx_END_CRITICAL_SECTION(); - return repr; -} -static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { -#if CYTHON_COMPILING_IN_LIMITED_API - PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyCFunction meth; - int flags; - meth = PyCFunction_GetFunction(f); - if (unlikely(!meth)) return NULL; - flags = PyCFunction_GetFlags(f); - if (unlikely(flags < 0)) return NULL; -#else - PyCFunctionObject* f = (PyCFunctionObject*)func; - PyCFunction meth = f->m_ml->ml_meth; - int flags = f->m_ml->ml_flags; -#endif - Py_ssize_t size; - switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { - case METH_VARARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) - return (*meth)(self, arg); - break; - case METH_VARARGS | METH_KEYWORDS: - return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw); - case METH_NOARGS: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 0)) - return (*meth)(self, NULL); - __Pyx_CyFunction_raise_argument_count_error( - (__pyx_CyFunctionObject*)func, - "takes no arguments", size); - return NULL; - } - break; - case METH_O: - if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(arg); -#else - size = PyTuple_Size(arg); - if (unlikely(size < 0)) return NULL; -#endif - if (likely(size == 1)) { - PyObject *result, *arg0; - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - arg0 = PyTuple_GET_ITEM(arg, 0); - #else - arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; - #endif - result = (*meth)(self, arg0); - #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(arg0); - #endif - return result; - } - __Pyx_CyFunction_raise_argument_count_error( - (__pyx_CyFunctionObject*)func, - "takes exactly one argument", size); - return NULL; - } - break; - default: - PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); - return NULL; - } - __Pyx_CyFunction_raise_type_error( - (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); - return NULL; -} -static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *self, *result; -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)func)->m_self; -#endif - result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); - return result; -} -static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { - PyObject *result; - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) - __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); - if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE - return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); -#else - (void) &__Pyx_PyVectorcall_FastCallDict; - return PyVectorcall_Call(func, args, kw); -#endif - } -#endif - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - Py_ssize_t argc; - PyObject *new_args; - PyObject *self; -#if CYTHON_ASSUME_SAFE_SIZE - argc = PyTuple_GET_SIZE(args); -#else - argc = PyTuple_Size(args); - if (unlikely(argc < 0)) return NULL; -#endif - new_args = PyTuple_GetSlice(args, 1, argc); - if (unlikely(!new_args)) - return NULL; - self = PyTuple_GetItem(args, 0); - if (unlikely(!self)) { - Py_DECREF(new_args); - PyErr_Format(PyExc_TypeError, - "unbound method %.200S() needs an argument", - cyfunc->func_qualname); - return NULL; - } - result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); - Py_DECREF(new_args); - } else { - result = __Pyx_CyFunction_Call(func, args, kw); - } - return result; -} -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) -static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) -{ - int ret = 0; - if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { - if (unlikely(nargs < 1)) { - __Pyx_CyFunction_raise_type_error( - cyfunc, "needs an argument"); - return -1; - } - ret = 1; - } - if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { - __Pyx_CyFunction_raise_type_error( - cyfunc, "takes no keyword arguments"); - return -1; - } - return ret; -} -static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; -#if CYTHON_COMPILING_IN_LIMITED_API - PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); - if (unlikely(!meth)) return NULL; -#else - PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; -#endif - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)cyfunc)->m_self; -#endif - break; - default: - return NULL; - } - if (unlikely(nargs != 0)) { - __Pyx_CyFunction_raise_argument_count_error( - cyfunc, "takes no arguments", nargs); - return NULL; - } - return meth(self, NULL); -} -static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; -#if CYTHON_COMPILING_IN_LIMITED_API - PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); - if (unlikely(!meth)) return NULL; -#else - PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; -#endif - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)cyfunc)->m_self; -#endif - break; - default: - return NULL; - } - if (unlikely(nargs != 1)) { - __Pyx_CyFunction_raise_argument_count_error( - cyfunc, "takes exactly one argument", nargs); - return NULL; - } - return meth(self, args[0]); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; -#if CYTHON_COMPILING_IN_LIMITED_API - PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); - if (unlikely(!meth)) return NULL; -#else - PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; -#endif - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)cyfunc)->m_self; -#endif - break; - default: - return NULL; - } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); -} -static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) -{ - __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else - Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif - PyObject *self; -#if CYTHON_COMPILING_IN_LIMITED_API - PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); - if (unlikely(!meth)) return NULL; -#else - PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; -#endif - switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { - case 1: - self = args[0]; - args += 1; - nargs -= 1; - break; - case 0: -#if CYTHON_COMPILING_IN_LIMITED_API - self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); - if (unlikely(!self) && PyErr_Occurred()) return NULL; -#else - self = ((PyCFunctionObject*)cyfunc)->m_self; -#endif - break; - default: - return NULL; - } - return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); -} -#endif -static PyType_Slot __pyx_CyFunctionType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, - {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, - {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, - {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, - {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, - {Py_tp_methods, (void *)__pyx_CyFunction_methods}, - {Py_tp_members, (void *)__pyx_CyFunction_members}, - {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, - {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, - {0, 0}, -}; -static PyType_Spec __pyx_CyFunctionType_spec = { - __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", - sizeof(__pyx_CyFunctionObject), - 0, -#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR - Py_TPFLAGS_METHOD_DESCRIPTOR | -#endif -#if CYTHON_METH_FASTCALL -#if defined(Py_TPFLAGS_HAVE_VECTORCALL) - Py_TPFLAGS_HAVE_VECTORCALL | -#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) - _Py_TPFLAGS_HAVE_VECTORCALL | -#endif -#endif // CYTHON_METH_FASTCALL -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, - __pyx_CyFunctionType_slots -}; -static int __pyx_CyFunction_init(PyObject *module) { - __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec( - mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL); - if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { - return -1; - } - return 0; -} -static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); - if (unlikely(!m->defaults)) - return NULL; - return m->defaults; -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_tuple = tuple; - Py_INCREF(tuple); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults_kwdict = dict; - Py_INCREF(dict); -} -static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { - __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->func_annotations = dict; - Py_INCREF(dict); -} - -/* CythonFunction */ -static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, - PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { - PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), - ml, flags, qualname, closure, module, globals, code - ); - if (likely(op)) { - PyObject_GC_Track(op); - } - return op; -} - -/* CLineInTraceback */ -#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME -static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; - PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif - CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { - return c_line; - } - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); - if (likely(cython_runtime_dict)) { - __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); - __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) - Py_XINCREF(use_cline); - __Pyx_END_CRITICAL_SECTION(); - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_INCREF(use_cline); - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { - c_line = 0; - } - Py_XDECREF(use_cline); - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - return c_line; -} -#endif - -/* CodeObjectCache */ -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { - __Pyx_CachedCodeObjectType* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!code_cache->entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); - if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { - return NULL; - } - code_object = code_cache->entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS - (void)__pyx__find_code_object; - return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. -#else - struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); - if (old_count < 0) { - __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); - return NULL; - } -#endif - __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); -#endif - return result; -#endif -} -static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) -{ - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - code_cache->entries = entries; - code_cache->max_count = 64; - code_cache->count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); - if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { - __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_INCREF(code_object); - Py_DECREF(tmp); - return; - } - if (code_cache->count == code_cache->max_count) { - int new_max = code_cache->max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - code_cache->entries = entries; - code_cache->max_count = new_max; - } - for (i=code_cache->count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - code_cache->count++; - Py_INCREF(code_object); -} -static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS - (void)__pyx__insert_code_object; - return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. -#else - struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - __pyx_nonatomic_int_type expected = 0; - if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { - return; - } -#endif - __pyx__insert_code_object(code_cache, code_line, code_object); -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); -#endif -#endif -} - -/* AddTraceback */ -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, - PyObject *firstlineno, PyObject *name) { - PyObject *replace = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; - replace = PyObject_GetAttrString(code, "replace"); - if (likely(replace)) { - PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); - Py_DECREF(replace); - return result; - } - PyErr_Clear(); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; - PyObject *replace = NULL, *getframe = NULL, *frame = NULL; - PyObject *exc_type, *exc_value, *exc_traceback; - int success = 0; - if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); - } - PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!code_object) { - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); - } - if (unlikely(!code_object)) goto bad; - __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); - } else { - dict = PyDict_New(); - } - getframe = PySys_GetObject("_getframe"); - if (unlikely(!getframe)) goto bad; - if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; - frame = PyEval_EvalCode(code_object, dict, dict); - if (unlikely(!frame) || frame == Py_None) goto bad; - success = 1; - bad: - PyErr_Restore(exc_type, exc_value, exc_traceback); - Py_XDECREF(code_object); - Py_XDECREF(py_py_line); - Py_XDECREF(py_funcname); - Py_XDECREF(dict); - Py_XDECREF(replace); - if (success) { - PyTraceBack_Here( - (struct _frame*)frame); - } - Py_XDECREF(frame); -} -#else -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = NULL; - PyObject *py_funcname = NULL; - if (c_line) { - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - funcname = PyUnicode_AsUTF8(py_funcname); - if (!funcname) goto bad; - } - py_code = PyCode_NewEmpty(filename, funcname, py_line); - Py_XDECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject *ptype, *pvalue, *ptraceback; - if (c_line) { - c_line = __Pyx_CLineForTraceback(tstate, c_line); - } - py_code = __pyx_find_code_object(c_line ? -c_line : py_line); - if (!py_code) { - __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) { - /* If the code object creation fails, then we should clear the - fetched exception references and propagate the new exception */ - Py_XDECREF(ptype); - Py_XDECREF(pvalue); - Py_XDECREF(ptraceback); - goto bad; - } - __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); - __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); - } - py_frame = PyFrame_New( - tstate, /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - __Pyx_PyFrame_SetLineNumber(py_frame, py_line); - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} -#endif - -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { -#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(!PyLong_Check(x))) { - int val; - PyObject *tmp = __Pyx_PyNumber_Long(x); - if (!tmp) return (int) -1; - val = __Pyx_PyLong_As_int(tmp); - Py_DECREF(tmp); - return val; - } - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(int) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(int) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - int val; - int ret = -1; -#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API - Py_ssize_t bytes_copied = PyLong_AsNativeBytes( - x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); - if (unlikely(bytes_copied == -1)) { - } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { - goto raise_overflow; - } else { - ret = 0; - } -#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)x, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *v; - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (likely(PyLong_CheckExact(x))) { - v = __Pyx_NewRef(x); - } else { - v = PyNumber_Long(x); - if (unlikely(!v)) return (int) -1; - assert(PyLong_CheckExact(v)); - } - { - int result = PyObject_RichCompareBool(v, Py_False, Py_LT); - if (unlikely(result < 0)) { - Py_DECREF(v); - return (int) -1; - } - is_negative = result == 1; - } - if (is_unsigned && unlikely(is_negative)) { - Py_DECREF(v); - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - Py_DECREF(v); - if (unlikely(!stepval)) - return (int) -1; - } else { - stepval = v; - } - v = NULL; - val = (int) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - long idigit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - val |= ((int) idigit) << bits; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - } - Py_DECREF(shift); shift = NULL; - Py_DECREF(mask); mask = NULL; - { - long idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((int) idigit) << bits; - } - if (!is_unsigned) { - if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - if (unlikely(ret)) - return (int) -1; - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) { -#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 (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyLong_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 - if (is_unsigned) { - return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); - } else { - return PyLong_FromNativeBytes(bytes, sizeof(value), -1); - } -#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 - int one = 1; int little = (int)*(unsigned char *)&one; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); -#else - int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL, *kwds = NULL; - PyObject *py_bytes = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - { - PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; - if (!is_unsigned) { - kwds = __Pyx_MakeVectorcallBuilderKwds(1); - if (!kwds) goto limited_bad; - if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; - } - result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); - } - limited_bad: - Py_XDECREF(kwds); - Py_XDECREF(order_str); - Py_XDECREF(py_bytes); - Py_XDECREF(from_bytes); - return result; -#endif - } -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyLong_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - unsigned char *bytes = (unsigned char *)&value; -#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 - if (is_unsigned) { - return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); - } else { - return PyLong_FromNativeBytes(bytes, sizeof(value), -1); - } -#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 - int one = 1; int little = (int)*(unsigned char *)&one; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); -#else - int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL, *kwds = NULL; - PyObject *py_bytes = NULL, *order_str = NULL; - from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); - if (!from_bytes) return NULL; - py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); - if (!py_bytes) goto limited_bad; - order_str = PyUnicode_FromString(little ? "little" : "big"); - if (!order_str) goto limited_bad; - { - PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; - if (!is_unsigned) { - kwds = __Pyx_MakeVectorcallBuilderKwds(1); - if (!kwds) goto limited_bad; - if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; - } - result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); - } - limited_bad: - Py_XDECREF(kwds); - Py_XDECREF(order_str); - Py_XDECREF(py_bytes); - Py_XDECREF(from_bytes); - return result; -#endif - } -} - -/* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 -static __Pyx_TypeName -__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) -{ - PyObject *module = NULL, *name = NULL, *result = NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 - name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_mstate_global->__pyx_n_u_qualname); - #else - name = PyType_GetQualName(tp); - #endif - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; - module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_mstate_global->__pyx_n_u_module); - if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; - if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { - result = name; - name = NULL; - goto done; - } - result = PyUnicode_FromFormat("%U.%U", module, name); - if (unlikely(result == NULL)) goto bad; - done: - Py_XDECREF(name); - Py_XDECREF(module); - return result; - bad: - PyErr_Clear(); - if (name) { - result = name; - name = NULL; - } else { - result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__3); - } - goto done; -} -#endif - -/* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - const long neg_one = (long) -1, const_zero = (long) 0; -#ifdef __Pyx_HAS_GCC_DIAGNOSTIC -#pragma GCC diagnostic pop -#endif - const int is_unsigned = neg_one > const_zero; - if (unlikely(!PyLong_Check(x))) { - long val; - PyObject *tmp = __Pyx_PyNumber_Long(x); - if (!tmp) return (long) -1; - val = __Pyx_PyLong_As_long(tmp); - Py_DECREF(tmp); - return val; - } - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - if (unlikely(__Pyx_PyLong_IsNeg(x))) { - goto raise_neg_overflow; - } else if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_DigitCount(x)) { - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if ((sizeof(long) <= sizeof(unsigned long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - if (__Pyx_PyLong_IsCompact(x)) { - __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) - } else { - const digit* digits = __Pyx_PyLong_Digits(x); - assert(__Pyx_PyLong_DigitCount(x) > 1); - switch (__Pyx_PyLong_SignedDigitCount(x)) { - case -2: - if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { - if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } - } -#endif - if ((sizeof(long) <= sizeof(long))) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { - long val; - int ret = -1; -#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API - Py_ssize_t bytes_copied = PyLong_AsNativeBytes( - x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); - if (unlikely(bytes_copied == -1)) { - } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { - goto raise_overflow; - } else { - ret = 0; - } -#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - ret = _PyLong_AsByteArray((PyLongObject *)x, - bytes, sizeof(val), - is_little, !is_unsigned); -#else - PyObject *v; - PyObject *stepval = NULL, *mask = NULL, *shift = NULL; - int bits, remaining_bits, is_negative = 0; - int chunk_size = (sizeof(long) < 8) ? 30 : 62; - if (likely(PyLong_CheckExact(x))) { - v = __Pyx_NewRef(x); - } else { - v = PyNumber_Long(x); - if (unlikely(!v)) return (long) -1; - assert(PyLong_CheckExact(v)); - } - { - int result = PyObject_RichCompareBool(v, Py_False, Py_LT); - if (unlikely(result < 0)) { - Py_DECREF(v); - return (long) -1; - } - is_negative = result == 1; - } - if (is_unsigned && unlikely(is_negative)) { - Py_DECREF(v); - goto raise_neg_overflow; - } else if (is_negative) { - stepval = PyNumber_Invert(v); - Py_DECREF(v); - if (unlikely(!stepval)) - return (long) -1; - } else { - stepval = v; - } - v = NULL; - val = (long) 0; - mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; - shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; - for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { - PyObject *tmp, *digit; - long idigit; - digit = PyNumber_And(stepval, mask); - if (unlikely(!digit)) goto done; - idigit = PyLong_AsLong(digit); - Py_DECREF(digit); - if (unlikely(idigit < 0)) goto done; - val |= ((long) idigit) << bits; - tmp = PyNumber_Rshift(stepval, shift); - if (unlikely(!tmp)) goto done; - Py_DECREF(stepval); stepval = tmp; - } - Py_DECREF(shift); shift = NULL; - Py_DECREF(mask); mask = NULL; - { - long idigit = PyLong_AsLong(stepval); - if (unlikely(idigit < 0)) goto done; - remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); - if (unlikely(idigit >= (1L << remaining_bits))) - goto raise_overflow; - val |= ((long) idigit) << bits; - } - if (!is_unsigned) { - if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) - goto raise_overflow; - if (is_negative) - val = ~val; - } - ret = 0; - done: - Py_XDECREF(shift); - Py_XDECREF(mask); - Py_XDECREF(stepval); -#endif - if (unlikely(ret)) - return (long) -1; - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* FastTypeChecks */ -#if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); - for (i=0; i__Pyx_GetBuiltinNext_LimitedAPI_cache)) - __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); - return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; -} -#endif -static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 - PyObject *result; - PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); - if (unlikely(!next)) return NULL; - result = PyObject_CallFunctionObjArgs(next, iterator, NULL); - return result; -#else - (void)__Pyx_GetBuiltinName; // only for early limited API - iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); - assert(iternext); - return iternext(iterator); -#endif -} - -/* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) -static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { - PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); - Py_DECREF(method); - return result; -} -#endif -static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { -#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 - PyObject *args[2] = {obj, arg}; - (void) __Pyx_PyObject_GetMethod; - (void) __Pyx_PyObject_CallOneArg; - (void) __Pyx_PyObject_Call2Args; - return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); -#else - PyObject *method = NULL, *result; - int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); - if (likely(is_method)) { - result = __Pyx_PyObject_Call2Args(method, obj, arg); - Py_DECREF(method); - return result; - } - if (unlikely(!method)) return NULL; - return __Pyx__PyObject_CallMethod1(method, arg); -#endif -} - -/* ReturnWithStopIteration */ -static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); -static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { - if (value == Py_None) { - if (async || !iternext) - PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); - return; - } - __Pyx__ReturnWithStopIteration(value, async); -} -static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { -#if CYTHON_COMPILING_IN_CPYTHON - __Pyx_PyThreadState_declare -#endif - PyObject *exc; - PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; -#if CYTHON_COMPILING_IN_CPYTHON - if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { - if (PY_VERSION_HEX >= (0x030e00A1)) { - exc = __Pyx_PyObject_CallOneArg(exc_type, value); - } else { - PyObject *args_tuple = PyTuple_New(1); - if (unlikely(!args_tuple)) return; - Py_INCREF(value); - PyTuple_SET_ITEM(args_tuple, 0, value); - exc = PyObject_Call(exc_type, args_tuple, NULL); - Py_DECREF(args_tuple); - } - if (unlikely(!exc)) return; - } else { - Py_INCREF(value); - exc = value; - } - #if CYTHON_FAST_THREAD_STATE - __Pyx_PyThreadState_assign - #if CYTHON_USE_EXC_INFO_STACK - if (!__pyx_tstate->exc_info->exc_value) - #else - if (!__pyx_tstate->exc_type) - #endif - { - Py_INCREF(exc_type); - __Pyx_ErrRestore(exc_type, exc, NULL); - return; - } - #endif -#else - exc = __Pyx_PyObject_CallOneArg(exc_type, value); - if (unlikely(!exc)) return; -#endif - PyErr_SetObject(exc_type, exc); - Py_DECREF(exc); -} - -/* CoroutineBase */ -#if !CYTHON_COMPILING_IN_LIMITED_API -#include -#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif -#endif // CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void -__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { -#if CYTHON_USE_AM_SEND - gen->yieldfrom_am_send = NULL; -#endif - Py_CLEAR(gen->yieldfrom); -} -static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { - PyObject *et, *ev, *tb; - PyObject *value = NULL; - CYTHON_UNUSED_VAR(__pyx_tstate); - __Pyx_ErrFetch(&et, &ev, &tb); - if (!et) { - Py_XDECREF(tb); - Py_XDECREF(ev); - Py_INCREF(Py_None); - *pvalue = Py_None; - return 0; - } - if (likely(et == PyExc_StopIteration)) { - if (!ev) { - Py_INCREF(Py_None); - value = Py_None; - } - else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { - #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL - value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); - if (unlikely(!value)) goto limited_api_failure; - #else - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); - #endif - Py_DECREF(ev); - } - else if (unlikely(PyTuple_Check(ev))) { - Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely(tuple_size < 0)) { - Py_XDECREF(tb); - Py_DECREF(ev); - Py_DECREF(et); - return -1; - } - #endif - if (tuple_size >= 1) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - value = PyTuple_GET_ITEM(ev, 0); - Py_INCREF(value); -#elif CYTHON_ASSUME_SAFE_MACROS - value = PySequence_ITEM(ev, 0); -#else - value = PySequence_GetItem(ev, 0); - if (!value) goto limited_api_failure; -#endif - } else { - Py_INCREF(Py_None); - value = Py_None; - } - Py_DECREF(ev); - } - else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { - value = ev; - } - if (likely(value)) { - Py_XDECREF(tb); - Py_DECREF(et); - *pvalue = value; - return 0; - } - } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - PyErr_NormalizeException(&et, &ev, &tb); - if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { - __Pyx_ErrRestore(et, ev, tb); - return -1; - } - Py_XDECREF(tb); - Py_DECREF(et); -#if CYTHON_COMPILING_IN_LIMITED_API - value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); -#else - value = ((PyStopIterationObject *)ev)->value; - Py_INCREF(value); -#endif - Py_DECREF(ev); -#if CYTHON_COMPILING_IN_LIMITED_API - if (unlikely(!value)) return -1; -#endif - *pvalue = value; - return 0; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS - limited_api_failure: - Py_XDECREF(et); - Py_XDECREF(tb); - Py_XDECREF(ev); - return -1; -#endif -} -static CYTHON_INLINE -__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { - if (*retval) { - return PYGEN_NEXT; - } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { - return PYGEN_RETURN; - } else { - return PYGEN_ERROR; - } -} -static CYTHON_INLINE -void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { -#if PY_VERSION_HEX >= 0x030B00a4 - Py_CLEAR(exc_state->exc_value); -#else - PyObject *t, *v, *tb; - t = exc_state->exc_type; - v = exc_state->exc_value; - tb = exc_state->exc_traceback; - exc_state->exc_type = NULL; - exc_state->exc_value = NULL; - exc_state->exc_traceback = NULL; - Py_XDECREF(t); - Py_XDECREF(v); - Py_XDECREF(tb); -#endif -} -#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { - msg = "coroutine already executing"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { - msg = "async generator already executing"; - #endif - } else { - msg = "generator already executing"; - } - PyErr_SetString(PyExc_ValueError, msg); -} -static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { - CYTHON_MAYBE_UNUSED_VAR(gen); - CYTHON_MAYBE_UNUSED_VAR(closing); - #ifdef __Pyx_Coroutine_USED - if (!closing && __Pyx_Coroutine_Check(gen)) { - PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); - } else - #endif - if (value) { - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(PyExc_StopAsyncIteration); - else - #endif - PyErr_SetNone(PyExc_StopIteration); - } -} -static -__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { - __Pyx_PyThreadState_declare - PyThreadState *tstate; - __Pyx_ExcInfoStruct *exc_state; - PyObject *retval; - assert(__Pyx_Coroutine_get_is_running(self)); // Callers should ensure is_running - if (unlikely(self->resume_label == -1)) { - __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); - return PYGEN_ERROR; - } -#if CYTHON_FAST_THREAD_STATE - __Pyx_PyThreadState_assign - tstate = __pyx_tstate; -#else - tstate = __Pyx_PyThreadState_Current; -#endif - exc_state = &self->gi_exc_state; - if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - #else - PyObject *exc_tb; - #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON - exc_tb = PyException_GetTraceback(exc_state->exc_value); - #elif PY_VERSION_HEX >= 0x030B00a4 - exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; - #else - exc_tb = exc_state->exc_traceback; - #endif - if (exc_tb) { - PyTracebackObject *tb = (PyTracebackObject *) exc_tb; - PyFrameObject *f = tb->tb_frame; - assert(f->f_back == NULL); - #if PY_VERSION_HEX >= 0x030B00A1 - f->f_back = PyThreadState_GetFrame(tstate); - #else - Py_XINCREF(tstate->frame); - f->f_back = tstate->frame; - #endif - #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON - Py_DECREF(exc_tb); - #endif - } - #endif - } -#if CYTHON_USE_EXC_INFO_STACK - exc_state->previous_item = tstate->exc_info; - tstate->exc_info = exc_state; -#else - if (exc_state->exc_type) { - __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); - } else { - __Pyx_Coroutine_ExceptionClear(exc_state); - __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); - } -#endif - retval = self->body(self, tstate, value); -#if CYTHON_USE_EXC_INFO_STACK - exc_state = &self->gi_exc_state; - tstate->exc_info = exc_state->previous_item; - exc_state->previous_item = NULL; - __Pyx_Coroutine_ResetFrameBackpointer(exc_state); -#endif - *result = retval; - if (self->resume_label == -1) { - return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; - } - return PYGEN_NEXT; -} -static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API - CYTHON_UNUSED_VAR(exc_state); -#else - PyObject *exc_tb; - #if PY_VERSION_HEX >= 0x030B00a4 - if (!exc_state->exc_value) return; - exc_tb = PyException_GetTraceback(exc_state->exc_value); - #else - exc_tb = exc_state->exc_traceback; - #endif - if (likely(exc_tb)) { - PyTracebackObject *tb = (PyTracebackObject *) exc_tb; - PyFrameObject *f = tb->tb_frame; - Py_CLEAR(f->f_back); - #if PY_VERSION_HEX >= 0x030B00a4 - Py_DECREF(exc_tb); - #endif - } -#endif -} -#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\ - ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext)) -static PyObject * -__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) { - CYTHON_MAYBE_UNUSED_VAR(gen); - if (likely(result == PYGEN_RETURN)) { - int is_async = 0; - #ifdef __Pyx_AsyncGen_USED - is_async = __Pyx_AsyncGen_CheckExact(gen); - #endif - __Pyx_ReturnWithStopIteration(retval, is_async, iternext); - Py_XDECREF(retval); - } - return NULL; -} -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE -PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { -#if PY_VERSION_HEX <= 0x030A00A1 - return _PyGen_Send(gen, arg); -#else - PyObject *result; - if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { - if (PyAsyncGen_CheckExact(gen)) { - assert(result == Py_None); - PyErr_SetNone(PyExc_StopAsyncIteration); - } - else if (result == Py_None) { - PyErr_SetNone(PyExc_StopIteration); - } - else { -#if PY_VERSION_HEX < 0x030d00A1 - _PyGen_SetStopIterationValue(result); -#else - if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { - PyErr_SetObject(PyExc_StopIteration, result); - } else { - PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); - if (likely(exc != NULL)) { - PyErr_SetObject(PyExc_StopIteration, exc); - Py_DECREF(exc); - } - } -#endif - } - Py_DECREF(result); - result = NULL; - } - return result; -#endif -} -#endif -static CYTHON_INLINE __Pyx_PySendResult -__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { - __Pyx_PySendResult result; - PyObject *val = NULL; - assert(__Pyx_Coroutine_get_is_running(gen)); - __Pyx_Coroutine_Undelegate(gen); - __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); - Py_XDECREF(val); - return result; -} -#if CYTHON_USE_AM_SEND -static __Pyx_PySendResult -__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { - PyObject *ret = NULL; - __Pyx_PySendResult delegate_result, result; - assert(__Pyx_Coroutine_get_is_running(gen)); - delegate_result = gen_am_send(gen->yieldfrom, value, &ret); - if (delegate_result == PYGEN_NEXT) { - assert (ret != NULL); - *retval = ret; - return PYGEN_NEXT; - } - assert (delegate_result != PYGEN_ERROR || ret == NULL); - __Pyx_Coroutine_Undelegate(gen); - result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0); - Py_XDECREF(ret); - return result; -} -#endif -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval = NULL; - __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); - return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); -} -static __Pyx_PySendResult -__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { - __Pyx_PySendResult result; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { - *retval = __Pyx_Coroutine_AlreadyRunningError(gen); - return PYGEN_ERROR; - } - #if CYTHON_USE_AM_SEND - if (gen->yieldfrom_am_send) { - result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); - } else - #endif - if (gen->yieldfrom) { - PyObject *yf = gen->yieldfrom; - PyObject *ret; - #if !CYTHON_USE_AM_SEND - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { - ret = __Pyx_Coroutine_Send(yf, value); - } else - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_PyAsyncGenASend_CheckExact(yf)) { - ret = __Pyx_async_gen_asend_send(yf, value); - } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); - } else - if (PyCoro_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); - } else - #endif - #endif - { - #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 - if (value == Py_None && PyIter_Check(yf)) - ret = __Pyx_PyIter_Next_Plain(yf); - else - #endif - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); - } - if (likely(ret)) { - __Pyx_Coroutine_unset_is_running(gen); - *retval = ret; - return PYGEN_NEXT; - } - result = __Pyx_Coroutine_FinishDelegation(gen, retval); - } else { - result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); - } - __Pyx_Coroutine_unset_is_running(gen); - return result; -} -static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { - __Pyx_PySendResult result; - PyObject *retval = NULL; - CYTHON_UNUSED_VAR(gen); - assert(__Pyx_Coroutine_get_is_running(gen)); - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - result = __Pyx_Coroutine_Close(yf, &retval); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { - result = __Pyx_Coroutine_Close(yf, &retval); - } else - if (__Pyx_CoroutineAwait_CheckExact(yf)) { - result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); - } else - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_PyAsyncGenASend_CheckExact(yf)) { - retval = __Pyx_async_gen_asend_close(yf, NULL); - result = PYGEN_RETURN; - } else - if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { - retval = __Pyx_async_gen_athrow_close(yf, NULL); - result = PYGEN_RETURN; - } else - #endif - { - PyObject *meth; - result = PYGEN_RETURN; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); - if (unlikely(!meth)) { - if (unlikely(PyErr_Occurred())) { - PyErr_WriteUnraisable(yf); - } - } else { - retval = __Pyx_PyObject_CallNoArg(meth); - Py_DECREF(meth); - if (unlikely(!retval)) { - result = PYGEN_ERROR; - } - } - } - Py_XDECREF(retval); - return result == PYGEN_ERROR ? -1 : 0; -} -static PyObject *__Pyx_Generator_Next(PyObject *self) { - __Pyx_PySendResult result; - PyObject *retval = NULL; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { - return __Pyx_Coroutine_AlreadyRunningError(gen); - } - #if CYTHON_USE_AM_SEND - if (gen->yieldfrom_am_send) { - result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); - } else - #endif - if (gen->yieldfrom) { - PyObject *yf = gen->yieldfrom; - PyObject *ret; - #ifdef __Pyx_Generator_USED - if (__Pyx_Generator_CheckExact(yf)) { - ret = __Pyx_Generator_Next(yf); - } else - #endif - #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_CheckExact(yf)) { - ret = __Pyx_Coroutine_Send(yf, Py_None); - } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif - ret = __Pyx_PyIter_Next_Plain(yf); - if (likely(ret)) { - __Pyx_Coroutine_unset_is_running(gen); - return ret; - } - result = __Pyx_Coroutine_FinishDelegation(gen, &retval); - } else { - result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); - } - __Pyx_Coroutine_unset_is_running(gen); - return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1); -} -static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { - PyObject *retval = NULL; - __Pyx_PySendResult result; - CYTHON_UNUSED_VAR(arg); - result = __Pyx_Coroutine_Close(self, &retval); - if (unlikely(result == PYGEN_ERROR)) - return NULL; - Py_XDECREF(retval); - Py_RETURN_NONE; -} -static __Pyx_PySendResult -__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - __Pyx_PySendResult result; - PyObject *yf; - int err = 0; - if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { - *retval = __Pyx_Coroutine_AlreadyRunningError(gen); - return PYGEN_ERROR; - } - yf = gen->yieldfrom; - if (yf) { - Py_INCREF(yf); - err = __Pyx_Coroutine_CloseIter(gen, yf); - __Pyx_Coroutine_Undelegate(gen); - Py_DECREF(yf); - } - if (err == 0) - PyErr_SetNone(PyExc_GeneratorExit); - result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); - if (result == PYGEN_ERROR) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_Coroutine_unset_is_running(gen); - if (!__Pyx_PyErr_Occurred()) { - return PYGEN_RETURN; - } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { - __Pyx_PyErr_Clear(); - return PYGEN_RETURN; - } - return PYGEN_ERROR; - } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { - __Pyx_Coroutine_unset_is_running(gen); - return PYGEN_RETURN; - } else { - const char *msg; - Py_DECREF(*retval); - *retval = NULL; - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(self)) { - msg = "coroutine ignored GeneratorExit"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(self)) { - msg = "async generator ignored GeneratorExit"; - #endif - } else { - msg = "generator ignored GeneratorExit"; - } - PyErr_SetString(PyExc_RuntimeError, msg); - __Pyx_Coroutine_unset_is_running(gen); - return PYGEN_ERROR; - } -} -static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, - PyObject *args, int close_on_genexit) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *yf; - if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) - return __Pyx_Coroutine_AlreadyRunningError(gen); - yf = gen->yieldfrom; - if (yf) { - __Pyx_PySendResult result; - PyObject *ret; - Py_INCREF(yf); - if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { - int err = __Pyx_Coroutine_CloseIter(gen, yf); - Py_DECREF(yf); - __Pyx_Coroutine_Undelegate(gen); - if (err < 0) - goto propagate_exception; - goto throw_here; - } - if (0 - #ifdef __Pyx_Generator_USED - || __Pyx_Generator_CheckExact(yf) - #endif - #ifdef __Pyx_Coroutine_USED - || __Pyx_Coroutine_Check(yf) - #endif - ) { - ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); - #endif - } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); - if (unlikely(!meth)) { - Py_DECREF(yf); - if (unlikely(PyErr_Occurred())) { - __Pyx_Coroutine_unset_is_running(gen); - return NULL; - } - __Pyx_Coroutine_Undelegate(gen); - goto throw_here; - } - if (likely(args)) { - ret = __Pyx_PyObject_Call(meth, args, NULL); - } else { - PyObject *cargs[4] = {NULL, typ, val, tb}; - ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); - } - Py_DECREF(meth); - } - Py_DECREF(yf); - if (ret) { - __Pyx_Coroutine_unset_is_running(gen); - return ret; - } - result = __Pyx_Coroutine_FinishDelegation(gen, &ret); - __Pyx_Coroutine_unset_is_running(gen); - return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0); - } -throw_here: - __Pyx_Raise(typ, val, tb, NULL); -propagate_exception: - { - PyObject *retval = NULL; - __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); - __Pyx_Coroutine_unset_is_running(gen); - return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0); - } -} -static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { - PyObject *typ; - PyObject *val = NULL; - PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) - return NULL; - return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); -} -static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { -#if PY_VERSION_HEX >= 0x030B00a4 - Py_VISIT(exc_state->exc_value); -#else - Py_VISIT(exc_state->exc_type); - Py_VISIT(exc_state->exc_value); - Py_VISIT(exc_state->exc_traceback); -#endif - return 0; -} -static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { - { - int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); - if (e) return e; - } - Py_VISIT(gen->closure); - Py_VISIT(gen->classobj); - Py_VISIT(gen->yieldfrom); - return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); -} -static int __Pyx_Coroutine_clear(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - Py_CLEAR(gen->closure); - Py_CLEAR(gen->classobj); - __Pyx_Coroutine_Undelegate(gen); - __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); -#ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(self)) { - Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); - } -#endif - Py_CLEAR(gen->gi_code); - Py_CLEAR(gen->gi_frame); - Py_CLEAR(gen->gi_name); - Py_CLEAR(gen->gi_qualname); - Py_CLEAR(gen->gi_modulename); - return 0; -} -static void __Pyx_Coroutine_dealloc(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject_GC_UnTrack(gen); - if (gen->gi_weakreflist != NULL) - PyObject_ClearWeakRefs(self); - if (gen->resume_label >= 0) { - PyObject_GC_Track(self); -#if CYTHON_USE_TP_FINALIZE - if (unlikely(PyObject_CallFinalizerFromDealloc(self))) -#else - { - destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); - if (del) del(self); - } - if (unlikely(Py_REFCNT(self) > 0)) -#endif - { - return; - } - PyObject_GC_UnTrack(self); - } -#ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(self)) { - /* We have to handle this case for asynchronous generators - right here, because this code has to be between UNTRACK - and GC_Del. */ - Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); - } -#endif - __Pyx_Coroutine_clear(self); - __Pyx_PyHeapTypeObject_GC_Del(gen); -} -#if CYTHON_USE_TP_FINALIZE -static void __Pyx_Coroutine_del(PyObject *self) { - PyObject *error_type, *error_value, *error_traceback; - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - __Pyx_PyThreadState_declare - if (gen->resume_label < 0) { - return; - } - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); -#ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(self)) { - __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; - PyObject *finalizer = agen->ag_finalizer; - if (finalizer && !agen->ag_closed) { - PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); - if (unlikely(!res)) { - PyErr_WriteUnraisable(self); - } else { - Py_DECREF(res); - } - __Pyx_ErrRestore(error_type, error_value, error_traceback); - return; - } - } -#endif - if (unlikely(gen->resume_label == 0 && !error_value)) { -#ifdef __Pyx_Coroutine_USED -#ifdef __Pyx_Generator_USED - if (!__Pyx_Generator_CheckExact(self)) -#endif - { - PyObject_GC_UnTrack(self); - if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) - PyErr_WriteUnraisable(self); - PyObject_GC_Track(self); - } -#endif - } else { - PyObject *retval = NULL; - __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); - if (result == PYGEN_ERROR) { - PyErr_WriteUnraisable(self); - } else { - Py_XDECREF(retval); - } - } - __Pyx_ErrRestore(error_type, error_value, error_traceback); -} -#endif -static PyObject * -__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) -{ - PyObject *name = self->gi_name; - CYTHON_UNUSED_VAR(context); - if (unlikely(!name)) name = Py_None; - Py_INCREF(name); - return name; -} -static int -__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL || !PyUnicode_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__name__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(self->gi_name, value); - return 0; -} -static PyObject * -__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) -{ - PyObject *name = self->gi_qualname; - CYTHON_UNUSED_VAR(context); - if (unlikely(!name)) name = Py_None; - Py_INCREF(name); - return name; -} -static int -__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL || !PyUnicode_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "__qualname__ must be set to a string object"); - return -1; - } - Py_INCREF(value); - __Pyx_Py_XDECREF_SET(self->gi_qualname, value); - return 0; -} -static PyObject * -__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) -{ -#if !CYTHON_COMPILING_IN_LIMITED_API - PyObject *frame; - #if PY_VERSION_HEX >= 0x030d0000 - Py_BEGIN_CRITICAL_SECTION(self); - #endif - frame = self->gi_frame; - if (!frame) { - if (unlikely(!self->gi_code)) { - Py_RETURN_NONE; - } - PyObject *globals = PyDict_New(); - if (unlikely(!globals)) return NULL; - frame = (PyObject *) PyFrame_New( - PyThreadState_Get(), /*PyThreadState *tstate,*/ - (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - Py_DECREF(globals); - if (unlikely(!frame)) - return NULL; - if (unlikely(self->gi_frame)) { - Py_DECREF(frame); - frame = self->gi_frame; - } else { - self->gi_frame = frame; - } - } - Py_INCREF(frame); - #if PY_VERSION_HEX >= 0x030d0000 - Py_END_CRITICAL_SECTION(); - #endif - return frame; -#else - CYTHON_UNUSED_VAR(self); - Py_RETURN_NONE; -#endif -} -static PyObject * -__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { - CYTHON_UNUSED_VAR(context); - PyObject *frame = self->gi_frame; - if (frame) - return __Pyx_NewRef(frame); - return __Pyx__Coroutine_get_frame(self); -} -static __pyx_CoroutineObject *__Pyx__Coroutine_New( - PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name) { - __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); - if (unlikely(!gen)) - return NULL; - return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); -} -static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( - __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, - PyObject *name, PyObject *qualname, PyObject *module_name) { - gen->body = body; - gen->closure = closure; - Py_XINCREF(closure); - gen->is_running = 0; - gen->resume_label = 0; - gen->classobj = NULL; - gen->yieldfrom = NULL; - gen->yieldfrom_am_send = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API - gen->gi_exc_state.exc_value = NULL; - #else - gen->gi_exc_state.exc_type = NULL; - gen->gi_exc_state.exc_value = NULL; - gen->gi_exc_state.exc_traceback = NULL; - #endif -#if CYTHON_USE_EXC_INFO_STACK - gen->gi_exc_state.previous_item = NULL; -#endif - gen->gi_weakreflist = NULL; - Py_XINCREF(qualname); - gen->gi_qualname = qualname; - Py_XINCREF(name); - gen->gi_name = name; - Py_XINCREF(module_name); - gen->gi_modulename = module_name; - Py_XINCREF(code); - gen->gi_code = code; - gen->gi_frame = NULL; - PyObject_GC_Track(gen); - return gen; -} -static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) { - char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif - result = gen->is_running; - gen->is_running = 1; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif - return result; -} -static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) { - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif - assert(gen->is_running); - gen->is_running = 0; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif -} -static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) { - char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif - result = gen->is_running; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif - return result; -} -static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { - CYTHON_UNUSED_VAR(closure); - char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen); - if (result) Py_RETURN_TRUE; - else Py_RETURN_FALSE; -} -#if __PYX_HAS_PY_AM_SEND == 2 -static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) { - Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type; - if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) { - return; - } - memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async)); - static_amsend_methods->am_send = am_send; - type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods); -} -#endif -static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) { - CYTHON_UNUSED_VAR(arg); - __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self)); - PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object", - self_type_name); - __Pyx_DECREF_TypeName(self_type_name); - return NULL; -} - -/* Generator */ -static PyMethodDef __pyx_Generator_methods[] = { - {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, - {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, - {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, - {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0}, - {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0}, - {0, 0, 0, 0} -}; -static PyMemberDef __pyx_Generator_memberlist[] = { - {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - PyDoc_STR("object being iterated by 'yield from', or None")}, - {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, - {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, - {0, 0, 0, 0, 0} -}; -static PyGetSetDef __pyx_Generator_getsets[] = { - {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - PyDoc_STR("name of the generator"), 0}, - {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - PyDoc_STR("qualified name of the generator"), 0}, - {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - PyDoc_STR("Frame of the generator"), 0}, - {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL}, - {0, 0, 0, 0, 0} -}; -static PyType_Slot __pyx_GeneratorType_slots[] = { - {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, - {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, - {Py_tp_iter, (void *)PyObject_SelfIter}, - {Py_tp_iternext, (void *)__Pyx_Generator_Next}, - {Py_tp_methods, (void *)__pyx_Generator_methods}, - {Py_tp_members, (void *)__pyx_Generator_memberlist}, - {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, -#if CYTHON_USE_TP_FINALIZE - {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, -#endif -#if __PYX_HAS_PY_AM_SEND == 1 - {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, -#endif - {0, 0}, -}; -static PyType_Spec __pyx_GeneratorType_spec = { - __PYX_TYPE_MODULE_PREFIX "generator", - sizeof(__pyx_CoroutineObject), - 0, -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | -#endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, - __pyx_GeneratorType_slots -}; -#if __PYX_HAS_PY_AM_SEND == 2 -static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async; -#endif -static int __pyx_Generator_init(PyObject *module) { - __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); - mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec( - mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL); - if (unlikely(!mstate->__pyx_GeneratorType)) { - return -1; - } -#if __PYX_HAS_PY_AM_SEND == 2 - __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend); -#endif - return 0; -} -static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { - __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *retval = NULL; - if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) { - return __Pyx_Coroutine_AlreadyRunningError(gen); - } - __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); - __Pyx_Coroutine_unset_is_running(gen); - (void) result; - assert (result == PYGEN_RETURN || result == PYGEN_ERROR); - assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); - return retval; -} - -/* GetRuntimeVersion */ -static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - return Py_Version & ~0xFFUL; -#else - static unsigned long __Pyx_cached_runtime_version = 0; - if (__Pyx_cached_runtime_version == 0) { - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); - ++i; - } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; - } - __Pyx_cached_runtime_version = version; - } - return __Pyx_cached_runtime_version; -#endif -} - -/* CheckBinaryVersion */ -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { - const unsigned long MAJOR_MINOR = 0xFFFF0000UL; - if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) - return 0; - if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) - return 1; - { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compile time Python version %d.%d " - "of module '%.100s' " - "%s " - "runtime version %d.%d", - (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), - __Pyx_MODULE_NAME, - (allow_newer) ? "was newer than" : "does not match", - (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) - ); - return PyErr_WarnEx(NULL, message, 1); - } -} - -/* VoidPtrImport */ -#ifndef __PYX_HAVE_RT_ImportVoidPtr_3_1_2 -#define __PYX_HAVE_RT_ImportVoidPtr_3_1_2 -static int __Pyx_ImportVoidPtr_3_1_2(PyObject *module, const char *name, void **p, const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - d = PyObject_GetAttrString(module, "__pyx_capi__"); - if (!d) - goto bad; -#if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000) - PyDict_GetItemStringRef(d, name, &cobj); -#else - cobj = PyDict_GetItemString(d, name); - Py_XINCREF(cobj); -#endif - if (!cobj) { - PyErr_Format(PyExc_ImportError, - "%.200s does not export expected C variable %.200s", - PyModule_GetName(module), name); - goto bad; - } - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); - goto bad; - } - *p = PyCapsule_GetPointer(cobj, sig); - if (!(*p)) - goto bad; - Py_DECREF(d); - Py_DECREF(cobj); - return 0; -bad: - Py_XDECREF(d); - Py_XDECREF(cobj); - return -1; -} -#endif - -/* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction_3_1_2 -#define __PYX_HAVE_RT_ImportFunction_3_1_2 -static int __Pyx_ImportFunction_3_1_2(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(module, "__pyx_capi__"); - if (!d) - goto bad; -#if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000) - PyDict_GetItemStringRef(d, funcname, &cobj); -#else - cobj = PyDict_GetItemString(d, funcname); - Py_XINCREF(cobj); -#endif - if (!cobj) { - PyErr_Format(PyExc_ImportError, - "%.200s does not export expected C function %.200s", - PyModule_GetName(module), funcname); - goto bad; - } - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); - *f = tmp.fp; - if (!(*f)) - goto bad; - Py_DECREF(d); - Py_DECREF(cobj); - return 0; -bad: - Py_XDECREF(d); - Py_XDECREF(cobj); - return -1; -} -#endif - -/* NewCodeObj */ -#if CYTHON_COMPILING_IN_LIMITED_API - static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } -#elif PY_VERSION_HEX >= 0x030B0000 - static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -static PyObject* __Pyx_PyCode_New( - const __Pyx_PyCode_New_function_description descr, - PyObject * const *varnames, - PyObject *filename, - PyObject *funcname, - const char *line_table, - PyObject *tuple_dedup_map -) { - PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; - Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; - PyObject *varnames_tuple = PyTuple_New(var_count); - if (unlikely(!varnames_tuple)) return NULL; - for (Py_ssize_t i=0; i < var_count; i++) { - Py_INCREF(varnames[i]); - if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; - } - #if CYTHON_COMPILING_IN_LIMITED_API - varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); - if (!varnames_tuple_dedup) { - if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; - varnames_tuple_dedup = varnames_tuple; - } - #else - varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); - if (unlikely(!varnames_tuple_dedup)) goto done; - #endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(varnames_tuple_dedup); - #endif - if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL - && !CYTHON_COMPILING_IN_GRAAL) { - line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); - if (unlikely(!line_table_bytes)) goto done; - Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; - code_bytes = PyBytes_FromStringAndSize(NULL, code_len); - if (unlikely(!code_bytes)) goto done; - char* c_code_bytes = PyBytes_AsString(code_bytes); - if (unlikely(!c_code_bytes)) goto done; - memset(c_code_bytes, 0, (size_t) code_len); - } - code_obj = (PyObject*) __Pyx__PyCode_New( - (int) descr.argcount, - (int) descr.num_posonly_args, - (int) descr.num_kwonly_args, - (int) descr.nlocals, - 0, - (int) descr.flags, - code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, - __pyx_mstate_global->__pyx_empty_tuple, - __pyx_mstate_global->__pyx_empty_tuple, - varnames_tuple_dedup, - __pyx_mstate_global->__pyx_empty_tuple, - __pyx_mstate_global->__pyx_empty_tuple, - filename, - funcname, - (int) descr.first_line, - (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes - ); -done: - Py_XDECREF(code_bytes); - Py_XDECREF(line_table_bytes); - #if CYTHON_AVOID_BORROWED_REFS - Py_XDECREF(varnames_tuple_dedup); - #endif - Py_DECREF(varnames_tuple); - return code_obj; -} - -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { - while (t->s) { - PyObject *str; - if (t->is_unicode) { - if (t->intern) { - str = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); - } else { - str = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - str = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - if (!str) - return -1; - *target = str; - if (PyObject_Hash(str) == -1) - return -1; - ++t; - ++target; - } - return 0; -} - -#include -static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { - size_t len = strlen(s); - if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { - PyErr_SetString(PyExc_OverflowError, "byte string is too long"); - return -1; - } - return (Py_ssize_t) len; -} -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - Py_ssize_t len = __Pyx_ssize_strlen(c_str); - if (unlikely(len < 0)) return NULL; - return __Pyx_PyUnicode_FromStringAndSize(c_str, len); -} -static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { - Py_ssize_t len = __Pyx_ssize_strlen(c_str); - if (unlikely(len < 0)) return NULL; - return PyByteArray_FromStringAndSize(c_str, len); -} -static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; -#if CYTHON_COMPILING_IN_LIMITED_API - { - const char* result; - Py_ssize_t unicode_length; - CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 - if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; - #else - result = PyUnicode_AsUTF8AndSize(o, length); - #endif - #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - unicode_length = PyUnicode_GetLength(o); - if (unlikely(unicode_length < 0)) return NULL; - if (unlikely(unicode_length != *length)) { - PyUnicode_AsASCIIString(o); - return NULL; - } - #endif - return result; - } -#else -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (likely(PyUnicode_IS_ASCII(o))) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif -} -#endif -static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 - if (PyUnicode_Check(o)) { - return __Pyx_PyUnicode_AsStringAndSize(o, length); - } else -#endif - if (PyByteArray_Check(o)) { -#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); -#else - *length = PyByteArray_Size(o); - if (*length == -1) return NULL; - return PyByteArray_AsString(o); -#endif - } else - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { - int retval; - if (unlikely(!x)) return -1; - retval = __Pyx_PyObject_IsTrue(x); - Py_DECREF(x); - return retval; -} -static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); - if (PyLong_Check(result)) { - if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " - "The ability to return an instance of a strict subclass of int is deprecated, " - "and may be removed in a future version of Python.", - result_type_name)) { - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; - } - __Pyx_DECREF_TypeName(result_type_name); - return result; - } - PyErr_Format(PyExc_TypeError, - "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", - result_type_name); - __Pyx_DECREF_TypeName(result_type_name); - Py_DECREF(result); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { -#if CYTHON_USE_TYPE_SLOTS - PyNumberMethods *m; -#endif - PyObject *res = NULL; - if (likely(PyLong_Check(x))) - return __Pyx_NewRef(x); -#if CYTHON_USE_TYPE_SLOTS - m = Py_TYPE(x)->tp_as_number; - if (likely(m && m->nb_int)) { - res = m->nb_int(x); - } -#else - if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Long(x); - } -#endif - if (likely(res)) { - if (unlikely(!PyLong_CheckExact(res))) { - return __Pyx_PyNumber_LongWrongResultType(res); - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(__Pyx_PyLong_IsCompact(b))) { - return __Pyx_PyLong_CompactValue(b); - } else { - const digit* digits = __Pyx_PyLong_Digits(b); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyLong_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { - if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { - return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); - } else { - Py_ssize_t ival; - PyObject *x; - x = PyNumber_Index(o); - if (!x) return -1; - ival = PyLong_AsLong(x); - Py_DECREF(x); - return ival; - } -} -static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { - CYTHON_UNUSED_VAR(b); - return __Pyx_NewRef(Py_None); -} -static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); -} -static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { - return PyLong_FromSize_t(ival); -} - - -/* MultiPhaseInitModuleState */ -#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE -#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE -#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) - #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 -#else - #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 -#endif -#endif -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS -#error "Module state with PEP489 requires atomics. Currently that's one of\ - C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" -#endif -#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE -#define __Pyx_ModuleStateLookup_Lock() -#define __Pyx_ModuleStateLookup_Unlock() -#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 -static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; -#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) -#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) -#elif defined(__cplusplus) && __cplusplus >= 201103L -#include -static std::mutex __Pyx_ModuleStateLookup_mutex; -#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() -#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() -#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) -#include -static mtx_t __Pyx_ModuleStateLookup_mutex; -static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; -static void __Pyx_ModuleStateLookup_initialize_mutex(void) { - mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); -} -#define __Pyx_ModuleStateLookup_Lock()\ - call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ - mtx_lock(&__Pyx_ModuleStateLookup_mutex) -#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) -#elif defined(HAVE_PTHREAD_H) -#include -static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; -#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) -#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) -#elif defined(_WIN32) -#include // synchapi.h on its own doesn't work -static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; -#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) -#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) -#else -#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ - Requires C standard >= C11, or C++ standard >= C++11,\ - or pthreads, or the Windows 32 API, or Python >= 3.13." -#endif -typedef struct { - int64_t id; - PyObject *module; -} __Pyx_InterpreterIdAndModule; -typedef struct { - char interpreter_id_as_index; - Py_ssize_t count; - Py_ssize_t allocated; - __Pyx_InterpreterIdAndModule table[1]; -} __Pyx_ModuleStateLookupData; -#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE -static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; -#endif -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE -static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; -#else -static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; -#endif -static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( - __Pyx_InterpreterIdAndModule* table, - Py_ssize_t count, - int64_t interpreterId) { - __Pyx_InterpreterIdAndModule* begin = table; - __Pyx_InterpreterIdAndModule* end = begin + count; - if (begin->id == interpreterId) { - return begin; - } - while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { - __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; - if (halfway->id == interpreterId) { - return halfway; - } - if (halfway->id < interpreterId) { - begin = halfway; - } else { - end = halfway; - } - } - for (; begin < end; ++begin) { - if (begin->id >= interpreterId) return begin; - } - return begin; -} -static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { - int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); - if (interpreter_id == -1) return NULL; -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE - __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); - { - __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); - if (likely(data)) { - __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); - if (likely(data == new_data)) { - goto read_finished; - } - } - __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); - __Pyx_ModuleStateLookup_Lock(); - __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); - data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); - __Pyx_ModuleStateLookup_Unlock(); - } - read_finished:; -#else - __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; -#endif - __Pyx_InterpreterIdAndModule* found = NULL; - if (unlikely(!data)) goto end; - if (data->interpreter_id_as_index) { - if (interpreter_id < data->count) { - found = data->table+interpreter_id; - } - } else { - found = __Pyx_State_FindModuleStateLookupTableLowerBound( - data->table, data->count, interpreter_id); - } - end: - { - PyObject *result=NULL; - if (found && found->id == interpreter_id) { - result = found->module; - } -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE - __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); -#endif - return result; - } -} -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE -static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { - while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); -} -#else -#define __Pyx_ModuleStateLookup_wait_until_no_readers() -#endif -static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { - Py_ssize_t to_allocate = (*old_data)->allocated; - while (to_allocate <= interpreter_id) { - if (to_allocate == 0) to_allocate = 1; - else to_allocate *= 2; - } - __Pyx_ModuleStateLookupData *new_data = *old_data; - if (to_allocate != (*old_data)->allocated) { - new_data = (__Pyx_ModuleStateLookupData *)realloc( - *old_data, - sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); - if (!new_data) { - PyErr_NoMemory(); - return -1; - } - for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { - new_data->table[i].id = i; - new_data->table[i].module = NULL; - } - new_data->allocated = to_allocate; - } - new_data->table[interpreter_id].module = module; - if (new_data->count < interpreter_id+1) { - new_data->count = interpreter_id+1; - } - *old_data = new_data; - return 0; -} -static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { - __Pyx_InterpreterIdAndModule *read = data->table; - __Pyx_InterpreterIdAndModule *write = data->table; - __Pyx_InterpreterIdAndModule *end = read + data->count; - for (; readmodule) { - write->id = read->id; - write->module = read->module; - ++write; - } - } - data->count = write - data->table; - for (; writeid = 0; - write->module = NULL; - } - data->interpreter_id_as_index = 0; -} -static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { - int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); - if (interpreter_id == -1) return -1; - int result = 0; - __Pyx_ModuleStateLookup_Lock(); -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE - __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) - __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); -#else - __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; -#endif - __Pyx_ModuleStateLookupData *new_data = old_data; - if (!new_data) { - new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); - if (!new_data) { - result = -1; - PyErr_NoMemory(); - goto end; - } - new_data->allocated = 1; - new_data->interpreter_id_as_index = 1; - } - __Pyx_ModuleStateLookup_wait_until_no_readers(); - if (new_data->interpreter_id_as_index) { - if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { - result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); - goto end; - } - __Pyx_State_ConvertFromInterpIdAsIndex(new_data); - } - { - Py_ssize_t insert_at = 0; - { - __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( - new_data->table, new_data->count, interpreter_id); - assert(lower_bound); - insert_at = lower_bound - new_data->table; - if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { - lower_bound->module = module; - goto end; // already in table, nothing more to do - } - } - if (new_data->count+1 >= new_data->allocated) { - Py_ssize_t to_allocate = (new_data->count+1)*2; - new_data = - (__Pyx_ModuleStateLookupData*)realloc( - new_data, - sizeof(__Pyx_ModuleStateLookupData) + - (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); - if (!new_data) { - result = -1; - new_data = old_data; - PyErr_NoMemory(); - goto end; - } - new_data->allocated = to_allocate; - } - ++new_data->count; - int64_t last_id = interpreter_id; - PyObject *last_module = module; - for (Py_ssize_t i=insert_at; icount; ++i) { - int64_t current_id = new_data->table[i].id; - new_data->table[i].id = last_id; - last_id = current_id; - PyObject *current_module = new_data->table[i].module; - new_data->table[i].module = last_module; - last_module = current_module; - } - } - end: -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE - __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); -#else - __Pyx_ModuleStateLookup_data = new_data; -#endif - __Pyx_ModuleStateLookup_Unlock(); - return result; -} -static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { - int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); - if (interpreter_id == -1) return -1; - __Pyx_ModuleStateLookup_Lock(); -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE - __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) - __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); -#else - __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; -#endif - if (data->interpreter_id_as_index) { - if (interpreter_id < data->count) { - data->table[interpreter_id].module = NULL; - } - goto done; - } - { - __Pyx_ModuleStateLookup_wait_until_no_readers(); - __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( - data->table, data->count, interpreter_id); - if (!lower_bound) goto done; - if (lower_bound->id != interpreter_id) goto done; - __Pyx_InterpreterIdAndModule *end = data->table+data->count; - for (;lower_boundid = (lower_bound+1)->id; - lower_bound->module = (lower_bound+1)->module; - } - } - --data->count; - if (data->count == 0) { - free(data); - data = NULL; - } - done: -#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE - __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); -#else - __Pyx_ModuleStateLookup_data = data; -#endif - __Pyx_ModuleStateLookup_Unlock(); - return 0; -} -#endif - -/* #### Code section: utility_code_pragmas_end ### */ -#ifdef _MSC_VER -#pragma warning( pop ) -#endif - - - -/* #### Code section: end ### */ -#endif /* Py_PYTHON_H */ diff --git a/pyreadstat/pyreadstat.pxd b/pyreadstat/pyreadstat.pxd deleted file mode 100644 index fcd31cc..0000000 --- a/pyreadstat/pyreadstat.pxd +++ /dev/null @@ -1,18 +0,0 @@ -# cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 -# ############################################################################# -# Copyright 2018 Hoffmann-La Roche -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ############################################################################# - - diff --git a/pyreadstat/pyreadstat.pyx b/pyreadstat/pyreadstat.py similarity index 77% rename from pyreadstat/pyreadstat.pyx rename to pyreadstat/pyreadstat.py index c9c2361..b02cfa0 100644 --- a/pyreadstat/pyreadstat.pyx +++ b/pyreadstat/pyreadstat.py @@ -1,5 +1,3 @@ -# cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 - # ############################################################################# # Copyright 2018 Hoffmann-La Roche # @@ -16,28 +14,24 @@ # limitations under the License. # ############################################################################# -## if want to profile: # cython: profile=True - import multiprocessing as mp import narwhals.stable.v2 as nw import numpy as np -from _readstat_parser cimport py_file_format, py_file_extension, run_conversion -from _readstat_parser import PyreadstatError -from _readstat_writer cimport run_write -cimport _readstat_parser, _readstat_writer -from worker import worker -from pyfunctions import set_value_labels, set_catalog_to_sas +from ._readstat_parser import PyreadstatError, parser_entry_point +from ._readstat_writer import writer_entry_point +from .worker import worker +from .pyfunctions import set_value_labels, set_catalog_to_sas # Public interface # Parsing functions def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, - formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): + formats_as_category=True, formats_as_ordered_category=False, encoding=None, usecols=None, user_missing=False, + disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, + extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): r""" Read a SAS sas7bdat file. It accepts the path to a sas7bcat. @@ -104,29 +98,16 @@ def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=Fa supplied. Look at the documentation for more information. """ + parser_format = "sas7bdat" + data_frame, metadata = parser_entry_point(filename_path, parser_format, + metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, + encoding=encoding, usecols=usecols, user_missing=user_missing, + disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, + output_format=output_format, extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) - cdef bint metaonly = 0 - if metadataonly: - metaonly = 1 - - cdef bint dates_as_pandas = 0 - if dates_as_pandas_datetime: - dates_as_pandas = 1 - - cdef bint usernan = 0 - if user_missing: - usernan = 1 - - cdef bint no_datetime_conversion = 0 - if disable_datetime_conversion: - no_datetime_conversion = 1 - - cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BDAT - data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - metadata.file_format = "sas7bdat" + metadata.file_format = parser_format if catalog_file: _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) @@ -136,9 +117,9 @@ def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=Fa return data_frame, metadata -def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, str encoding=None, - list usecols=None, disable_datetime_conversion=False, int row_limit=0, int row_offset=0, - str output_format=None, list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): +def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, encoding=None, + usecols=None, disable_datetime_conversion=False, row_limit=0, row_offset=0, + output_format=None, extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): r""" Read a SAS xport file. @@ -185,35 +166,23 @@ def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False metadata : object with metadata. Look at the documentation for more information. """ + parser_format = "xport" + data_frame, metadata = parser_entry_point(filename_path, parser_format, + metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, + encoding=encoding, usecols=usecols, + disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, + output_format=output_format, extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) - cdef bint metaonly = 0 - if metadataonly: - metaonly = 1 - - cdef bint dates_as_pandas = 0 - if dates_as_pandas_datetime: - dates_as_pandas = 1 - - cdef bint usernan = 0 - - cdef bint no_datetime_conversion = 0 - if disable_datetime_conversion: - no_datetime_conversion = 1 - - cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_XPORT - data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - metadata.file_format = "xport" + metadata.file_format = parser_format return data_frame, metadata def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): + formats_as_category=True, formats_as_ordered_category=False, encoding=None, usecols=None, user_missing=False, + disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, + extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): r""" Read a STATA dta file @@ -274,29 +243,16 @@ def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, metadata : object with metadata. Look at the documentation for more information. """ + parser_format = "dta" + data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, + metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, + encoding=encoding, usecols=usecols, user_missing=user_missing, + disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, + output_format=output_format, extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) - cdef bint metaonly = 0 - if metadataonly: - metaonly = 1 - - cdef bint dates_as_pandas = 0 - if dates_as_pandas_datetime: - dates_as_pandas = 1 - - cdef bint usernan = 0 - if user_missing: - usernan = 1 - - cdef bint no_datetime_conversion = 0 - if disable_datetime_conversion: - no_datetime_conversion = 1 - - cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_STATA - cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_DTA - data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - metadata.file_format = "dta" + metadata.file_format = parser_format if apply_value_formats: data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, @@ -306,9 +262,9 @@ def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, - disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, - list extra_date_formats=None, list extra_time_formats=None): + formats_as_category=True, formats_as_ordered_category=False, encoding=None, usecols=None, user_missing=False, + disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, extra_datetime_formats=None, + extra_date_formats=None, extra_time_formats=None): r""" Read a SPSS sav or zsav (compressed) files @@ -369,29 +325,17 @@ def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, metadata : object with metadata. Look at the documentation for more information. """ + parser_format = "sav/zsav" - cdef bint metaonly = 0 - if metadataonly: - metaonly = 1 - - cdef bint dates_as_pandas = 0 - if dates_as_pandas_datetime: - dates_as_pandas = 1 + data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, + metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, + encoding=encoding, usecols=usecols, user_missing=user_missing, + disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, + output_format=output_format, extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) - cdef bint usernan = 0 - if user_missing: - usernan = 1 - - cdef bint no_datetime_conversion = 0 - if disable_datetime_conversion: - no_datetime_conversion = 1 - - cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS - cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAV - data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - metadata.file_format = "sav/zsav" + metadata.file_format = parser_format if apply_value_formats: data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, @@ -401,9 +345,9 @@ def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - formats_as_category=True, formats_as_ordered_category=False, list usecols=None, - disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, - list extra_datetime_formats=None, list extra_date_formats=None, list extra_time_formats=None): + formats_as_category=True, formats_as_ordered_category=False, usecols=None, + disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, + extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): r""" Read a SPSS por file. Files are assumed to be UTF-8 encoded, the encoding cannot be set to other. @@ -458,36 +402,24 @@ def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, metadata : object with metadata. Look at the documentation for more information. """ - - cdef bint metaonly = 0 - if metadataonly: - metaonly = 1 - - cdef bint dates_as_pandas = 0 - if dates_as_pandas_datetime: - dates_as_pandas = 1 - - cdef bint usernan = 0 - - cdef bint no_datetime_conversion = 0 - if disable_datetime_conversion: - no_datetime_conversion = 1 - - cdef str encoding = None + parser_format = "por" + data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, + metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, + usecols=usecols, + disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, + output_format=output_format, extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) + + metadata.file_format = parser_format - cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SPSS - cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_POR - data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - metadata.file_format = "por" if apply_value_formats: data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category) return data_frame, metadata -def read_sas7bcat(filename_path, str encoding=None, str output_format=None): +def read_sas7bcat(filename_path, encoding=None, output_format=None): r""" Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary value_labels that contains the formats. When parsing the sas7bdat file, in the metadata, the dictionary @@ -517,23 +449,13 @@ def read_sas7bcat(filename_path, str encoding=None, str output_format=None): object with metadata. The member value_labels is the one that contains the formats. Look at the documentation for more information. """ - cdef bint metaonly = 1 - cdef bint dates_as_pandas = 0 - cdef list usecols = None - cdef bint usernan = 0 - cdef bint no_datetime_conversion = 0 - cdef long row_limit=0 - cdef long row_offset=0 - cdef list extra_datetime_formats=None - cdef list extra_date_formats=None - cdef list extra_time_formats=None - - cdef py_file_format file_format = _readstat_parser.FILE_FORMAT_SAS - cdef py_file_extension file_extension = _readstat_parser.FILE_EXT_SAS7BCAT - data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, - dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, - output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) - metadata.file_format = "sas7bcat" + parser_format = "sas7bcat" + data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, + encoding=encoding, + output_format=output_format, + ) + + metadata.file_format = parser_format return data_frame, metadata @@ -710,9 +632,9 @@ def read_file_multiprocessing(read_function, file_path, num_processes=None, num_ # Write API -def write_sav(df, dst_path, str file_label="", 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, dict variable_format=None): +def write_sav(df, dst_path, file_label="", column_labels=None, compress=False, row_compress=False, note=None, + variable_value_labels=None, missing_ranges=None, variable_display_width=None, + variable_measure=None, variable_format=None): """ Writes a dataframe to a SPSS sav or zsav file. @@ -758,20 +680,7 @@ def write_sav(df, dst_path, str file_label="", object column_labels=None, compre values being strings defining the format. See README, setting variable formats section, for more information. """ - - cdef int file_format_version = 2 - cdef str var_width - cdef bint row_compression = 0 - if compress and row_compress: - raise PyreadstatError("compress and row_compress cannot be both True") - if compress: - file_format_version = 3 - if row_compress: - row_compression = 1 - cdef table_name = "" - cdef dict missing_user_values = None - cdef dict variable_alignment = None - + writer_format = "sav" # formats formats_presets = {'restricted_integer':'N{var_width}', 'integer':'F{var_width}.0'} @@ -781,12 +690,13 @@ def write_sav(df, dst_path, str file_label="", object column_labels=None, compre var_width = str(len(str(max(df[col_name])))) variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) - run_write(df, dst_path, _readstat_writer.FILE_FORMAT_SAV, 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) + writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, + compress=compress, row_compress=row_compress, note=note, + variable_value_labels=variable_value_labels, missing_ranges=missing_ranges, variable_display_width=variable_display_width, + variable_measure=variable_measure, variable_format=variable_format) -def write_dta(df, dst_path, str file_label="", object column_labels=None, int version=15, - dict variable_value_labels=None, dict missing_user_values=None, dict variable_format=None): +def write_dta(df, dst_path, file_label="", column_labels=None, version=15, + variable_value_labels=None, missing_user_values=None, variable_format=None): """ Writes a dataframe to a STATA dta file @@ -819,36 +729,15 @@ def write_dta(df, dst_path, str file_label="", object column_labels=None, int ve for more information. """ - if version == 15: - file_format_version = 119 - elif version == 14: - file_format_version = 118 - elif version == 13: - file_format_version = 117 - elif version == 12: - file_format_version = 115 - elif version in {10, 11}: - file_format_version = 114 - elif version in {8, 9}: - file_format_version = 113 - else: - raise Exception("Version not supported") - - cdef str note = "" - cdef str table_name = "" - cdef dict missing_ranges = None - cdef dict variable_alignment = None - cdef dict variable_display_width = None - cdef dict variable_measure = None - #cdef dict variable_format = None - cdef bint row_compression = 0 - - run_write(df, dst_path, _readstat_writer.FILE_FORMAT_DTA, 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) - -def write_xport(df, dst_path, str file_label="", object column_labels=None, str table_name=None, int file_format_version = 8, - dict variable_format=None): + writer_format = "dta" + writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, + version=version, + variable_value_labels=variable_value_labels, + missing_user_values=missing_user_values, + variable_format=variable_format) + +def write_xport(df, dst_path, file_label="", column_labels=None, table_name=None, file_format_version = 8, + variable_format=None): """ Writes a dataframe to a SAS Xport (xpt) file. If no table_name is specified the dataset has by default the name DATASET (take it into account if @@ -878,20 +767,13 @@ def write_xport(df, dst_path, str file_label="", object column_labels=None, str for more information. """ - cdef dict variable_value_labels = None - cdef str note = "" - cdef dict missing_ranges = None - cdef dict missing_user_values = None - cdef dict variable_alignment = None - cdef dict variable_display_width = None - cdef dict variable_measure = None - #cdef dict variable_format = None - cdef bint row_compression = 0 - run_write(df, dst_path, _readstat_writer.FILE_FORMAT_XPORT, 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) - -def write_por(df, dst_path, str file_label="", object column_labels=None, dict variable_format=None): + writer_format = "xport" + writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, + version=file_format_version, + table_name=table_name, + variable_format=variable_format) + +def write_por(df, dst_path, file_label="", column_labels=None, variable_format=None): """ Writes a dataframe to a SPSS POR file. @@ -914,18 +796,7 @@ def write_por(df, dst_path, str file_label="", object column_labels=None, dict v for more information. """ - # atm version 5 and 8 are supported by readstat but only 5 can be later be read by SAS - cdef str note=None - cdef int file_format_version = 0 - cdef dict variable_value_labels=None - cdef dict missing_ranges = None - cdef dict missing_user_values = None - cdef dict variable_alignment = None - cdef dict variable_display_width = None - cdef dict variable_measure = None - cdef str table_name = "" - #cdef dict variable_format = None - cdef bint row_compression = 0 - run_write(df, dst_path, _readstat_writer.FILE_FORMAT_POR, 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) + writer_format = "por" + writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, + variable_format=variable_format) + diff --git a/setup.py b/setup.py index ce36203..f1dc4a3 100644 --- a/setup.py +++ b/setup.py @@ -115,14 +115,7 @@ def is_python_lt_14(): # Extensions sources.sort() -extensions = [Extension("pyreadstat.pyreadstat", - sources=["pyreadstat/pyreadstat" + ext] + sources, - # this dot here is important for cython to find the pxd files - include_dirs =include_dirs, - libraries=libraries, - library_dirs=library_dirs, - extra_compile_args=["-Ireadstat", "-DHAVE_ZLIB=1"] ), - Extension("pyreadstat._readstat_parser", +extensions = [Extension("pyreadstat._readstat_parser", sources=["pyreadstat/_readstat_parser" + ext] + sources, include_dirs = include_dirs, library_dirs=library_dirs, @@ -156,7 +149,7 @@ def is_python_lt_14(): setup( name='pyreadstat', - version='1.3.3', + version='1.3.4', description=short_description, author="Otto Fajardo", author_email="pleasecontactviagithub@notvalid.com", From 684e6b61c36e528845c08b1adf9c3a27a1a3b122 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Wed, 4 Feb 2026 14:14:52 +0100 Subject: [PATCH 02/10] moving metadata container to a py file --- pyreadstat/__init__.py | 3 +- pyreadstat/_readstat_parser.c | 5218 ++++++++++++++----------------- pyreadstat/_readstat_parser.pyx | 32 +- pyreadstat/pyclasses.py | 44 + pyreadstat/pyreadstat.py | 4 +- 5 files changed, 2456 insertions(+), 2845 deletions(-) create mode 100644 pyreadstat/pyclasses.py diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index 10ddff5..8ecd1c4 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -17,7 +17,8 @@ from .pyreadstat import read_sav, read_sas7bdat, read_xport, read_dta, read_sav, read_por, read_sas7bcat from .pyreadstat import write_sav, write_dta, write_xport, write_por from .pyreadstat import read_file_in_chunks, read_file_multiprocessing -from ._readstat_parser import ReadstatError, metadata_container +from .pyclasses import metadata_container +from ._readstat_parser import ReadstatError from .pyfunctions import set_value_labels, set_catalog_to_sas __version__ = "1.3.4" diff --git a/pyreadstat/_readstat_parser.c b/pyreadstat/_readstat_parser.c index 85d745b..7bfcc02 100644 --- a/pyreadstat/_readstat_parser.c +++ b/pyreadstat/_readstat_parser.c @@ -1719,7 +1719,7 @@ enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format { }; typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format; -/* "pyreadstat/_readstat_parser.pyx":931 +/* "pyreadstat/_readstat_parser.pyx":907 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -2097,22 +2097,6 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif -/* PyObjectDelAttr.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 -#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) -#else -#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) -#endif - -/* PyObjectSetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); -#else -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); @@ -2400,6 +2384,22 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif +/* PyObjectDelAttr.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 +#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) +#else +#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -2656,16 +2656,8 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject *module, PyObject *globals, PyObject* code); -/* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 -#define __Pyx_SetNameInClass(ns, name, value)\ - (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) -#elif CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_SetNameInClass(ns, name, value)\ - (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) -#else -#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) -#endif +/* Py3UpdateBases.proto */ +static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); @@ -2686,9 +2678,6 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); -/* Py3UpdateBases.proto */ -static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); - /* CLineInTraceback.proto */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); @@ -3009,7 +2998,6 @@ static const char __pyx_k_date[] = "date"; static const char __pyx_k_dict[] = "dict"; static const char __pyx_k_fill[] = "fill"; static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_int8[] = "int8"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_left[] = "left"; @@ -3173,6 +3161,7 @@ static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_from_dict[] = "from_dict"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_pyclasses[] = "pyclasses"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_row_limit[] = "row_limit"; @@ -3279,15 +3268,12 @@ static const char __pyx_k_readstat_to_numpy_types[] = "readstat_to_numpy_types"; static const char __pyx_k_readstat_variable_types[] = "readstat_variable_types"; static const char __pyx_k_dates_as_pandas_datetime[] = "dates_as_pandas_datetime"; static const char __pyx_k_with_date_type_in_column[] = "' with date type in column '"; -static const char __pyx_k_metadata_container___init[] = "metadata_container.__init__"; static const char __pyx_k_disable_datetime_conversion[] = "disable_datetime_conversion"; static const char __pyx_k_formats_as_ordered_category[] = "formats_as_ordered_category"; static const char __pyx_k_pyreadstat__readstat_parser[] = "pyreadstat._readstat_parser"; -static const char __pyx_k_A_Q_a_O1_Q_M_1_1_N_q_a_A_Q_O1[] = "\200A\330\010\014\320\014 \240\001\330\010\014\320\014!\240\021\330\010\014\320\014*\250!\330\010\014\320\014\035\230Q\330\010\014\320\014\036\230a\330\010\014\210O\2301\330\010\014\320\014)\250\021\330\010\014\320\014 \240\001\330\010\014\320\014%\240Q\330\010\014\210M\230\021\330\010\014\320\014+\2501\330\010\014\320\014+\2501\330\010\014\210N\230!\330\010\014\320\014\"\240!\330\010\014\320\014'\240q\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014&\240a\330\010\014\320\014$\240A\330\010\014\320\014\035\230Q\330\010\014\320\014!\240\021\330\010\014\210O\2301"; static const char __pyx_k_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a[] = "\320\000&\240a\330\027+\2501\330\r'\320'J\320J]\320]p\320pq\330\r0\3200A\320AS\320Sk\320kl\330\r+\2501\360\014\000\005\010\200~\220S\230\001\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\330\t\027\220s\230!\330\010\026\220a\330\010\031\230\021\340\010\016\210o\230Q\230a\340\004\031\230\021\330\004\007\200q\330\010\023\2201\340\004 \240\001\330\004\007\200q\330\010\032\230!\340\004\030\230\001\330\004\007\200q\330\010\022\220!\340\004'\240q\330\004\007\200q\330\010!\240\021\340\004\020\220\013\230>\250\021\250/\270\035\320FV\320V`\320`a\330*;\2709\300I\320Me\320ek\320kv\320v|\320|}\330*9\3209Q\320Qe\320ef\340\004\013\210<\220q"; static const char __pyx_k_data_container___reduce_cython[] = "data_container.__reduce_cython__"; static const char __pyx_k_Just_defining_a_custom_exceptio[] = "\n Just defining a custom exception to raise when readstat gives an error return code.\n "; -static const char __pyx_k_This_class_holds_metadata_we_wa[] = "\n This class holds metadata we want to give back to python\n "; static const char __pyx_k_pyreadstat__readstat_parser_pyx[] = "pyreadstat/_readstat_parser.pyx"; static const char __pyx_k_Failed_convert_C_to_python_value[] = "Failed convert C to python value"; static const char __pyx_k_Failed_to_read_number_of_variabl[] = "Failed to read number of variables"; @@ -3306,7 +3292,6 @@ static const char __pyx_k_Just_defining_a_custom_exceptio_2[] = "\n Just defi static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_18metadata_container___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_path, PyObject *__pyx_v_parser_format, PyObject *__pyx_v_metadataonly, PyObject *__pyx_v_dates_as_pandas_datetime, CYTHON_UNUSED PyObject *__pyx_v_formats_as_category, CYTHON_UNUSED PyObject *__pyx_v_formats_as_ordered_category, PyObject *__pyx_v_encoding, PyObject *__pyx_v_usecols, PyObject *__pyx_v_user_missing, PyObject *__pyx_v_disable_datetime_conversion, int __pyx_v_row_limit, int __pyx_v_row_offset, PyObject *__pyx_v_output_format, PyObject *__pyx_v_extra_datetime_formats, PyObject *__pyx_v_extra_date_formats, PyObject *__pyx_v_extra_time_formats); /* proto */ static PyObject *__pyx_tp_new_10pyreadstat_16_readstat_parser_data_container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ @@ -3361,8 +3346,8 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[2]; - PyObject *__pyx_codeobj_tab[4]; - PyObject *__pyx_string_tab[331]; + PyObject *__pyx_codeobj_tab[3]; + PyObject *__pyx_string_tab[329]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_100000; @@ -3493,247 +3478,245 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_TIME8 __pyx_string_tab[87] #define __pyx_n_u_TIMEAMPM __pyx_string_tab[88] #define __pyx_n_u_TOD __pyx_string_tab[89] -#define __pyx_kp_u_This_class_holds_metadata_we_wa __pyx_string_tab[90] -#define __pyx_n_u_TypeError __pyx_string_tab[91] -#define __pyx_n_u_UnicodeError __pyx_string_tab[92] -#define __pyx_kp_u_Unknown_file_format __pyx_string_tab[93] -#define __pyx_kp_u_Unkown_data_type __pyx_string_tab[94] -#define __pyx_n_u_WEEKDATE __pyx_string_tab[95] -#define __pyx_n_u_WEEKDATX __pyx_string_tab[96] -#define __pyx_n_u_YMDHMS16 __pyx_string_tab[97] -#define __pyx_n_u_YMDHMS19 __pyx_string_tab[98] -#define __pyx_kp_u_YMDHMS19_2 __pyx_string_tab[99] -#define __pyx_n_u_YMDHMS20 __pyx_string_tab[100] -#define __pyx_n_u_YYMMDD __pyx_string_tab[101] -#define __pyx_n_u_YYMMDD10 __pyx_string_tab[102] -#define __pyx_n_u_YYMMDDB __pyx_string_tab[103] -#define __pyx_n_u_YYMMDDD __pyx_string_tab[104] -#define __pyx_n_u_YYMMDDN __pyx_string_tab[105] -#define __pyx_n_u_YYMMDDP __pyx_string_tab[106] -#define __pyx_n_u_YYMMDDS __pyx_string_tab[107] -#define __pyx_kp_u_You_requested_pandas_as_output_f __pyx_string_tab[108] -#define __pyx_kp_u_You_requested_polars_as_output_f __pyx_string_tab[109] -#define __pyx_kp_u__2 __pyx_string_tab[110] -#define __pyx_kp_u__3 __pyx_string_tab[111] -#define __pyx_kp_u__4 __pyx_string_tab[112] -#define __pyx_kp_u_add_note __pyx_string_tab[113] -#define __pyx_n_u_all __pyx_string_tab[114] -#define __pyx_n_u_allowed_formats __pyx_string_tab[115] -#define __pyx_n_u_append __pyx_string_tab[116] -#define __pyx_n_u_astype __pyx_string_tab[117] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[118] -#define __pyx_n_u_backend __pyx_string_tab[119] -#define __pyx_n_u_center __pyx_string_tab[120] -#define __pyx_n_u_class_getitem __pyx_string_tab[121] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[122] -#define __pyx_n_u_col __pyx_string_tab[123] -#define __pyx_n_u_collections __pyx_string_tab[124] -#define __pyx_kp_u_column_0_is_duplicated_renamed_t __pyx_string_tab[125] -#define __pyx_n_u_column_labels __pyx_string_tab[126] -#define __pyx_n_u_column_names __pyx_string_tab[127] -#define __pyx_n_u_column_names_to_labels __pyx_string_tab[128] -#define __pyx_n_u_columns __pyx_string_tab[129] -#define __pyx_n_u_copy __pyx_string_tab[130] -#define __pyx_n_u_counted_value __pyx_string_tab[131] -#define __pyx_n_u_creation_time __pyx_string_tab[132] -#define __pyx_n_u_d __pyx_string_tab[133] -#define __pyx_kp_u_d_2 __pyx_string_tab[134] -#define __pyx_n_u_data_container __pyx_string_tab[135] -#define __pyx_n_u_data_container___reduce_cython __pyx_string_tab[136] -#define __pyx_n_u_data_container___setstate_cython __pyx_string_tab[137] -#define __pyx_n_u_data_frame __pyx_string_tab[138] -#define __pyx_n_u_date __pyx_string_tab[139] -#define __pyx_n_u_dates_as_pandas __pyx_string_tab[140] -#define __pyx_n_u_dates_as_pandas_datetime __pyx_string_tab[141] -#define __pyx_n_u_datetime __pyx_string_tab[142] -#define __pyx_n_u_dict __pyx_string_tab[143] -#define __pyx_kp_u_disable __pyx_string_tab[144] -#define __pyx_n_u_disable_datetime_conversion __pyx_string_tab[145] -#define __pyx_n_u_doc __pyx_string_tab[146] -#define __pyx_n_u_double __pyx_string_tab[147] -#define __pyx_n_u_dta __pyx_string_tab[148] -#define __pyx_n_u_dtype __pyx_string_tab[149] -#define __pyx_n_u_dtypes __pyx_string_tab[150] -#define __pyx_n_u_duplicated __pyx_string_tab[151] -#define __pyx_n_u_empty __pyx_string_tab[152] -#define __pyx_kp_u_enable __pyx_string_tab[153] -#define __pyx_n_u_encode __pyx_string_tab[154] -#define __pyx_n_u_encoding __pyx_string_tab[155] -#define __pyx_n_u_enumerate __pyx_string_tab[156] -#define __pyx_n_u_expanduser __pyx_string_tab[157] -#define __pyx_n_u_extend __pyx_string_tab[158] -#define __pyx_n_u_extra_date_formats __pyx_string_tab[159] -#define __pyx_n_u_extra_datetime_formats __pyx_string_tab[160] -#define __pyx_n_u_extra_time_formats __pyx_string_tab[161] -#define __pyx_n_u_file_encoding __pyx_string_tab[162] -#define __pyx_n_u_file_extension __pyx_string_tab[163] -#define __pyx_n_u_file_format __pyx_string_tab[164] -#define __pyx_n_u_file_label __pyx_string_tab[165] -#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[166] -#define __pyx_n_u_filename_path __pyx_string_tab[167] -#define __pyx_n_u_fill __pyx_string_tab[168] -#define __pyx_n_u_float __pyx_string_tab[169] -#define __pyx_n_u_float64 __pyx_string_tab[170] -#define __pyx_n_u_format __pyx_string_tab[171] -#define __pyx_n_u_formats_as_category __pyx_string_tab[172] -#define __pyx_n_u_formats_as_ordered_category __pyx_string_tab[173] -#define __pyx_n_u_from_dict __pyx_string_tab[174] -#define __pyx_n_u_from_epoch __pyx_string_tab[175] -#define __pyx_n_u_fromtimestamp __pyx_string_tab[176] -#define __pyx_n_u_fsdecode __pyx_string_tab[177] -#define __pyx_n_u_fsencode __pyx_string_tab[178] -#define __pyx_n_u_func __pyx_string_tab[179] -#define __pyx_kp_u_gc __pyx_string_tab[180] -#define __pyx_n_u_get __pyx_string_tab[181] -#define __pyx_n_u_get_native_namespace __pyx_string_tab[182] -#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[183] -#define __pyx_n_u_getstate __pyx_string_tab[184] -#define __pyx_n_u_hi __pyx_string_tab[185] -#define __pyx_n_u_init __pyx_string_tab[186] -#define __pyx_n_u_initializing __pyx_string_tab[187] -#define __pyx_n_u_int16 __pyx_string_tab[188] -#define __pyx_n_u_int32 __pyx_string_tab[189] -#define __pyx_n_u_int64 __pyx_string_tab[190] -#define __pyx_n_u_int8 __pyx_string_tab[191] -#define __pyx_n_u_is_coroutine __pyx_string_tab[192] -#define __pyx_n_u_is_dichotomy __pyx_string_tab[193] -#define __pyx_kp_u_isenabled __pyx_string_tab[194] -#define __pyx_n_u_isfile __pyx_string_tab[195] -#define __pyx_n_u_items __pyx_string_tab[196] -#define __pyx_n_u_keys __pyx_string_tab[197] -#define __pyx_n_u_label __pyx_string_tab[198] -#define __pyx_n_u_left __pyx_string_tab[199] -#define __pyx_n_u_lo __pyx_string_tab[200] -#define __pyx_n_u_loc __pyx_string_tab[201] -#define __pyx_n_u_main __pyx_string_tab[202] -#define __pyx_n_u_metaclass __pyx_string_tab[203] -#define __pyx_n_u_metadata __pyx_string_tab[204] -#define __pyx_n_u_metadata_container __pyx_string_tab[205] -#define __pyx_n_u_metadata_container___init __pyx_string_tab[206] -#define __pyx_n_u_metadataonly __pyx_string_tab[207] -#define __pyx_n_u_metaonly __pyx_string_tab[208] -#define __pyx_n_u_missing_ranges __pyx_string_tab[209] -#define __pyx_n_u_missing_user_values __pyx_string_tab[210] -#define __pyx_n_u_modification_time __pyx_string_tab[211] -#define __pyx_n_u_module __pyx_string_tab[212] -#define __pyx_n_u_mr_sets __pyx_string_tab[213] -#define __pyx_n_u_mro_entries __pyx_string_tab[214] -#define __pyx_n_u_name __pyx_string_tab[215] -#define __pyx_n_u_name_2 __pyx_string_tab[216] -#define __pyx_n_u_nan __pyx_string_tab[217] -#define __pyx_n_u_narwhals __pyx_string_tab[218] -#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[219] -#define __pyx_n_u_no_datetime_conversion __pyx_string_tab[220] -#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[221] -#define __pyx_n_u_nominal __pyx_string_tab[222] -#define __pyx_n_u_notes __pyx_string_tab[223] -#define __pyx_n_u_np __pyx_string_tab[224] -#define __pyx_n_u_nt __pyx_string_tab[225] -#define __pyx_n_u_number_columns __pyx_string_tab[226] -#define __pyx_n_u_number_rows __pyx_string_tab[227] -#define __pyx_n_u_numpy __pyx_string_tab[228] -#define __pyx_n_u_nw __pyx_string_tab[229] -#define __pyx_n_u_object __pyx_string_tab[230] -#define __pyx_n_u_ordinal __pyx_string_tab[231] -#define __pyx_n_u_original_variable_types __pyx_string_tab[232] -#define __pyx_n_u_os __pyx_string_tab[233] -#define __pyx_n_u_output_format __pyx_string_tab[234] -#define __pyx_kp_u_output_format_must_be_one_of_all __pyx_string_tab[235] -#define __pyx_n_u_pandas __pyx_string_tab[236] -#define __pyx_n_u_parser_entry_point __pyx_string_tab[237] -#define __pyx_n_u_parser_format __pyx_string_tab[238] -#define __pyx_n_u_path __pyx_string_tab[239] -#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[240] -#define __pyx_kp_u_path_must_be_str_bytes_or_unicod __pyx_string_tab[241] -#define __pyx_n_u_polars __pyx_string_tab[242] -#define __pyx_n_u_pop __pyx_string_tab[243] -#define __pyx_n_u_por __pyx_string_tab[244] -#define __pyx_n_u_prepare __pyx_string_tab[245] -#define __pyx_n_u_pyreadstat__readstat_parser __pyx_string_tab[246] -#define __pyx_kp_u_pyreadstat__readstat_parser_pyx __pyx_string_tab[247] -#define __pyx_n_u_pyx_capi __pyx_string_tab[248] -#define __pyx_n_u_pyx_state __pyx_string_tab[249] -#define __pyx_n_u_qualname __pyx_string_tab[250] -#define __pyx_n_u_range __pyx_string_tab[251] -#define __pyx_n_u_read __pyx_string_tab[252] -#define __pyx_n_u_readstat_to_numpy_types __pyx_string_tab[253] -#define __pyx_n_u_readstat_variable_types __pyx_string_tab[254] -#define __pyx_n_u_reduce __pyx_string_tab[255] -#define __pyx_n_u_reduce_cython __pyx_string_tab[256] -#define __pyx_n_u_reduce_ex __pyx_string_tab[257] -#define __pyx_n_u_right __pyx_string_tab[258] -#define __pyx_n_u_row_limit __pyx_string_tab[259] -#define __pyx_n_u_row_offset __pyx_string_tab[260] -#define __pyx_n_u_s __pyx_string_tab[261] -#define __pyx_n_u_sas7bcat __pyx_string_tab[262] -#define __pyx_n_u_sas7bdat __pyx_string_tab[263] -#define __pyx_n_u_sas_all_formats __pyx_string_tab[264] -#define __pyx_n_u_sas_date_formats __pyx_string_tab[265] -#define __pyx_n_u_sas_datetime_formats __pyx_string_tab[266] -#define __pyx_n_u_sas_origin __pyx_string_tab[267] -#define __pyx_n_u_sas_time_formats __pyx_string_tab[268] -#define __pyx_kp_u_sav_zsav __pyx_string_tab[269] -#define __pyx_n_u_scale __pyx_string_tab[270] -#define __pyx_n_u_schema __pyx_string_tab[271] -#define __pyx_n_u_seek __pyx_string_tab[272] -#define __pyx_n_u_self __pyx_string_tab[273] -#define __pyx_n_u_set_name __pyx_string_tab[274] -#define __pyx_n_u_setstate __pyx_string_tab[275] -#define __pyx_n_u_setstate_cython __pyx_string_tab[276] -#define __pyx_n_u_spec __pyx_string_tab[277] -#define __pyx_n_u_spss_all_formats __pyx_string_tab[278] -#define __pyx_n_u_spss_date_formats __pyx_string_tab[279] -#define __pyx_n_u_spss_datetime_formats __pyx_string_tab[280] -#define __pyx_n_u_spss_origin __pyx_string_tab[281] -#define __pyx_n_u_spss_time_formats __pyx_string_tab[282] -#define __pyx_n_u_stable __pyx_string_tab[283] -#define __pyx_n_u_stata_all_formats __pyx_string_tab[284] -#define __pyx_n_u_stata_date_formats __pyx_string_tab[285] -#define __pyx_n_u_stata_datetime_formats __pyx_string_tab[286] -#define __pyx_n_u_stata_origin __pyx_string_tab[287] -#define __pyx_n_u_stata_time_formats __pyx_string_tab[288] -#define __pyx_n_u_string __pyx_string_tab[289] -#define __pyx_kp_u_stringsource __pyx_string_tab[290] -#define __pyx_n_u_surrogateescape __pyx_string_tab[291] -#define __pyx_n_u_sys __pyx_string_tab[292] -#define __pyx_kp_u_tC __pyx_string_tab[293] -#define __pyx_n_u_table_name __pyx_string_tab[294] -#define __pyx_kp_u_tc __pyx_string_tab[295] -#define __pyx_kp_u_tcHH_MM __pyx_string_tab[296] -#define __pyx_kp_u_tcHH_MM_SS __pyx_string_tab[297] -#define __pyx_kp_u_td __pyx_string_tab[298] -#define __pyx_kp_u_tdCCYY_NN_DD __pyx_string_tab[299] -#define __pyx_kp_u_tdD_m_Y __pyx_string_tab[300] -#define __pyx_n_u_tell __pyx_string_tab[301] -#define __pyx_n_u_test __pyx_string_tab[302] -#define __pyx_n_u_time __pyx_string_tab[303] -#define __pyx_n_u_time_unit __pyx_string_tab[304] -#define __pyx_n_u_to_datetime __pyx_string_tab[305] -#define __pyx_n_u_to_native __pyx_string_tab[306] -#define __pyx_n_u_tolist __pyx_string_tab[307] -#define __pyx_n_u_type __pyx_string_tab[308] -#define __pyx_n_u_undetermined __pyx_string_tab[309] -#define __pyx_n_u_unknown __pyx_string_tab[310] -#define __pyx_n_u_usecols __pyx_string_tab[311] -#define __pyx_n_u_user_missing __pyx_string_tab[312] -#define __pyx_n_u_usernan __pyx_string_tab[313] -#define __pyx_kp_u_utf_8 __pyx_string_tab[314] -#define __pyx_n_u_v2 __pyx_string_tab[315] -#define __pyx_n_u_value_labels __pyx_string_tab[316] -#define __pyx_n_u_variable_alignment __pyx_string_tab[317] -#define __pyx_n_u_variable_display_width __pyx_string_tab[318] -#define __pyx_n_u_variable_list __pyx_string_tab[319] -#define __pyx_n_u_variable_measure __pyx_string_tab[320] -#define __pyx_n_u_variable_storage_width __pyx_string_tab[321] -#define __pyx_n_u_variable_to_label __pyx_string_tab[322] -#define __pyx_n_u_variable_value_labels __pyx_string_tab[323] -#define __pyx_n_u_warn __pyx_string_tab[324] -#define __pyx_n_u_warnings __pyx_string_tab[325] -#define __pyx_n_u_with_columns __pyx_string_tab[326] -#define __pyx_kp_u_with_date_type_in_column __pyx_string_tab[327] -#define __pyx_kp_u_wrong_parser_format __pyx_string_tab[328] -#define __pyx_n_u_xport __pyx_string_tab[329] -#define __pyx_n_u_zip __pyx_string_tab[330] +#define __pyx_n_u_TypeError __pyx_string_tab[90] +#define __pyx_n_u_UnicodeError __pyx_string_tab[91] +#define __pyx_kp_u_Unknown_file_format __pyx_string_tab[92] +#define __pyx_kp_u_Unkown_data_type __pyx_string_tab[93] +#define __pyx_n_u_WEEKDATE __pyx_string_tab[94] +#define __pyx_n_u_WEEKDATX __pyx_string_tab[95] +#define __pyx_n_u_YMDHMS16 __pyx_string_tab[96] +#define __pyx_n_u_YMDHMS19 __pyx_string_tab[97] +#define __pyx_kp_u_YMDHMS19_2 __pyx_string_tab[98] +#define __pyx_n_u_YMDHMS20 __pyx_string_tab[99] +#define __pyx_n_u_YYMMDD __pyx_string_tab[100] +#define __pyx_n_u_YYMMDD10 __pyx_string_tab[101] +#define __pyx_n_u_YYMMDDB __pyx_string_tab[102] +#define __pyx_n_u_YYMMDDD __pyx_string_tab[103] +#define __pyx_n_u_YYMMDDN __pyx_string_tab[104] +#define __pyx_n_u_YYMMDDP __pyx_string_tab[105] +#define __pyx_n_u_YYMMDDS __pyx_string_tab[106] +#define __pyx_kp_u_You_requested_pandas_as_output_f __pyx_string_tab[107] +#define __pyx_kp_u_You_requested_polars_as_output_f __pyx_string_tab[108] +#define __pyx_kp_u__2 __pyx_string_tab[109] +#define __pyx_kp_u__3 __pyx_string_tab[110] +#define __pyx_kp_u__4 __pyx_string_tab[111] +#define __pyx_kp_u_add_note __pyx_string_tab[112] +#define __pyx_n_u_all __pyx_string_tab[113] +#define __pyx_n_u_allowed_formats __pyx_string_tab[114] +#define __pyx_n_u_append __pyx_string_tab[115] +#define __pyx_n_u_astype __pyx_string_tab[116] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[117] +#define __pyx_n_u_backend __pyx_string_tab[118] +#define __pyx_n_u_center __pyx_string_tab[119] +#define __pyx_n_u_class_getitem __pyx_string_tab[120] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[121] +#define __pyx_n_u_col __pyx_string_tab[122] +#define __pyx_n_u_collections __pyx_string_tab[123] +#define __pyx_kp_u_column_0_is_duplicated_renamed_t __pyx_string_tab[124] +#define __pyx_n_u_column_labels __pyx_string_tab[125] +#define __pyx_n_u_column_names __pyx_string_tab[126] +#define __pyx_n_u_column_names_to_labels __pyx_string_tab[127] +#define __pyx_n_u_columns __pyx_string_tab[128] +#define __pyx_n_u_copy __pyx_string_tab[129] +#define __pyx_n_u_counted_value __pyx_string_tab[130] +#define __pyx_n_u_creation_time __pyx_string_tab[131] +#define __pyx_n_u_d __pyx_string_tab[132] +#define __pyx_kp_u_d_2 __pyx_string_tab[133] +#define __pyx_n_u_data_container __pyx_string_tab[134] +#define __pyx_n_u_data_container___reduce_cython __pyx_string_tab[135] +#define __pyx_n_u_data_container___setstate_cython __pyx_string_tab[136] +#define __pyx_n_u_data_frame __pyx_string_tab[137] +#define __pyx_n_u_date __pyx_string_tab[138] +#define __pyx_n_u_dates_as_pandas __pyx_string_tab[139] +#define __pyx_n_u_dates_as_pandas_datetime __pyx_string_tab[140] +#define __pyx_n_u_datetime __pyx_string_tab[141] +#define __pyx_n_u_dict __pyx_string_tab[142] +#define __pyx_kp_u_disable __pyx_string_tab[143] +#define __pyx_n_u_disable_datetime_conversion __pyx_string_tab[144] +#define __pyx_n_u_doc __pyx_string_tab[145] +#define __pyx_n_u_double __pyx_string_tab[146] +#define __pyx_n_u_dta __pyx_string_tab[147] +#define __pyx_n_u_dtype __pyx_string_tab[148] +#define __pyx_n_u_dtypes __pyx_string_tab[149] +#define __pyx_n_u_duplicated __pyx_string_tab[150] +#define __pyx_n_u_empty __pyx_string_tab[151] +#define __pyx_kp_u_enable __pyx_string_tab[152] +#define __pyx_n_u_encode __pyx_string_tab[153] +#define __pyx_n_u_encoding __pyx_string_tab[154] +#define __pyx_n_u_enumerate __pyx_string_tab[155] +#define __pyx_n_u_expanduser __pyx_string_tab[156] +#define __pyx_n_u_extend __pyx_string_tab[157] +#define __pyx_n_u_extra_date_formats __pyx_string_tab[158] +#define __pyx_n_u_extra_datetime_formats __pyx_string_tab[159] +#define __pyx_n_u_extra_time_formats __pyx_string_tab[160] +#define __pyx_n_u_file_encoding __pyx_string_tab[161] +#define __pyx_n_u_file_extension __pyx_string_tab[162] +#define __pyx_n_u_file_format __pyx_string_tab[163] +#define __pyx_n_u_file_label __pyx_string_tab[164] +#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[165] +#define __pyx_n_u_filename_path __pyx_string_tab[166] +#define __pyx_n_u_fill __pyx_string_tab[167] +#define __pyx_n_u_float __pyx_string_tab[168] +#define __pyx_n_u_float64 __pyx_string_tab[169] +#define __pyx_n_u_format __pyx_string_tab[170] +#define __pyx_n_u_formats_as_category __pyx_string_tab[171] +#define __pyx_n_u_formats_as_ordered_category __pyx_string_tab[172] +#define __pyx_n_u_from_dict __pyx_string_tab[173] +#define __pyx_n_u_from_epoch __pyx_string_tab[174] +#define __pyx_n_u_fromtimestamp __pyx_string_tab[175] +#define __pyx_n_u_fsdecode __pyx_string_tab[176] +#define __pyx_n_u_fsencode __pyx_string_tab[177] +#define __pyx_n_u_func __pyx_string_tab[178] +#define __pyx_kp_u_gc __pyx_string_tab[179] +#define __pyx_n_u_get __pyx_string_tab[180] +#define __pyx_n_u_get_native_namespace __pyx_string_tab[181] +#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[182] +#define __pyx_n_u_getstate __pyx_string_tab[183] +#define __pyx_n_u_hi __pyx_string_tab[184] +#define __pyx_n_u_initializing __pyx_string_tab[185] +#define __pyx_n_u_int16 __pyx_string_tab[186] +#define __pyx_n_u_int32 __pyx_string_tab[187] +#define __pyx_n_u_int64 __pyx_string_tab[188] +#define __pyx_n_u_int8 __pyx_string_tab[189] +#define __pyx_n_u_is_coroutine __pyx_string_tab[190] +#define __pyx_n_u_is_dichotomy __pyx_string_tab[191] +#define __pyx_kp_u_isenabled __pyx_string_tab[192] +#define __pyx_n_u_isfile __pyx_string_tab[193] +#define __pyx_n_u_items __pyx_string_tab[194] +#define __pyx_n_u_keys __pyx_string_tab[195] +#define __pyx_n_u_label __pyx_string_tab[196] +#define __pyx_n_u_left __pyx_string_tab[197] +#define __pyx_n_u_lo __pyx_string_tab[198] +#define __pyx_n_u_loc __pyx_string_tab[199] +#define __pyx_n_u_main __pyx_string_tab[200] +#define __pyx_n_u_metaclass __pyx_string_tab[201] +#define __pyx_n_u_metadata __pyx_string_tab[202] +#define __pyx_n_u_metadata_container __pyx_string_tab[203] +#define __pyx_n_u_metadataonly __pyx_string_tab[204] +#define __pyx_n_u_metaonly __pyx_string_tab[205] +#define __pyx_n_u_missing_ranges __pyx_string_tab[206] +#define __pyx_n_u_missing_user_values __pyx_string_tab[207] +#define __pyx_n_u_modification_time __pyx_string_tab[208] +#define __pyx_n_u_module __pyx_string_tab[209] +#define __pyx_n_u_mr_sets __pyx_string_tab[210] +#define __pyx_n_u_mro_entries __pyx_string_tab[211] +#define __pyx_n_u_name __pyx_string_tab[212] +#define __pyx_n_u_name_2 __pyx_string_tab[213] +#define __pyx_n_u_nan __pyx_string_tab[214] +#define __pyx_n_u_narwhals __pyx_string_tab[215] +#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[216] +#define __pyx_n_u_no_datetime_conversion __pyx_string_tab[217] +#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[218] +#define __pyx_n_u_nominal __pyx_string_tab[219] +#define __pyx_n_u_notes __pyx_string_tab[220] +#define __pyx_n_u_np __pyx_string_tab[221] +#define __pyx_n_u_nt __pyx_string_tab[222] +#define __pyx_n_u_number_columns __pyx_string_tab[223] +#define __pyx_n_u_number_rows __pyx_string_tab[224] +#define __pyx_n_u_numpy __pyx_string_tab[225] +#define __pyx_n_u_nw __pyx_string_tab[226] +#define __pyx_n_u_object __pyx_string_tab[227] +#define __pyx_n_u_ordinal __pyx_string_tab[228] +#define __pyx_n_u_original_variable_types __pyx_string_tab[229] +#define __pyx_n_u_os __pyx_string_tab[230] +#define __pyx_n_u_output_format __pyx_string_tab[231] +#define __pyx_kp_u_output_format_must_be_one_of_all __pyx_string_tab[232] +#define __pyx_n_u_pandas __pyx_string_tab[233] +#define __pyx_n_u_parser_entry_point __pyx_string_tab[234] +#define __pyx_n_u_parser_format __pyx_string_tab[235] +#define __pyx_n_u_path __pyx_string_tab[236] +#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[237] +#define __pyx_kp_u_path_must_be_str_bytes_or_unicod __pyx_string_tab[238] +#define __pyx_n_u_polars __pyx_string_tab[239] +#define __pyx_n_u_pop __pyx_string_tab[240] +#define __pyx_n_u_por __pyx_string_tab[241] +#define __pyx_n_u_prepare __pyx_string_tab[242] +#define __pyx_n_u_pyclasses __pyx_string_tab[243] +#define __pyx_n_u_pyreadstat__readstat_parser __pyx_string_tab[244] +#define __pyx_kp_u_pyreadstat__readstat_parser_pyx __pyx_string_tab[245] +#define __pyx_n_u_pyx_capi __pyx_string_tab[246] +#define __pyx_n_u_pyx_state __pyx_string_tab[247] +#define __pyx_n_u_qualname __pyx_string_tab[248] +#define __pyx_n_u_range __pyx_string_tab[249] +#define __pyx_n_u_read __pyx_string_tab[250] +#define __pyx_n_u_readstat_to_numpy_types __pyx_string_tab[251] +#define __pyx_n_u_readstat_variable_types __pyx_string_tab[252] +#define __pyx_n_u_reduce __pyx_string_tab[253] +#define __pyx_n_u_reduce_cython __pyx_string_tab[254] +#define __pyx_n_u_reduce_ex __pyx_string_tab[255] +#define __pyx_n_u_right __pyx_string_tab[256] +#define __pyx_n_u_row_limit __pyx_string_tab[257] +#define __pyx_n_u_row_offset __pyx_string_tab[258] +#define __pyx_n_u_s __pyx_string_tab[259] +#define __pyx_n_u_sas7bcat __pyx_string_tab[260] +#define __pyx_n_u_sas7bdat __pyx_string_tab[261] +#define __pyx_n_u_sas_all_formats __pyx_string_tab[262] +#define __pyx_n_u_sas_date_formats __pyx_string_tab[263] +#define __pyx_n_u_sas_datetime_formats __pyx_string_tab[264] +#define __pyx_n_u_sas_origin __pyx_string_tab[265] +#define __pyx_n_u_sas_time_formats __pyx_string_tab[266] +#define __pyx_kp_u_sav_zsav __pyx_string_tab[267] +#define __pyx_n_u_scale __pyx_string_tab[268] +#define __pyx_n_u_schema __pyx_string_tab[269] +#define __pyx_n_u_seek __pyx_string_tab[270] +#define __pyx_n_u_self __pyx_string_tab[271] +#define __pyx_n_u_set_name __pyx_string_tab[272] +#define __pyx_n_u_setstate __pyx_string_tab[273] +#define __pyx_n_u_setstate_cython __pyx_string_tab[274] +#define __pyx_n_u_spec __pyx_string_tab[275] +#define __pyx_n_u_spss_all_formats __pyx_string_tab[276] +#define __pyx_n_u_spss_date_formats __pyx_string_tab[277] +#define __pyx_n_u_spss_datetime_formats __pyx_string_tab[278] +#define __pyx_n_u_spss_origin __pyx_string_tab[279] +#define __pyx_n_u_spss_time_formats __pyx_string_tab[280] +#define __pyx_n_u_stable __pyx_string_tab[281] +#define __pyx_n_u_stata_all_formats __pyx_string_tab[282] +#define __pyx_n_u_stata_date_formats __pyx_string_tab[283] +#define __pyx_n_u_stata_datetime_formats __pyx_string_tab[284] +#define __pyx_n_u_stata_origin __pyx_string_tab[285] +#define __pyx_n_u_stata_time_formats __pyx_string_tab[286] +#define __pyx_n_u_string __pyx_string_tab[287] +#define __pyx_kp_u_stringsource __pyx_string_tab[288] +#define __pyx_n_u_surrogateescape __pyx_string_tab[289] +#define __pyx_n_u_sys __pyx_string_tab[290] +#define __pyx_kp_u_tC __pyx_string_tab[291] +#define __pyx_n_u_table_name __pyx_string_tab[292] +#define __pyx_kp_u_tc __pyx_string_tab[293] +#define __pyx_kp_u_tcHH_MM __pyx_string_tab[294] +#define __pyx_kp_u_tcHH_MM_SS __pyx_string_tab[295] +#define __pyx_kp_u_td __pyx_string_tab[296] +#define __pyx_kp_u_tdCCYY_NN_DD __pyx_string_tab[297] +#define __pyx_kp_u_tdD_m_Y __pyx_string_tab[298] +#define __pyx_n_u_tell __pyx_string_tab[299] +#define __pyx_n_u_test __pyx_string_tab[300] +#define __pyx_n_u_time __pyx_string_tab[301] +#define __pyx_n_u_time_unit __pyx_string_tab[302] +#define __pyx_n_u_to_datetime __pyx_string_tab[303] +#define __pyx_n_u_to_native __pyx_string_tab[304] +#define __pyx_n_u_tolist __pyx_string_tab[305] +#define __pyx_n_u_type __pyx_string_tab[306] +#define __pyx_n_u_undetermined __pyx_string_tab[307] +#define __pyx_n_u_unknown __pyx_string_tab[308] +#define __pyx_n_u_usecols __pyx_string_tab[309] +#define __pyx_n_u_user_missing __pyx_string_tab[310] +#define __pyx_n_u_usernan __pyx_string_tab[311] +#define __pyx_kp_u_utf_8 __pyx_string_tab[312] +#define __pyx_n_u_v2 __pyx_string_tab[313] +#define __pyx_n_u_value_labels __pyx_string_tab[314] +#define __pyx_n_u_variable_alignment __pyx_string_tab[315] +#define __pyx_n_u_variable_display_width __pyx_string_tab[316] +#define __pyx_n_u_variable_list __pyx_string_tab[317] +#define __pyx_n_u_variable_measure __pyx_string_tab[318] +#define __pyx_n_u_variable_storage_width __pyx_string_tab[319] +#define __pyx_n_u_variable_to_label __pyx_string_tab[320] +#define __pyx_n_u_variable_value_labels __pyx_string_tab[321] +#define __pyx_n_u_warn __pyx_string_tab[322] +#define __pyx_n_u_warnings __pyx_string_tab[323] +#define __pyx_n_u_with_columns __pyx_string_tab[324] +#define __pyx_kp_u_with_date_type_in_column __pyx_string_tab[325] +#define __pyx_kp_u_wrong_parser_format __pyx_string_tab[326] +#define __pyx_n_u_xport __pyx_string_tab[327] +#define __pyx_n_u_zip __pyx_string_tab[328] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3764,8 +3747,8 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<331; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<329; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_100000); @@ -3799,8 +3782,8 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_type_10pyreadstat_16_readstat_parser_data_container); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<331; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<329; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_100000); @@ -5832,7 +5815,7 @@ static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":87 +/* "pyreadstat/_readstat_parser.pyx":89 * """ * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -5874,7 +5857,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "pyreadstat/_readstat_parser.pyx":88 + /* "pyreadstat/_readstat_parser.pyx":90 * * def __cinit__(self): * self.n_obs = 0 # <<<<<<<<<<<<<< @@ -5883,7 +5866,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->n_obs = 0; - /* "pyreadstat/_readstat_parser.pyx":89 + /* "pyreadstat/_readstat_parser.pyx":91 * def __cinit__(self): * self.n_obs = 0 * self.n_vars = 0 # <<<<<<<<<<<<<< @@ -5892,7 +5875,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->n_vars = 0; - /* "pyreadstat/_readstat_parser.pyx":90 + /* "pyreadstat/_readstat_parser.pyx":92 * self.n_obs = 0 * self.n_vars = 0 * self.max_n_obs = 0 # <<<<<<<<<<<<<< @@ -5901,14 +5884,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->max_n_obs = 0; - /* "pyreadstat/_readstat_parser.pyx":91 + /* "pyreadstat/_readstat_parser.pyx":93 * self.n_vars = 0 * self.max_n_obs = 0 * self.col_data = list() # <<<<<<<<<<<<<< * self.col_data_len = list() * self.col_names = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_data); @@ -5916,14 +5899,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":92 + /* "pyreadstat/_readstat_parser.pyx":94 * self.max_n_obs = 0 * self.col_data = list() * self.col_data_len = list() # <<<<<<<<<<<<<< * self.col_names = list() * self.col_labels = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_data_len); @@ -5931,14 +5914,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_data_len = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":93 + /* "pyreadstat/_readstat_parser.pyx":95 * self.col_data = list() * self.col_data_len = list() * self.col_names = list() # <<<<<<<<<<<<<< * self.col_labels = list() * self.col_dtypes = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_names); @@ -5946,14 +5929,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":94 + /* "pyreadstat/_readstat_parser.pyx":96 * self.col_data_len = list() * self.col_names = list() * self.col_labels = list() # <<<<<<<<<<<<<< * self.col_dtypes = list() * self.col_numpy_dtypes = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_labels); @@ -5961,14 +5944,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_labels = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":95 + /* "pyreadstat/_readstat_parser.pyx":97 * self.col_names = list() * self.col_labels = list() * self.col_dtypes = list() # <<<<<<<<<<<<<< * self.col_numpy_dtypes = list() * self.col_dtypes_isobject = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_dtypes); @@ -5976,14 +5959,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_dtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":96 + /* "pyreadstat/_readstat_parser.pyx":98 * self.col_labels = list() * self.col_dtypes = list() * self.col_numpy_dtypes = list() # <<<<<<<<<<<<<< * self.col_dtypes_isobject = list() * self.col_dytpes_isfloat = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_numpy_dtypes); @@ -5991,14 +5974,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_numpy_dtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":97 + /* "pyreadstat/_readstat_parser.pyx":99 * self.col_dtypes = list() * self.col_numpy_dtypes = list() * self.col_dtypes_isobject = list() # <<<<<<<<<<<<<< * self.col_dytpes_isfloat = list() * self.col_formats = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_dtypes_isobject); @@ -6006,14 +5989,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_dtypes_isobject = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":98 + /* "pyreadstat/_readstat_parser.pyx":100 * self.col_numpy_dtypes = list() * self.col_dtypes_isobject = list() * self.col_dytpes_isfloat = list() # <<<<<<<<<<<<<< * self.col_formats = list() * self.col_formats_original = list() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_dytpes_isfloat); @@ -6021,14 +6004,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_dytpes_isfloat = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":99 + /* "pyreadstat/_readstat_parser.pyx":101 * self.col_dtypes_isobject = list() * self.col_dytpes_isfloat = list() * self.col_formats = list() # <<<<<<<<<<<<<< * self.col_formats_original = list() * self.origin = None */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_formats); @@ -6036,14 +6019,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_formats = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":100 + /* "pyreadstat/_readstat_parser.pyx":102 * self.col_dytpes_isfloat = list() * self.col_formats = list() * self.col_formats_original = list() # <<<<<<<<<<<<<< * self.origin = None * self.unix_to_origin_secs = 0 */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->col_formats_original); @@ -6051,7 +6034,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->col_formats_original = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":101 + /* "pyreadstat/_readstat_parser.pyx":103 * self.col_formats = list() * self.col_formats_original = list() * self.origin = None # <<<<<<<<<<<<<< @@ -6064,7 +6047,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->origin); __pyx_v_self->origin = Py_None; - /* "pyreadstat/_readstat_parser.pyx":102 + /* "pyreadstat/_readstat_parser.pyx":104 * self.col_formats_original = list() * self.origin = None * self.unix_to_origin_secs = 0 # <<<<<<<<<<<<<< @@ -6073,7 +6056,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->unix_to_origin_secs = 0.0; - /* "pyreadstat/_readstat_parser.pyx":103 + /* "pyreadstat/_readstat_parser.pyx":105 * self.origin = None * self.unix_to_origin_secs = 0 * self.is_unkown_number_rows = 0 # <<<<<<<<<<<<<< @@ -6082,7 +6065,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->is_unkown_number_rows = 0; - /* "pyreadstat/_readstat_parser.pyx":104 + /* "pyreadstat/_readstat_parser.pyx":106 * self.unix_to_origin_secs = 0 * self.is_unkown_number_rows = 0 * self.file_encoding = None # <<<<<<<<<<<<<< @@ -6095,7 +6078,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->file_encoding); __pyx_v_self->file_encoding = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":105 + /* "pyreadstat/_readstat_parser.pyx":107 * self.is_unkown_number_rows = 0 * self.file_encoding = None * self.file_label = None # <<<<<<<<<<<<<< @@ -6108,7 +6091,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->file_label); __pyx_v_self->file_label = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":106 + /* "pyreadstat/_readstat_parser.pyx":108 * self.file_encoding = None * self.file_label = None * self.metaonly = 0 # <<<<<<<<<<<<<< @@ -6117,7 +6100,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->metaonly = 0; - /* "pyreadstat/_readstat_parser.pyx":107 + /* "pyreadstat/_readstat_parser.pyx":109 * self.file_label = None * self.metaonly = 0 * self.dates_as_pandas = 0 # <<<<<<<<<<<<<< @@ -6126,14 +6109,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->dates_as_pandas = 0; - /* "pyreadstat/_readstat_parser.pyx":108 + /* "pyreadstat/_readstat_parser.pyx":110 * self.metaonly = 0 * self.dates_as_pandas = 0 * self.label_to_var_name = dict() # <<<<<<<<<<<<<< * self.labels_raw = dict() * self.notes = list() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->label_to_var_name); @@ -6141,14 +6124,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->label_to_var_name = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":109 + /* "pyreadstat/_readstat_parser.pyx":111 * self.dates_as_pandas = 0 * self.label_to_var_name = dict() * self.labels_raw = dict() # <<<<<<<<<<<<<< * self.notes = list() * self.user_encoding = None */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->labels_raw); @@ -6156,14 +6139,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->labels_raw = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":110 + /* "pyreadstat/_readstat_parser.pyx":112 * self.label_to_var_name = dict() * self.labels_raw = dict() * self.notes = list() # <<<<<<<<<<<<<< * self.user_encoding = None * self.table_name = None */ - __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, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->notes); @@ -6171,7 +6154,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->notes = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":111 + /* "pyreadstat/_readstat_parser.pyx":113 * self.labels_raw = dict() * self.notes = list() * self.user_encoding = None # <<<<<<<<<<<<<< @@ -6184,7 +6167,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->user_encoding); __pyx_v_self->user_encoding = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":112 + /* "pyreadstat/_readstat_parser.pyx":114 * self.notes = list() * self.user_encoding = None * self.table_name = None # <<<<<<<<<<<<<< @@ -6197,7 +6180,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->table_name); __pyx_v_self->table_name = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":113 + /* "pyreadstat/_readstat_parser.pyx":115 * self.user_encoding = None * self.table_name = None * self.filter_cols = 0 # <<<<<<<<<<<<<< @@ -6206,14 +6189,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->filter_cols = 0; - /* "pyreadstat/_readstat_parser.pyx":114 + /* "pyreadstat/_readstat_parser.pyx":116 * self.table_name = None * self.filter_cols = 0 * self.use_cols = list() # <<<<<<<<<<<<<< * self.usernan = 0 * self.missing_ranges = dict() */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->use_cols); @@ -6221,7 +6204,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->use_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":115 + /* "pyreadstat/_readstat_parser.pyx":117 * self.filter_cols = 0 * self.use_cols = list() * self.usernan = 0 # <<<<<<<<<<<<<< @@ -6230,14 +6213,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->usernan = 0; - /* "pyreadstat/_readstat_parser.pyx":116 + /* "pyreadstat/_readstat_parser.pyx":118 * self.use_cols = list() * self.usernan = 0 * self.missing_ranges = dict() # <<<<<<<<<<<<<< * self.missing_user_values = dict() * self.variable_storage_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->missing_ranges); @@ -6245,14 +6228,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->missing_ranges = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":117 + /* "pyreadstat/_readstat_parser.pyx":119 * self.usernan = 0 * self.missing_ranges = dict() * self.missing_user_values = dict() # <<<<<<<<<<<<<< * self.variable_storage_width = dict() * self.variable_display_width = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->missing_user_values); @@ -6260,14 +6243,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->missing_user_values = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":118 + /* "pyreadstat/_readstat_parser.pyx":120 * self.missing_ranges = dict() * self.missing_user_values = dict() * self.variable_storage_width = dict() # <<<<<<<<<<<<<< * self.variable_display_width = dict() * self.variable_alignment = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_storage_width); @@ -6275,14 +6258,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_storage_width = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":119 + /* "pyreadstat/_readstat_parser.pyx":121 * self.missing_user_values = dict() * self.variable_storage_width = dict() * self.variable_display_width = dict() # <<<<<<<<<<<<<< * self.variable_alignment = dict() * self.variable_measure = dict() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_display_width); @@ -6290,14 +6273,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_display_width = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":120 + /* "pyreadstat/_readstat_parser.pyx":122 * self.variable_storage_width = dict() * self.variable_display_width = dict() * self.variable_alignment = dict() # <<<<<<<<<<<<<< * self.variable_measure = dict() * self.no_datetime_conversion = 0 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_alignment); @@ -6305,14 +6288,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_alignment = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":121 + /* "pyreadstat/_readstat_parser.pyx":123 * self.variable_display_width = dict() * self.variable_alignment = dict() * self.variable_measure = dict() # <<<<<<<<<<<<<< * self.no_datetime_conversion = 0 * self.ctime = 0 */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->variable_measure); @@ -6320,7 +6303,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->variable_measure = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":122 + /* "pyreadstat/_readstat_parser.pyx":124 * self.variable_alignment = dict() * self.variable_measure = dict() * self.no_datetime_conversion = 0 # <<<<<<<<<<<<<< @@ -6329,7 +6312,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->no_datetime_conversion = 0; - /* "pyreadstat/_readstat_parser.pyx":123 + /* "pyreadstat/_readstat_parser.pyx":125 * self.variable_measure = dict() * self.no_datetime_conversion = 0 * self.ctime = 0 # <<<<<<<<<<<<<< @@ -6338,7 +6321,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->ctime = 0; - /* "pyreadstat/_readstat_parser.pyx":124 + /* "pyreadstat/_readstat_parser.pyx":126 * self.no_datetime_conversion = 0 * self.ctime = 0 * self.mtime = 0 # <<<<<<<<<<<<<< @@ -6347,14 +6330,14 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s */ __pyx_v_self->mtime = 0; - /* "pyreadstat/_readstat_parser.pyx":125 + /* "pyreadstat/_readstat_parser.pyx":127 * self.ctime = 0 * self.mtime = 0 * self.mr_sets = dict() # <<<<<<<<<<<<<< * self.output_format = "" * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->mr_sets); @@ -6362,12 +6345,12 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __pyx_v_self->mr_sets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":126 + /* "pyreadstat/_readstat_parser.pyx":128 * self.mtime = 0 * self.mr_sets = dict() * self.output_format = "" # <<<<<<<<<<<<<< * - * class metadata_container: + * */ __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_); @@ -6375,7 +6358,7 @@ static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(s __Pyx_DECREF(__pyx_v_self->output_format); __pyx_v_self->output_format = __pyx_mstate_global->__pyx_kp_u_; - /* "pyreadstat/_readstat_parser.pyx":87 + /* "pyreadstat/_readstat_parser.pyx":89 * """ * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -6599,431 +6582,62 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_4__se return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":132 - * This class holds metadata we want to give back to python +/* "pyreadstat/_readstat_parser.pyx":146 + * + * + * cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): # <<<<<<<<<<<<<< * """ - * def __init__(self): # <<<<<<<<<<<<<< - * self.column_names = list() - * self.column_labels = list() + * Transforms a readstat var_format to a date, datetime or time format label */ -/* Python wrapper */ -static PyObject *__pyx_pw_10pyreadstat_16_readstat_parser_18metadata_container_1__init__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10pyreadstat_16_readstat_parser_18metadata_container_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10pyreadstat_16_readstat_parser_18metadata_container_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10pyreadstat_16_readstat_parser_18metadata_container_1__init__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,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, 132, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 1: - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 132, __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, "__init__", 0) < 0) __PYX_ERR(0, 132, __pyx_L3_error) - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 132, __pyx_L3_error) } - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 132, __pyx_L3_error) - } - __pyx_v_self = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 132, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("pyreadstat._readstat_parser.metadata_container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10pyreadstat_16_readstat_parser_18metadata_container___init__(__pyx_self, __pyx_v_self); - - /* function exit code */ - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_18metadata_container___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; +static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(PyObject *__pyx_v_var_format, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format) { + __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_r; + int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - /* "pyreadstat/_readstat_parser.pyx":133 + /* "pyreadstat/_readstat_parser.pyx":150 + * Transforms a readstat var_format to a date, datetime or time format label * """ - * def __init__(self): - * self.column_names = list() # <<<<<<<<<<<<<< - * self.column_labels = list() - * self.column_names_to_labels = dict() + * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< + * if var_format in sas_all_formats: + * if var_format in sas_date_formats: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + switch (__pyx_v_file_format) { + case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":134 - * def __init__(self): - * self.column_names = list() - * self.column_labels = list() # <<<<<<<<<<<<<< - * self.column_names_to_labels = dict() - * self.file_encoding = None + /* "pyreadstat/_readstat_parser.pyx":151 + * """ + * if file_format == FILE_FORMAT_SAS: + * if var_format in sas_all_formats: # <<<<<<<<<<<<<< + * if var_format in sas_date_formats: + * return DATE_FORMAT_DATE */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_1) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":135 - * self.column_names = list() - * self.column_labels = list() - * self.column_names_to_labels = dict() # <<<<<<<<<<<<<< - * self.file_encoding = None - * self.number_columns = None + /* "pyreadstat/_readstat_parser.pyx":152 + * if file_format == FILE_FORMAT_SAS: + * if var_format in sas_all_formats: + * if var_format in sas_date_formats: # <<<<<<<<<<<<<< + * return DATE_FORMAT_DATE + * elif var_format in sas_datetime_formats: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_1) < 0) __PYX_ERR(0, 135, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) + if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":136 - * self.column_labels = list() - * self.column_names_to_labels = dict() - * self.file_encoding = None # <<<<<<<<<<<<<< - * self.number_columns = None - * self.number_rows = None -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_file_encoding, Py_None) < 0) __PYX_ERR(0, 136, __pyx_L1_error) - - /* "pyreadstat/_readstat_parser.pyx":137 - * self.column_names_to_labels = dict() - * self.file_encoding = None - * self.number_columns = None # <<<<<<<<<<<<<< - * self.number_rows = None - * self.variable_value_labels = dict() -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_number_columns, Py_None) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - - /* "pyreadstat/_readstat_parser.pyx":138 - * self.file_encoding = None - * self.number_columns = None - * self.number_rows = None # <<<<<<<<<<<<<< - * self.variable_value_labels = dict() - * self.value_labels = dict() -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_number_rows, Py_None) < 0) __PYX_ERR(0, 138, __pyx_L1_error) - - /* "pyreadstat/_readstat_parser.pyx":139 - * self.number_columns = None - * self.number_rows = None - * self.variable_value_labels = dict() # <<<<<<<<<<<<<< - * self.value_labels = dict() - * self.variable_to_label = dict() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":140 - * self.number_rows = None - * self.variable_value_labels = dict() - * self.value_labels = dict() # <<<<<<<<<<<<<< - * self.variable_to_label = dict() - * self.notes = list() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_t_1) < 0) __PYX_ERR(0, 140, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":141 - * self.variable_value_labels = dict() - * self.value_labels = dict() - * self.variable_to_label = dict() # <<<<<<<<<<<<<< - * self.notes = list() - * self.original_variable_types = dict() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_t_1) < 0) __PYX_ERR(0, 141, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":142 - * self.value_labels = dict() - * self.variable_to_label = dict() - * self.notes = list() # <<<<<<<<<<<<<< - * self.original_variable_types = dict() - * self.readstat_variable_types = dict() -*/ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":143 - * self.variable_to_label = dict() - * self.notes = list() - * self.original_variable_types = dict() # <<<<<<<<<<<<<< - * self.readstat_variable_types = dict() - * self.table_name = None -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_t_1) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":144 - * self.notes = list() - * self.original_variable_types = dict() - * self.readstat_variable_types = dict() # <<<<<<<<<<<<<< - * self.table_name = None - * self.missing_ranges = dict() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_t_1) < 0) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":145 - * self.original_variable_types = dict() - * self.readstat_variable_types = dict() - * self.table_name = None # <<<<<<<<<<<<<< - * self.missing_ranges = dict() - * self.missing_user_values = dict() -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_table_name, Py_None) < 0) __PYX_ERR(0, 145, __pyx_L1_error) - - /* "pyreadstat/_readstat_parser.pyx":146 - * self.readstat_variable_types = dict() - * self.table_name = None - * self.missing_ranges = dict() # <<<<<<<<<<<<<< - * self.missing_user_values = dict() - * self.variable_storage_width = dict() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_1) < 0) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":147 - * self.table_name = None - * self.missing_ranges = dict() - * self.missing_user_values = dict() # <<<<<<<<<<<<<< - * self.variable_storage_width = dict() - * self.variable_display_width = dict() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_missing_user_values, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":148 - * self.missing_ranges = dict() - * self.missing_user_values = dict() - * self.variable_storage_width = dict() # <<<<<<<<<<<<<< - * self.variable_display_width = dict() - * self.variable_alignment = dict() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":149 - * self.missing_user_values = dict() - * self.variable_storage_width = dict() - * self.variable_display_width = dict() # <<<<<<<<<<<<<< - * self.variable_alignment = dict() - * self.variable_measure = dict() -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_1) < 0) __PYX_ERR(0, 149, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":150 - * self.variable_storage_width = dict() - * self.variable_display_width = dict() - * self.variable_alignment = dict() # <<<<<<<<<<<<<< - * self.variable_measure = dict() - * self.creation_time = None -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_1) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":151 - * self.variable_display_width = dict() - * self.variable_alignment = dict() - * self.variable_measure = dict() # <<<<<<<<<<<<<< - * self.creation_time = None - * self.modification_time = None -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_1) < 0) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":152 - * self.variable_alignment = dict() - * self.variable_measure = dict() - * self.creation_time = None # <<<<<<<<<<<<<< - * self.modification_time = None - * self.mr_sets = dict() -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_creation_time, Py_None) < 0) __PYX_ERR(0, 152, __pyx_L1_error) - - /* "pyreadstat/_readstat_parser.pyx":153 - * self.variable_measure = dict() - * self.creation_time = None - * self.modification_time = None # <<<<<<<<<<<<<< - * self.mr_sets = dict() - * -*/ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_modification_time, Py_None) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - - /* "pyreadstat/_readstat_parser.pyx":154 - * self.creation_time = None - * self.modification_time = None - * self.mr_sets = dict() # <<<<<<<<<<<<<< - * - * -*/ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_1) < 0) __PYX_ERR(0, 154, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "pyreadstat/_readstat_parser.pyx":132 - * This class holds metadata we want to give back to python - * """ - * def __init__(self): # <<<<<<<<<<<<<< - * self.column_names = list() - * self.column_labels = list() -*/ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("pyreadstat._readstat_parser.metadata_container.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pyreadstat/_readstat_parser.pyx":170 - * - * - * cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): # <<<<<<<<<<<<<< - * """ - * Transforms a readstat var_format to a date, datetime or time format label -*/ - -static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(PyObject *__pyx_v_var_format, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_v_file_format) { - __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_r; - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - - /* "pyreadstat/_readstat_parser.pyx":174 - * Transforms a readstat var_format to a date, datetime or time format label - * """ - * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< - * if var_format in sas_all_formats: - * if var_format in sas_date_formats: -*/ - switch (__pyx_v_file_format) { - case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - - /* "pyreadstat/_readstat_parser.pyx":175 - * """ - * if file_format == FILE_FORMAT_SAS: - * if var_format in sas_all_formats: # <<<<<<<<<<<<<< - * if var_format in sas_date_formats: - * return DATE_FORMAT_DATE -*/ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/_readstat_parser.pyx":176 - * if file_format == FILE_FORMAT_SAS: - * if var_format in sas_all_formats: - * if var_format in sas_date_formats: # <<<<<<<<<<<<<< - * return DATE_FORMAT_DATE - * elif var_format in sas_datetime_formats: -*/ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) - if (__pyx_t_1) { - - /* "pyreadstat/_readstat_parser.pyx":177 - * if var_format in sas_all_formats: - * if var_format in sas_date_formats: - * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< - * elif var_format in sas_datetime_formats: - * return DATE_FORMAT_DATETIME + /* "pyreadstat/_readstat_parser.pyx":153 + * if var_format in sas_all_formats: + * if var_format in sas_date_formats: + * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< + * elif var_format in sas_datetime_formats: + * return DATE_FORMAT_DATETIME */ __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":176 + /* "pyreadstat/_readstat_parser.pyx":152 * if file_format == FILE_FORMAT_SAS: * if var_format in sas_all_formats: * if var_format in sas_date_formats: # <<<<<<<<<<<<<< @@ -7032,17 +6646,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":178 + /* "pyreadstat/_readstat_parser.pyx":154 * if var_format in sas_date_formats: * return DATE_FORMAT_DATE * elif var_format in sas_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 154, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":179 + /* "pyreadstat/_readstat_parser.pyx":155 * return DATE_FORMAT_DATE * elif var_format in sas_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -7052,7 +6666,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":178 + /* "pyreadstat/_readstat_parser.pyx":154 * if var_format in sas_date_formats: * return DATE_FORMAT_DATE * elif var_format in sas_datetime_formats: # <<<<<<<<<<<<<< @@ -7061,17 +6675,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":180 + /* "pyreadstat/_readstat_parser.pyx":156 * elif var_format in sas_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * else: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 156, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":181 + /* "pyreadstat/_readstat_parser.pyx":157 * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -7081,7 +6695,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":180 + /* "pyreadstat/_readstat_parser.pyx":156 * elif var_format in sas_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in sas_time_formats: # <<<<<<<<<<<<<< @@ -7090,7 +6704,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":175 + /* "pyreadstat/_readstat_parser.pyx":151 * """ * if file_format == FILE_FORMAT_SAS: * if var_format in sas_all_formats: # <<<<<<<<<<<<<< @@ -7100,7 +6714,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":183 + /* "pyreadstat/_readstat_parser.pyx":159 * return DATE_FORMAT_TIME * else: * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -7113,7 +6727,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":174 + /* "pyreadstat/_readstat_parser.pyx":150 * Transforms a readstat var_format to a date, datetime or time format label * """ * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -7123,27 +6737,27 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":186 + /* "pyreadstat/_readstat_parser.pyx":162 * * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: # <<<<<<<<<<<<<< * if var_format in spss_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":187 + /* "pyreadstat/_readstat_parser.pyx":163 * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: * if var_format in spss_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":188 + /* "pyreadstat/_readstat_parser.pyx":164 * if var_format in spss_all_formats: * if var_format in spss_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -7153,7 +6767,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":187 + /* "pyreadstat/_readstat_parser.pyx":163 * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: * if var_format in spss_date_formats: # <<<<<<<<<<<<<< @@ -7162,17 +6776,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":189 + /* "pyreadstat/_readstat_parser.pyx":165 * if var_format in spss_date_formats: * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":190 + /* "pyreadstat/_readstat_parser.pyx":166 * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -7182,7 +6796,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":189 + /* "pyreadstat/_readstat_parser.pyx":165 * if var_format in spss_date_formats: * return DATE_FORMAT_DATE * elif var_format in spss_datetime_formats: # <<<<<<<<<<<<<< @@ -7191,17 +6805,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":191 + /* "pyreadstat/_readstat_parser.pyx":167 * elif var_format in spss_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * else: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 167, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":192 + /* "pyreadstat/_readstat_parser.pyx":168 * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -7211,7 +6825,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":191 + /* "pyreadstat/_readstat_parser.pyx":167 * elif var_format in spss_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in spss_time_formats: # <<<<<<<<<<<<<< @@ -7220,7 +6834,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":186 + /* "pyreadstat/_readstat_parser.pyx":162 * * elif file_format == FILE_FORMAT_SPSS: * if var_format in spss_all_formats: # <<<<<<<<<<<<<< @@ -7230,7 +6844,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre goto __pyx_L5; } - /* "pyreadstat/_readstat_parser.pyx":194 + /* "pyreadstat/_readstat_parser.pyx":170 * return DATE_FORMAT_TIME * else: * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -7243,7 +6857,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre } __pyx_L5:; - /* "pyreadstat/_readstat_parser.pyx":185 + /* "pyreadstat/_readstat_parser.pyx":161 * return DATE_FORMAT_NOTADATE * * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7253,27 +6867,27 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":197 + /* "pyreadstat/_readstat_parser.pyx":173 * * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: # <<<<<<<<<<<<<< * if var_format in stata_date_formats: * return DATE_FORMAT_DATE */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 173, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":198 + /* "pyreadstat/_readstat_parser.pyx":174 * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: * if var_format in stata_date_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":199 + /* "pyreadstat/_readstat_parser.pyx":175 * if var_format in stata_all_formats: * if var_format in stata_date_formats: * return DATE_FORMAT_DATE # <<<<<<<<<<<<<< @@ -7283,7 +6897,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":198 + /* "pyreadstat/_readstat_parser.pyx":174 * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: * if var_format in stata_date_formats: # <<<<<<<<<<<<<< @@ -7292,17 +6906,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":200 + /* "pyreadstat/_readstat_parser.pyx":176 * if var_format in stata_date_formats: * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":201 + /* "pyreadstat/_readstat_parser.pyx":177 * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME # <<<<<<<<<<<<<< @@ -7312,7 +6926,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":200 + /* "pyreadstat/_readstat_parser.pyx":176 * if var_format in stata_date_formats: * return DATE_FORMAT_DATE * elif var_format in stata_datetime_formats: # <<<<<<<<<<<<<< @@ -7321,17 +6935,17 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":202 + /* "pyreadstat/_readstat_parser.pyx":178 * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: # <<<<<<<<<<<<<< * return DATE_FORMAT_TIME * else: */ - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_var_format, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":203 + /* "pyreadstat/_readstat_parser.pyx":179 * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: * return DATE_FORMAT_TIME # <<<<<<<<<<<<<< @@ -7341,7 +6955,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre __pyx_r = __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":202 + /* "pyreadstat/_readstat_parser.pyx":178 * elif var_format in stata_datetime_formats: * return DATE_FORMAT_DATETIME * elif var_format in stata_time_formats: # <<<<<<<<<<<<<< @@ -7350,7 +6964,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre */ } - /* "pyreadstat/_readstat_parser.pyx":197 + /* "pyreadstat/_readstat_parser.pyx":173 * * elif file_format == FILE_FORMAT_STATA: * if var_format in stata_all_formats: # <<<<<<<<<<<<<< @@ -7360,7 +6974,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre goto __pyx_L7; } - /* "pyreadstat/_readstat_parser.pyx":205 + /* "pyreadstat/_readstat_parser.pyx":181 * return DATE_FORMAT_TIME * else: * return DATE_FORMAT_NOTADATE # <<<<<<<<<<<<<< @@ -7373,7 +6987,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre } __pyx_L7:; - /* "pyreadstat/_readstat_parser.pyx":196 + /* "pyreadstat/_readstat_parser.pyx":172 * return DATE_FORMAT_NOTADATE * * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7384,7 +6998,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre default: break; } - /* "pyreadstat/_readstat_parser.pyx":170 + /* "pyreadstat/_readstat_parser.pyx":146 * * * cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): # <<<<<<<<<<<<<< @@ -7402,7 +7016,7 @@ static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyre return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":207 +/* "pyreadstat/_readstat_parser.pyx":183 * return DATE_FORMAT_NOTADATE * * cdef object transform_datetime(py_datetime_format var_format, double tstamp, py_file_format file_format, object origin, # <<<<<<<<<<<<<< @@ -7428,7 +7042,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transform_datetime", 0); - /* "pyreadstat/_readstat_parser.pyx":225 + /* "pyreadstat/_readstat_parser.pyx":201 * # for any other we return a python datetime, date or time object. * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -7438,17 +7052,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py switch (__pyx_v_var_format) { case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE: - /* "pyreadstat/_readstat_parser.pyx":226 + /* "pyreadstat/_readstat_parser.pyx":202 * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: * if output_format == "polars": # <<<<<<<<<<<<<< * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":228 + /* "pyreadstat/_readstat_parser.pyx":204 * if output_format == "polars": * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7458,7 +7072,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":230 + /* "pyreadstat/_readstat_parser.pyx":206 * if file_format == FILE_FORMAT_SPSS: * # tstamp is in seconds * return (tstamp - unix_to_origin_secs)/86400 # <<<<<<<<<<<<<< @@ -7466,13 +7080,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * # tstamp is in days */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs) / 86400.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs) / 86400.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":228 + /* "pyreadstat/_readstat_parser.pyx":204 * if output_format == "polars": * # we want to return days from unix * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7481,7 +7095,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":233 + /* "pyreadstat/_readstat_parser.pyx":209 * else: * # tstamp is in days * return tstamp - (unix_to_origin_secs/86400) # <<<<<<<<<<<<<< @@ -7490,14 +7104,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - (__pyx_v_unix_to_origin_secs / 86400.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - (__pyx_v_unix_to_origin_secs / 86400.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":226 + /* "pyreadstat/_readstat_parser.pyx":202 * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: * if output_format == "polars": # <<<<<<<<<<<<<< @@ -7506,7 +7120,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":235 + /* "pyreadstat/_readstat_parser.pyx":211 * return tstamp - (unix_to_origin_secs/86400) * * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7516,7 +7130,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":237 + /* "pyreadstat/_readstat_parser.pyx":213 * if file_format == FILE_FORMAT_SPSS: * # tstamp is in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7525,7 +7139,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":238 + /* "pyreadstat/_readstat_parser.pyx":214 * # tstamp is in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7534,19 +7148,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":239 + /* "pyreadstat/_readstat_parser.pyx":215 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * tdelta = timedelta_new(days, secs, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":235 + /* "pyreadstat/_readstat_parser.pyx":211 * return tstamp - (unix_to_origin_secs/86400) * * if file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -7556,7 +7170,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L5; } - /* "pyreadstat/_readstat_parser.pyx":243 + /* "pyreadstat/_readstat_parser.pyx":219 * else: * # tstamp is in days * days = tstamp # <<<<<<<<<<<<<< @@ -7566,33 +7180,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)__pyx_v_tstamp); - /* "pyreadstat/_readstat_parser.pyx":244 + /* "pyreadstat/_readstat_parser.pyx":220 * # tstamp is in days * days = tstamp * tdelta = timedelta_new(days, 0, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L5:; - /* "pyreadstat/_readstat_parser.pyx":246 + /* "pyreadstat/_readstat_parser.pyx":222 * tdelta = timedelta_new(days, 0, 0) * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * if dates_as_pandas: * return mydat */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":247 + /* "pyreadstat/_readstat_parser.pyx":223 * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta * if dates_as_pandas: # <<<<<<<<<<<<<< @@ -7601,7 +7215,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ if (__pyx_v_dates_as_pandas) { - /* "pyreadstat/_readstat_parser.pyx":248 + /* "pyreadstat/_readstat_parser.pyx":224 * mydat = origin + tdelta * if dates_as_pandas: * return mydat # <<<<<<<<<<<<<< @@ -7613,7 +7227,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_r = __pyx_v_mydat; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":247 + /* "pyreadstat/_readstat_parser.pyx":223 * #tdelta = timedelta(days=tstamp) * mydat = origin + tdelta * if dates_as_pandas: # <<<<<<<<<<<<<< @@ -7622,7 +7236,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":250 + /* "pyreadstat/_readstat_parser.pyx":226 * return mydat * else: * return mydat.date() # <<<<<<<<<<<<<< @@ -7638,7 +7252,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_date, __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_2)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; @@ -7646,7 +7260,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":225 + /* "pyreadstat/_readstat_parser.pyx":201 * # for any other we return a python datetime, date or time object. * # polars also works with these objects, but it is slower * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -7656,17 +7270,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py break; case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME: - /* "pyreadstat/_readstat_parser.pyx":252 + /* "pyreadstat/_readstat_parser.pyx":228 * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: * if output_format == "polars": # <<<<<<<<<<<<<< * # we want to return seconds from unix * if file_format == FILE_FORMAT_STATA: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":254 + /* "pyreadstat/_readstat_parser.pyx":230 * if output_format == "polars": * # we want to return seconds from unix * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7676,7 +7290,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":256 + /* "pyreadstat/_readstat_parser.pyx":232 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * return (tstamp/1000) - unix_to_origin_secs # <<<<<<<<<<<<<< @@ -7684,13 +7298,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py * # tstamp in seconds */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp / 1000.0) - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_tstamp / 1000.0) - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":254 + /* "pyreadstat/_readstat_parser.pyx":230 * if output_format == "polars": * # we want to return seconds from unix * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7699,7 +7313,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":259 + /* "pyreadstat/_readstat_parser.pyx":235 * else: * # tstamp in seconds * return tstamp - unix_to_origin_secs # <<<<<<<<<<<<<< @@ -7708,14 +7322,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_tstamp - __pyx_v_unix_to_origin_secs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":252 + /* "pyreadstat/_readstat_parser.pyx":228 * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: * if output_format == "polars": # <<<<<<<<<<<<<< @@ -7724,7 +7338,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ } - /* "pyreadstat/_readstat_parser.pyx":261 + /* "pyreadstat/_readstat_parser.pyx":237 * return tstamp - unix_to_origin_secs * * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7734,7 +7348,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":263 + /* "pyreadstat/_readstat_parser.pyx":239 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) # <<<<<<<<<<<<<< @@ -7743,7 +7357,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400000.0))); - /* "pyreadstat/_readstat_parser.pyx":264 + /* "pyreadstat/_readstat_parser.pyx":240 * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 # <<<<<<<<<<<<<< @@ -7752,7 +7366,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_msecs = __Pyx_mod_double(__pyx_v_tstamp, 86400000.0, 1); - /* "pyreadstat/_readstat_parser.pyx":265 + /* "pyreadstat/_readstat_parser.pyx":241 * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 * secs = (msecs/1000) # <<<<<<<<<<<<<< @@ -7761,7 +7375,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)(__pyx_v_msecs / 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":266 + /* "pyreadstat/_readstat_parser.pyx":242 * msecs = tstamp % 86400000 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) # <<<<<<<<<<<<<< @@ -7770,19 +7384,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_usecs = ((int)(__Pyx_mod_double(__pyx_v_msecs, 1000.0, 1) * 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":267 + /* "pyreadstat/_readstat_parser.pyx":243 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(milliseconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":261 + /* "pyreadstat/_readstat_parser.pyx":237 * return tstamp - unix_to_origin_secs * * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7792,7 +7406,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L9; } - /* "pyreadstat/_readstat_parser.pyx":271 + /* "pyreadstat/_readstat_parser.pyx":247 * else: * # tstamp in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7802,7 +7416,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":272 + /* "pyreadstat/_readstat_parser.pyx":248 * # tstamp in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7811,33 +7425,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":273 + /* "pyreadstat/_readstat_parser.pyx":249 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * tdelta = timedelta_new(days, secs, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L9:; - /* "pyreadstat/_readstat_parser.pyx":275 + /* "pyreadstat/_readstat_parser.pyx":251 * tdelta = timedelta_new(days, secs, 0) * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * return mydat * elif var_format == DATE_FORMAT_TIME: */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":276 + /* "pyreadstat/_readstat_parser.pyx":252 * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta * return mydat # <<<<<<<<<<<<<< @@ -7849,7 +7463,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_r = __pyx_v_mydat; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":251 + /* "pyreadstat/_readstat_parser.pyx":227 * else: * return mydat.date() * elif var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -7859,7 +7473,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py break; case __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME: - /* "pyreadstat/_readstat_parser.pyx":278 + /* "pyreadstat/_readstat_parser.pyx":254 * return mydat * elif var_format == DATE_FORMAT_TIME: * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7869,7 +7483,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py __pyx_t_1 = (__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":280 + /* "pyreadstat/_readstat_parser.pyx":256 * if file_format == FILE_FORMAT_STATA: * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) # <<<<<<<<<<<<<< @@ -7878,7 +7492,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400000.0))); - /* "pyreadstat/_readstat_parser.pyx":281 + /* "pyreadstat/_readstat_parser.pyx":257 * # tstamp is in millisecons * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 # <<<<<<<<<<<<<< @@ -7887,7 +7501,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_msecs = __Pyx_mod_double(__pyx_v_tstamp, 86400000.0, 1); - /* "pyreadstat/_readstat_parser.pyx":282 + /* "pyreadstat/_readstat_parser.pyx":258 * days = (floor(tstamp / 86400000)) * msecs = tstamp % 86400000 * secs = (msecs/1000) # <<<<<<<<<<<<<< @@ -7896,7 +7510,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)(__pyx_v_msecs / 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":283 + /* "pyreadstat/_readstat_parser.pyx":259 * msecs = tstamp % 86400000 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) # <<<<<<<<<<<<<< @@ -7905,19 +7519,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_usecs = ((int)(__Pyx_mod_double(__pyx_v_msecs, 1000.0, 1) * 1000.0)); - /* "pyreadstat/_readstat_parser.pyx":284 + /* "pyreadstat/_readstat_parser.pyx":260 * secs = (msecs/1000) * usecs = ((msecs % 1000) * 1000 ) * tdelta = timedelta_new(days, secs, usecs) # <<<<<<<<<<<<<< * #tdelta = timedelta(milliseconds=tstamp) * else: */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, __pyx_v_usecs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":278 + /* "pyreadstat/_readstat_parser.pyx":254 * return mydat * elif var_format == DATE_FORMAT_TIME: * if file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -7927,7 +7541,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":288 + /* "pyreadstat/_readstat_parser.pyx":264 * else: * # tstamp in seconds * days = (floor(tstamp / 86400)) # <<<<<<<<<<<<<< @@ -7937,7 +7551,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py /*else*/ { __pyx_v_days = ((int)floor((__pyx_v_tstamp / 86400.0))); - /* "pyreadstat/_readstat_parser.pyx":289 + /* "pyreadstat/_readstat_parser.pyx":265 * # tstamp in seconds * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) # <<<<<<<<<<<<<< @@ -7946,33 +7560,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py */ __pyx_v_secs = ((int)__Pyx_mod_double(__pyx_v_tstamp, 86400.0, 1)); - /* "pyreadstat/_readstat_parser.pyx":290 + /* "pyreadstat/_readstat_parser.pyx":266 * days = (floor(tstamp / 86400)) * secs = (tstamp % 86400) * tdelta = timedelta_new(days, secs, 0) # <<<<<<<<<<<<<< * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_secs, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_tdelta = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":292 + /* "pyreadstat/_readstat_parser.pyx":268 * tdelta = timedelta_new(days, secs, 0) * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta # <<<<<<<<<<<<<< * return mydat.time() * */ - __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_origin, __pyx_v_tdelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mydat = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":293 + /* "pyreadstat/_readstat_parser.pyx":269 * #tdelta = timedelta(seconds=tstamp) * mydat = origin + tdelta * return mydat.time() # <<<<<<<<<<<<<< @@ -7987,14 +7601,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_time, __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_2)) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":277 + /* "pyreadstat/_readstat_parser.pyx":253 * mydat = origin + tdelta * return mydat * elif var_format == DATE_FORMAT_TIME: # <<<<<<<<<<<<<< @@ -8005,7 +7619,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py default: break; } - /* "pyreadstat/_readstat_parser.pyx":207 + /* "pyreadstat/_readstat_parser.pyx":183 * return DATE_FORMAT_NOTADATE * * cdef object transform_datetime(py_datetime_format var_format, double tstamp, py_file_format file_format, object origin, # <<<<<<<<<<<<<< @@ -8029,7 +7643,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__py return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":296 +/* "pyreadstat/_readstat_parser.pyx":272 * * * cdef object convert_readstat_to_python_value(readstat_value_t value, int index, data_container dc): # <<<<<<<<<<<<<< @@ -8078,7 +7692,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_readstat_to_python_value", 0); - /* "pyreadstat/_readstat_parser.pyx":324 + /* "pyreadstat/_readstat_parser.pyx":300 * cdef str output_format * * var_type = dc.col_dtypes[index] # <<<<<<<<<<<<<< @@ -8087,15 +7701,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ if (unlikely(__pyx_v_dc->col_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 324, __pyx_L1_error) + __PYX_ERR(0, 300, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_2 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_type = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":325 + /* "pyreadstat/_readstat_parser.pyx":301 * * var_type = dc.col_dtypes[index] * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -8104,15 +7718,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 325, __pyx_L1_error) + __PYX_ERR(0, 301, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_3 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_format = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":326 + /* "pyreadstat/_readstat_parser.pyx":302 * var_type = dc.col_dtypes[index] * var_format = dc.col_formats[index] * origin = dc.origin # <<<<<<<<<<<<<< @@ -8124,7 +7738,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_origin = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":327 + /* "pyreadstat/_readstat_parser.pyx":303 * var_format = dc.col_formats[index] * origin = dc.origin * unix_to_origin_secs = dc.unix_to_origin_secs # <<<<<<<<<<<<<< @@ -8134,7 +7748,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_4 = __pyx_v_dc->unix_to_origin_secs; __pyx_v_unix_to_origin_secs = __pyx_t_4; - /* "pyreadstat/_readstat_parser.pyx":328 + /* "pyreadstat/_readstat_parser.pyx":304 * origin = dc.origin * unix_to_origin_secs = dc.unix_to_origin_secs * dates_as_pandas = dc.dates_as_pandas # <<<<<<<<<<<<<< @@ -8144,7 +7758,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_5 = __pyx_v_dc->dates_as_pandas; __pyx_v_dates_as_pandas = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":329 + /* "pyreadstat/_readstat_parser.pyx":305 * unix_to_origin_secs = dc.unix_to_origin_secs * dates_as_pandas = dc.dates_as_pandas * file_format = dc.file_format # <<<<<<<<<<<<<< @@ -8154,7 +7768,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_6 = __pyx_v_dc->file_format; __pyx_v_file_format = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":330 + /* "pyreadstat/_readstat_parser.pyx":306 * dates_as_pandas = dc.dates_as_pandas * file_format = dc.file_format * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -8166,7 +7780,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":333 + /* "pyreadstat/_readstat_parser.pyx":309 * * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -8177,7 +7791,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt case READSTAT_TYPE_STRING: case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":334 + /* "pyreadstat/_readstat_parser.pyx":310 * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) # <<<<<<<<<<<<<< @@ -8186,7 +7800,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_str_value = readstat_string_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":335 + /* "pyreadstat/_readstat_parser.pyx":311 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * if c_str_value != NULL: # <<<<<<<<<<<<<< @@ -8196,14 +7810,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_5 = (__pyx_v_c_str_value != NULL); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":336 + /* "pyreadstat/_readstat_parser.pyx":312 * c_str_value = readstat_string_value(value) * if c_str_value != NULL: * py_str_value = c_str_value # <<<<<<<<<<<<<< * else: * py_str_value = '' */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -8211,7 +7825,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_v_py_str_value = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":335 + /* "pyreadstat/_readstat_parser.pyx":311 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * if c_str_value != NULL: # <<<<<<<<<<<<<< @@ -8221,7 +7835,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":338 + /* "pyreadstat/_readstat_parser.pyx":314 * py_str_value = c_str_value * else: * py_str_value = '' # <<<<<<<<<<<<<< @@ -8234,7 +7848,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":339 + /* "pyreadstat/_readstat_parser.pyx":315 * else: * py_str_value = '' * pyformat = VAR_FORMAT_STRING # <<<<<<<<<<<<<< @@ -8243,7 +7857,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING; - /* "pyreadstat/_readstat_parser.pyx":333 + /* "pyreadstat/_readstat_parser.pyx":309 * * # transform to values cython can deal with * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -8253,7 +7867,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":341 + /* "pyreadstat/_readstat_parser.pyx":317 * pyformat = VAR_FORMAT_STRING * elif var_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) # <<<<<<<<<<<<<< @@ -8262,7 +7876,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int8_value = readstat_int8_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":342 + /* "pyreadstat/_readstat_parser.pyx":318 * elif var_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value # <<<<<<<<<<<<<< @@ -8271,7 +7885,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int8_value); - /* "pyreadstat/_readstat_parser.pyx":343 + /* "pyreadstat/_readstat_parser.pyx":319 * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -8280,7 +7894,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":340 + /* "pyreadstat/_readstat_parser.pyx":316 * py_str_value = '' * pyformat = VAR_FORMAT_STRING * elif var_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -8290,7 +7904,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":345 + /* "pyreadstat/_readstat_parser.pyx":321 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) # <<<<<<<<<<<<<< @@ -8299,7 +7913,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int16_value = readstat_int16_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":346 + /* "pyreadstat/_readstat_parser.pyx":322 * elif var_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value # <<<<<<<<<<<<<< @@ -8308,7 +7922,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int16_value); - /* "pyreadstat/_readstat_parser.pyx":347 + /* "pyreadstat/_readstat_parser.pyx":323 * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -8317,7 +7931,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":344 + /* "pyreadstat/_readstat_parser.pyx":320 * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -8327,7 +7941,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":349 + /* "pyreadstat/_readstat_parser.pyx":325 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) # <<<<<<<<<<<<<< @@ -8336,7 +7950,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_int32_value = readstat_int32_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":350 + /* "pyreadstat/_readstat_parser.pyx":326 * elif var_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value # <<<<<<<<<<<<<< @@ -8345,7 +7959,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_long_value = ((long)__pyx_v_c_int32_value); - /* "pyreadstat/_readstat_parser.pyx":351 + /* "pyreadstat/_readstat_parser.pyx":327 * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -8354,7 +7968,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":348 + /* "pyreadstat/_readstat_parser.pyx":324 * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -8364,7 +7978,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":353 + /* "pyreadstat/_readstat_parser.pyx":329 * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) # <<<<<<<<<<<<<< @@ -8373,7 +7987,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_float_value = readstat_float_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":354 + /* "pyreadstat/_readstat_parser.pyx":330 * elif var_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) * py_float_value = c_float_value # <<<<<<<<<<<<<< @@ -8382,7 +7996,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_float_value = ((double)__pyx_v_c_float_value); - /* "pyreadstat/_readstat_parser.pyx":355 + /* "pyreadstat/_readstat_parser.pyx":331 * c_float_value = readstat_float_value(value) * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -8391,7 +8005,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":352 + /* "pyreadstat/_readstat_parser.pyx":328 * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG * elif var_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -8401,7 +8015,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":357 + /* "pyreadstat/_readstat_parser.pyx":333 * pyformat = VAR_FORMAT_FLOAT * elif var_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); # <<<<<<<<<<<<<< @@ -8410,7 +8024,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_c_double_value = readstat_double_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":358 + /* "pyreadstat/_readstat_parser.pyx":334 * elif var_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); * py_float_value = c_double_value # <<<<<<<<<<<<<< @@ -8419,7 +8033,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_py_float_value = ((double)__pyx_v_c_double_value); - /* "pyreadstat/_readstat_parser.pyx":359 + /* "pyreadstat/_readstat_parser.pyx":335 * c_double_value = readstat_double_value(value); * py_float_value = c_double_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -8428,7 +8042,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":356 + /* "pyreadstat/_readstat_parser.pyx":332 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif var_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -8438,7 +8052,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; default: - /* "pyreadstat/_readstat_parser.pyx":361 + /* "pyreadstat/_readstat_parser.pyx":337 * pyformat = VAR_FORMAT_FLOAT * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -8446,7 +8060,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt * # final transformation and storage */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8465,16 +8079,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __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, 361, __pyx_L1_error) + __PYX_ERR(0, 337, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":365 + /* "pyreadstat/_readstat_parser.pyx":341 * # final transformation and storage * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -8484,7 +8098,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt switch (__pyx_v_pyformat) { case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING: - /* "pyreadstat/_readstat_parser.pyx":366 + /* "pyreadstat/_readstat_parser.pyx":342 * * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8501,18 +8115,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L5_bool_binop_done:; if (likely(__pyx_t_5)) { - /* "pyreadstat/_readstat_parser.pyx":367 + /* "pyreadstat/_readstat_parser.pyx":343 * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_str_value # <<<<<<<<<<<<<< * else: * #str_byte_val = py_str_value.encode("UTF-8") */ - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 367, __pyx_L1_error) } + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 343, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_py_str_value); __pyx_v_result = __pyx_v_py_str_value; - /* "pyreadstat/_readstat_parser.pyx":366 + /* "pyreadstat/_readstat_parser.pyx":342 * * if pyformat == VAR_FORMAT_STRING: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8522,7 +8136,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L4; } - /* "pyreadstat/_readstat_parser.pyx":370 + /* "pyreadstat/_readstat_parser.pyx":346 * else: * #str_byte_val = py_str_value.encode("UTF-8") * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) # <<<<<<<<<<<<<< @@ -8531,18 +8145,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt */ /*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, 370, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 370, __pyx_L1_error) } - __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_py_str_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 370, __pyx_L1_error) + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 346, __pyx_L1_error) } + __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_py_str_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 370, __pyx_L1_error) + __PYX_ERR(0, 346, __pyx_L1_error) } - __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_12), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_12), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_STRING_type_with_value; @@ -8551,7 +8165,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_14[3] = __pyx_t_13; __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_14, 5, 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13)); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; @@ -8573,16 +8187,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __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, 370, __pyx_L1_error) + __PYX_ERR(0, 346, __pyx_L1_error) } __pyx_L4:; - /* "pyreadstat/_readstat_parser.pyx":365 + /* "pyreadstat/_readstat_parser.pyx":341 * # final transformation and storage * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -8592,7 +8206,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG: - /* "pyreadstat/_readstat_parser.pyx":372 + /* "pyreadstat/_readstat_parser.pyx":348 * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8609,19 +8223,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L8_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":373 + /* "pyreadstat/_readstat_parser.pyx":349 * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_long_value # <<<<<<<<<<<<<< * else: * tstamp = py_long_value */ - __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_py_long_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_long(__pyx_v_py_long_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":372 + /* "pyreadstat/_readstat_parser.pyx":348 * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8631,7 +8245,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L7; } - /* "pyreadstat/_readstat_parser.pyx":375 + /* "pyreadstat/_readstat_parser.pyx":351 * result = py_long_value * else: * tstamp = py_long_value # <<<<<<<<<<<<<< @@ -8641,21 +8255,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt /*else*/ { __pyx_v_tstamp = ((double)__pyx_v_py_long_value); - /* "pyreadstat/_readstat_parser.pyx":376 + /* "pyreadstat/_readstat_parser.pyx":352 * else: * tstamp = py_long_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L7:; - /* "pyreadstat/_readstat_parser.pyx":371 + /* "pyreadstat/_readstat_parser.pyx":347 * #str_byte_val = py_str_value.encode("UTF-8") * raise PyreadstatError("STRING type with value '%s' with date type in column '%s'" % (py_str_value, dc.col_names[index])) * elif pyformat == VAR_FORMAT_LONG: # <<<<<<<<<<<<<< @@ -8665,7 +8279,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":378 + /* "pyreadstat/_readstat_parser.pyx":354 * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8682,19 +8296,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_L11_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":379 + /* "pyreadstat/_readstat_parser.pyx":355 * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: * result = py_float_value # <<<<<<<<<<<<<< * else: * #tstamp = py_float_value */ - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":378 + /* "pyreadstat/_readstat_parser.pyx":354 * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: * if var_format == DATE_FORMAT_NOTADATE or dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -8704,7 +8318,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":382 + /* "pyreadstat/_readstat_parser.pyx":358 * else: * #tstamp = py_float_value * tstamp = py_float_value # <<<<<<<<<<<<<< @@ -8714,21 +8328,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt /*else*/ { __pyx_v_tstamp = __pyx_v_py_float_value; - /* "pyreadstat/_readstat_parser.pyx":383 + /* "pyreadstat/_readstat_parser.pyx":359 * #tstamp = py_float_value * tstamp = py_float_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) # <<<<<<<<<<<<<< * #elif pyformat == VAR_FORMAT_MISSING: * # pass */ - __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_7 = __pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_v_var_format, __pyx_v_tstamp, __pyx_v_file_format, __pyx_v_origin, __pyx_v_dates_as_pandas, __pyx_v_output_format, __pyx_v_unix_to_origin_secs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_result = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":377 + /* "pyreadstat/_readstat_parser.pyx":353 * tstamp = py_long_value * result = transform_datetime(var_format, tstamp, file_format, origin, dates_as_pandas, output_format, unix_to_origin_secs) * elif pyformat == VAR_FORMAT_FLOAT: # <<<<<<<<<<<<<< @@ -8738,7 +8352,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt break; default: - /* "pyreadstat/_readstat_parser.pyx":387 + /* "pyreadstat/_readstat_parser.pyx":363 * # pass * else: * raise PyreadstatError("Failed convert C to python value") # <<<<<<<<<<<<<< @@ -8746,7 +8360,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt * return result */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -8765,16 +8379,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __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, 387, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":389 + /* "pyreadstat/_readstat_parser.pyx":365 * raise PyreadstatError("Failed convert C to python value") * * return result # <<<<<<<<<<<<<< @@ -8786,7 +8400,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":296 + /* "pyreadstat/_readstat_parser.pyx":272 * * * cdef object convert_readstat_to_python_value(readstat_value_t value, int index, data_container dc): # <<<<<<<<<<<<<< @@ -8814,7 +8428,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_pyt return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":392 +/* "pyreadstat/_readstat_parser.pyx":368 * * * cdef int handle_metadata(readstat_metadata_t *metadata, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -8856,7 +8470,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_metadata", 0); - /* "pyreadstat/_readstat_parser.pyx":401 + /* "pyreadstat/_readstat_parser.pyx":377 * * cdef int var_count, obs_count, mr_len * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -8868,7 +8482,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":410 + /* "pyreadstat/_readstat_parser.pyx":386 * cdef int ctime * cdef int mtime * cdef int i = 0 # <<<<<<<<<<<<<< @@ -8877,31 +8491,31 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_i = 0; - /* "pyreadstat/_readstat_parser.pyx":412 + /* "pyreadstat/_readstat_parser.pyx":388 * cdef int i = 0 * cdef mr_set_t * mr_sets_orig * cdef dict mr_sets = {} # <<<<<<<<<<<<<< * cdef str name * cdef list variable_list = [] */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mr_sets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":414 + /* "pyreadstat/_readstat_parser.pyx":390 * cdef dict mr_sets = {} * cdef str name * cdef list variable_list = [] # <<<<<<<<<<<<<< * * metaonly = dc.metaonly */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":416 + /* "pyreadstat/_readstat_parser.pyx":392 * cdef list variable_list = [] * * metaonly = dc.metaonly # <<<<<<<<<<<<<< @@ -8911,7 +8525,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = __pyx_v_dc->metaonly; __pyx_v_metaonly = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":418 + /* "pyreadstat/_readstat_parser.pyx":394 * metaonly = dc.metaonly * * var_count = readstat_get_var_count(metadata) # <<<<<<<<<<<<<< @@ -8920,7 +8534,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_var_count = readstat_get_var_count(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":419 + /* "pyreadstat/_readstat_parser.pyx":395 * * var_count = readstat_get_var_count(metadata) * if var_count<0: # <<<<<<<<<<<<<< @@ -8930,7 +8544,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_var_count < 0); if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":420 + /* "pyreadstat/_readstat_parser.pyx":396 * var_count = readstat_get_var_count(metadata) * if var_count<0: * raise PyreadstatError("Failed to read number of variables") # <<<<<<<<<<<<<< @@ -8938,7 +8552,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta * if obs_count <0: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -8957,14 +8571,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_1 = __Pyx_PyObject_FastCall(__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, 420, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __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, 420, __pyx_L1_error) + __PYX_ERR(0, 396, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":419 + /* "pyreadstat/_readstat_parser.pyx":395 * * var_count = readstat_get_var_count(metadata) * if var_count<0: # <<<<<<<<<<<<<< @@ -8973,7 +8587,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":421 + /* "pyreadstat/_readstat_parser.pyx":397 * if var_count<0: * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) # <<<<<<<<<<<<<< @@ -8982,7 +8596,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_obs_count = readstat_get_row_count(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":422 + /* "pyreadstat/_readstat_parser.pyx":398 * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) * if obs_count <0: # <<<<<<<<<<<<<< @@ -8992,7 +8606,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_obs_count < 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":424 + /* "pyreadstat/_readstat_parser.pyx":400 * if obs_count <0: * # if <0 it means the number of rows is not known, allocate 100 000 * obs_count = 100000 # <<<<<<<<<<<<<< @@ -9001,7 +8615,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_obs_count = 0x186A0; - /* "pyreadstat/_readstat_parser.pyx":425 + /* "pyreadstat/_readstat_parser.pyx":401 * # if <0 it means the number of rows is not known, allocate 100 000 * obs_count = 100000 * dc.is_unkown_number_rows = 1 # <<<<<<<<<<<<<< @@ -9010,7 +8624,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->is_unkown_number_rows = 1; - /* "pyreadstat/_readstat_parser.pyx":422 + /* "pyreadstat/_readstat_parser.pyx":398 * raise PyreadstatError("Failed to read number of variables") * obs_count = readstat_get_row_count(metadata) * if obs_count <0: # <<<<<<<<<<<<<< @@ -9019,7 +8633,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":427 + /* "pyreadstat/_readstat_parser.pyx":403 * dc.is_unkown_number_rows = 1 * * dc.n_obs = obs_count # <<<<<<<<<<<<<< @@ -9028,7 +8642,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->n_obs = __pyx_v_obs_count; - /* "pyreadstat/_readstat_parser.pyx":428 + /* "pyreadstat/_readstat_parser.pyx":404 * * dc.n_obs = obs_count * dc.n_vars = var_count # <<<<<<<<<<<<<< @@ -9037,7 +8651,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->n_vars = __pyx_v_var_count; - /* "pyreadstat/_readstat_parser.pyx":430 + /* "pyreadstat/_readstat_parser.pyx":406 * dc.n_vars = var_count * * mr_len = readstat_get_multiple_response_sets_length(metadata); # <<<<<<<<<<<<<< @@ -9046,7 +8660,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_mr_len = ((int)readstat_get_multiple_response_sets_length(__pyx_v_metadata)); - /* "pyreadstat/_readstat_parser.pyx":431 + /* "pyreadstat/_readstat_parser.pyx":407 * * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); # <<<<<<<<<<<<<< @@ -9055,7 +8669,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_mr_sets_orig = readstat_get_multiple_response_sets(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":432 + /* "pyreadstat/_readstat_parser.pyx":408 * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: # <<<<<<<<<<<<<< @@ -9065,7 +8679,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_mr_sets_orig != NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":433 + /* "pyreadstat/_readstat_parser.pyx":409 * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: * i = 0 # <<<<<<<<<<<<<< @@ -9074,7 +8688,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_i = 0; - /* "pyreadstat/_readstat_parser.pyx":434 + /* "pyreadstat/_readstat_parser.pyx":410 * if mr_sets_orig != NULL: * i = 0 * while i < mr_len: # <<<<<<<<<<<<<< @@ -9085,14 +8699,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_t_2 = (__pyx_v_i < __pyx_v_mr_len); if (!__pyx_t_2) break; - /* "pyreadstat/_readstat_parser.pyx":435 + /* "pyreadstat/_readstat_parser.pyx":411 * i = 0 * while i < mr_len: * name = mr_sets_orig[i].name # <<<<<<<<<<<<<< * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): */ - __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -9100,19 +8714,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_XDECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":436 + /* "pyreadstat/_readstat_parser.pyx":412 * while i < mr_len: * name = mr_sets_orig[i].name * variable_list = [] # <<<<<<<<<<<<<< * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_variable_list, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":437 + /* "pyreadstat/_readstat_parser.pyx":413 * name = mr_sets_orig[i].name * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): # <<<<<<<<<<<<<< @@ -9124,50 +8738,50 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_j = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":438 + /* "pyreadstat/_readstat_parser.pyx":414 * variable_list = [] * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) # <<<<<<<<<<<<<< * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(((__pyx_v_mr_sets_orig[__pyx_v_i]).subvariables[__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(((__pyx_v_mr_sets_orig[__pyx_v_i]).subvariables[__pyx_v_j])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_variable_list, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_variable_list, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "pyreadstat/_readstat_parser.pyx":440 + /* "pyreadstat/_readstat_parser.pyx":416 * variable_list.append(mr_sets_orig[i].subvariables[j]) * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), # <<<<<<<<<<<<<< * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyUnicode_FromOrdinal((__pyx_v_mr_sets_orig[__pyx_v_i]).type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal((__pyx_v_mr_sets_orig[__pyx_v_i]).type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_1) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":441 + /* "pyreadstat/_readstat_parser.pyx":417 * mr_sets[name] = { * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), # <<<<<<<<<<<<<< * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, */ - __pyx_t_1 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).is_dichotomy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).is_dichotomy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_dichotomy, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_dichotomy, __pyx_t_1) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":442 + /* "pyreadstat/_readstat_parser.pyx":418 * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, # <<<<<<<<<<<<<< @@ -9176,7 +8790,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_t_2 = ((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value != -1L); if (__pyx_t_2) { - __pyx_t_3 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int((__pyx_v_mr_sets_orig[__pyx_v_i]).counted_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; @@ -9184,41 +8798,41 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_counted_value, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_counted_value, __pyx_t_1) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":443 + /* "pyreadstat/_readstat_parser.pyx":419 * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, # <<<<<<<<<<<<<< * 'variable_list': variable_list * } */ - __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString((__pyx_v_mr_sets_orig[__pyx_v_i]).label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_t_1) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_t_1) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":444 + /* "pyreadstat/_readstat_parser.pyx":420 * 'counted_value': mr_sets_orig[i].counted_value if mr_sets_orig[i].counted_value != -1 else None, * 'label': mr_sets_orig[i].label, * 'variable_list': variable_list # <<<<<<<<<<<<<< * } * i += 1 */ - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variable_list, __pyx_v_variable_list) < 0) __PYX_ERR(0, 440, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variable_list, __pyx_v_variable_list) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":439 + /* "pyreadstat/_readstat_parser.pyx":415 * for j in range(mr_sets_orig[i].num_subvars): * variable_list.append(mr_sets_orig[i].subvariables[j]) * mr_sets[name] = { # <<<<<<<<<<<<<< * 'type': chr(mr_sets_orig[i].type), * 'is_dichotomy': bool(mr_sets_orig[i].is_dichotomy), */ - if (unlikely((PyDict_SetItem(__pyx_v_mr_sets, __pyx_v_name, __pyx_t_4) < 0))) __PYX_ERR(0, 439, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_mr_sets, __pyx_v_name, __pyx_t_4) < 0))) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":446 + /* "pyreadstat/_readstat_parser.pyx":422 * 'variable_list': variable_list * } * i += 1 # <<<<<<<<<<<<<< @@ -9228,7 +8842,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_i = (__pyx_v_i + 1); } - /* "pyreadstat/_readstat_parser.pyx":447 + /* "pyreadstat/_readstat_parser.pyx":423 * } * i += 1 * dc.mr_sets = mr_sets # <<<<<<<<<<<<<< @@ -9241,7 +8855,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->mr_sets); __pyx_v_dc->mr_sets = __pyx_v_mr_sets; - /* "pyreadstat/_readstat_parser.pyx":432 + /* "pyreadstat/_readstat_parser.pyx":408 * mr_len = readstat_get_multiple_response_sets_length(metadata); * mr_sets_orig = readstat_get_multiple_response_sets(metadata); * if mr_sets_orig != NULL: # <<<<<<<<<<<<<< @@ -9250,22 +8864,22 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":449 + /* "pyreadstat/_readstat_parser.pyx":425 * dc.mr_sets = mr_sets * * dc.col_data_len = [obs_count] * var_count # <<<<<<<<<<<<<< * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count */ - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_4) != (0)) __PYX_ERR(0, 449, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_4) != (0)) __PYX_ERR(0, 425, __pyx_L1_error); } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -9275,20 +8889,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_data_len = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":450 + /* "pyreadstat/_readstat_parser.pyx":426 * * dc.col_data_len = [obs_count] * var_count * dc.col_numpy_dtypes = [None] * var_count # <<<<<<<<<<<<<< * dc.col_dytpes_isfloat = [0] * var_count * dc.col_dtypes_isobject = [0] * var_count */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 450, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 426, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -9297,20 +8911,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_numpy_dtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":451 + /* "pyreadstat/_readstat_parser.pyx":427 * dc.col_data_len = [obs_count] * var_count * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count # <<<<<<<<<<<<<< * dc.col_dtypes_isobject = [0] * var_count * */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 451, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 427, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -9319,20 +8933,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_dytpes_isfloat = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":452 + /* "pyreadstat/_readstat_parser.pyx":428 * dc.col_numpy_dtypes = [None] * var_count * dc.col_dytpes_isfloat = [0] * var_count * dc.col_dtypes_isobject = [0] * var_count # <<<<<<<<<<<<<< * * # read other metadata */ - __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_var_count<0) ? 0:__pyx_v_var_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_var_count; __pyx_temp++) { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 452, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 428, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_t_1); @@ -9341,7 +8955,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->col_dtypes_isobject = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":455 + /* "pyreadstat/_readstat_parser.pyx":431 * * # read other metadata * flabel_orig = readstat_get_file_label(metadata); # <<<<<<<<<<<<<< @@ -9350,7 +8964,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_flabel_orig = readstat_get_file_label(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":456 + /* "pyreadstat/_readstat_parser.pyx":432 * # read other metadata * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) # <<<<<<<<<<<<<< @@ -9359,7 +8973,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_fencoding_orig = readstat_get_file_encoding(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":457 + /* "pyreadstat/_readstat_parser.pyx":433 * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: # <<<<<<<<<<<<<< @@ -9377,14 +8991,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L11_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":458 + /* "pyreadstat/_readstat_parser.pyx":434 * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: * flabel = flabel_orig # <<<<<<<<<<<<<< * else: * flabel = None */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_flabel_orig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_flabel_orig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -9392,7 +9006,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_flabel = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":457 + /* "pyreadstat/_readstat_parser.pyx":433 * flabel_orig = readstat_get_file_label(metadata); * fencoding_orig = readstat_get_file_encoding(metadata) * if flabel_orig != NULL and flabel_orig[0]: # <<<<<<<<<<<<<< @@ -9402,7 +9016,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":460 + /* "pyreadstat/_readstat_parser.pyx":436 * flabel = flabel_orig * else: * flabel = None # <<<<<<<<<<<<<< @@ -9415,7 +9029,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":461 + /* "pyreadstat/_readstat_parser.pyx":437 * else: * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: # <<<<<<<<<<<<<< @@ -9433,14 +9047,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L14_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":462 + /* "pyreadstat/_readstat_parser.pyx":438 * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: * fencoding = fencoding_orig # <<<<<<<<<<<<<< * else: * fencoding = None */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_fencoding_orig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_fencoding_orig); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); @@ -9448,7 +9062,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_fencoding = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":461 + /* "pyreadstat/_readstat_parser.pyx":437 * else: * flabel = None * if fencoding_orig != NULL and fencoding_orig[0]: # <<<<<<<<<<<<<< @@ -9458,7 +9072,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":464 + /* "pyreadstat/_readstat_parser.pyx":440 * fencoding = fencoding_orig * else: * fencoding = None # <<<<<<<<<<<<<< @@ -9471,7 +9085,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta } __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":466 + /* "pyreadstat/_readstat_parser.pyx":442 * fencoding = None * * dc.file_encoding = fencoding # <<<<<<<<<<<<<< @@ -9484,7 +9098,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->file_encoding); __pyx_v_dc->file_encoding = __pyx_v_fencoding; - /* "pyreadstat/_readstat_parser.pyx":467 + /* "pyreadstat/_readstat_parser.pyx":443 * * dc.file_encoding = fencoding * dc.file_label = flabel # <<<<<<<<<<<<<< @@ -9497,7 +9111,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __Pyx_DECREF(__pyx_v_dc->file_label); __pyx_v_dc->file_label = __pyx_v_flabel; - /* "pyreadstat/_readstat_parser.pyx":469 + /* "pyreadstat/_readstat_parser.pyx":445 * dc.file_label = flabel * * table = readstat_get_table_name(metadata) # <<<<<<<<<<<<<< @@ -9506,7 +9120,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_table = readstat_get_table_name(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":470 + /* "pyreadstat/_readstat_parser.pyx":446 * * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: # <<<<<<<<<<<<<< @@ -9524,14 +9138,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_L17_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":471 + /* "pyreadstat/_readstat_parser.pyx":447 * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: * dc.table_name = table # <<<<<<<<<<<<<< * * dc.ctime = readstat_get_creation_time(metadata) */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -9542,7 +9156,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_v_dc->table_name = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":470 + /* "pyreadstat/_readstat_parser.pyx":446 * * table = readstat_get_table_name(metadata) * if table != NULL and table[0]: # <<<<<<<<<<<<<< @@ -9551,7 +9165,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ } - /* "pyreadstat/_readstat_parser.pyx":473 + /* "pyreadstat/_readstat_parser.pyx":449 * dc.table_name = table * * dc.ctime = readstat_get_creation_time(metadata) # <<<<<<<<<<<<<< @@ -9560,7 +9174,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->ctime = readstat_get_creation_time(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":474 + /* "pyreadstat/_readstat_parser.pyx":450 * * dc.ctime = readstat_get_creation_time(metadata) * dc.mtime = readstat_get_modified_time(metadata) # <<<<<<<<<<<<<< @@ -9569,7 +9183,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta */ __pyx_v_dc->mtime = readstat_get_modified_time(__pyx_v_metadata); - /* "pyreadstat/_readstat_parser.pyx":476 + /* "pyreadstat/_readstat_parser.pyx":452 * dc.mtime = readstat_get_modified_time(metadata) * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -9579,7 +9193,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":392 + /* "pyreadstat/_readstat_parser.pyx":368 * * * cdef int handle_metadata(readstat_metadata_t *metadata, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -9605,7 +9219,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_meta return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":478 +/* "pyreadstat/_readstat_parser.pyx":454 * return READSTAT_HANDLER_OK * * cdef int handle_variable(int index, readstat_variable_t *variable, # <<<<<<<<<<<<<< @@ -9668,7 +9282,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_variable", 0); - /* "pyreadstat/_readstat_parser.pyx":507 + /* "pyreadstat/_readstat_parser.pyx":483 * cdef int dupcolcnt * * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -9680,7 +9294,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":508 + /* "pyreadstat/_readstat_parser.pyx":484 * * cdef data_container dc = ctx * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -9692,7 +9306,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":511 + /* "pyreadstat/_readstat_parser.pyx":487 * * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) # <<<<<<<<<<<<<< @@ -9701,7 +9315,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_name = readstat_variable_get_name(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":512 + /* "pyreadstat/_readstat_parser.pyx":488 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -9711,7 +9325,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_name == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":513 + /* "pyreadstat/_readstat_parser.pyx":489 * var_name = readstat_variable_get_name(variable) * if var_name == NULL: * col_name = None # <<<<<<<<<<<<<< @@ -9721,7 +9335,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_name = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":512 + /* "pyreadstat/_readstat_parser.pyx":488 * # get variable name, label, format and type and put into our data container * var_name = readstat_variable_get_name(variable) * if var_name == NULL: # <<<<<<<<<<<<<< @@ -9731,7 +9345,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":515 + /* "pyreadstat/_readstat_parser.pyx":491 * col_name = None * else: * col_name = var_name # <<<<<<<<<<<<<< @@ -9739,7 +9353,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * # if the user introduced a list of columns to include, continue only if the column is in the list */ /*else*/ { - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); @@ -9749,7 +9363,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":518 + /* "pyreadstat/_readstat_parser.pyx":494 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -9761,12 +9375,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_v_dc->filter_cols; goto __pyx_L5_bool_binop_done; } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->use_cols, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 494, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":519 + /* "pyreadstat/_readstat_parser.pyx":495 * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 # <<<<<<<<<<<<<< @@ -9775,7 +9389,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dc->n_vars = (__pyx_v_dc->n_vars - 1); - /* "pyreadstat/_readstat_parser.pyx":520 + /* "pyreadstat/_readstat_parser.pyx":496 * if dc.filter_cols and not (col_name in dc.use_cols): * dc.n_vars -= 1 * return READSTAT_HANDLER_SKIP_VARIABLE # <<<<<<<<<<<<<< @@ -9785,7 +9399,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_r = READSTAT_HANDLER_SKIP_VARIABLE; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":518 + /* "pyreadstat/_readstat_parser.pyx":494 * * # if the user introduced a list of columns to include, continue only if the column is in the list * if dc.filter_cols and not (col_name in dc.use_cols): # <<<<<<<<<<<<<< @@ -9794,7 +9408,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":522 + /* "pyreadstat/_readstat_parser.pyx":498 * return READSTAT_HANDLER_SKIP_VARIABLE * * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< @@ -9803,17 +9417,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":524 + /* "pyreadstat/_readstat_parser.pyx":500 * index = readstat_variable_get_index_after_skipping(variable) * * if col_name in dc.col_names: # <<<<<<<<<<<<<< * dupcolcnt = 1 * while True: */ - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->col_names, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_col_name, __pyx_v_dc->col_names, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 500, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":525 + /* "pyreadstat/_readstat_parser.pyx":501 * * if col_name in dc.col_names: * dupcolcnt = 1 # <<<<<<<<<<<<<< @@ -9822,7 +9436,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dupcolcnt = 1; - /* "pyreadstat/_readstat_parser.pyx":526 + /* "pyreadstat/_readstat_parser.pyx":502 * if col_name in dc.col_names: * dupcolcnt = 1 * while True: # <<<<<<<<<<<<<< @@ -9831,28 +9445,28 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ while (1) { - /* "pyreadstat/_readstat_parser.pyx":527 + /* "pyreadstat/_readstat_parser.pyx":503 * dupcolcnt = 1 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) # <<<<<<<<<<<<<< * if newcolname in col_name: * dupcolcnt += 1 */ - __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_col_name, __pyx_mstate_global->__pyx_n_u_duplicated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_col_name, __pyx_mstate_global->__pyx_n_u_duplicated); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dupcolcnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dupcolcnt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_newcolname, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":528 + /* "pyreadstat/_readstat_parser.pyx":504 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: # <<<<<<<<<<<<<< @@ -9861,12 +9475,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_col_name == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 528, __pyx_L1_error) + __PYX_ERR(0, 504, __pyx_L1_error) } - __pyx_t_2 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_newcolname, __pyx_v_col_name, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_ContainsTF(__pyx_v_newcolname, __pyx_v_col_name, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":529 + /* "pyreadstat/_readstat_parser.pyx":505 * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: * dupcolcnt += 1 # <<<<<<<<<<<<<< @@ -9875,7 +9489,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_dupcolcnt = (__pyx_v_dupcolcnt + 1); - /* "pyreadstat/_readstat_parser.pyx":530 + /* "pyreadstat/_readstat_parser.pyx":506 * if newcolname in col_name: * dupcolcnt += 1 * continue # <<<<<<<<<<<<<< @@ -9884,7 +9498,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ goto __pyx_L8_continue; - /* "pyreadstat/_readstat_parser.pyx":528 + /* "pyreadstat/_readstat_parser.pyx":504 * while True: * newcolname = col_name + "_duplicated" + str(dupcolcnt) * if newcolname in col_name: # <<<<<<<<<<<<<< @@ -9893,7 +9507,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":532 + /* "pyreadstat/_readstat_parser.pyx":508 * continue * else: * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) # <<<<<<<<<<<<<< @@ -9908,13 +9522,13 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_col_name, __pyx_v_newcolname}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":533 + /* "pyreadstat/_readstat_parser.pyx":509 * else: * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) * warnings.warn(msg) # <<<<<<<<<<<<<< @@ -9922,9 +9536,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * break */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = 1; @@ -9944,12 +9558,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __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_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":534 + /* "pyreadstat/_readstat_parser.pyx":510 * msg = "column '{0}' is duplicated, renamed to '{1}'".format(col_name, newcolname) * warnings.warn(msg) * col_name = newcolname # <<<<<<<<<<<<<< @@ -9959,7 +9573,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_v_newcolname); __Pyx_DECREF_SET(__pyx_v_col_name, __pyx_v_newcolname); - /* "pyreadstat/_readstat_parser.pyx":535 + /* "pyreadstat/_readstat_parser.pyx":511 * warnings.warn(msg) * col_name = newcolname * break # <<<<<<<<<<<<<< @@ -9972,7 +9586,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L9_break:; - /* "pyreadstat/_readstat_parser.pyx":524 + /* "pyreadstat/_readstat_parser.pyx":500 * index = readstat_variable_get_index_after_skipping(variable) * * if col_name in dc.col_names: # <<<<<<<<<<<<<< @@ -9981,7 +9595,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":537 + /* "pyreadstat/_readstat_parser.pyx":513 * break * * dc.col_names.append(col_name) # <<<<<<<<<<<<<< @@ -9990,11 +9604,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 537, __pyx_L1_error) + __PYX_ERR(0, 513, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 513, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":540 + /* "pyreadstat/_readstat_parser.pyx":516 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -10004,14 +9618,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_val_labels != NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":541 + /* "pyreadstat/_readstat_parser.pyx":517 * # the name of the value label for the variable * if val_labels != NULL: * label_name = val_labels # <<<<<<<<<<<<<< * if label_name: * dc.label_to_var_name[col_name] = label_name */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -10019,7 +9633,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_v_label_name = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":542 + /* "pyreadstat/_readstat_parser.pyx":518 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< @@ -10027,19 +9641,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ __pyx_t_2 = (__pyx_v_label_name != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_label_name) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 518, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":543 + /* "pyreadstat/_readstat_parser.pyx":519 * label_name = val_labels * if label_name: * dc.label_to_var_name[col_name] = label_name # <<<<<<<<<<<<<< * * var_label = readstat_variable_get_label(variable) */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0))) __PYX_ERR(0, 543, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->label_to_var_name, __pyx_v_col_name, __pyx_v_label_name) < 0))) __PYX_ERR(0, 519, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":542 + /* "pyreadstat/_readstat_parser.pyx":518 * if val_labels != NULL: * label_name = val_labels * if label_name: # <<<<<<<<<<<<<< @@ -10048,7 +9662,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":540 + /* "pyreadstat/_readstat_parser.pyx":516 * * # the name of the value label for the variable * if val_labels != NULL: # <<<<<<<<<<<<<< @@ -10057,7 +9671,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":545 + /* "pyreadstat/_readstat_parser.pyx":521 * dc.label_to_var_name[col_name] = label_name * * var_label = readstat_variable_get_label(variable) # <<<<<<<<<<<<<< @@ -10066,7 +9680,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_label = readstat_variable_get_label(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":546 + /* "pyreadstat/_readstat_parser.pyx":522 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< @@ -10076,7 +9690,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_label == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":547 + /* "pyreadstat/_readstat_parser.pyx":523 * var_label = readstat_variable_get_label(variable) * if var_label == NULL: * col_label = None # <<<<<<<<<<<<<< @@ -10086,7 +9700,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_label = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":546 + /* "pyreadstat/_readstat_parser.pyx":522 * * var_label = readstat_variable_get_label(variable) * if var_label == NULL: # <<<<<<<<<<<<<< @@ -10096,7 +9710,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L13; } - /* "pyreadstat/_readstat_parser.pyx":549 + /* "pyreadstat/_readstat_parser.pyx":525 * col_label = None * else: * col_label = var_label # <<<<<<<<<<<<<< @@ -10104,7 +9718,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ /*else*/ { - __pyx_t_7 = __Pyx_PyUnicode_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_FromString(__pyx_v_var_label); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); @@ -10114,7 +9728,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L13:; - /* "pyreadstat/_readstat_parser.pyx":550 + /* "pyreadstat/_readstat_parser.pyx":526 * else: * col_label = var_label * dc.col_labels.append(col_label) # <<<<<<<<<<<<<< @@ -10123,11 +9737,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 550, __pyx_L1_error) + __PYX_ERR(0, 526, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_labels, __pyx_v_col_label); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 526, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":553 + /* "pyreadstat/_readstat_parser.pyx":529 * * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) # <<<<<<<<<<<<<< @@ -10136,7 +9750,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_format = readstat_variable_get_format(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":554 + /* "pyreadstat/_readstat_parser.pyx":530 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< @@ -10146,7 +9760,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_var_format == NULL); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":556 + /* "pyreadstat/_readstat_parser.pyx":532 * if var_format == NULL: * #col_format_original = "NULL" * col_format_original = None # <<<<<<<<<<<<<< @@ -10156,7 +9770,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(Py_None); __pyx_v_col_format_original = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":554 + /* "pyreadstat/_readstat_parser.pyx":530 * # format, we have to transform it in something more usable * var_format = readstat_variable_get_format(variable) * if var_format == NULL: # <<<<<<<<<<<<<< @@ -10166,7 +9780,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":558 + /* "pyreadstat/_readstat_parser.pyx":534 * col_format_original = None * else: * col_format_original = var_format # <<<<<<<<<<<<<< @@ -10174,7 +9788,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * dc.col_formats_original.append(col_format_original) */ /*else*/ { - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_var_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); @@ -10184,7 +9798,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L14:; - /* "pyreadstat/_readstat_parser.pyx":559 + /* "pyreadstat/_readstat_parser.pyx":535 * else: * col_format_original = var_format * file_format = dc.file_format # <<<<<<<<<<<<<< @@ -10194,7 +9808,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_9 = __pyx_v_dc->file_format; __pyx_v_file_format = __pyx_t_9; - /* "pyreadstat/_readstat_parser.pyx":560 + /* "pyreadstat/_readstat_parser.pyx":536 * col_format_original = var_format * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) # <<<<<<<<<<<<<< @@ -10203,21 +9817,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_formats_original == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 560, __pyx_L1_error) + __PYX_ERR(0, 536, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats_original, __pyx_v_col_format_original); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 536, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":561 + /* "pyreadstat/_readstat_parser.pyx":537 * file_format = dc.file_format * dc.col_formats_original.append(col_format_original) * col_format_final = transform_variable_format(col_format_original, file_format) # <<<<<<<<<<<<<< * dc.col_formats.append(col_format_final) * # readstat type */ - __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(__pyx_v_col_format_original, __pyx_v_file_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_10 = __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(__pyx_v_col_format_original, __pyx_v_file_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L1_error) __pyx_v_col_format_final = __pyx_t_10; - /* "pyreadstat/_readstat_parser.pyx":562 + /* "pyreadstat/_readstat_parser.pyx":538 * dc.col_formats_original.append(col_format_original) * col_format_final = transform_variable_format(col_format_original, file_format) * dc.col_formats.append(col_format_final) # <<<<<<<<<<<<<< @@ -10226,14 +9840,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 562, __pyx_L1_error) + __PYX_ERR(0, 538, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_v_col_format_final); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_formats, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":564 + /* "pyreadstat/_readstat_parser.pyx":540 * dc.col_formats.append(col_format_final) * # readstat type * var_type = readstat_variable_get_type(variable) # <<<<<<<<<<<<<< @@ -10242,7 +9856,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_var_type = readstat_variable_get_type(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":565 + /* "pyreadstat/_readstat_parser.pyx":541 * # readstat type * var_type = readstat_variable_get_type(variable) * dc.col_dtypes.append(var_type) # <<<<<<<<<<<<<< @@ -10251,14 +9865,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_dtypes == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 565, __pyx_L1_error) + __PYX_ERR(0, 541, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_dtypes, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":568 + /* "pyreadstat/_readstat_parser.pyx":544 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< @@ -10276,7 +9890,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_L16_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":569 + /* "pyreadstat/_readstat_parser.pyx":545 * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: * curnptype = object # <<<<<<<<<<<<<< @@ -10286,7 +9900,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_builtin_object); __pyx_v_curnptype = __pyx_builtin_object; - /* "pyreadstat/_readstat_parser.pyx":568 + /* "pyreadstat/_readstat_parser.pyx":544 * # equivalent numpy type * # if it's a date then we need object * if col_format_final != DATE_FORMAT_NOTADATE and dc.no_datetime_conversion == 0: # <<<<<<<<<<<<<< @@ -10296,7 +9910,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L15; } - /* "pyreadstat/_readstat_parser.pyx":571 + /* "pyreadstat/_readstat_parser.pyx":547 * curnptype = object * else: * curnptype = readstat_to_numpy_types[var_type] # <<<<<<<<<<<<<< @@ -10306,11 +9920,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i /*else*/ { if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 571, __pyx_L1_error) + __PYX_ERR(0, 547, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_From_readstat_type_t(__pyx_v_var_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_curnptype = __pyx_t_1; @@ -10318,7 +9932,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L15:; - /* "pyreadstat/_readstat_parser.pyx":572 + /* "pyreadstat/_readstat_parser.pyx":548 * else: * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 # <<<<<<<<<<<<<< @@ -10327,7 +9941,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 0; - /* "pyreadstat/_readstat_parser.pyx":573 + /* "pyreadstat/_readstat_parser.pyx":549 * curnptype = readstat_to_numpy_types[var_type] * iscurnptypefloat = 0 * iscurnptypeobject = 0 # <<<<<<<<<<<<<< @@ -10336,7 +9950,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 0; - /* "pyreadstat/_readstat_parser.pyx":575 + /* "pyreadstat/_readstat_parser.pyx":551 * iscurnptypeobject = 0 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype # <<<<<<<<<<<<<< @@ -10345,23 +9959,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 575, __pyx_L1_error) + __PYX_ERR(0, 551, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 575, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_v_curnptype, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 551, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":576 + /* "pyreadstat/_readstat_parser.pyx":552 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< * iscurnptypeobject = 1 * if curnptype == np.float64: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_builtin_object, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":577 + /* "pyreadstat/_readstat_parser.pyx":553 * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -10370,7 +9984,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":576 + /* "pyreadstat/_readstat_parser.pyx":552 * # book keeping numpy types * dc.col_numpy_dtypes[index] = curnptype * if curnptype == object: # <<<<<<<<<<<<<< @@ -10379,25 +9993,25 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":578 + /* "pyreadstat/_readstat_parser.pyx":554 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_curnptype, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __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, 578, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":579 + /* "pyreadstat/_readstat_parser.pyx":555 * iscurnptypeobject = 1 * if curnptype == np.float64: * iscurnptypefloat = 1 # <<<<<<<<<<<<<< @@ -10406,7 +10020,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_iscurnptypefloat = 1; - /* "pyreadstat/_readstat_parser.pyx":578 + /* "pyreadstat/_readstat_parser.pyx":554 * if curnptype == object: * iscurnptypeobject = 1 * if curnptype == np.float64: # <<<<<<<<<<<<<< @@ -10415,39 +10029,39 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":580 + /* "pyreadstat/_readstat_parser.pyx":556 * if curnptype == np.float64: * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject # <<<<<<<<<<<<<< * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypeobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 580, __pyx_L1_error) + __PYX_ERR(0, 556, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":581 + /* "pyreadstat/_readstat_parser.pyx":557 * iscurnptypefloat = 1 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat # <<<<<<<<<<<<<< * metaonly = dc.metaonly * # pre-allocate data */ - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_iscurnptypefloat); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 581, __pyx_L1_error) + __PYX_ERR(0, 557, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":582 + /* "pyreadstat/_readstat_parser.pyx":558 * dc.col_dtypes_isobject[index] = iscurnptypeobject * dc.col_dytpes_isfloat[index] = iscurnptypefloat * metaonly = dc.metaonly # <<<<<<<<<<<<<< @@ -10457,7 +10071,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = __pyx_v_dc->metaonly; __pyx_v_metaonly = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":584 + /* "pyreadstat/_readstat_parser.pyx":560 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< @@ -10466,17 +10080,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (__pyx_v_metaonly) { - /* "pyreadstat/_readstat_parser.pyx":585 + /* "pyreadstat/_readstat_parser.pyx":561 * # pre-allocate data * if metaonly: * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(1, dtype=curnptype) * else: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":586 + /* "pyreadstat/_readstat_parser.pyx":562 * if metaonly: * if output_format == "pandas": * row = np.empty(1, dtype=curnptype) # <<<<<<<<<<<<<< @@ -10484,9 +10098,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * row = list() */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; @@ -10503,20 +10117,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, __pyx_mstate_global->__pyx_int_1}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 586, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 562, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_row = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":585 + /* "pyreadstat/_readstat_parser.pyx":561 * # pre-allocate data * if metaonly: * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -10526,7 +10140,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L21; } - /* "pyreadstat/_readstat_parser.pyx":588 + /* "pyreadstat/_readstat_parser.pyx":564 * row = np.empty(1, dtype=curnptype) * else: * row = list() # <<<<<<<<<<<<<< @@ -10534,14 +10148,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * obs_count = dc.n_obs */ /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_row = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L21:; - /* "pyreadstat/_readstat_parser.pyx":584 + /* "pyreadstat/_readstat_parser.pyx":560 * metaonly = dc.metaonly * # pre-allocate data * if metaonly: # <<<<<<<<<<<<<< @@ -10551,7 +10165,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L20; } - /* "pyreadstat/_readstat_parser.pyx":590 + /* "pyreadstat/_readstat_parser.pyx":566 * row = list() * else: * obs_count = dc.n_obs # <<<<<<<<<<<<<< @@ -10562,17 +10176,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_11 = __pyx_v_dc->n_obs; __pyx_v_obs_count = __pyx_t_11; - /* "pyreadstat/_readstat_parser.pyx":591 + /* "pyreadstat/_readstat_parser.pyx":567 * else: * obs_count = dc.n_obs * if output_format == "pandas": # <<<<<<<<<<<<<< * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: */ - __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":592 + /* "pyreadstat/_readstat_parser.pyx":568 * obs_count = dc.n_obs * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) # <<<<<<<<<<<<<< @@ -10580,12 +10194,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * row.fill(np.nan) */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_obs_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -10601,21 +10215,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_5}; - __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 592, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 568, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_row = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":593 + /* "pyreadstat/_readstat_parser.pyx":569 * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -10631,7 +10245,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_L24_bool_binop_done:; if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":594 + /* "pyreadstat/_readstat_parser.pyx":570 * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * row.fill(np.nan) # <<<<<<<<<<<<<< @@ -10640,9 +10254,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_t_7 = __pyx_v_row; __Pyx_INCREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_6 = 0; @@ -10651,12 +10265,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fill, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":593 + /* "pyreadstat/_readstat_parser.pyx":569 * if output_format == "pandas": * row = np.empty(obs_count, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -10665,7 +10279,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":591 + /* "pyreadstat/_readstat_parser.pyx":567 * else: * obs_count = dc.n_obs * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -10675,7 +10289,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i goto __pyx_L22; } - /* "pyreadstat/_readstat_parser.pyx":596 + /* "pyreadstat/_readstat_parser.pyx":572 * row.fill(np.nan) * else: * row = [None] * obs_count # <<<<<<<<<<<<<< @@ -10683,13 +10297,13 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i * */ /*else*/ { - __pyx_t_1 = PyList_New(1 * ((__pyx_v_obs_count<0) ? 0:__pyx_v_obs_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * ((__pyx_v_obs_count<0) ? 0:__pyx_v_obs_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_obs_count; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 596, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 572, __pyx_L1_error); } } __pyx_v_row = __pyx_t_1; @@ -10699,7 +10313,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i } __pyx_L20:; - /* "pyreadstat/_readstat_parser.pyx":597 + /* "pyreadstat/_readstat_parser.pyx":573 * else: * row = [None] * obs_count * dc.col_data.append(row) # <<<<<<<<<<<<<< @@ -10708,11 +10322,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 597, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dc->col_data, __pyx_v_row); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 573, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":600 + /* "pyreadstat/_readstat_parser.pyx":576 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -10721,7 +10335,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (__pyx_v_dc->usernan) { - /* "pyreadstat/_readstat_parser.pyx":601 + /* "pyreadstat/_readstat_parser.pyx":577 * # missing values * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) # <<<<<<<<<<<<<< @@ -10730,7 +10344,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_n_ranges = readstat_variable_get_missing_ranges_count(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":602 + /* "pyreadstat/_readstat_parser.pyx":578 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -10740,19 +10354,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_t_2 = (__pyx_v_n_ranges > 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":603 + /* "pyreadstat/_readstat_parser.pyx":579 * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: * missing_ranges = list() # <<<<<<<<<<<<<< * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_ranges = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":604 + /* "pyreadstat/_readstat_parser.pyx":580 * if n_ranges>0: * missing_ranges = list() * for i in range(0, n_ranges): # <<<<<<<<<<<<<< @@ -10764,7 +10378,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; - /* "pyreadstat/_readstat_parser.pyx":605 + /* "pyreadstat/_readstat_parser.pyx":581 * missing_ranges = list() * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) # <<<<<<<<<<<<<< @@ -10773,19 +10387,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_loval = readstat_variable_get_missing_range_lo(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":606 + /* "pyreadstat/_readstat_parser.pyx":582 * for i in range(0, n_ranges): * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) # <<<<<<<<<<<<<< * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_loval, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_pyloval, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":607 + /* "pyreadstat/_readstat_parser.pyx":583 * loval = readstat_variable_get_missing_range_lo(variable, i) * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) # <<<<<<<<<<<<<< @@ -10794,34 +10408,34 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_hival = readstat_variable_get_missing_range_hi(__pyx_v_variable, __pyx_v_i); - /* "pyreadstat/_readstat_parser.pyx":608 + /* "pyreadstat/_readstat_parser.pyx":584 * pyloval = convert_readstat_to_python_value(loval, index, dc) * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) # <<<<<<<<<<<<<< * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges */ - __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_hival, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_pyhival, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":609 + /* "pyreadstat/_readstat_parser.pyx":585 * hival = readstat_variable_get_missing_range_hi(variable, i) * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) # <<<<<<<<<<<<<< * dc.missing_ranges[col_name] = missing_ranges * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_lo, __pyx_v_pyloval) < 0) __PYX_ERR(0, 609, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hi, __pyx_v_pyhival) < 0) __PYX_ERR(0, 609, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 609, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_lo, __pyx_v_pyloval) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hi, __pyx_v_pyhival) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_missing_ranges, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "pyreadstat/_readstat_parser.pyx":610 + /* "pyreadstat/_readstat_parser.pyx":586 * pyhival = convert_readstat_to_python_value(hival, index, dc) * missing_ranges.append({'lo':pyloval, 'hi':pyhival}) * dc.missing_ranges[col_name] = missing_ranges # <<<<<<<<<<<<<< @@ -10830,11 +10444,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ if (unlikely(__pyx_v_dc->missing_ranges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 610, __pyx_L1_error) + __PYX_ERR(0, 586, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0))) __PYX_ERR(0, 610, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_ranges, __pyx_v_col_name, __pyx_v_missing_ranges) < 0))) __PYX_ERR(0, 586, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":602 + /* "pyreadstat/_readstat_parser.pyx":578 * if dc.usernan: * n_ranges = readstat_variable_get_missing_ranges_count(variable) * if n_ranges>0: # <<<<<<<<<<<<<< @@ -10843,7 +10457,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":600 + /* "pyreadstat/_readstat_parser.pyx":576 * * # missing values * if dc.usernan: # <<<<<<<<<<<<<< @@ -10852,7 +10466,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ } - /* "pyreadstat/_readstat_parser.pyx":613 + /* "pyreadstat/_readstat_parser.pyx":589 * * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) # <<<<<<<<<<<<<< @@ -10861,35 +10475,35 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_storage_width = readstat_variable_get_storage_width(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":614 + /* "pyreadstat/_readstat_parser.pyx":590 * cdef size_t storage_width * storage_width = readstat_variable_get_storage_width(variable) * dc.variable_storage_width[col_name] = storage_width # <<<<<<<<<<<<<< * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) */ - __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_storage_width)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->variable_storage_width == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 614, __pyx_L1_error) + __PYX_ERR(0, 590, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 614, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->variable_storage_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":616 + /* "pyreadstat/_readstat_parser.pyx":592 * dc.variable_storage_width[col_name] = storage_width * * dc.variable_display_width[col_name] = readstat_variable_get_display_width(variable) # <<<<<<<<<<<<<< * * cdef readstat_alignment_t align */ - __pyx_t_1 = __Pyx_PyLong_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(readstat_variable_get_display_width(__pyx_v_variable)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 616, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_display_width, __pyx_v_col_name, __pyx_t_1) < 0))) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":620 + /* "pyreadstat/_readstat_parser.pyx":596 * cdef readstat_alignment_t align * cdef str pyalign * align = readstat_variable_get_alignment(variable) # <<<<<<<<<<<<<< @@ -10898,7 +10512,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_align = readstat_variable_get_alignment(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":621 + /* "pyreadstat/_readstat_parser.pyx":597 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -10908,7 +10522,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_align) { case READSTAT_ALIGNMENT_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":622 + /* "pyreadstat/_readstat_parser.pyx":598 * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" # <<<<<<<<<<<<<< @@ -10918,7 +10532,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_unknown); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_unknown; - /* "pyreadstat/_readstat_parser.pyx":621 + /* "pyreadstat/_readstat_parser.pyx":597 * cdef str pyalign * align = readstat_variable_get_alignment(variable) * if align == READSTAT_ALIGNMENT_UNKNOWN: # <<<<<<<<<<<<<< @@ -10928,7 +10542,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_LEFT: - /* "pyreadstat/_readstat_parser.pyx":624 + /* "pyreadstat/_readstat_parser.pyx":600 * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" # <<<<<<<<<<<<<< @@ -10938,7 +10552,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_left); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_left; - /* "pyreadstat/_readstat_parser.pyx":623 + /* "pyreadstat/_readstat_parser.pyx":599 * if align == READSTAT_ALIGNMENT_UNKNOWN: * pyalign = "unknown" * elif align == READSTAT_ALIGNMENT_LEFT: # <<<<<<<<<<<<<< @@ -10948,7 +10562,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_CENTER: - /* "pyreadstat/_readstat_parser.pyx":626 + /* "pyreadstat/_readstat_parser.pyx":602 * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" # <<<<<<<<<<<<<< @@ -10958,7 +10572,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_center); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_center; - /* "pyreadstat/_readstat_parser.pyx":625 + /* "pyreadstat/_readstat_parser.pyx":601 * elif align == READSTAT_ALIGNMENT_LEFT: * pyalign = "left" * elif align == READSTAT_ALIGNMENT_CENTER: # <<<<<<<<<<<<<< @@ -10968,7 +10582,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_ALIGNMENT_RIGHT: - /* "pyreadstat/_readstat_parser.pyx":628 + /* "pyreadstat/_readstat_parser.pyx":604 * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: * pyalign = "right" # <<<<<<<<<<<<<< @@ -10978,7 +10592,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_right); __pyx_v_pyalign = __pyx_mstate_global->__pyx_n_u_right; - /* "pyreadstat/_readstat_parser.pyx":627 + /* "pyreadstat/_readstat_parser.pyx":603 * elif align == READSTAT_ALIGNMENT_CENTER: * pyalign = "center" * elif align == READSTAT_ALIGNMENT_RIGHT: # <<<<<<<<<<<<<< @@ -10988,7 +10602,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":630 + /* "pyreadstat/_readstat_parser.pyx":606 * pyalign = "right" * else: * pyalign = "undetermined" # <<<<<<<<<<<<<< @@ -11000,16 +10614,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":632 + /* "pyreadstat/_readstat_parser.pyx":608 * pyalign = "undetermined" * * dc.variable_alignment[col_name] = pyalign # <<<<<<<<<<<<<< * * cdef readstat_measure_t measure */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0))) __PYX_ERR(0, 632, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_alignment, __pyx_v_col_name, __pyx_v_pyalign) < 0))) __PYX_ERR(0, 608, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":636 + /* "pyreadstat/_readstat_parser.pyx":612 * cdef readstat_measure_t measure * cdef str pymeasure * measure = readstat_variable_get_measure(variable) # <<<<<<<<<<<<<< @@ -11018,7 +10632,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i */ __pyx_v_measure = readstat_variable_get_measure(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":637 + /* "pyreadstat/_readstat_parser.pyx":613 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -11028,7 +10642,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i switch (__pyx_v_measure) { case READSTAT_MEASURE_UNKNOWN: - /* "pyreadstat/_readstat_parser.pyx":638 + /* "pyreadstat/_readstat_parser.pyx":614 * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" # <<<<<<<<<<<<<< @@ -11038,7 +10652,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_unknown); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_unknown; - /* "pyreadstat/_readstat_parser.pyx":637 + /* "pyreadstat/_readstat_parser.pyx":613 * cdef str pymeasure * measure = readstat_variable_get_measure(variable) * if measure == READSTAT_MEASURE_UNKNOWN: # <<<<<<<<<<<<<< @@ -11048,7 +10662,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_NOMINAL: - /* "pyreadstat/_readstat_parser.pyx":640 + /* "pyreadstat/_readstat_parser.pyx":616 * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" # <<<<<<<<<<<<<< @@ -11058,7 +10672,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_nominal); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_nominal; - /* "pyreadstat/_readstat_parser.pyx":639 + /* "pyreadstat/_readstat_parser.pyx":615 * if measure == READSTAT_MEASURE_UNKNOWN: * pymeasure = "unknown" * elif measure == READSTAT_MEASURE_NOMINAL: # <<<<<<<<<<<<<< @@ -11068,7 +10682,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_ORDINAL: - /* "pyreadstat/_readstat_parser.pyx":642 + /* "pyreadstat/_readstat_parser.pyx":618 * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" # <<<<<<<<<<<<<< @@ -11078,7 +10692,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ordinal); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_ordinal; - /* "pyreadstat/_readstat_parser.pyx":641 + /* "pyreadstat/_readstat_parser.pyx":617 * elif measure == READSTAT_MEASURE_NOMINAL: * pymeasure = "nominal" * elif measure == READSTAT_MEASURE_ORDINAL: # <<<<<<<<<<<<<< @@ -11088,7 +10702,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; case READSTAT_MEASURE_SCALE: - /* "pyreadstat/_readstat_parser.pyx":644 + /* "pyreadstat/_readstat_parser.pyx":620 * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: * pymeasure = "scale" # <<<<<<<<<<<<<< @@ -11098,7 +10712,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scale); __pyx_v_pymeasure = __pyx_mstate_global->__pyx_n_u_scale; - /* "pyreadstat/_readstat_parser.pyx":643 + /* "pyreadstat/_readstat_parser.pyx":619 * elif measure == READSTAT_MEASURE_ORDINAL: * pymeasure = "ordinal" * elif measure == READSTAT_MEASURE_SCALE: # <<<<<<<<<<<<<< @@ -11108,7 +10722,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; default: - /* "pyreadstat/_readstat_parser.pyx":646 + /* "pyreadstat/_readstat_parser.pyx":622 * pymeasure = "scale" * else: * pymeasure = "undetermined" # <<<<<<<<<<<<<< @@ -11120,16 +10734,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i break; } - /* "pyreadstat/_readstat_parser.pyx":648 + /* "pyreadstat/_readstat_parser.pyx":624 * pymeasure = "undetermined" * * dc.variable_measure[col_name] = pymeasure # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0))) __PYX_ERR(0, 648, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->variable_measure, __pyx_v_col_name, __pyx_v_pymeasure) < 0))) __PYX_ERR(0, 624, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":650 + /* "pyreadstat/_readstat_parser.pyx":626 * dc.variable_measure[col_name] = pymeasure * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -11139,7 +10753,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":478 + /* "pyreadstat/_readstat_parser.pyx":454 * return READSTAT_HANDLER_OK * * cdef int handle_variable(int index, readstat_variable_t *variable, # <<<<<<<<<<<<<< @@ -11176,7 +10790,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int __pyx_v_i return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":653 +/* "pyreadstat/_readstat_parser.pyx":629 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -11214,7 +10828,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value", 0); - /* "pyreadstat/_readstat_parser.pyx":674 + /* "pyreadstat/_readstat_parser.pyx":650 * * # extract variables we need from data container * dc = ctx # <<<<<<<<<<<<<< @@ -11226,7 +10840,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":675 + /* "pyreadstat/_readstat_parser.pyx":651 * # extract variables we need from data container * dc = ctx * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -11238,7 +10852,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_v_output_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":676 + /* "pyreadstat/_readstat_parser.pyx":652 * dc = ctx * output_format = dc.output_format * index = readstat_variable_get_index_after_skipping(variable) # <<<<<<<<<<<<<< @@ -11247,7 +10861,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_index = readstat_variable_get_index_after_skipping(__pyx_v_variable); - /* "pyreadstat/_readstat_parser.pyx":677 + /* "pyreadstat/_readstat_parser.pyx":653 * output_format = dc.output_format * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs # <<<<<<<<<<<<<< @@ -11257,7 +10871,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_2 = __pyx_v_dc->max_n_obs; __pyx_v_max_n_obs = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":678 + /* "pyreadstat/_readstat_parser.pyx":654 * index = readstat_variable_get_index_after_skipping(variable) * max_n_obs = dc.max_n_obs * is_unkown_number_rows = dc.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -11267,7 +10881,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = __pyx_v_dc->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":682 + /* "pyreadstat/_readstat_parser.pyx":658 * # check that we still have enough room in our pre-allocated lists * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -11276,15 +10890,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 682, __pyx_L1_error) + __PYX_ERR(0, 658, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":683 + /* "pyreadstat/_readstat_parser.pyx":659 * # if not, add more room * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] # <<<<<<<<<<<<<< @@ -11293,15 +10907,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 683, __pyx_L1_error) + __PYX_ERR(0, 659, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_iscurnptypefloat = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":684 + /* "pyreadstat/_readstat_parser.pyx":660 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -11310,7 +10924,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (__pyx_v_is_unkown_number_rows) { - /* "pyreadstat/_readstat_parser.pyx":685 + /* "pyreadstat/_readstat_parser.pyx":661 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -11320,7 +10934,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_max_n_obs <= __pyx_v_obs_index); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":686 + /* "pyreadstat/_readstat_parser.pyx":662 * if is_unkown_number_rows: * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 # <<<<<<<<<<<<<< @@ -11329,7 +10943,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_dc->max_n_obs = (__pyx_v_obs_index + 1); - /* "pyreadstat/_readstat_parser.pyx":685 + /* "pyreadstat/_readstat_parser.pyx":661 * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: * if max_n_obs <= obs_index: # <<<<<<<<<<<<<< @@ -11338,7 +10952,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":687 + /* "pyreadstat/_readstat_parser.pyx":663 * if max_n_obs <= obs_index: * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] # <<<<<<<<<<<<<< @@ -11347,15 +10961,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 687, __pyx_L1_error) + __PYX_ERR(0, 663, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data_len, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __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, 687, __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, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_var_max_rows = __pyx_t_2; - /* "pyreadstat/_readstat_parser.pyx":688 + /* "pyreadstat/_readstat_parser.pyx":664 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -11365,17 +10979,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_var_max_rows <= __pyx_v_obs_index); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":689 + /* "pyreadstat/_readstat_parser.pyx":665 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: * if output_format == "pandas": # <<<<<<<<<<<<<< * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 665, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":690 + /* "pyreadstat/_readstat_parser.pyx":666 * if var_max_rows <= obs_index: * if output_format == "pandas": * curnptype = dc.col_numpy_dtypes[index] # <<<<<<<<<<<<<< @@ -11384,14 +10998,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 690, __pyx_L1_error) + __PYX_ERR(0, 666, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_curnptype = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":691 + /* "pyreadstat/_readstat_parser.pyx":667 * if output_format == "pandas": * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) # <<<<<<<<<<<<<< @@ -11399,9 +11013,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * buf_list.fill(np.nan) */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; @@ -11418,20 +11032,20 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_100000}; - __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 691, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dtype, __pyx_v_curnptype, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 667, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_buf_list = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":692 + /* "pyreadstat/_readstat_parser.pyx":668 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -11447,7 +11061,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L8_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":693 + /* "pyreadstat/_readstat_parser.pyx":669 * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) # <<<<<<<<<<<<<< @@ -11456,9 +11070,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_t_6 = __pyx_v_buf_list; __Pyx_INCREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 0; @@ -11467,12 +11081,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fill, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":692 + /* "pyreadstat/_readstat_parser.pyx":668 * curnptype = dc.col_numpy_dtypes[index] * buf_list = np.empty(100000, dtype=curnptype) * if iscurnptypeobject or iscurnptypefloat: # <<<<<<<<<<<<<< @@ -11481,7 +11095,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":694 + /* "pyreadstat/_readstat_parser.pyx":670 * if iscurnptypeobject or iscurnptypefloat: * buf_list.fill(np.nan) * dc.col_data[index] = np.append(dc.col_data[index], buf_list) # <<<<<<<<<<<<<< @@ -11489,16 +11103,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * buf_list = [None] * 100000 */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_append); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_append); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 694, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 1; #if CYTHON_UNPACK_METHODS @@ -11518,17 +11132,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 694, __pyx_L1_error) + __PYX_ERR(0, 670, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 694, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":689 + /* "pyreadstat/_readstat_parser.pyx":665 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11538,7 +11152,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L6; } - /* "pyreadstat/_readstat_parser.pyx":696 + /* "pyreadstat/_readstat_parser.pyx":672 * dc.col_data[index] = np.append(dc.col_data[index], buf_list) * else: * buf_list = [None] * 100000 # <<<<<<<<<<<<<< @@ -11546,19 +11160,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * var_max_rows += 100000 */ /*else*/ { - __pyx_t_1 = PyList_New(1 * 100000); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_1 = PyList_New(1 * 100000); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 0x186A0; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 696, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None) != (0)) __PYX_ERR(0, 672, __pyx_L1_error); } } __pyx_v_buf_list = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":697 + /* "pyreadstat/_readstat_parser.pyx":673 * else: * buf_list = [None] * 100000 * dc.col_data[index].extend(buf_list) # <<<<<<<<<<<<<< @@ -11567,9 +11181,9 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 697, __pyx_L1_error) + __PYX_ERR(0, 673, __pyx_L1_error) } - __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); @@ -11579,14 +11193,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L6:; - /* "pyreadstat/_readstat_parser.pyx":698 + /* "pyreadstat/_readstat_parser.pyx":674 * buf_list = [None] * 100000 * dc.col_data[index].extend(buf_list) * var_max_rows += 100000 # <<<<<<<<<<<<<< @@ -11595,23 +11209,23 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_var_max_rows = (__pyx_v_var_max_rows + 0x186A0); - /* "pyreadstat/_readstat_parser.pyx":699 + /* "pyreadstat/_readstat_parser.pyx":675 * dc.col_data[index].extend(buf_list) * var_max_rows += 100000 * dc.col_data_len[index] = var_max_rows # <<<<<<<<<<<<<< * * # transform to python value types */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_var_max_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_dc->col_data_len == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 699, __pyx_L1_error) + __PYX_ERR(0, 675, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 699, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data_len, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":688 + /* "pyreadstat/_readstat_parser.pyx":664 * dc.max_n_obs = obs_index + 1 * var_max_rows = dc.col_data_len[index] * if var_max_rows <= obs_index: # <<<<<<<<<<<<<< @@ -11620,7 +11234,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":684 + /* "pyreadstat/_readstat_parser.pyx":660 * iscurnptypeobject = dc.col_dtypes_isobject[index] * iscurnptypefloat = dc.col_dytpes_isfloat[index] * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -11629,7 +11243,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":702 + /* "pyreadstat/_readstat_parser.pyx":678 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -11639,7 +11253,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":704 + /* "pyreadstat/_readstat_parser.pyx":680 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -11657,17 +11271,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_L12_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":705 + /* "pyreadstat/_readstat_parser.pyx":681 * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": # <<<<<<<<<<<<<< * if iscurnptypefloat == 1 or iscurnptypeobject == 1: * # already allocated */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 681, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":706 + /* "pyreadstat/_readstat_parser.pyx":682 * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": * if iscurnptypefloat == 1 or iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11687,7 +11301,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L15; } - /* "pyreadstat/_readstat_parser.pyx":712 + /* "pyreadstat/_readstat_parser.pyx":688 * # for any type except float, the numpy type will be object as now we have nans * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -11697,11 +11311,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 712, __pyx_L1_error) + __PYX_ERR(0, 688, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 688, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":713 + /* "pyreadstat/_readstat_parser.pyx":689 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -11710,11 +11324,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 713, __pyx_L1_error) + __PYX_ERR(0, 689, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 713, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 689, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":714 + /* "pyreadstat/_readstat_parser.pyx":690 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -11723,7 +11337,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":715 + /* "pyreadstat/_readstat_parser.pyx":691 * dc.col_dtypes_isobject[index] = 1 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -11732,57 +11346,57 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 715, __pyx_L1_error) + __PYX_ERR(0, 691, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_builtin_object}; - __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 715, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_4, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 691, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 715, __pyx_L1_error) + __PYX_ERR(0, 691, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 715, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":716 + /* "pyreadstat/_readstat_parser.pyx":692 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index:] = np.nan # <<<<<<<<<<<<<< * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 716, __pyx_L1_error) + __PYX_ERR(0, 692, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetSlice(__pyx_t_1, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < 0) __PYX_ERR(0, 716, __pyx_L1_error) + if (__Pyx_PyObject_SetSlice(__pyx_t_1, __pyx_t_5, __pyx_v_obs_index, 0, NULL, NULL, NULL, 1, 0, 1) < 0) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L15:; - /* "pyreadstat/_readstat_parser.pyx":705 + /* "pyreadstat/_readstat_parser.pyx":681 * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -11791,7 +11405,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":704 + /* "pyreadstat/_readstat_parser.pyx":680 * if readstat_value_is_missing(value, variable): * # The user does not want to retrieve missing values * if not dc.usernan or readstat_value_is_system_missing(value): # <<<<<<<<<<<<<< @@ -11801,7 +11415,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L11; } - /* "pyreadstat/_readstat_parser.pyx":718 + /* "pyreadstat/_readstat_parser.pyx":694 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -11811,19 +11425,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_defined_missing(__pyx_v_value, __pyx_v_variable) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":720 + /* "pyreadstat/_readstat_parser.pyx":696 * elif readstat_value_is_defined_missing(value, variable): * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): */ - __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_5 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyvalue = __pyx_t_5; __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":721 + /* "pyreadstat/_readstat_parser.pyx":697 * # SPSS missing values * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -11832,14 +11446,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 697, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely((__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_5, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":718 + /* "pyreadstat/_readstat_parser.pyx":694 * dc.col_data[index][obs_index:] = np.nan * #dc.col_data[index][obs_index] = NAN * elif readstat_value_is_defined_missing(value, variable): # <<<<<<<<<<<<<< @@ -11849,7 +11463,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L11; } - /* "pyreadstat/_readstat_parser.pyx":722 + /* "pyreadstat/_readstat_parser.pyx":698 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -11859,7 +11473,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":723 + /* "pyreadstat/_readstat_parser.pyx":699 * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): * iscurnptypeobject = dc.col_dtypes_isobject[index] # <<<<<<<<<<<<<< @@ -11868,15 +11482,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 723, __pyx_L1_error) + __PYX_ERR(0, 699, __pyx_L1_error) } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_iscurnptypeobject = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":725 + /* "pyreadstat/_readstat_parser.pyx":701 * iscurnptypeobject = dc.col_dtypes_isobject[index] * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -11885,17 +11499,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":728 + /* "pyreadstat/_readstat_parser.pyx":704 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": # <<<<<<<<<<<<<< * if iscurnptypeobject == 1: * dc.col_data[index][obs_index] = chr(missing_tag) */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":729 + /* "pyreadstat/_readstat_parser.pyx":705 * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11905,26 +11519,26 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_iscurnptypeobject == 1); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":730 + /* "pyreadstat/_readstat_parser.pyx":706 * if output_format == "pandas": * if iscurnptypeobject == 1: * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * else: * dc.col_numpy_dtypes[index] = object */ - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 730, __pyx_L1_error) + __PYX_ERR(0, 706, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 730, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_1, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":729 + /* "pyreadstat/_readstat_parser.pyx":705 * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": * if iscurnptypeobject == 1: # <<<<<<<<<<<<<< @@ -11934,7 +11548,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L19; } - /* "pyreadstat/_readstat_parser.pyx":732 + /* "pyreadstat/_readstat_parser.pyx":708 * dc.col_data[index][obs_index] = chr(missing_tag) * else: * dc.col_numpy_dtypes[index] = object # <<<<<<<<<<<<<< @@ -11944,11 +11558,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ /*else*/ { if (unlikely(__pyx_v_dc->col_numpy_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 732, __pyx_L1_error) + __PYX_ERR(0, 708, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 732, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_numpy_dtypes, __pyx_v_index, __pyx_builtin_object, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 708, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":733 + /* "pyreadstat/_readstat_parser.pyx":709 * else: * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 # <<<<<<<<<<<<<< @@ -11957,11 +11571,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dtypes_isobject == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 733, __pyx_L1_error) + __PYX_ERR(0, 709, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 733, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dtypes_isobject, __pyx_v_index, __pyx_mstate_global->__pyx_int_1, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 709, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":734 + /* "pyreadstat/_readstat_parser.pyx":710 * dc.col_numpy_dtypes[index] = object * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 # <<<<<<<<<<<<<< @@ -11970,11 +11584,11 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_dytpes_isfloat == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 734, __pyx_L1_error) + __PYX_ERR(0, 710, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_mstate_global->__pyx_int_0, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 734, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_dytpes_isfloat, __pyx_v_index, __pyx_mstate_global->__pyx_int_0, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 710, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":735 + /* "pyreadstat/_readstat_parser.pyx":711 * dc.col_dtypes_isobject[index] = 1 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 # <<<<<<<<<<<<<< @@ -11983,7 +11597,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ __pyx_v_iscurnptypeobject = 1; - /* "pyreadstat/_readstat_parser.pyx":736 + /* "pyreadstat/_readstat_parser.pyx":712 * dc.col_dytpes_isfloat[index] = 0 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) # <<<<<<<<<<<<<< @@ -11992,54 +11606,54 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 736, __pyx_L1_error) + __PYX_ERR(0, 712, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_builtin_object}; - __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 736, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_copy, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 712, __pyx_L1_error) __pyx_t_5 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 736, __pyx_L1_error) + __PYX_ERR(0, 712, __pyx_L1_error) } - if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_dc->col_data, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1) < 0))) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":737 + /* "pyreadstat/_readstat_parser.pyx":713 * iscurnptypeobject = 1 * dc.col_data[index] = dc.col_data[index].astype(object, copy=False) * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< * else: * dc.col_data[index][obs_index] = chr(missing_tag) */ - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 737, __pyx_L1_error) + __PYX_ERR(0, 713, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 737, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L19:; - /* "pyreadstat/_readstat_parser.pyx":728 + /* "pyreadstat/_readstat_parser.pyx":704 * # In SAS missing values are A to Z or _ in stata a to z * # if (missing_tag >=65 and missing_tag <= 90) or missing_tag == 95 or (missing_tag >=61 and missing_tag <= 122): * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -12049,7 +11663,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L18; } - /* "pyreadstat/_readstat_parser.pyx":739 + /* "pyreadstat/_readstat_parser.pyx":715 * dc.col_data[index][obs_index] = chr(missing_tag) * else: * dc.col_data[index][obs_index] = chr(missing_tag) # <<<<<<<<<<<<<< @@ -12057,21 +11671,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * if curset is None: */ /*else*/ { - __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 739, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 739, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_t_5, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L18:; - /* "pyreadstat/_readstat_parser.pyx":740 + /* "pyreadstat/_readstat_parser.pyx":716 * else: * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) # <<<<<<<<<<<<<< @@ -12080,18 +11694,18 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 740, __pyx_L1_error) + __PYX_ERR(0, 716, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_dc->missing_user_values, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PySet_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_4))) __PYX_ERR(0, 740, __pyx_L1_error) + if (!(likely(PySet_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_4))) __PYX_ERR(0, 716, __pyx_L1_error) __pyx_v_curset = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":741 + /* "pyreadstat/_readstat_parser.pyx":717 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -12101,19 +11715,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_t_3 = (__pyx_v_curset == ((PyObject*)Py_None)); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":742 + /* "pyreadstat/_readstat_parser.pyx":718 * curset = dc.missing_user_values.get(index) * if curset is None: * curset = set() # <<<<<<<<<<<<<< * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset */ - __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_curset, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":741 + /* "pyreadstat/_readstat_parser.pyx":717 * dc.col_data[index][obs_index] = chr(missing_tag) * curset = dc.missing_user_values.get(index) * if curset is None: # <<<<<<<<<<<<<< @@ -12122,7 +11736,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ } - /* "pyreadstat/_readstat_parser.pyx":743 + /* "pyreadstat/_readstat_parser.pyx":719 * if curset is None: * curset = set() * curset.add(chr(missing_tag)) # <<<<<<<<<<<<<< @@ -12131,14 +11745,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_curset == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); - __PYX_ERR(0, 743, __pyx_L1_error) + __PYX_ERR(0, 719, __pyx_L1_error) } - __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_9 = PySet_Add(__pyx_v_curset, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":744 + /* "pyreadstat/_readstat_parser.pyx":720 * curset = set() * curset.add(chr(missing_tag)) * dc.missing_user_values[index] = curset # <<<<<<<<<<<<<< @@ -12147,14 +11761,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 744, __pyx_L1_error) + __PYX_ERR(0, 720, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_4, __pyx_v_curset) < 0))) __PYX_ERR(0, 744, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_dc->missing_user_values, __pyx_t_4, __pyx_v_curset) < 0))) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":722 + /* "pyreadstat/_readstat_parser.pyx":698 * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue * elif readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -12164,7 +11778,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ } __pyx_L11:; - /* "pyreadstat/_readstat_parser.pyx":702 + /* "pyreadstat/_readstat_parser.pyx":678 * * # transform to python value types * if readstat_value_is_missing(value, variable): # <<<<<<<<<<<<<< @@ -12174,7 +11788,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ goto __pyx_L10; } - /* "pyreadstat/_readstat_parser.pyx":746 + /* "pyreadstat/_readstat_parser.pyx":722 * dc.missing_user_values[index] = curset * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) # <<<<<<<<<<<<<< @@ -12182,12 +11796,12 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ * */ /*else*/ { - __pyx_t_4 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_4 = __pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(__pyx_v_value, __pyx_v_index, __pyx_v_dc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_pyvalue = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":747 + /* "pyreadstat/_readstat_parser.pyx":723 * else: * pyvalue = convert_readstat_to_python_value(value, index, dc) * dc.col_data[index][obs_index] = pyvalue # <<<<<<<<<<<<<< @@ -12196,16 +11810,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ */ if (unlikely(__pyx_v_dc->col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 747, __pyx_L1_error) + __PYX_ERR(0, 723, __pyx_L1_error) } - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_dc->col_data, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 747, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_t_4, __pyx_v_obs_index, __pyx_v_pyvalue, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_parser.pyx":749 + /* "pyreadstat/_readstat_parser.pyx":725 * dc.col_data[index][obs_index] = pyvalue * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12215,7 +11829,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":653 + /* "pyreadstat/_readstat_parser.pyx":629 * * * cdef int handle_value(int obs_index, readstat_variable_t * variable, readstat_value_t value, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12242,7 +11856,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int __pyx_v_obs_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":752 +/* "pyreadstat/_readstat_parser.pyx":728 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12281,7 +11895,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_value_label", 0); - /* "pyreadstat/_readstat_parser.pyx":758 + /* "pyreadstat/_readstat_parser.pyx":734 * """ * * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -12293,14 +11907,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":776 + /* "pyreadstat/_readstat_parser.pyx":752 * cdef str value_label_name * * var_label = val_labels # <<<<<<<<<<<<<< * value_label_name = label * */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_val_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12308,14 +11922,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_var_label = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":777 + /* "pyreadstat/_readstat_parser.pyx":753 * * var_label = val_labels * value_label_name = label # <<<<<<<<<<<<<< * * cdef readstat_type_t value_type */ - __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); @@ -12323,7 +11937,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_value_label_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":780 + /* "pyreadstat/_readstat_parser.pyx":756 * * cdef readstat_type_t value_type * value_type = readstat_value_type(value) # <<<<<<<<<<<<<< @@ -12332,7 +11946,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_value_type = readstat_value_type(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":782 + /* "pyreadstat/_readstat_parser.pyx":758 * value_type = readstat_value_type(value) * * labels_raw = dc.labels_raw # <<<<<<<<<<<<<< @@ -12344,7 +11958,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_labels_raw = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":783 + /* "pyreadstat/_readstat_parser.pyx":759 * * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) # <<<<<<<<<<<<<< @@ -12358,36 +11972,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_var_label}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_cur_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":784 + /* "pyreadstat/_readstat_parser.pyx":760 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< * cur_dict = dict() * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":785 + /* "pyreadstat/_readstat_parser.pyx":761 * cur_dict = labels_raw.get(var_label) * if not cur_dict: * cur_dict = dict() # <<<<<<<<<<<<<< * * if readstat_value_is_tagged_missing(value): */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_dict, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":784 + /* "pyreadstat/_readstat_parser.pyx":760 * labels_raw = dc.labels_raw * cur_dict = labels_raw.get(var_label) * if not cur_dict: # <<<<<<<<<<<<<< @@ -12396,7 +12010,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ } - /* "pyreadstat/_readstat_parser.pyx":787 + /* "pyreadstat/_readstat_parser.pyx":763 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -12406,7 +12020,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_5 = (readstat_value_is_tagged_missing(__pyx_v_value) != 0); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":789 + /* "pyreadstat/_readstat_parser.pyx":765 * if readstat_value_is_tagged_missing(value): * # SAS and Stata missing values * missing_tag = readstat_value_tag(value) # <<<<<<<<<<<<<< @@ -12415,19 +12029,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_missing_tag = ((int)readstat_value_tag(__pyx_v_value)); - /* "pyreadstat/_readstat_parser.pyx":791 + /* "pyreadstat/_readstat_parser.pyx":767 * missing_tag = readstat_value_tag(value) * # In SAS missing values are A to Z or _ in stata a to z * cur_dict[chr(missing_tag)] = value_label_name # <<<<<<<<<<<<<< * else: * */ - __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_v_missing_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 791, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_1, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":787 + /* "pyreadstat/_readstat_parser.pyx":763 * cur_dict = dict() * * if readstat_value_is_tagged_missing(value): # <<<<<<<<<<<<<< @@ -12437,7 +12051,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py goto __pyx_L4; } - /* "pyreadstat/_readstat_parser.pyx":794 + /* "pyreadstat/_readstat_parser.pyx":770 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12446,7 +12060,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ /*else*/ { - /* "pyreadstat/_readstat_parser.pyx":814 + /* "pyreadstat/_readstat_parser.pyx":790 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -12456,7 +12070,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_value_type) { case READSTAT_TYPE_STRING: - /* "pyreadstat/_readstat_parser.pyx":794 + /* "pyreadstat/_readstat_parser.pyx":770 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12465,7 +12079,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":795 + /* "pyreadstat/_readstat_parser.pyx":771 * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) # <<<<<<<<<<<<<< @@ -12474,14 +12088,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_str_value = readstat_string_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":796 + /* "pyreadstat/_readstat_parser.pyx":772 * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: * c_str_value = readstat_string_value(value) * py_str_value = c_str_value # <<<<<<<<<<<<<< * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_c_str_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12489,7 +12103,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_v_py_str_value = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":797 + /* "pyreadstat/_readstat_parser.pyx":773 * c_str_value = readstat_string_value(value) * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING # <<<<<<<<<<<<<< @@ -12498,7 +12112,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING; - /* "pyreadstat/_readstat_parser.pyx":794 + /* "pyreadstat/_readstat_parser.pyx":770 * else: * * if value_type == READSTAT_TYPE_STRING or value_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -12508,7 +12122,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":799 + /* "pyreadstat/_readstat_parser.pyx":775 * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) # <<<<<<<<<<<<<< @@ -12517,7 +12131,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int8_value = readstat_int8_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":800 + /* "pyreadstat/_readstat_parser.pyx":776 * elif value_type == READSTAT_TYPE_INT8: * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value # <<<<<<<<<<<<<< @@ -12526,7 +12140,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int8_value); - /* "pyreadstat/_readstat_parser.pyx":801 + /* "pyreadstat/_readstat_parser.pyx":777 * c_int8_value = readstat_int8_value(value) * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12535,7 +12149,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":798 + /* "pyreadstat/_readstat_parser.pyx":774 * py_str_value = c_str_value * pyformat = VAR_FORMAT_STRING * elif value_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -12545,7 +12159,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":803 + /* "pyreadstat/_readstat_parser.pyx":779 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) # <<<<<<<<<<<<<< @@ -12554,7 +12168,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int16_value = readstat_int16_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":804 + /* "pyreadstat/_readstat_parser.pyx":780 * elif value_type == READSTAT_TYPE_INT16: * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value # <<<<<<<<<<<<<< @@ -12563,7 +12177,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int16_value); - /* "pyreadstat/_readstat_parser.pyx":805 + /* "pyreadstat/_readstat_parser.pyx":781 * c_int16_value = readstat_int16_value(value) * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12572,7 +12186,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":802 + /* "pyreadstat/_readstat_parser.pyx":778 * py_long_value = c_int8_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -12582,7 +12196,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":807 + /* "pyreadstat/_readstat_parser.pyx":783 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) # <<<<<<<<<<<<<< @@ -12591,7 +12205,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_int32_value = readstat_int32_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":808 + /* "pyreadstat/_readstat_parser.pyx":784 * elif value_type == READSTAT_TYPE_INT32: * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value # <<<<<<<<<<<<<< @@ -12600,7 +12214,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_long_value = ((long)__pyx_v_c_int32_value); - /* "pyreadstat/_readstat_parser.pyx":809 + /* "pyreadstat/_readstat_parser.pyx":785 * c_int32_value = readstat_int32_value(value) * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG # <<<<<<<<<<<<<< @@ -12609,7 +12223,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG; - /* "pyreadstat/_readstat_parser.pyx":806 + /* "pyreadstat/_readstat_parser.pyx":782 * py_long_value = c_int16_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -12619,7 +12233,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":811 + /* "pyreadstat/_readstat_parser.pyx":787 * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) # <<<<<<<<<<<<<< @@ -12628,7 +12242,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_float_value = readstat_float_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":812 + /* "pyreadstat/_readstat_parser.pyx":788 * elif value_type == READSTAT_TYPE_FLOAT: * c_float_value = readstat_float_value(value) * py_float_value = c_float_value # <<<<<<<<<<<<<< @@ -12637,7 +12251,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_float_value); - /* "pyreadstat/_readstat_parser.pyx":813 + /* "pyreadstat/_readstat_parser.pyx":789 * c_float_value = readstat_float_value(value) * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -12646,7 +12260,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":810 + /* "pyreadstat/_readstat_parser.pyx":786 * py_long_value = c_int32_value * pyformat = VAR_FORMAT_LONG * elif value_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -12656,7 +12270,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":815 + /* "pyreadstat/_readstat_parser.pyx":791 * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); # <<<<<<<<<<<<<< @@ -12665,7 +12279,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_c_double_value = readstat_double_value(__pyx_v_value); - /* "pyreadstat/_readstat_parser.pyx":816 + /* "pyreadstat/_readstat_parser.pyx":792 * elif value_type == READSTAT_TYPE_DOUBLE: * c_double_value = readstat_double_value(value); * py_float_value = c_double_value # <<<<<<<<<<<<<< @@ -12674,7 +12288,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_py_float_value = ((double)__pyx_v_c_double_value); - /* "pyreadstat/_readstat_parser.pyx":817 + /* "pyreadstat/_readstat_parser.pyx":793 * c_double_value = readstat_double_value(value); * py_float_value = c_double_value * pyformat = VAR_FORMAT_FLOAT # <<<<<<<<<<<<<< @@ -12683,7 +12297,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py */ __pyx_v_pyformat = __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT; - /* "pyreadstat/_readstat_parser.pyx":814 + /* "pyreadstat/_readstat_parser.pyx":790 * py_float_value = c_float_value * pyformat = VAR_FORMAT_FLOAT * elif value_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -12693,7 +12307,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":819 + /* "pyreadstat/_readstat_parser.pyx":795 * pyformat = VAR_FORMAT_FLOAT * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -12701,7 +12315,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py * */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS @@ -12720,16 +12334,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __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, 819, __pyx_L1_error) + __PYX_ERR(0, 795, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":822 + /* "pyreadstat/_readstat_parser.pyx":798 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -12739,17 +12353,17 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py switch (__pyx_v_pyformat) { case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING: - /* "pyreadstat/_readstat_parser.pyx":823 + /* "pyreadstat/_readstat_parser.pyx":799 * * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name */ - if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 823, __pyx_L1_error) } - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 823, __pyx_L1_error) + if (unlikely(!__pyx_v_py_str_value)) { __Pyx_RaiseUnboundLocalError("py_str_value"); __PYX_ERR(0, 799, __pyx_L1_error) } + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_v_py_str_value, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 799, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":822 + /* "pyreadstat/_readstat_parser.pyx":798 * * * if pyformat == VAR_FORMAT_STRING: # <<<<<<<<<<<<<< @@ -12759,16 +12373,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG: - /* "pyreadstat/_readstat_parser.pyx":825 + /* "pyreadstat/_readstat_parser.pyx":801 * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name */ - if (unlikely((__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 825, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_cur_dict, __pyx_v_py_long_value, __pyx_v_value_label_name, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 801, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":824 + /* "pyreadstat/_readstat_parser.pyx":800 * if pyformat == VAR_FORMAT_STRING: * cur_dict[py_str_value] = value_label_name * elif pyformat == VAR_FORMAT_LONG: # <<<<<<<<<<<<<< @@ -12778,19 +12392,19 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":827 + /* "pyreadstat/_readstat_parser.pyx":803 * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name # <<<<<<<<<<<<<< * elif pyformat == VAR_FORMAT_MISSING: * pass */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_py_float_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 827, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_cur_dict, __pyx_t_2, __pyx_v_value_label_name) < 0))) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":826 + /* "pyreadstat/_readstat_parser.pyx":802 * elif pyformat == VAR_FORMAT_LONG: * cur_dict[py_long_value] = value_label_name * elif pyformat == VAR_FORMAT_FLOAT: # <<<<<<<<<<<<<< @@ -12800,7 +12414,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; case __pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_MISSING: - /* "pyreadstat/_readstat_parser.pyx":828 + /* "pyreadstat/_readstat_parser.pyx":804 * elif pyformat == VAR_FORMAT_FLOAT: * cur_dict[py_float_value] = value_label_name * elif pyformat == VAR_FORMAT_MISSING: # <<<<<<<<<<<<<< @@ -12810,7 +12424,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py break; default: - /* "pyreadstat/_readstat_parser.pyx":831 + /* "pyreadstat/_readstat_parser.pyx":807 * pass * else: * raise PyreadstatError("Failed convert C to python value") # <<<<<<<<<<<<<< @@ -12818,7 +12432,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py * dc.labels_raw[var_label] = cur_dict */ __pyx_t_6 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS @@ -12837,27 +12451,27 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __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, 831, __pyx_L1_error) + __PYX_ERR(0, 807, __pyx_L1_error) break; } } __pyx_L4:; - /* "pyreadstat/_readstat_parser.pyx":833 + /* "pyreadstat/_readstat_parser.pyx":809 * raise PyreadstatError("Failed convert C to python value") * * dc.labels_raw[var_label] = cur_dict # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - if (unlikely((PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0))) __PYX_ERR(0, 833, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_dc->labels_raw, __pyx_v_var_label, __pyx_v_cur_dict) < 0))) __PYX_ERR(0, 809, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":835 + /* "pyreadstat/_readstat_parser.pyx":811 * dc.labels_raw[var_label] = cur_dict * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12867,7 +12481,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":752 + /* "pyreadstat/_readstat_parser.pyx":728 * * * cdef int handle_value_label(char *val_labels, readstat_value_t value, char *label, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12893,7 +12507,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *__py return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":837 +/* "pyreadstat/_readstat_parser.pyx":813 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12914,7 +12528,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_note", 0); - /* "pyreadstat/_readstat_parser.pyx":843 + /* "pyreadstat/_readstat_parser.pyx":819 * * cdef str pynote * cdef data_container dc = ctx # <<<<<<<<<<<<<< @@ -12926,14 +12540,14 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_dc = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":845 + /* "pyreadstat/_readstat_parser.pyx":821 * cdef data_container dc = ctx * * pynote = note # <<<<<<<<<<<<<< * dc.notes.append(pynote) * */ - __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_FromString(__pyx_v_note); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -12941,16 +12555,16 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_v_pynote = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":846 + /* "pyreadstat/_readstat_parser.pyx":822 * * pynote = note * dc.notes.append(pynote) # <<<<<<<<<<<<<< * * return READSTAT_HANDLER_OK */ - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 846, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_dc->notes, __pyx_v_pynote); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 822, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":848 + /* "pyreadstat/_readstat_parser.pyx":824 * dc.notes.append(pynote) * * return READSTAT_HANDLER_OK # <<<<<<<<<<<<<< @@ -12960,7 +12574,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int __pyx_r = READSTAT_HANDLER_OK; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":837 + /* "pyreadstat/_readstat_parser.pyx":813 * return READSTAT_HANDLER_OK * * cdef int handle_note (int note_index, char *note, void *ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -12981,7 +12595,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(CYTHON_UNUSED int return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":850 +/* "pyreadstat/_readstat_parser.pyx":826 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -13008,21 +12622,21 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handle_open", 0); - /* "pyreadstat/_readstat_parser.pyx":858 + /* "pyreadstat/_readstat_parser.pyx":834 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< * return -1 * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __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, 858, __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, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { @@ -13031,15 +12645,15 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 858, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "pyreadstat/_readstat_parser.pyx":859 + /* "pyreadstat/_readstat_parser.pyx":835 * * if not os.path.isfile(u8_path): * return -1 # <<<<<<<<<<<<<< @@ -13049,7 +12663,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = -1; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":858 + /* "pyreadstat/_readstat_parser.pyx":834 * cdef Py_ssize_t length * * if not os.path.isfile(u8_path): # <<<<<<<<<<<<<< @@ -13058,36 +12672,36 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":861 + /* "pyreadstat/_readstat_parser.pyx":837 * return -1 * * if os.name == "nt": # <<<<<<<<<<<<<< * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nt, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "pyreadstat/_readstat_parser.pyx":862 + /* "pyreadstat/_readstat_parser.pyx":838 * * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(u8_path, &length) # <<<<<<<<<<<<<< * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) */ - __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_FromString(__pyx_v_u8_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyUnicode_AsWideCharString(__pyx_t_4, (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((wchar_t *)0))) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_t_8 = PyUnicode_AsWideCharString(__pyx_t_4, (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((wchar_t *)0))) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_u16_path = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":863 + /* "pyreadstat/_readstat_parser.pyx":839 * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) # <<<<<<<<<<<<<< @@ -13096,7 +12710,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ __pyx_v_fd = _wsopen(__pyx_v_u16_path, (_O_RDONLY | _O_BINARY), _SH_DENYWR, 0); - /* "pyreadstat/_readstat_parser.pyx":864 + /* "pyreadstat/_readstat_parser.pyx":840 * u16_path = PyUnicode_AsWideCharString(u8_path, &length) * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) # <<<<<<<<<<<<<< @@ -13105,7 +12719,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ assign_fd(__pyx_v_io_ctx, __pyx_v_fd); - /* "pyreadstat/_readstat_parser.pyx":865 + /* "pyreadstat/_readstat_parser.pyx":841 * fd = _wsopen(u16_path, _O_RDONLY | _O_BINARY, _SH_DENYWR, 0) * assign_fd(io_ctx, fd) * return fd # <<<<<<<<<<<<<< @@ -13115,7 +12729,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx __pyx_r = __pyx_v_fd; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":861 + /* "pyreadstat/_readstat_parser.pyx":837 * return -1 * * if os.name == "nt": # <<<<<<<<<<<<<< @@ -13124,7 +12738,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx */ } - /* "pyreadstat/_readstat_parser.pyx":867 + /* "pyreadstat/_readstat_parser.pyx":843 * return fd * else: * return -1 # <<<<<<<<<<<<<< @@ -13136,7 +12750,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":850 + /* "pyreadstat/_readstat_parser.pyx":826 * return READSTAT_HANDLER_OK * * cdef int handle_open(const char *u8_path, void *io_ctx) except READSTAT_HANDLER_ABORT: # <<<<<<<<<<<<<< @@ -13157,7 +12771,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":872 +/* "pyreadstat/_readstat_parser.pyx":848 * cdef object _file_object_ctx = None * * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13168,7 +12782,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *__pyx static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_UNUSED char const *__pyx_v_path, CYTHON_UNUSED void *__pyx_v_io_ctx) { int __pyx_r; - /* "pyreadstat/_readstat_parser.pyx":874 + /* "pyreadstat/_readstat_parser.pyx":850 * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: * """File is already open - this is a no-op""" * return 0 # <<<<<<<<<<<<<< @@ -13178,7 +12792,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":872 + /* "pyreadstat/_readstat_parser.pyx":848 * cdef object _file_object_ctx = None * * cdef int pyobject_open_handler(const char *path, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13191,7 +12805,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":876 +/* "pyreadstat/_readstat_parser.pyx":852 * return 0 * * cdef int pyobject_close_handler(void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13202,7 +12816,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(CYTHON_ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON_UNUSED void *__pyx_v_io_ctx) { int __pyx_r; - /* "pyreadstat/_readstat_parser.pyx":878 + /* "pyreadstat/_readstat_parser.pyx":854 * cdef int pyobject_close_handler(void *io_ctx) noexcept: * """User manages file lifetime - this is a no-op""" * return 0 # <<<<<<<<<<<<<< @@ -13212,7 +12826,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":876 + /* "pyreadstat/_readstat_parser.pyx":852 * return 0 * * cdef int pyobject_close_handler(void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13225,7 +12839,7 @@ static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(CYTHON return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":880 +/* "pyreadstat/_readstat_parser.pyx":856 * return 0 * * cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13255,7 +12869,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pyobject_read_handler", 0); - /* "pyreadstat/_readstat_parser.pyx":887 + /* "pyreadstat/_readstat_parser.pyx":863 * cdef char *data_ptr * * try: # <<<<<<<<<<<<<< @@ -13271,7 +12885,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":888 + /* "pyreadstat/_readstat_parser.pyx":864 * * try: * file_obj = _file_object_ctx # <<<<<<<<<<<<<< @@ -13281,7 +12895,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); __pyx_v_file_obj = __pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx; - /* "pyreadstat/_readstat_parser.pyx":889 + /* "pyreadstat/_readstat_parser.pyx":865 * try: * file_obj = _file_object_ctx * data = file_obj.read(nbyte) # <<<<<<<<<<<<<< @@ -13290,7 +12904,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ __pyx_t_5 = __pyx_v_file_obj; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_nbyte); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 889, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_nbyte); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { @@ -13298,14 +12912,14 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 865, __pyx_L3_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, 889, __pyx_L3_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 865, __pyx_L3_error) __pyx_v_data = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":890 + /* "pyreadstat/_readstat_parser.pyx":866 * file_obj = _file_object_ctx * data = file_obj.read(nbyte) * bytes_read = len(data) # <<<<<<<<<<<<<< @@ -13314,12 +12928,12 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 890, __pyx_L3_error) + __PYX_ERR(0, 866, __pyx_L3_error) } - __pyx_t_8 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 890, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 866, __pyx_L3_error) __pyx_v_bytes_read = __pyx_t_8; - /* "pyreadstat/_readstat_parser.pyx":891 + /* "pyreadstat/_readstat_parser.pyx":867 * data = file_obj.read(nbyte) * bytes_read = len(data) * if bytes_read > 0: # <<<<<<<<<<<<<< @@ -13329,7 +12943,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_t_9 = (__pyx_v_bytes_read > 0); if (__pyx_t_9) { - /* "pyreadstat/_readstat_parser.pyx":892 + /* "pyreadstat/_readstat_parser.pyx":868 * bytes_read = len(data) * if bytes_read > 0: * data_ptr = data # <<<<<<<<<<<<<< @@ -13338,12 +12952,12 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ if (unlikely(__pyx_v_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 892, __pyx_L3_error) + __PYX_ERR(0, 868, __pyx_L3_error) } - __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L3_error) + __pyx_t_10 = __Pyx_PyBytes_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 868, __pyx_L3_error) __pyx_v_data_ptr = ((char *)__pyx_t_10); - /* "pyreadstat/_readstat_parser.pyx":893 + /* "pyreadstat/_readstat_parser.pyx":869 * if bytes_read > 0: * data_ptr = data * memcpy(buf, data_ptr, bytes_read) # <<<<<<<<<<<<<< @@ -13352,7 +12966,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ (void)(memcpy(__pyx_v_buf, __pyx_v_data_ptr, __pyx_v_bytes_read)); - /* "pyreadstat/_readstat_parser.pyx":891 + /* "pyreadstat/_readstat_parser.pyx":867 * data = file_obj.read(nbyte) * bytes_read = len(data) * if bytes_read > 0: # <<<<<<<<<<<<<< @@ -13361,7 +12975,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( */ } - /* "pyreadstat/_readstat_parser.pyx":894 + /* "pyreadstat/_readstat_parser.pyx":870 * data_ptr = data * memcpy(buf, data_ptr, bytes_read) * return bytes_read # <<<<<<<<<<<<<< @@ -13371,7 +12985,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __pyx_r = __pyx_v_bytes_read; goto __pyx_L7_try_return; - /* "pyreadstat/_readstat_parser.pyx":887 + /* "pyreadstat/_readstat_parser.pyx":863 * cdef char *data_ptr * * try: # <<<<<<<<<<<<<< @@ -13384,7 +12998,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_parser.pyx":895 + /* "pyreadstat/_readstat_parser.pyx":871 * memcpy(buf, data_ptr, bytes_read) * return bytes_read * except: # <<<<<<<<<<<<<< @@ -13394,7 +13008,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( /*except:*/ { __Pyx_ErrRestore(0,0,0); - /* "pyreadstat/_readstat_parser.pyx":896 + /* "pyreadstat/_readstat_parser.pyx":872 * return bytes_read * except: * return -1 # <<<<<<<<<<<<<< @@ -13405,7 +13019,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( goto __pyx_L6_except_return; } - /* "pyreadstat/_readstat_parser.pyx":887 + /* "pyreadstat/_readstat_parser.pyx":863 * cdef char *data_ptr * * try: # <<<<<<<<<<<<<< @@ -13426,7 +13040,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":880 + /* "pyreadstat/_readstat_parser.pyx":856 * return 0 * * cdef ssize_t pyobject_read_handler(void *buf, size_t nbyte, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13442,7 +13056,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler( return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":898 +/* "pyreadstat/_readstat_parser.pyx":874 * return -1 * * cdef readstat_off_t pyobject_seek_handler(readstat_off_t offset, readstat_io_flags_t whence, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13469,7 +13083,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pyobject_seek_handler", 0); - /* "pyreadstat/_readstat_parser.pyx":903 + /* "pyreadstat/_readstat_parser.pyx":879 * cdef int py_whence * * try: # <<<<<<<<<<<<<< @@ -13485,7 +13099,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":904 + /* "pyreadstat/_readstat_parser.pyx":880 * * try: * file_obj = _file_object_ctx # <<<<<<<<<<<<<< @@ -13495,7 +13109,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx); __pyx_v_file_obj = __pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx; - /* "pyreadstat/_readstat_parser.pyx":905 + /* "pyreadstat/_readstat_parser.pyx":881 * try: * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: # <<<<<<<<<<<<<< @@ -13505,7 +13119,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand switch (__pyx_v_whence) { case READSTAT_SEEK_SET: - /* "pyreadstat/_readstat_parser.pyx":906 + /* "pyreadstat/_readstat_parser.pyx":882 * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: * py_whence = 0 # <<<<<<<<<<<<<< @@ -13514,7 +13128,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_v_py_whence = 0; - /* "pyreadstat/_readstat_parser.pyx":905 + /* "pyreadstat/_readstat_parser.pyx":881 * try: * file_obj = _file_object_ctx * if whence == READSTAT_SEEK_SET: # <<<<<<<<<<<<<< @@ -13524,7 +13138,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; case READSTAT_SEEK_CUR: - /* "pyreadstat/_readstat_parser.pyx":908 + /* "pyreadstat/_readstat_parser.pyx":884 * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: * py_whence = 1 # <<<<<<<<<<<<<< @@ -13533,7 +13147,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_v_py_whence = 1; - /* "pyreadstat/_readstat_parser.pyx":907 + /* "pyreadstat/_readstat_parser.pyx":883 * if whence == READSTAT_SEEK_SET: * py_whence = 0 * elif whence == READSTAT_SEEK_CUR: # <<<<<<<<<<<<<< @@ -13543,7 +13157,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; default: - /* "pyreadstat/_readstat_parser.pyx":910 + /* "pyreadstat/_readstat_parser.pyx":886 * py_whence = 1 * else: # READSTAT_SEEK_END * py_whence = 2 # <<<<<<<<<<<<<< @@ -13554,7 +13168,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand break; } - /* "pyreadstat/_readstat_parser.pyx":912 + /* "pyreadstat/_readstat_parser.pyx":888 * py_whence = 2 * * file_obj.seek(offset, py_whence) # <<<<<<<<<<<<<< @@ -13563,9 +13177,9 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand */ __pyx_t_5 = __pyx_v_file_obj; __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyLong_From_off_t(__pyx_v_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L3_error) + __pyx_t_6 = __Pyx_PyLong_From_off_t(__pyx_v_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 888, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_py_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L3_error) + __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_py_whence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 0; { @@ -13574,12 +13188,12 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":913 + /* "pyreadstat/_readstat_parser.pyx":889 * * file_obj.seek(offset, py_whence) * return file_obj.tell() # <<<<<<<<<<<<<< @@ -13593,15 +13207,15 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tell, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_9 = __Pyx_PyLong_As_off_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((readstat_off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L3_error) + __pyx_t_9 = __Pyx_PyLong_As_off_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((readstat_off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_9; goto __pyx_L7_try_return; - /* "pyreadstat/_readstat_parser.pyx":903 + /* "pyreadstat/_readstat_parser.pyx":879 * cdef int py_whence * * try: # <<<<<<<<<<<<<< @@ -13615,7 +13229,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":914 + /* "pyreadstat/_readstat_parser.pyx":890 * file_obj.seek(offset, py_whence) * return file_obj.tell() * except: # <<<<<<<<<<<<<< @@ -13625,7 +13239,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand /*except:*/ { __Pyx_ErrRestore(0,0,0); - /* "pyreadstat/_readstat_parser.pyx":915 + /* "pyreadstat/_readstat_parser.pyx":891 * return file_obj.tell() * except: * return -1 # <<<<<<<<<<<<<< @@ -13636,7 +13250,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand goto __pyx_L6_except_return; } - /* "pyreadstat/_readstat_parser.pyx":903 + /* "pyreadstat/_readstat_parser.pyx":879 * cdef int py_whence * * try: # <<<<<<<<<<<<<< @@ -13657,7 +13271,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand goto __pyx_L0; } - /* "pyreadstat/_readstat_parser.pyx":898 + /* "pyreadstat/_readstat_parser.pyx":874 * return -1 * * cdef readstat_off_t pyobject_seek_handler(readstat_off_t offset, readstat_io_flags_t whence, void *io_ctx) noexcept: # <<<<<<<<<<<<<< @@ -13672,7 +13286,7 @@ static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_hand return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":918 +/* "pyreadstat/_readstat_parser.pyx":894 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -13694,7 +13308,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_exit_status", 0); - /* "pyreadstat/_readstat_parser.pyx":925 + /* "pyreadstat/_readstat_parser.pyx":901 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -13704,7 +13318,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_t_1 = (__pyx_v_retcode != READSTAT_OK); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":926 + /* "pyreadstat/_readstat_parser.pyx":902 * cdef str err_message * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) # <<<<<<<<<<<<<< @@ -13713,14 +13327,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ __pyx_v_err_readstat = readstat_error_message(__pyx_v_retcode); - /* "pyreadstat/_readstat_parser.pyx":927 + /* "pyreadstat/_readstat_parser.pyx":903 * 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, 927, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); @@ -13728,7 +13342,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_v_err_message = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":928 + /* "pyreadstat/_readstat_parser.pyx":904 * err_readstat = readstat_error_message(retcode) * err_message = err_readstat * raise ReadstatError(err_message) # <<<<<<<<<<<<<< @@ -13736,7 +13350,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e * */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -13755,14 +13369,14 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __pyx_t_3 = __Pyx_PyObject_FastCall(__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, 928, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 904, __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, 928, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":925 + /* "pyreadstat/_readstat_parser.pyx":901 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -13771,7 +13385,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e */ } - /* "pyreadstat/_readstat_parser.pyx":918 + /* "pyreadstat/_readstat_parser.pyx":894 * * * cdef void check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -13791,7 +13405,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_e __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":931 +/* "pyreadstat/_readstat_parser.pyx":907 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -13831,7 +13445,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ } } - /* "pyreadstat/_readstat_parser.pyx":958 + /* "pyreadstat/_readstat_parser.pyx":934 * cdef bytes encoding_byte * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -13841,7 +13455,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":959 + /* "pyreadstat/_readstat_parser.pyx":935 * * metaonly = data.metaonly * ctx = data # <<<<<<<<<<<<<< @@ -13850,7 +13464,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":962 + /* "pyreadstat/_readstat_parser.pyx":938 * * #readstat_error_t error = READSTAT_OK; * parser = readstat_parser_init() # <<<<<<<<<<<<<< @@ -13859,7 +13473,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_parser = readstat_parser_init(); - /* "pyreadstat/_readstat_parser.pyx":963 + /* "pyreadstat/_readstat_parser.pyx":939 * #readstat_error_t error = READSTAT_OK; * parser = readstat_parser_init() * metadata_handler = handle_metadata # <<<<<<<<<<<<<< @@ -13868,7 +13482,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_metadata_handler = ((readstat_metadata_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_metadata); - /* "pyreadstat/_readstat_parser.pyx":964 + /* "pyreadstat/_readstat_parser.pyx":940 * parser = readstat_parser_init() * metadata_handler = handle_metadata * variable_handler = handle_variable # <<<<<<<<<<<<<< @@ -13877,7 +13491,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_variable_handler = ((readstat_variable_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_variable); - /* "pyreadstat/_readstat_parser.pyx":965 + /* "pyreadstat/_readstat_parser.pyx":941 * metadata_handler = handle_metadata * variable_handler = handle_variable * value_handler = handle_value # <<<<<<<<<<<<<< @@ -13886,7 +13500,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_handler = ((readstat_value_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value); - /* "pyreadstat/_readstat_parser.pyx":966 + /* "pyreadstat/_readstat_parser.pyx":942 * variable_handler = handle_variable * value_handler = handle_value * value_label_handler = handle_value_label # <<<<<<<<<<<<<< @@ -13895,7 +13509,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_value_label_handler = ((readstat_value_label_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_value_label); - /* "pyreadstat/_readstat_parser.pyx":967 + /* "pyreadstat/_readstat_parser.pyx":943 * value_handler = handle_value * value_label_handler = handle_value_label * note_handler = handle_note # <<<<<<<<<<<<<< @@ -13904,43 +13518,43 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_note_handler = ((readstat_note_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_note); - /* "pyreadstat/_readstat_parser.pyx":970 + /* "pyreadstat/_readstat_parser.pyx":946 * * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_metadata_handler(__pyx_v_parser, __pyx_v_metadata_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":971 + /* "pyreadstat/_readstat_parser.pyx":947 * * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_variable_handler(__pyx_v_parser, __pyx_v_variable_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":972 + /* "pyreadstat/_readstat_parser.pyx":948 * check_exit_status(readstat_set_metadata_handler(parser, metadata_handler)) * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) # <<<<<<<<<<<<<< * check_exit_status(readstat_set_note_handler(parser, note_handler)) * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_label_handler(__pyx_v_parser, __pyx_v_value_label_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 948, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":973 + /* "pyreadstat/_readstat_parser.pyx":949 * check_exit_status(readstat_set_variable_handler(parser, variable_handler)) * check_exit_status(readstat_set_value_label_handler(parser, value_label_handler)) * check_exit_status(readstat_set_note_handler(parser, note_handler)) # <<<<<<<<<<<<<< * * # Set up custom I/O handlers for file objects */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_note_handler(__pyx_v_parser, __pyx_v_note_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 949, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":976 + /* "pyreadstat/_readstat_parser.pyx":952 * * # Set up custom I/O handlers for file objects * if file_obj is not None: # <<<<<<<<<<<<<< @@ -13950,7 +13564,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_file_obj != Py_None); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":977 + /* "pyreadstat/_readstat_parser.pyx":953 * # Set up custom I/O handlers for file objects * if file_obj is not None: * _file_object_ctx = file_obj # <<<<<<<<<<<<<< @@ -13962,7 +13576,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx, __pyx_v_file_obj); __Pyx_GIVEREF(__pyx_v_file_obj); - /* "pyreadstat/_readstat_parser.pyx":978 + /* "pyreadstat/_readstat_parser.pyx":954 * if file_obj is not None: * _file_object_ctx = file_obj * open_handler = pyobject_open_handler # <<<<<<<<<<<<<< @@ -13971,7 +13585,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_open_handler = ((readstat_open_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler); - /* "pyreadstat/_readstat_parser.pyx":979 + /* "pyreadstat/_readstat_parser.pyx":955 * _file_object_ctx = file_obj * open_handler = pyobject_open_handler * close_handler = pyobject_close_handler # <<<<<<<<<<<<<< @@ -13980,7 +13594,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_close_handler = ((readstat_close_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler); - /* "pyreadstat/_readstat_parser.pyx":980 + /* "pyreadstat/_readstat_parser.pyx":956 * open_handler = pyobject_open_handler * close_handler = pyobject_close_handler * read_handler = pyobject_read_handler # <<<<<<<<<<<<<< @@ -13989,7 +13603,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_read_handler = ((readstat_read_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler); - /* "pyreadstat/_readstat_parser.pyx":981 + /* "pyreadstat/_readstat_parser.pyx":957 * close_handler = pyobject_close_handler * read_handler = pyobject_read_handler * seek_handler = pyobject_seek_handler # <<<<<<<<<<<<<< @@ -13998,7 +13612,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_seek_handler = ((readstat_seek_handler)__pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_handler); - /* "pyreadstat/_readstat_parser.pyx":982 + /* "pyreadstat/_readstat_parser.pyx":958 * read_handler = pyobject_read_handler * seek_handler = pyobject_seek_handler * readstat_set_open_handler(parser, open_handler) # <<<<<<<<<<<<<< @@ -14007,7 +13621,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_open_handler(__pyx_v_parser, __pyx_v_open_handler)); - /* "pyreadstat/_readstat_parser.pyx":983 + /* "pyreadstat/_readstat_parser.pyx":959 * seek_handler = pyobject_seek_handler * readstat_set_open_handler(parser, open_handler) * readstat_set_close_handler(parser, close_handler) # <<<<<<<<<<<<<< @@ -14016,7 +13630,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_close_handler(__pyx_v_parser, __pyx_v_close_handler)); - /* "pyreadstat/_readstat_parser.pyx":984 + /* "pyreadstat/_readstat_parser.pyx":960 * readstat_set_open_handler(parser, open_handler) * readstat_set_close_handler(parser, close_handler) * readstat_set_read_handler(parser, read_handler) # <<<<<<<<<<<<<< @@ -14025,7 +13639,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_read_handler(__pyx_v_parser, __pyx_v_read_handler)); - /* "pyreadstat/_readstat_parser.pyx":985 + /* "pyreadstat/_readstat_parser.pyx":961 * readstat_set_close_handler(parser, close_handler) * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) # <<<<<<<<<<<<<< @@ -14034,7 +13648,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_seek_handler(__pyx_v_parser, __pyx_v_seek_handler)); - /* "pyreadstat/_readstat_parser.pyx":976 + /* "pyreadstat/_readstat_parser.pyx":952 * * # Set up custom I/O handlers for file objects * if file_obj is not None: # <<<<<<<<<<<<<< @@ -14044,23 +13658,23 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":986 + /* "pyreadstat/_readstat_parser.pyx":962 * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) * elif os.name == "nt": # <<<<<<<<<<<<<< * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __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, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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, 986, __pyx_L1_error) + __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, 962, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":988 + /* "pyreadstat/_readstat_parser.pyx":964 * elif os.name == "nt": * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open # <<<<<<<<<<<<<< @@ -14069,7 +13683,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_open_handler = ((readstat_open_handler)__pyx_f_10pyreadstat_16_readstat_parser_handle_open); - /* "pyreadstat/_readstat_parser.pyx":989 + /* "pyreadstat/_readstat_parser.pyx":965 * # on windows we need a custom open handler in order to deal with internation characters in the path. * open_handler = handle_open * readstat_set_open_handler(parser, open_handler) # <<<<<<<<<<<<<< @@ -14078,7 +13692,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ (void)(readstat_set_open_handler(__pyx_v_parser, __pyx_v_open_handler)); - /* "pyreadstat/_readstat_parser.pyx":986 + /* "pyreadstat/_readstat_parser.pyx":962 * readstat_set_read_handler(parser, read_handler) * readstat_set_seek_handler(parser, seek_handler) * elif os.name == "nt": # <<<<<<<<<<<<<< @@ -14088,7 +13702,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":991 + /* "pyreadstat/_readstat_parser.pyx":967 * readstat_set_open_handler(parser, open_handler) * * if not metaonly: # <<<<<<<<<<<<<< @@ -14098,16 +13712,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (!__pyx_v_metaonly); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":992 + /* "pyreadstat/_readstat_parser.pyx":968 * * if not metaonly: * check_exit_status(readstat_set_value_handler(parser, value_handler)) # <<<<<<<<<<<<<< * * # if the user set the encoding manually */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_value_handler(__pyx_v_parser, __pyx_v_value_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":991 + /* "pyreadstat/_readstat_parser.pyx":967 * readstat_set_open_handler(parser, open_handler) * * if not metaonly: # <<<<<<<<<<<<<< @@ -14116,7 +13730,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":995 + /* "pyreadstat/_readstat_parser.pyx":971 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< @@ -14124,10 +13738,10 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ * readstat_set_file_character_encoding(parser, encoding_bytes) */ __pyx_t_1 = (__pyx_v_data->user_encoding != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_data->user_encoding) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 995, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 971, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":996 + /* "pyreadstat/_readstat_parser.pyx":972 * # if the user set the encoding manually * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") # <<<<<<<<<<<<<< @@ -14136,24 +13750,24 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ if (unlikely(__pyx_v_data->user_encoding == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); - __PYX_ERR(0, 996, __pyx_L1_error) + __PYX_ERR(0, 972, __pyx_L1_error) } - __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_data->user_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_data->user_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_encoding_bytes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":997 + /* "pyreadstat/_readstat_parser.pyx":973 * if data.user_encoding: * encoding_bytes = data.user_encoding.encode("utf-8") * readstat_set_file_character_encoding(parser, encoding_bytes) # <<<<<<<<<<<<<< * * if row_limit: */ - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_encoding_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error) (void)(readstat_set_file_character_encoding(__pyx_v_parser, ((char *)__pyx_t_4))); - /* "pyreadstat/_readstat_parser.pyx":995 + /* "pyreadstat/_readstat_parser.pyx":971 * * # if the user set the encoding manually * if data.user_encoding: # <<<<<<<<<<<<<< @@ -14162,7 +13776,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":999 + /* "pyreadstat/_readstat_parser.pyx":975 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -14172,16 +13786,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_limit != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1000 + /* "pyreadstat/_readstat_parser.pyx":976 * * if row_limit: * check_exit_status(readstat_set_row_limit(parser, row_limit)) # <<<<<<<<<<<<<< * * if row_offset: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_limit(__pyx_v_parser, __pyx_v_row_limit)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":999 + /* "pyreadstat/_readstat_parser.pyx":975 * readstat_set_file_character_encoding(parser, encoding_bytes) * * if row_limit: # <<<<<<<<<<<<<< @@ -14190,7 +13804,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":1002 + /* "pyreadstat/_readstat_parser.pyx":978 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -14200,16 +13814,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (__pyx_v_row_offset != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1003 + /* "pyreadstat/_readstat_parser.pyx":979 * * if row_offset: * check_exit_status(readstat_set_row_offset(parser, row_offset)) # <<<<<<<<<<<<<< * * # parse! */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_row_offset(__pyx_v_parser, __pyx_v_row_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 979, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1002 + /* "pyreadstat/_readstat_parser.pyx":978 * check_exit_status(readstat_set_row_limit(parser, row_limit)) * * if row_offset: # <<<<<<<<<<<<<< @@ -14218,7 +13832,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":1006 + /* "pyreadstat/_readstat_parser.pyx":982 * * # parse! * if file_extension == FILE_EXT_SAV: # <<<<<<<<<<<<<< @@ -14228,7 +13842,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ switch (__pyx_v_file_extension) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV: - /* "pyreadstat/_readstat_parser.pyx":1007 + /* "pyreadstat/_readstat_parser.pyx":983 * # parse! * if file_extension == FILE_EXT_SAV: * error = readstat_parse_sav(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14237,7 +13851,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sav(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1006 + /* "pyreadstat/_readstat_parser.pyx":982 * * # parse! * if file_extension == FILE_EXT_SAV: # <<<<<<<<<<<<<< @@ -14247,7 +13861,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT: - /* "pyreadstat/_readstat_parser.pyx":1009 + /* "pyreadstat/_readstat_parser.pyx":985 * error = readstat_parse_sav(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BDAT: * error = readstat_parse_sas7bdat(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14256,7 +13870,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sas7bdat(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1008 + /* "pyreadstat/_readstat_parser.pyx":984 * if file_extension == FILE_EXT_SAV: * error = readstat_parse_sav(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BDAT: # <<<<<<<<<<<<<< @@ -14266,7 +13880,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA: - /* "pyreadstat/_readstat_parser.pyx":1011 + /* "pyreadstat/_readstat_parser.pyx":987 * error = readstat_parse_sas7bdat(parser, filename, ctx); * elif file_extension == FILE_EXT_DTA: * error = readstat_parse_dta(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14275,7 +13889,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_dta(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1010 + /* "pyreadstat/_readstat_parser.pyx":986 * elif file_extension == FILE_EXT_SAS7BDAT: * error = readstat_parse_sas7bdat(parser, filename, ctx); * elif file_extension == FILE_EXT_DTA: # <<<<<<<<<<<<<< @@ -14285,7 +13899,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT: - /* "pyreadstat/_readstat_parser.pyx":1013 + /* "pyreadstat/_readstat_parser.pyx":989 * error = readstat_parse_dta(parser, filename, ctx); * elif file_extension == FILE_EXT_XPORT: * error = readstat_parse_xport(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14294,7 +13908,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_xport(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1012 + /* "pyreadstat/_readstat_parser.pyx":988 * elif file_extension == FILE_EXT_DTA: * error = readstat_parse_dta(parser, filename, ctx); * elif file_extension == FILE_EXT_XPORT: # <<<<<<<<<<<<<< @@ -14304,7 +13918,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR: - /* "pyreadstat/_readstat_parser.pyx":1015 + /* "pyreadstat/_readstat_parser.pyx":991 * error = readstat_parse_xport(parser, filename, ctx); * elif file_extension == FILE_EXT_POR: * error = readstat_parse_por(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14313,7 +13927,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_por(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1014 + /* "pyreadstat/_readstat_parser.pyx":990 * elif file_extension == FILE_EXT_XPORT: * error = readstat_parse_xport(parser, filename, ctx); * elif file_extension == FILE_EXT_POR: # <<<<<<<<<<<<<< @@ -14323,7 +13937,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT: - /* "pyreadstat/_readstat_parser.pyx":1017 + /* "pyreadstat/_readstat_parser.pyx":993 * error = readstat_parse_por(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BCAT: * error = readstat_parse_sas7bcat(parser, filename, ctx); # <<<<<<<<<<<<<< @@ -14332,7 +13946,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_error = readstat_parse_sas7bcat(__pyx_v_parser, __pyx_v_filename, __pyx_v_ctx); - /* "pyreadstat/_readstat_parser.pyx":1016 + /* "pyreadstat/_readstat_parser.pyx":992 * elif file_extension == FILE_EXT_POR: * error = readstat_parse_por(parser, filename, ctx); * elif file_extension == FILE_EXT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -14343,7 +13957,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ default: break; } - /* "pyreadstat/_readstat_parser.pyx":1019 + /* "pyreadstat/_readstat_parser.pyx":995 * error = readstat_parse_sas7bcat(parser, filename, ctx); * #error = parse_func(parser, filename, ctx); * readstat_parser_free(parser) # <<<<<<<<<<<<<< @@ -14352,7 +13966,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ readstat_parser_free(__pyx_v_parser); - /* "pyreadstat/_readstat_parser.pyx":1022 + /* "pyreadstat/_readstat_parser.pyx":998 * # check if a python error ocurred, if yes, it will be printed by the interpreter, * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() # <<<<<<<<<<<<<< @@ -14361,7 +13975,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ __pyx_v_pyerr = PyErr_Occurred(); - /* "pyreadstat/_readstat_parser.pyx":1023 + /* "pyreadstat/_readstat_parser.pyx":999 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -14371,16 +13985,16 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __pyx_t_1 = (((void *)__pyx_v_pyerr) == NULL); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1024 + /* "pyreadstat/_readstat_parser.pyx":1000 * pyerr = PyErr_Occurred() * if pyerr == NULL: * check_exit_status(error) # <<<<<<<<<<<<<< * * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(__pyx_v_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1023 + /* "pyreadstat/_readstat_parser.pyx":999 * # if not, make sure that the return from parse_func is OK, if not print * pyerr = PyErr_Occurred() * if pyerr == NULL: # <<<<<<<<<<<<<< @@ -14389,7 +14003,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ */ } - /* "pyreadstat/_readstat_parser.pyx":931 + /* "pyreadstat/_readstat_parser.pyx":907 * * * cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<< @@ -14408,7 +14022,7 @@ static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *__ __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_parser.pyx":1027 +/* "pyreadstat/_readstat_parser.pyx":1003 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -14442,7 +14056,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_to_dict", 0); - /* "pyreadstat/_readstat_parser.pyx":1041 + /* "pyreadstat/_readstat_parser.pyx":1017 * cdef bint metaonly * * final_container = OrderedDict() # <<<<<<<<<<<<<< @@ -14450,7 +14064,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( * col_names = data.col_names */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -14469,13 +14083,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_final_container = __pyx_t_1; __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1042 + /* "pyreadstat/_readstat_parser.pyx":1018 * * final_container = OrderedDict() * col_data = data.col_data # <<<<<<<<<<<<<< @@ -14487,7 +14101,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_data = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1043 + /* "pyreadstat/_readstat_parser.pyx":1019 * final_container = OrderedDict() * col_data = data.col_data * col_names = data.col_names # <<<<<<<<<<<<<< @@ -14499,7 +14113,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_v_col_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1044 + /* "pyreadstat/_readstat_parser.pyx":1020 * col_data = data.col_data * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -14509,7 +14123,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":1045 + /* "pyreadstat/_readstat_parser.pyx":1021 * col_names = data.col_names * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs # <<<<<<<<<<<<<< @@ -14519,7 +14133,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_6 = __pyx_v_data->max_n_obs; __pyx_v_max_n_obs = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1046 + /* "pyreadstat/_readstat_parser.pyx":1022 * is_unkown_number_rows = data.is_unkown_number_rows * max_n_obs = data.max_n_obs * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -14529,7 +14143,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_5; - /* "pyreadstat/_readstat_parser.pyx":1048 + /* "pyreadstat/_readstat_parser.pyx":1024 * metaonly = data.metaonly * * for fc_cnt in range(0, len(col_names)): # <<<<<<<<<<<<<< @@ -14538,14 +14152,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1048, __pyx_L1_error) + __PYX_ERR(0, 1024, __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, 1048, __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, 1024, __pyx_L1_error) __pyx_t_8 = __pyx_t_7; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) { __pyx_v_fc_cnt = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1049 + /* "pyreadstat/_readstat_parser.pyx":1025 * * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] # <<<<<<<<<<<<<< @@ -14554,15 +14168,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1049, __pyx_L1_error) + __PYX_ERR(0, 1025, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_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, 1049, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_cur_name_str, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1050 + /* "pyreadstat/_readstat_parser.pyx":1026 * for fc_cnt in range(0, len(col_names)): * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] # <<<<<<<<<<<<<< @@ -14571,14 +14185,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ if (unlikely(__pyx_v_col_data == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1050, __pyx_L1_error) + __PYX_ERR(0, 1026, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_col_data, __pyx_v_fc_cnt, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1051 + /* "pyreadstat/_readstat_parser.pyx":1027 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -14595,19 +14209,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_L6_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":1052 + /* "pyreadstat/_readstat_parser.pyx":1028 * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] # <<<<<<<<<<<<<< * if not metaonly: * final_container[cur_name_str] = cur_data */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_cur_data, 0, __pyx_v_max_n_obs, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_cur_data, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_parser.pyx":1051 + /* "pyreadstat/_readstat_parser.pyx":1027 * cur_name_str = col_names[fc_cnt] * cur_data = col_data[fc_cnt] * if is_unkown_number_rows and not metaonly: # <<<<<<<<<<<<<< @@ -14616,7 +14230,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( */ } - /* "pyreadstat/_readstat_parser.pyx":1053 + /* "pyreadstat/_readstat_parser.pyx":1029 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -14626,16 +14240,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_t_5 = (!__pyx_v_metaonly); if (__pyx_t_5) { - /* "pyreadstat/_readstat_parser.pyx":1054 + /* "pyreadstat/_readstat_parser.pyx":1030 * cur_data = cur_data[0:max_n_obs] * if not metaonly: * final_container[cur_name_str] = cur_data # <<<<<<<<<<<<<< * else: * final_container[cur_name_str] = list() */ - if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0))) __PYX_ERR(0, 1054, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_v_cur_data) < 0))) __PYX_ERR(0, 1030, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1053 + /* "pyreadstat/_readstat_parser.pyx":1029 * if is_unkown_number_rows and not metaonly: * cur_data = cur_data[0:max_n_obs] * if not metaonly: # <<<<<<<<<<<<<< @@ -14645,7 +14259,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( goto __pyx_L8; } - /* "pyreadstat/_readstat_parser.pyx":1056 + /* "pyreadstat/_readstat_parser.pyx":1032 * final_container[cur_name_str] = cur_data * else: * final_container[cur_name_str] = list() # <<<<<<<<<<<<<< @@ -14653,15 +14267,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( * return final_container */ /*else*/ { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0))) __PYX_ERR(0, 1056, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_final_container, __pyx_v_cur_name_str, __pyx_t_1) < 0))) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; } - /* "pyreadstat/_readstat_parser.pyx":1058 + /* "pyreadstat/_readstat_parser.pyx":1034 * final_container[cur_name_str] = list() * * return final_container # <<<<<<<<<<<<<< @@ -14673,7 +14287,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( __pyx_r = __pyx_v_final_container; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1027 + /* "pyreadstat/_readstat_parser.pyx":1003 * * * cdef object data_container_to_dict(data_container data): # <<<<<<<<<<<<<< @@ -14699,7 +14313,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict( return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1060 +/* "pyreadstat/_readstat_parser.pyx":1036 * return final_container * * cdef object dict_to_dataframe(object dict_data, data_container dc): # <<<<<<<<<<<<<< @@ -14751,7 +14365,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dict_to_dataframe", 0); - /* "pyreadstat/_readstat_parser.pyx":1070 + /* "pyreadstat/_readstat_parser.pyx":1046 * cdef py_datetime_format var_format * cdef list dtypes, sertypes, datetime_cols, date_cols * cdef dict schema = None # <<<<<<<<<<<<<< @@ -14761,7 +14375,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(Py_None); __pyx_v_schema = ((PyObject*)Py_None); - /* "pyreadstat/_readstat_parser.pyx":1072 + /* "pyreadstat/_readstat_parser.pyx":1048 * cdef dict schema = None * * dates_as_pandas = dc.dates_as_pandas # <<<<<<<<<<<<<< @@ -14771,7 +14385,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_1 = __pyx_v_dc->dates_as_pandas; __pyx_v_dates_as_pandas = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1073 + /* "pyreadstat/_readstat_parser.pyx":1049 * * dates_as_pandas = dc.dates_as_pandas * output_format = dc.output_format # <<<<<<<<<<<<<< @@ -14783,47 +14397,47 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_v_output_format = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1075 + /* "pyreadstat/_readstat_parser.pyx":1051 * output_format = dc.output_format * * if dict_data: # <<<<<<<<<<<<<< * #schema = None * # in polars if missing user values we need to explicitly set the type */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dict_data); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1051, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1079 + /* "pyreadstat/_readstat_parser.pyx":1055 * # in polars if missing user values we need to explicitly set the type * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: # <<<<<<<<<<<<<< * schema = dict() * for indx in range(0, len(dc.col_names)): */ - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1055, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_dc->missing_user_values); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_dc->missing_user_values); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1055, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1080 + /* "pyreadstat/_readstat_parser.pyx":1056 * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: * schema = dict() # <<<<<<<<<<<<<< * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_schema, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1081 + /* "pyreadstat/_readstat_parser.pyx":1057 * if output_format != "pandas" and dc.missing_user_values: * schema = dict() * for indx in range(0, len(dc.col_names)): # <<<<<<<<<<<<<< @@ -14834,15 +14448,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 1081, __pyx_L1_error) + __PYX_ERR(0, 1057, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1081, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_indx = __pyx_t_6; - /* "pyreadstat/_readstat_parser.pyx":1082 + /* "pyreadstat/_readstat_parser.pyx":1058 * schema = dict() * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] # <<<<<<<<<<<<<< @@ -14851,53 +14465,53 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1082, __pyx_L1_error) + __PYX_ERR(0, 1058, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_indx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_names, __pyx_v_indx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1082, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1058, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_col_name, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1083 + /* "pyreadstat/_readstat_parser.pyx":1059 * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): # <<<<<<<<<<<<<< * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide */ - __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_indx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_dc->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 1083, __pyx_L1_error) + __PYX_ERR(0, 1059, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_dc->missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_Keys(__pyx_v_dc->missing_user_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1084 + /* "pyreadstat/_readstat_parser.pyx":1060 * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): * sertypes = [type(x) for x in dict_data[col_name] if x is not None] # <<<<<<<<<<<<<< * # all missing, let polars decide * if not sertypes: */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict_data, __pyx_v_col_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict_data, __pyx_v_col_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1060, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14906,7 +14520,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } @@ -14916,7 +14530,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } @@ -14927,13 +14541,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_9; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_10(__pyx_t_8); 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, 1084, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1060, __pyx_L1_error) PyErr_Clear(); } break; @@ -14944,14 +14558,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = 0; __pyx_t_1 = (__pyx_v_x != Py_None); if (__pyx_t_1) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)((PyObject *)Py_TYPE(__pyx_v_x))))) __PYX_ERR(0, 1084, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)((PyObject *)Py_TYPE(__pyx_v_x))))) __PYX_ERR(0, 1060, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_sertypes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1086 + /* "pyreadstat/_readstat_parser.pyx":1062 * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide * if not sertypes: # <<<<<<<<<<<<<< @@ -14959,20 +14573,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * continue */ __pyx_t_1 = (__Pyx_PyList_GET_SIZE(__pyx_v_sertypes) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1086, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1062, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1087 + /* "pyreadstat/_readstat_parser.pyx":1063 * # all missing, let polars decide * if not sertypes: * schema[col_name] = None # <<<<<<<<<<<<<< * continue * allsame = all([x==sertypes[0] for x in sertypes]) */ - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1087, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1063, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1088 + /* "pyreadstat/_readstat_parser.pyx":1064 * if not sertypes: * schema[col_name] = None * continue # <<<<<<<<<<<<<< @@ -14981,7 +14595,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ goto __pyx_L7_continue; - /* "pyreadstat/_readstat_parser.pyx":1086 + /* "pyreadstat/_readstat_parser.pyx":1062 * sertypes = [type(x) for x in dict_data[col_name] if x is not None] * # all missing, let polars decide * if not sertypes: # <<<<<<<<<<<<<< @@ -14990,7 +14604,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1089 + /* "pyreadstat/_readstat_parser.pyx":1065 * schema[col_name] = None * continue * allsame = all([x==sertypes[0] for x in sertypes]) # <<<<<<<<<<<<<< @@ -15000,7 +14614,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_all); __pyx_t_2 = __pyx_builtin_all; - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __pyx_v_sertypes; __Pyx_INCREF(__pyx_t_12); __pyx_t_9 = 0; @@ -15008,21 +14622,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1089, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } __pyx_t_13 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_9); ++__pyx_t_9; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1089, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_sertypes, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_sertypes, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = PyObject_RichCompare(__pyx_v_x, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_v_x, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 1089, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_14))) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -15033,14 +14647,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1089, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_allsame = __pyx_t_3; - /* "pyreadstat/_readstat_parser.pyx":1091 + /* "pyreadstat/_readstat_parser.pyx":1067 * allsame = all([x==sertypes[0] for x in sertypes]) * # all the same: let polars decide * if allsame: # <<<<<<<<<<<<<< @@ -15049,16 +14663,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (__pyx_v_allsame) { - /* "pyreadstat/_readstat_parser.pyx":1092 + /* "pyreadstat/_readstat_parser.pyx":1068 * # all the same: let polars decide * if allsame: * schema[col_name] = None # <<<<<<<<<<<<<< * # not all the same type, has to be Object * else: */ - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1092, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1091 + /* "pyreadstat/_readstat_parser.pyx":1067 * allsame = all([x==sertypes[0] for x in sertypes]) * # all the same: let polars decide * if allsame: # <<<<<<<<<<<<<< @@ -15068,7 +14682,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L18; } - /* "pyreadstat/_readstat_parser.pyx":1095 + /* "pyreadstat/_readstat_parser.pyx":1071 * # not all the same type, has to be Object * else: * schema[col_name] = nw.Object # <<<<<<<<<<<<<< @@ -15076,17 +14690,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * schema[col_name] = None */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1095, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(0, 1095, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(0, 1071, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L18:; - /* "pyreadstat/_readstat_parser.pyx":1083 + /* "pyreadstat/_readstat_parser.pyx":1059 * for indx in range(0, len(dc.col_names)): * col_name = dc.col_names[indx] * if indx in dc.missing_user_values.keys(): # <<<<<<<<<<<<<< @@ -15096,7 +14710,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L9; } - /* "pyreadstat/_readstat_parser.pyx":1097 + /* "pyreadstat/_readstat_parser.pyx":1073 * schema[col_name] = nw.Object * else: * schema[col_name] = None # <<<<<<<<<<<<<< @@ -15104,13 +14718,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) */ /*else*/ { - if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_schema, __pyx_v_col_name, Py_None) < 0))) __PYX_ERR(0, 1073, __pyx_L1_error) } __pyx_L9:; __pyx_L7_continue:; } - /* "pyreadstat/_readstat_parser.pyx":1079 + /* "pyreadstat/_readstat_parser.pyx":1055 * # in polars if missing user values we need to explicitly set the type * # of that column to Object if not all the elements are of the same type * if output_format != "pandas" and dc.missing_user_values: # <<<<<<<<<<<<<< @@ -15119,7 +14733,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1099 + /* "pyreadstat/_readstat_parser.pyx":1075 * schema[col_name] = None * * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) # <<<<<<<<<<<<<< @@ -15127,9 +14741,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * data_frame = data_frame.to_native() */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = 1; @@ -15146,21 +14760,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_7, __pyx_v_dict_data}; - __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1099, __pyx_L1_error) + __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1099, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_schema, __pyx_t_11, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 1099, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1075, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_schema, __pyx_t_11, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 1075, __pyx_L1_error) __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_data_frame = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1100 + /* "pyreadstat/_readstat_parser.pyx":1076 * * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) * natnamespace = nw.get_native_namespace(data_frame) # <<<<<<<<<<<<<< @@ -15168,9 +14782,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_get_native_namespace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = 1; @@ -15190,13 +14804,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__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, 1100, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_natnamespace = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1101 + /* "pyreadstat/_readstat_parser.pyx":1077 * data_frame = nw.from_dict(dict_data, backend=output_format, schema=schema) * natnamespace = nw.get_native_namespace(data_frame) * data_frame = data_frame.to_native() # <<<<<<<<<<<<<< @@ -15210,13 +14824,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_native, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1103 + /* "pyreadstat/_readstat_parser.pyx":1079 * data_frame = data_frame.to_native() * * if dates_as_pandas and output_format=="pandas": # <<<<<<<<<<<<<< @@ -15228,12 +14842,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = __pyx_v_dates_as_pandas; goto __pyx_L20_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) __pyx_t_3 = __pyx_t_1; __pyx_L20_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1104 + /* "pyreadstat/_readstat_parser.pyx":1080 * * if dates_as_pandas and output_format=="pandas": * pd = natnamespace # <<<<<<<<<<<<<< @@ -15243,14 +14857,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_v_natnamespace); __pyx_v_pd = __pyx_v_natnamespace; - /* "pyreadstat/_readstat_parser.pyx":1105 + /* "pyreadstat/_readstat_parser.pyx":1081 * if dates_as_pandas and output_format=="pandas": * pd = natnamespace * dtypes = data_frame.dtypes.tolist() # <<<<<<<<<<<<<< * # check that datetime columns are datetime type * # this is needed in case all date values are nan */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1105, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); @@ -15260,14 +14874,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (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_2)) __PYX_ERR(0, 1105, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 1105, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 1081, __pyx_L1_error) __pyx_v_dtypes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1108 + /* "pyreadstat/_readstat_parser.pyx":1084 * # check that datetime columns are datetime type * # this is needed in case all date values are nan * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15275,16 +14889,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if dtypes[index] != '__pyx_n_u_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1084, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -15293,7 +14907,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15303,7 +14917,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1108, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1084, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15314,26 +14928,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_10(__pyx_t_8); 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, 1108, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1084, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1108, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_column, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; __pyx_v_index = __pyx_t_16; __pyx_t_16 = (__pyx_t_16 + 1); - /* "pyreadstat/_readstat_parser.pyx":1109 + /* "pyreadstat/_readstat_parser.pyx":1085 * # this is needed in case all date values are nan * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -15342,15 +14956,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1109, __pyx_L1_error) + __PYX_ERR(0, 1085, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_var_format = __pyx_t_17; - /* "pyreadstat/_readstat_parser.pyx":1110 + /* "pyreadstat/_readstat_parser.pyx":1086 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_kp_u_M8_ns, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_M8_ns, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { @@ -15383,7 +14997,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_L25_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1111 + /* "pyreadstat/_readstat_parser.pyx":1087 * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_n_u_to_datetime, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_loc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_loc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1111, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(0, 1087, __pyx_L1_error); __Pyx_INCREF(__pyx_v_column); __Pyx_GIVEREF(__pyx_v_column); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_column) != (0)) __PYX_ERR(0, 1111, __pyx_L1_error); - if (unlikely((PyObject_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_2) < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_column) != (0)) __PYX_ERR(0, 1087, __pyx_L1_error); + if (unlikely((PyObject_SetItem(__pyx_t_11, __pyx_t_7, __pyx_t_2) < 0))) __PYX_ERR(0, 1087, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1110 + /* "pyreadstat/_readstat_parser.pyx":1086 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1089, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; @@ -15464,7 +15078,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_L29_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1115 + /* "pyreadstat/_readstat_parser.pyx":1091 * if output_format == "polars" and not dc.no_datetime_conversion: * # datetime and date vectorized conversion * pl = natnamespace # <<<<<<<<<<<<<< @@ -15474,31 +15088,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_v_natnamespace); __pyx_v_pl = __pyx_v_natnamespace; - /* "pyreadstat/_readstat_parser.pyx":1116 + /* "pyreadstat/_readstat_parser.pyx":1092 * # datetime and date vectorized conversion * pl = natnamespace * datetime_cols = list() # <<<<<<<<<<<<<< * date_cols = list() * for index, column in enumerate(data_frame.columns): */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_datetime_cols = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1117 + /* "pyreadstat/_readstat_parser.pyx":1093 * pl = natnamespace * datetime_cols = list() * date_cols = list() # <<<<<<<<<<<<<< * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1117, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_date_cols = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1118 + /* "pyreadstat/_readstat_parser.pyx":1094 * datetime_cols = list() * date_cols = list() * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15506,16 +15120,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if var_format == DATE_FORMAT_DATETIME: */ __pyx_t_16 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data_frame, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1094, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -15524,7 +15138,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1094, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15534,7 +15148,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1094, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -15545,26 +15159,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1118, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1094, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_10(__pyx_t_2); 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, 1118, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1094, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_8); - if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1118, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_column, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; __pyx_v_index = __pyx_t_16; __pyx_t_16 = (__pyx_t_16 + 1); - /* "pyreadstat/_readstat_parser.pyx":1119 + /* "pyreadstat/_readstat_parser.pyx":1095 * date_cols = list() * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] # <<<<<<<<<<<<<< @@ -15573,15 +15187,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ if (unlikely(__pyx_v_dc->col_formats == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1119, __pyx_L1_error) + __PYX_ERR(0, 1095, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_dc->col_formats, __pyx_v_index, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_17 = ((__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format)__Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_8)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_var_format = __pyx_t_17; - /* "pyreadstat/_readstat_parser.pyx":1120 + /* "pyreadstat/_readstat_parser.pyx":1096 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -15591,16 +15205,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = (__pyx_v_var_format == __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1121 + /* "pyreadstat/_readstat_parser.pyx":1097 * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) # <<<<<<<<<<<<<< * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) */ - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_datetime_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_datetime_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1097, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1120 + /* "pyreadstat/_readstat_parser.pyx":1096 * for index, column in enumerate(data_frame.columns): * var_format = dc.col_formats[index] * if var_format == DATE_FORMAT_DATETIME: # <<<<<<<<<<<<<< @@ -15609,7 +15223,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1122 + /* "pyreadstat/_readstat_parser.pyx":1098 * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -15619,16 +15233,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_3 = (__pyx_v_var_format == __pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE); if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1123 + /* "pyreadstat/_readstat_parser.pyx":1099 * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) # <<<<<<<<<<<<<< * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) */ - __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_date_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1123, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_date_cols, __pyx_v_column); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1099, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1122 + /* "pyreadstat/_readstat_parser.pyx":1098 * if var_format == DATE_FORMAT_DATETIME: * datetime_cols.append(column) * if var_format == DATE_FORMAT_DATE: # <<<<<<<<<<<<<< @@ -15637,7 +15251,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1118 + /* "pyreadstat/_readstat_parser.pyx":1094 * datetime_cols = list() * date_cols = list() * for index, column in enumerate(data_frame.columns): # <<<<<<<<<<<<<< @@ -15647,7 +15261,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1124 + /* "pyreadstat/_readstat_parser.pyx":1100 * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) * if datetime_cols: # <<<<<<<<<<<<<< @@ -15655,10 +15269,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * if date_cols: */ __pyx_t_3 = (__Pyx_PyList_GET_SIZE(__pyx_v_datetime_cols) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1124, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1125 + /* "pyreadstat/_readstat_parser.pyx":1101 * date_cols.append(column) * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) # <<<<<<<<<<<<<< @@ -15669,25 +15283,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = __pyx_v_pl; __Pyx_INCREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = PySequence_Tuple(__pyx_v_datetime_cols); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_14 = PySequence_Tuple(__pyx_v_datetime_cols); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_11, __pyx_t_13}; - __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_s, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_s, __pyx_t_14, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1101, __pyx_L1_error) __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_from_epoch, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_15 = 0; @@ -15696,13 +15310,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__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, 1125, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1124 + /* "pyreadstat/_readstat_parser.pyx":1100 * if var_format == DATE_FORMAT_DATE: * date_cols.append(column) * if datetime_cols: # <<<<<<<<<<<<<< @@ -15711,7 +15325,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1126 + /* "pyreadstat/_readstat_parser.pyx":1102 * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) * if date_cols: # <<<<<<<<<<<<<< @@ -15719,10 +15333,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj * */ __pyx_t_3 = (__Pyx_PyList_GET_SIZE(__pyx_v_date_cols) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1126, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_3 < 0))) __PYX_ERR(0, 1102, __pyx_L1_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_parser.pyx":1127 + /* "pyreadstat/_readstat_parser.pyx":1103 * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) * if date_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*date_cols), time_unit='d')) # <<<<<<<<<<<<<< @@ -15733,25 +15347,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __Pyx_INCREF(__pyx_t_7); __pyx_t_14 = __pyx_v_pl; __Pyx_INCREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_pl, __pyx_mstate_global->__pyx_n_u_col); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = PySequence_Tuple(__pyx_v_date_cols); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_11 = PySequence_Tuple(__pyx_v_date_cols); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_14, __pyx_t_12}; - __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1127, __pyx_L1_error) + __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_d, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_time_unit, __pyx_mstate_global->__pyx_n_u_d, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1103, __pyx_L1_error) __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_from_epoch, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1127, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_15 = 0; @@ -15760,13 +15374,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_with_columns, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (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_2)) __PYX_ERR(0, 1127, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_data_frame, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1126 + /* "pyreadstat/_readstat_parser.pyx":1102 * if datetime_cols: * data_frame = data_frame.with_columns(pl.from_epoch(pl.col(*datetime_cols), time_unit='s')) * if date_cols: # <<<<<<<<<<<<<< @@ -15775,7 +15389,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1113 + /* "pyreadstat/_readstat_parser.pyx":1089 * data_frame.loc[:, column] = pd.to_datetime(data_frame[column]) * * if output_format == "polars" and not dc.no_datetime_conversion: # <<<<<<<<<<<<<< @@ -15784,7 +15398,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ } - /* "pyreadstat/_readstat_parser.pyx":1075 + /* "pyreadstat/_readstat_parser.pyx":1051 * output_format = dc.output_format * * if dict_data: # <<<<<<<<<<<<<< @@ -15794,7 +15408,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1130 + /* "pyreadstat/_readstat_parser.pyx":1106 * * else: * data_frame = nw.from_dict(dict_data, backend=output_format).to_native() # <<<<<<<<<<<<<< @@ -15803,9 +15417,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj */ /*else*/ { __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1130, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_nw); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1130, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_from_dict); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_15 = 1; @@ -15822,14 +15436,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj #endif { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_11, __pyx_v_dict_data}; - __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1130, __pyx_L1_error) + __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1130, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_backend, __pyx_v_output_format, __pyx_t_12, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) __pyx_t_7 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_14, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1130, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __pyx_t_7; @@ -15840,7 +15454,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_to_native, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (1*__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, 1130, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_data_frame = __pyx_t_2; @@ -15848,7 +15462,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1132 + /* "pyreadstat/_readstat_parser.pyx":1108 * data_frame = nw.from_dict(dict_data, backend=output_format).to_native() * * return data_frame # <<<<<<<<<<<<<< @@ -15860,7 +15474,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj __pyx_r = __pyx_v_data_frame; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1060 + /* "pyreadstat/_readstat_parser.pyx":1036 * return final_container * * cdef object dict_to_dataframe(object dict_data, data_container dc): # <<<<<<<<<<<<<< @@ -15898,7 +15512,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObj return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1134 +/* "pyreadstat/_readstat_parser.pyx":1110 * return data_frame * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -15944,7 +15558,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_container_extract_metadata", 0); - /* "pyreadstat/_readstat_parser.pyx":1151 + /* "pyreadstat/_readstat_parser.pyx":1127 * cdef readstat_type_t var_type * * metaonly = data.metaonly # <<<<<<<<<<<<<< @@ -15954,7 +15568,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->metaonly; __pyx_v_metaonly = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1152 + /* "pyreadstat/_readstat_parser.pyx":1128 * * metaonly = data.metaonly * is_unkown_number_rows = data.is_unkown_number_rows # <<<<<<<<<<<<<< @@ -15964,7 +15578,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = __pyx_v_data->is_unkown_number_rows; __pyx_v_is_unkown_number_rows = __pyx_t_1; - /* "pyreadstat/_readstat_parser.pyx":1154 + /* "pyreadstat/_readstat_parser.pyx":1130 * is_unkown_number_rows = data.is_unkown_number_rows * * cdef object metadata = metadata_container() # <<<<<<<<<<<<<< @@ -15972,7 +15586,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * # mr sets */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -15991,13 +15605,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__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, 1154, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_metadata = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1157 + /* "pyreadstat/_readstat_parser.pyx":1133 * * # mr sets * metadata.mr_sets = data.mr_sets # <<<<<<<<<<<<<< @@ -16006,22 +15620,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_2 = __pyx_v_data->mr_sets; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_2) < 0) __PYX_ERR(0, 1157, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_mr_sets, __pyx_t_2) < 0) __PYX_ERR(0, 1133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1160 + /* "pyreadstat/_readstat_parser.pyx":1136 * * # number of rows * metadata.number_columns = data.n_vars # <<<<<<<<<<<<<< * if is_unkown_number_rows: * if not metaonly: */ - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns, __pyx_t_2) < 0) __PYX_ERR(0, 1160, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns, __pyx_t_2) < 0) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1161 + /* "pyreadstat/_readstat_parser.pyx":1137 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -16030,7 +15644,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (__pyx_v_is_unkown_number_rows) { - /* "pyreadstat/_readstat_parser.pyx":1162 + /* "pyreadstat/_readstat_parser.pyx":1138 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -16040,19 +15654,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_1 = (!__pyx_v_metaonly); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1163 + /* "pyreadstat/_readstat_parser.pyx":1139 * if is_unkown_number_rows: * if not metaonly: * metadata.number_rows = data.max_n_obs # <<<<<<<<<<<<<< * else: * metadata.number_rows = data.n_obs */ - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->max_n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1163, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1162 + /* "pyreadstat/_readstat_parser.pyx":1138 * metadata.number_columns = data.n_vars * if is_unkown_number_rows: * if not metaonly: # <<<<<<<<<<<<<< @@ -16061,7 +15675,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1161 + /* "pyreadstat/_readstat_parser.pyx":1137 * # number of rows * metadata.number_columns = data.n_vars * if is_unkown_number_rows: # <<<<<<<<<<<<<< @@ -16071,7 +15685,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1165 + /* "pyreadstat/_readstat_parser.pyx":1141 * metadata.number_rows = data.max_n_obs * else: * metadata.number_rows = data.n_obs # <<<<<<<<<<<<<< @@ -16079,14 +15693,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * # value labels */ /*else*/ { - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_data->n_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_rows, __pyx_t_2) < 0) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1168 + /* "pyreadstat/_readstat_parser.pyx":1144 * * # value labels * labels_raw = data.labels_raw # <<<<<<<<<<<<<< @@ -16098,7 +15712,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_labels_raw = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1169 + /* "pyreadstat/_readstat_parser.pyx":1145 * # value labels * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name # <<<<<<<<<<<<<< @@ -16110,29 +15724,29 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_v_label_to_var_name = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1170 + /* "pyreadstat/_readstat_parser.pyx":1146 * labels_raw = data.labels_raw * label_to_var_name = data.label_to_var_name * variable_value_labels = dict() # <<<<<<<<<<<<<< * * if labels_raw: */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_variable_value_labels = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1172 + /* "pyreadstat/_readstat_parser.pyx":1148 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_labels_raw); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1148, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1173 + /* "pyreadstat/_readstat_parser.pyx":1149 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< @@ -16146,7 +15760,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_items, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -16154,9 +15768,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1149, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -16165,7 +15779,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1173, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1149, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16175,7 +15789,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1173, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1149, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16186,13 +15800,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_7(__pyx_t_4); 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, 1173, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1149, __pyx_L1_error) PyErr_Clear(); } break; @@ -16205,7 +15819,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1173, __pyx_L1_error) + __PYX_ERR(0, 1149, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16215,22 +15829,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1173, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1149, __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, 1173, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1149, __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); @@ -16238,7 +15852,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1173, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1149, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -16246,17 +15860,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1173, __pyx_L1_error) + __PYX_ERR(0, 1149, __pyx_L1_error) __pyx_L9_unpacking_done:; } - if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1173, __pyx_L1_error) - if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1173, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 1149, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_var_name, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_var_label, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1174 + /* "pyreadstat/_readstat_parser.pyx":1150 * if labels_raw: * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) # <<<<<<<<<<<<<< @@ -16270,32 +15884,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_var_label}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_current_labels, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":1175 + /* "pyreadstat/_readstat_parser.pyx":1151 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< * variable_value_labels[var_name] = current_labels * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1175, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_current_labels); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1151, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1176 + /* "pyreadstat/_readstat_parser.pyx":1152 * current_labels = labels_raw.get(var_label) * if current_labels: * variable_value_labels[var_name] = current_labels # <<<<<<<<<<<<<< * * original_types = dict() */ - if (unlikely((PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_variable_value_labels, __pyx_v_var_name, __pyx_v_current_labels) < 0))) __PYX_ERR(0, 1152, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1175 + /* "pyreadstat/_readstat_parser.pyx":1151 * for var_name, var_label in label_to_var_name.items(): * current_labels = labels_raw.get(var_label) * if current_labels: # <<<<<<<<<<<<<< @@ -16304,7 +15918,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1173 + /* "pyreadstat/_readstat_parser.pyx":1149 * * if labels_raw: * for var_name, var_label in label_to_var_name.items(): # <<<<<<<<<<<<<< @@ -16314,7 +15928,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1172 + /* "pyreadstat/_readstat_parser.pyx":1148 * variable_value_labels = dict() * * if labels_raw: # <<<<<<<<<<<<<< @@ -16323,31 +15937,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ } - /* "pyreadstat/_readstat_parser.pyx":1178 + /* "pyreadstat/_readstat_parser.pyx":1154 * variable_value_labels[var_name] = current_labels * * original_types = dict() # <<<<<<<<<<<<<< * readstat_types = dict() * for indx in range(metadata.number_columns): */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_original_types = __pyx_t_4; __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1179 + /* "pyreadstat/_readstat_parser.pyx":1155 * * original_types = dict() * readstat_types = dict() # <<<<<<<<<<<<<< * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1179, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_readstat_types = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1180 + /* "pyreadstat/_readstat_parser.pyx":1156 * original_types = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< @@ -16357,7 +15971,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_builtin_range); __pyx_t_8 = __pyx_builtin_range; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_number_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 1; { @@ -16366,7 +15980,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -16374,9 +15988,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1180, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1156, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -16385,7 +15999,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1156, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16395,7 +16009,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1156, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16406,13 +16020,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1180, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_8); 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, 1180, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1156, __pyx_L1_error) PyErr_Clear(); } break; @@ -16422,7 +16036,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1181 + /* "pyreadstat/_readstat_parser.pyx":1157 * readstat_types = dict() * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -16431,14 +16045,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1181, __pyx_L1_error) + __PYX_ERR(0, 1157, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1182 + /* "pyreadstat/_readstat_parser.pyx":1158 * for indx in range(metadata.number_columns): * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] # <<<<<<<<<<<<<< @@ -16447,23 +16061,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_formats_original == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1182, __pyx_L1_error) + __PYX_ERR(0, 1158, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_formats_original, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_cur_type, __pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1183 + /* "pyreadstat/_readstat_parser.pyx":1159 * cur_col = data.col_names[indx] * cur_type = data.col_formats_original[indx] * original_types[cur_col] = cur_type # <<<<<<<<<<<<<< * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: */ - if (unlikely((PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0))) __PYX_ERR(0, 1183, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_v_original_types, __pyx_v_cur_col, __pyx_v_cur_type) < 0))) __PYX_ERR(0, 1159, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1184 + /* "pyreadstat/_readstat_parser.pyx":1160 * cur_type = data.col_formats_original[indx] * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] # <<<<<<<<<<<<<< @@ -16472,15 +16086,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_dtypes == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1184, __pyx_L1_error) + __PYX_ERR(0, 1160, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_data->col_dtypes, __pyx_v_indx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1184, __pyx_L1_error) + __pyx_t_11 = ((readstat_type_t)__Pyx_PyLong_As_readstat_type_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_var_type = __pyx_t_11; - /* "pyreadstat/_readstat_parser.pyx":1185 + /* "pyreadstat/_readstat_parser.pyx":1161 * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -16491,16 +16105,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ case READSTAT_TYPE_STRING: case READSTAT_TYPE_STRING_REF: - /* "pyreadstat/_readstat_parser.pyx":1186 + /* "pyreadstat/_readstat_parser.pyx":1162 * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_string) < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_string) < 0))) __PYX_ERR(0, 1162, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1185 + /* "pyreadstat/_readstat_parser.pyx":1161 * original_types[cur_col] = cur_type * var_type = data.col_dtypes[indx] * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: # <<<<<<<<<<<<<< @@ -16510,16 +16124,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT8: - /* "pyreadstat/_readstat_parser.pyx":1188 + /* "pyreadstat/_readstat_parser.pyx":1164 * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int8) < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int8) < 0))) __PYX_ERR(0, 1164, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1187 + /* "pyreadstat/_readstat_parser.pyx":1163 * if var_type == READSTAT_TYPE_STRING or var_type == READSTAT_TYPE_STRING_REF: * readstat_types[cur_col] = "string" * elif var_type == READSTAT_TYPE_INT8: # <<<<<<<<<<<<<< @@ -16529,16 +16143,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT16: - /* "pyreadstat/_readstat_parser.pyx":1190 + /* "pyreadstat/_readstat_parser.pyx":1166 * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int16) < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int16) < 0))) __PYX_ERR(0, 1166, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1189 + /* "pyreadstat/_readstat_parser.pyx":1165 * elif var_type == READSTAT_TYPE_INT8: * readstat_types[cur_col] = "int8" * elif var_type == READSTAT_TYPE_INT16: # <<<<<<<<<<<<<< @@ -16548,16 +16162,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_INT32: - /* "pyreadstat/_readstat_parser.pyx":1192 + /* "pyreadstat/_readstat_parser.pyx":1168 * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int32) < 0))) __PYX_ERR(0, 1192, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_int32) < 0))) __PYX_ERR(0, 1168, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1191 + /* "pyreadstat/_readstat_parser.pyx":1167 * elif var_type == READSTAT_TYPE_INT16: * readstat_types[cur_col] = "int16" * elif var_type == READSTAT_TYPE_INT32: # <<<<<<<<<<<<<< @@ -16567,16 +16181,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_FLOAT: - /* "pyreadstat/_readstat_parser.pyx":1194 + /* "pyreadstat/_readstat_parser.pyx":1170 * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" # <<<<<<<<<<<<<< * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_float) < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_float) < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1193 + /* "pyreadstat/_readstat_parser.pyx":1169 * elif var_type == READSTAT_TYPE_INT32: * readstat_types[cur_col] = "int32" * elif var_type == READSTAT_TYPE_FLOAT: # <<<<<<<<<<<<<< @@ -16586,16 +16200,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; case READSTAT_TYPE_DOUBLE: - /* "pyreadstat/_readstat_parser.pyx":1196 + /* "pyreadstat/_readstat_parser.pyx":1172 * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: * readstat_types[cur_col] = "double" # <<<<<<<<<<<<<< * else: * raise PyreadstatError("Unkown data type") */ - if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_double) < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_readstat_types, __pyx_v_cur_col, __pyx_mstate_global->__pyx_n_u_double) < 0))) __PYX_ERR(0, 1172, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1195 + /* "pyreadstat/_readstat_parser.pyx":1171 * elif var_type == READSTAT_TYPE_FLOAT: * readstat_types[cur_col] = "float" * elif var_type == READSTAT_TYPE_DOUBLE: # <<<<<<<<<<<<<< @@ -16605,7 +16219,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ break; default: - /* "pyreadstat/_readstat_parser.pyx":1198 + /* "pyreadstat/_readstat_parser.pyx":1174 * readstat_types[cur_col] = "double" * else: * raise PyreadstatError("Unkown data type") # <<<<<<<<<<<<<< @@ -16613,7 +16227,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * for indx, curset in data.missing_user_values.items(): */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -16632,16 +16246,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __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; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __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, 1198, __pyx_L1_error) + __PYX_ERR(0, 1174, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1180 + /* "pyreadstat/_readstat_parser.pyx":1156 * original_types = dict() * readstat_types = dict() * for indx in range(metadata.number_columns): # <<<<<<<<<<<<<< @@ -16651,7 +16265,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1200 + /* "pyreadstat/_readstat_parser.pyx":1176 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -16660,18 +16274,18 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 1200, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_Items(__pyx_v_data->missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1176, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -16680,7 +16294,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1200, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16690,7 +16304,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { 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, 1200, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1176, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16701,13 +16315,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1176, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_7(__pyx_t_4); 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, 1200, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1176, __pyx_L1_error) PyErr_Clear(); } break; @@ -16720,7 +16334,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1200, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16730,22 +16344,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -16753,7 +16367,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1200, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1176, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_unpacking_done; @@ -16761,7 +16375,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1200, __pyx_L1_error) + __PYX_ERR(0, 1176, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_indx, __pyx_t_2); @@ -16769,7 +16383,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF_SET(__pyx_v_curset, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1201 + /* "pyreadstat/_readstat_parser.pyx":1177 * * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] # <<<<<<<<<<<<<< @@ -16778,33 +16392,33 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ if (unlikely(__pyx_v_data->col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 1201, __pyx_L1_error) + __PYX_ERR(0, 1177, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_data->col_names, __pyx_v_indx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_cur_col, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1202 + /* "pyreadstat/_readstat_parser.pyx":1178 * for indx, curset in data.missing_user_values.items(): * cur_col = data.col_names[indx] * metadata.missing_user_values[cur_col] = sorted(list(curset)) # <<<<<<<<<<<<<< * * metadata.notes = data.notes */ - __pyx_t_8 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) + __pyx_t_8 = PySequence_List(__pyx_v_curset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) + __pyx_t_3 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely((PyList_Sort(__pyx_t_3) < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) + if (unlikely((PyList_Sort(__pyx_t_3) < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_user_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_v_cur_col, __pyx_t_3) < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_v_cur_col, __pyx_t_3) < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1200 + /* "pyreadstat/_readstat_parser.pyx":1176 * raise PyreadstatError("Unkown data type") * * for indx, curset in data.missing_user_values.items(): # <<<<<<<<<<<<<< @@ -16814,7 +16428,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1204 + /* "pyreadstat/_readstat_parser.pyx":1180 * metadata.missing_user_values[cur_col] = sorted(list(curset)) * * metadata.notes = data.notes # <<<<<<<<<<<<<< @@ -16823,10 +16437,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->notes; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_4) < 0) __PYX_ERR(0, 1204, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_notes, __pyx_t_4) < 0) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1205 + /* "pyreadstat/_readstat_parser.pyx":1181 * * metadata.notes = data.notes * metadata.column_names = data.col_names # <<<<<<<<<<<<<< @@ -16835,10 +16449,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->col_names; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_4) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names, __pyx_t_4) < 0) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1206 + /* "pyreadstat/_readstat_parser.pyx":1182 * metadata.notes = data.notes * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels # <<<<<<<<<<<<<< @@ -16847,10 +16461,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->col_labels; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1207 + /* "pyreadstat/_readstat_parser.pyx":1183 * metadata.column_names = data.col_names * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} # <<<<<<<<<<<<<< @@ -16858,7 +16472,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ * metadata.file_label = data.file_label */ { /* enter inner scope */ - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L22_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_builtin_zip); @@ -16869,7 +16483,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__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_3)) __PYX_ERR(0, 1207, __pyx_L22_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -16877,9 +16491,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L22_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1207, __pyx_L22_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1183, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -16888,7 +16502,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1183, __pyx_L22_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16898,7 +16512,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1207, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1183, __pyx_L22_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -16909,13 +16523,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L22_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1183, __pyx_L22_error) } else { __pyx_t_3 = __pyx_t_7(__pyx_t_2); 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, 1207, __pyx_L22_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1183, __pyx_L22_error) PyErr_Clear(); } break; @@ -16928,7 +16542,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1207, __pyx_L22_error) + __PYX_ERR(0, 1183, __pyx_L22_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16938,22 +16552,22 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_INCREF(__pyx_t_9); } else { __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1207, __pyx_L22_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1207, __pyx_L22_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1207, __pyx_L22_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1207, __pyx_L22_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1207, __pyx_L22_error) + __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1183, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); @@ -16961,7 +16575,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L25_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1207, __pyx_L22_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1183, __pyx_L22_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L26_unpacking_done; @@ -16969,14 +16583,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1207, __pyx_L22_error) + __PYX_ERR(0, 1183, __pyx_L22_error) __pyx_L26_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; - if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 1207, __pyx_L22_error) + if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_7genexpr__pyx_v_v))) __PYX_ERR(0, 1183, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_7genexpr__pyx_v_k); __pyx_7genexpr__pyx_v_k = 0; @@ -16988,10 +16602,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ goto __pyx_L1_error; __pyx_L28_exit_scope:; } /* exit inner scope */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1207, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_column_names_to_labels, __pyx_t_4) < 0) __PYX_ERR(0, 1183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1208 + /* "pyreadstat/_readstat_parser.pyx":1184 * metadata.column_labels = data.col_labels * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding # <<<<<<<<<<<<<< @@ -17000,10 +16614,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->file_encoding; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_encoding, __pyx_t_4) < 0) __PYX_ERR(0, 1208, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_encoding, __pyx_t_4) < 0) __PYX_ERR(0, 1184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1209 + /* "pyreadstat/_readstat_parser.pyx":1185 * metadata.column_names_to_labels = {k:v for k,v in zip(data.col_names, data.col_labels)} * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label # <<<<<<<<<<<<<< @@ -17012,55 +16626,55 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->file_label; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_label, __pyx_t_4) < 0) __PYX_ERR(0, 1209, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_file_label, __pyx_t_4) < 0) __PYX_ERR(0, 1185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1210 + /* "pyreadstat/_readstat_parser.pyx":1186 * metadata.file_encoding = data.file_encoding * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels # <<<<<<<<<<<<<< * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_v_variable_value_labels) < 0) __PYX_ERR(0, 1210, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_value_labels, __pyx_v_variable_value_labels) < 0) __PYX_ERR(0, 1186, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1211 + /* "pyreadstat/_readstat_parser.pyx":1187 * metadata.file_label = data.file_label * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw # <<<<<<<<<<<<<< * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_v_labels_raw) < 0) __PYX_ERR(0, 1211, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_value_labels, __pyx_v_labels_raw) < 0) __PYX_ERR(0, 1187, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1212 + /* "pyreadstat/_readstat_parser.pyx":1188 * metadata.variable_value_labels = variable_value_labels * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name # <<<<<<<<<<<<<< * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_v_label_to_var_name) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_to_label, __pyx_v_label_to_var_name) < 0) __PYX_ERR(0, 1188, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1213 + /* "pyreadstat/_readstat_parser.pyx":1189 * metadata.value_labels = labels_raw * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types # <<<<<<<<<<<<<< * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_v_original_types) < 0) __PYX_ERR(0, 1213, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_original_variable_types, __pyx_v_original_types) < 0) __PYX_ERR(0, 1189, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1214 + /* "pyreadstat/_readstat_parser.pyx":1190 * metadata.variable_to_label = label_to_var_name * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types # <<<<<<<<<<<<<< * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_v_readstat_types) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_readstat_variable_types, __pyx_v_readstat_types) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1215 + /* "pyreadstat/_readstat_parser.pyx":1191 * metadata.original_variable_types = original_types * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name # <<<<<<<<<<<<<< @@ -17069,10 +16683,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->table_name; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_table_name, __pyx_t_4) < 0) __PYX_ERR(0, 1215, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_table_name, __pyx_t_4) < 0) __PYX_ERR(0, 1191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1216 + /* "pyreadstat/_readstat_parser.pyx":1192 * metadata.readstat_variable_types = readstat_types * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges # <<<<<<<<<<<<<< @@ -17081,10 +16695,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->missing_ranges; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_4) < 0) __PYX_ERR(0, 1216, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_missing_ranges, __pyx_t_4) < 0) __PYX_ERR(0, 1192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1217 + /* "pyreadstat/_readstat_parser.pyx":1193 * metadata.table_name = data.table_name * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width # <<<<<<<<<<<<<< @@ -17093,10 +16707,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_storage_width; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_4) < 0) __PYX_ERR(0, 1217, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_storage_width, __pyx_t_4) < 0) __PYX_ERR(0, 1193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1218 + /* "pyreadstat/_readstat_parser.pyx":1194 * metadata.missing_ranges = data.missing_ranges * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width # <<<<<<<<<<<<<< @@ -17105,10 +16719,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_display_width; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_4) < 0) __PYX_ERR(0, 1218, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_display_width, __pyx_t_4) < 0) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1219 + /* "pyreadstat/_readstat_parser.pyx":1195 * metadata.variable_storage_width = data.variable_storage_width * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment # <<<<<<<<<<<<<< @@ -17117,10 +16731,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_alignment; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_4) < 0) __PYX_ERR(0, 1219, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_alignment, __pyx_t_4) < 0) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1220 + /* "pyreadstat/_readstat_parser.pyx":1196 * metadata.variable_display_width = data.variable_display_width * metadata.variable_alignment = data.variable_alignment * metadata.variable_measure = data.variable_measure # <<<<<<<<<<<<<< @@ -17129,24 +16743,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ */ __pyx_t_4 = __pyx_v_data->variable_measure; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_4) < 0) __PYX_ERR(0, 1220, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_variable_measure, __pyx_t_4) < 0) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1221 + /* "pyreadstat/_readstat_parser.pyx":1197 * metadata.variable_alignment = data.variable_alignment * metadata.variable_measure = data.variable_measure * metadata.creation_time = datetime.datetime.fromtimestamp(data.ctime) # <<<<<<<<<<<<<< * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1221, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->ctime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->ctime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { @@ -17155,27 +16769,27 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_creation_time, __pyx_t_4) < 0) __PYX_ERR(0, 1221, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_creation_time, __pyx_t_4) < 0) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1222 + /* "pyreadstat/_readstat_parser.pyx":1198 * metadata.variable_measure = data.variable_measure * metadata.creation_time = datetime.datetime.fromtimestamp(data.ctime) * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) # <<<<<<<<<<<<<< * * return metadata */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1222, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_2; __Pyx_INCREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->mtime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_data->mtime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { @@ -17184,13 +16798,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_modification_time, __pyx_t_4) < 0) __PYX_ERR(0, 1222, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_metadata, __pyx_mstate_global->__pyx_n_u_modification_time, __pyx_t_4) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":1224 + /* "pyreadstat/_readstat_parser.pyx":1200 * metadata.modification_time = datetime.datetime.fromtimestamp(data.mtime) * * return metadata # <<<<<<<<<<<<<< @@ -17202,7 +16816,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ __pyx_r = __pyx_v_metadata; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1134 + /* "pyreadstat/_readstat_parser.pyx":1110 * return data_frame * * cdef object data_container_extract_metadata(data_container data): # <<<<<<<<<<<<<< @@ -17241,7 +16855,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_ return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1227 +/* "pyreadstat/_readstat_parser.pyx":1203 * * * cdef object run_conversion(object filename_path, py_file_format file_format, py_file_extension file_extension, # <<<<<<<<<<<<<< @@ -17292,7 +16906,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_RefNannySetupContext("run_conversion", 0); __Pyx_INCREF(__pyx_v_output_format); - /* "pyreadstat/_readstat_parser.pyx":1246 + /* "pyreadstat/_readstat_parser.pyx":1222 * cdef object data_dict * cdef object data_frame * cdef object file_obj = None # <<<<<<<<<<<<<< @@ -17302,25 +16916,25 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(Py_None); __pyx_v_file_obj = Py_None; - /* "pyreadstat/_readstat_parser.pyx":1249 + /* "pyreadstat/_readstat_parser.pyx":1225 * * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): # <<<<<<<<<<<<<< * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used */ - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1225, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filename_path, __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1225, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1250 + /* "pyreadstat/_readstat_parser.pyx":1226 * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): * file_obj = filename_path # <<<<<<<<<<<<<< @@ -17330,7 +16944,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_filename_path); __Pyx_DECREF_SET(__pyx_v_file_obj, __pyx_v_filename_path); - /* "pyreadstat/_readstat_parser.pyx":1251 + /* "pyreadstat/_readstat_parser.pyx":1227 * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used # <<<<<<<<<<<<<< @@ -17340,7 +16954,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_); __pyx_v_filename_bytes = __pyx_mstate_global->__pyx_kp_b_; - /* "pyreadstat/_readstat_parser.pyx":1249 + /* "pyreadstat/_readstat_parser.pyx":1225 * * # Check if filename_path is a file-like object * if hasattr(filename_path, 'read') and hasattr(filename_path, 'seek'): # <<<<<<<<<<<<<< @@ -17350,20 +16964,20 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1252 + /* "pyreadstat/_readstat_parser.pyx":1228 * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< * try: * filename_bytes = os.fsencode(filename_path) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_HasAttr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_t_1 = __Pyx_HasAttr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1253 + /* "pyreadstat/_readstat_parser.pyx":1229 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17379,7 +16993,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1254 + /* "pyreadstat/_readstat_parser.pyx":1230 * elif hasattr(os, 'fsencode'): * try: * filename_bytes = os.fsencode(filename_path) # <<<<<<<<<<<<<< @@ -17387,9 +17001,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * 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_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1254, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1254, __pyx_L6_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_fsencode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1230, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = 1; @@ -17409,14 +17023,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L6_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); } - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(0, 1254, __pyx_L6_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(0, 1230, __pyx_L6_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1253 + /* "pyreadstat/_readstat_parser.pyx":1229 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17434,7 +17048,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1255 + /* "pyreadstat/_readstat_parser.pyx":1231 * try: * filename_bytes = os.fsencode(filename_path) * except UnicodeError: # <<<<<<<<<<<<<< @@ -17444,12 +17058,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeError); if (__pyx_t_11) { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1255, __pyx_L8_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1231, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1256 + /* "pyreadstat/_readstat_parser.pyx":1232 * 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()) # <<<<<<<<<<<<<< @@ -17457,15 +17071,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * else: */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1232, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1256, __pyx_L8_except_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1232, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_15 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1256, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1232, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1256, __pyx_L8_except_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_getfilesystemencoding); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1232, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_10 = 1; @@ -17485,10 +17099,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1256, __pyx_L8_except_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1232, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_17 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1256, __pyx_L8_except_error) + __pyx_t_17 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_file_path_could_not_be_encoded_w, __pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1232, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = 1; @@ -17509,12 +17123,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1256, __pyx_L8_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1232, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_parser.pyx":1257 + /* "pyreadstat/_readstat_parser.pyx":1233 * 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") # <<<<<<<<<<<<<< @@ -17522,9 +17136,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if type(filename_path) == str: */ __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1257, __pyx_L8_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1233, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_17); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1257, __pyx_L8_except_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_fsdecode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1233, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_10 = 1; @@ -17544,16 +17158,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L8_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1257, __pyx_L8_except_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1233, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1257, __pyx_L8_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1233, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_8))) __PYX_ERR(0, 1257, __pyx_L8_except_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_8))) __PYX_ERR(0, 1233, __pyx_L8_except_error) __Pyx_XDECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17563,7 +17177,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject } goto __pyx_L8_except_error; - /* "pyreadstat/_readstat_parser.pyx":1253 + /* "pyreadstat/_readstat_parser.pyx":1229 * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): * try: # <<<<<<<<<<<<<< @@ -17584,7 +17198,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L11_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1252 + /* "pyreadstat/_readstat_parser.pyx":1228 * file_obj = filename_path * filename_bytes = b"" # Empty path - will be ignored when file_obj is used * elif hasattr(os, 'fsencode'): # <<<<<<<<<<<<<< @@ -17594,7 +17208,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1259 + /* "pyreadstat/_readstat_parser.pyx":1235 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -17602,12 +17216,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * elif type(filename_path) == bytes: */ /*else*/ { - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1259, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1260 + /* "pyreadstat/_readstat_parser.pyx":1236 * else: * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -17621,14 +17235,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1260, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1260, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1236, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1259 + /* "pyreadstat/_readstat_parser.pyx":1235 * filename_bytes = os.fsdecode(filename_path).encode("utf-8", "surrogateescape") * else: * if type(filename_path) == str: # <<<<<<<<<<<<<< @@ -17638,19 +17252,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":1261 + /* "pyreadstat/_readstat_parser.pyx":1237 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< * filename_bytes = filename_path * else: */ - __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1261, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_filename_path)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1262 + /* "pyreadstat/_readstat_parser.pyx":1238 * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: * filename_bytes = filename_path # <<<<<<<<<<<<<< @@ -17659,11 +17273,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_t_7 = __pyx_v_filename_path; __Pyx_INCREF(__pyx_t_7); - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1262, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1238, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1261 + /* "pyreadstat/_readstat_parser.pyx":1237 * if type(filename_path) == str: * filename_bytes = filename_path.encode('utf-8') * elif type(filename_path) == bytes: # <<<<<<<<<<<<<< @@ -17673,7 +17287,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L14; } - /* "pyreadstat/_readstat_parser.pyx":1264 + /* "pyreadstat/_readstat_parser.pyx":1240 * filename_bytes = filename_path * else: * raise PyreadstatError("path must be either str or bytes") # <<<<<<<<<<<<<< @@ -17682,7 +17296,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*else*/ { __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -17701,16 +17315,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1264, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1240, __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, 1264, __pyx_L1_error) + __PYX_ERR(0, 1240, __pyx_L1_error) } __pyx_L14:; - /* "pyreadstat/_readstat_parser.pyx":1265 + /* "pyreadstat/_readstat_parser.pyx":1241 * else: * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): # <<<<<<<<<<<<<< @@ -17719,24 +17333,24 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_filename_path))); __pyx_t_7 = ((PyObject *)Py_TYPE(__pyx_v_filename_path)); - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)(&PyUnicode_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L16_bool_binop_done:; @@ -17744,7 +17358,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_2 = __pyx_t_1; if (unlikely(__pyx_t_2)) { - /* "pyreadstat/_readstat_parser.pyx":1266 + /* "pyreadstat/_readstat_parser.pyx":1242 * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): * raise PyreadstatError("path must be str, bytes or unicode") # <<<<<<<<<<<<<< @@ -17752,7 +17366,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1266, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -17771,14 +17385,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1266, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1242, __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, 1266, __pyx_L1_error) + __PYX_ERR(0, 1242, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1265 + /* "pyreadstat/_readstat_parser.pyx":1241 * else: * raise PyreadstatError("path must be either str or bytes") * if type(filename_path) not in (str, bytes, unicode): # <<<<<<<<<<<<<< @@ -17787,7 +17401,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1267 + /* "pyreadstat/_readstat_parser.pyx":1243 * if type(filename_path) not in (str, bytes, unicode): * raise PyreadstatError("path must be str, bytes or unicode") * filename_bytes = filename_path.encode('utf-8') # <<<<<<<<<<<<<< @@ -17801,16 +17415,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1267, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1267, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1270 + /* "pyreadstat/_readstat_parser.pyx":1246 * * # Only check file existence for path-based reads * if file_obj is None: # <<<<<<<<<<<<<< @@ -17820,16 +17434,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_2 = (__pyx_v_file_obj == Py_None); if (__pyx_t_2) { - /* "pyreadstat/_readstat_parser.pyx":1271 + /* "pyreadstat/_readstat_parser.pyx":1247 * # Only check file existence for path-based reads * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) # <<<<<<<<<<<<<< * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1271, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_8; @@ -17840,23 +17454,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_expanduser, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (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_7)) __PYX_ERR(0, 1271, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1271, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_bytes, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1272 + /* "pyreadstat/_readstat_parser.pyx":1248 * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1272, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = __pyx_t_3; @@ -17867,15 +17481,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_isfile, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1272, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1272, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (!__pyx_t_2); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1273 + /* "pyreadstat/_readstat_parser.pyx":1249 * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): * raise PyreadstatError("File {0} does not exist!".format(filename_path)) # <<<<<<<<<<<<<< @@ -17883,7 +17497,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if output_format is None: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1273, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_File_0_does_not_exist; __Pyx_INCREF(__pyx_t_12); @@ -17892,7 +17506,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_filename_path}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1273, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_10 = 1; @@ -17913,14 +17527,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1273, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1249, __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, 1273, __pyx_L1_error) + __PYX_ERR(0, 1249, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1272 + /* "pyreadstat/_readstat_parser.pyx":1248 * if file_obj is None: * filename_bytes = os.path.expanduser(filename_bytes) * if not os.path.isfile(filename_bytes): # <<<<<<<<<<<<<< @@ -17929,7 +17543,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1270 + /* "pyreadstat/_readstat_parser.pyx":1246 * * # Only check file existence for path-based reads * if file_obj is None: # <<<<<<<<<<<<<< @@ -17938,7 +17552,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1275 + /* "pyreadstat/_readstat_parser.pyx":1251 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -17948,7 +17562,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_output_format == ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1276 + /* "pyreadstat/_readstat_parser.pyx":1252 * * if output_format is None: * output_format = 'pandas' # <<<<<<<<<<<<<< @@ -17958,7 +17572,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_pandas); __Pyx_DECREF_SET(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas); - /* "pyreadstat/_readstat_parser.pyx":1275 + /* "pyreadstat/_readstat_parser.pyx":1251 * raise PyreadstatError("File {0} does not exist!".format(filename_path)) * * if output_format is None: # <<<<<<<<<<<<<< @@ -17967,32 +17581,32 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1277 + /* "pyreadstat/_readstat_parser.pyx":1253 * if output_format is None: * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} # <<<<<<<<<<<<<< * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) */ - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pandas) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) - if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_polars) < 0) __PYX_ERR(0, 1277, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pandas) < 0) __PYX_ERR(0, 1253, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1253, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_polars) < 0) __PYX_ERR(0, 1253, __pyx_L1_error) __pyx_v_allowed_formats = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1278 + /* "pyreadstat/_readstat_parser.pyx":1254 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": */ - __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1278, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_output_format, __pyx_v_allowed_formats, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1254, __pyx_L1_error) if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1279 + /* "pyreadstat/_readstat_parser.pyx":1255 * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) # <<<<<<<<<<<<<< @@ -18000,21 +17614,21 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * try: */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1279, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_output_format_must_be_one_of_all; __Pyx_INCREF(__pyx_t_12); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_12, NULL}; - __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allowed_formats, __pyx_v_allowed_formats, __pyx_t_14, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_format, __pyx_v_output_format, __pyx_t_14, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_allowed_formats, __pyx_v_allowed_formats, __pyx_t_14, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 1255, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_format, __pyx_v_output_format, __pyx_t_14, __pyx_callargs+1, 1) < 0) __PYX_ERR(0, 1255, __pyx_L1_error) __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_10 = 1; @@ -18035,14 +17649,14 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1279, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1255, __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, 1279, __pyx_L1_error) + __PYX_ERR(0, 1255, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1278 + /* "pyreadstat/_readstat_parser.pyx":1254 * output_format = 'pandas' * allowed_formats = {'pandas', 'dict', 'polars'} * if output_format not in allowed_formats: # <<<<<<<<<<<<<< @@ -18051,17 +17665,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1280 + /* "pyreadstat/_readstat_parser.pyx":1256 * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": # <<<<<<<<<<<<<< * try: * import pandas */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_pandas, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1256, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1281 + /* "pyreadstat/_readstat_parser.pyx":1257 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -18077,19 +17691,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1282 + /* "pyreadstat/_readstat_parser.pyx":1258 * if output_format == "pandas": * try: * import pandas # <<<<<<<<<<<<<< * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") */ - __pyx_t_7 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_pandas, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1282, __pyx_L24_error) + __pyx_t_7 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_pandas, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1258, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_pandas = __pyx_t_7; __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1281 + /* "pyreadstat/_readstat_parser.pyx":1257 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -18113,7 +17727,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1283 + /* "pyreadstat/_readstat_parser.pyx":1259 * try: * import pandas * except: # <<<<<<<<<<<<<< @@ -18122,12 +17736,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1283, __pyx_L26_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_3) < 0) __PYX_ERR(0, 1259, __pyx_L26_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_3); - /* "pyreadstat/_readstat_parser.pyx":1284 + /* "pyreadstat/_readstat_parser.pyx":1260 * import pandas * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") # <<<<<<<<<<<<<< @@ -18135,7 +17749,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * try: */ __pyx_t_14 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1284, __pyx_L26_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1260, __pyx_L26_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18154,15 +17768,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1284, __pyx_L26_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L26_except_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, 1284, __pyx_L26_except_error) + __PYX_ERR(0, 1260, __pyx_L26_except_error) } - /* "pyreadstat/_readstat_parser.pyx":1281 + /* "pyreadstat/_readstat_parser.pyx":1257 * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": * try: # <<<<<<<<<<<<<< @@ -18178,7 +17792,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L29_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1280 + /* "pyreadstat/_readstat_parser.pyx":1256 * if output_format not in allowed_formats: * raise PyreadstatError("output format must be one of {allowed_formats}, '{output_format}' was given".format(allowed_formats=allowed_formats, output_format=output_format)) * if output_format == "pandas": # <<<<<<<<<<<<<< @@ -18187,17 +17801,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1285 + /* "pyreadstat/_readstat_parser.pyx":1261 * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": # <<<<<<<<<<<<<< * try: * import polars */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_polars, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1286 + /* "pyreadstat/_readstat_parser.pyx":1262 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18213,19 +17827,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "pyreadstat/_readstat_parser.pyx":1287 + /* "pyreadstat/_readstat_parser.pyx":1263 * if output_format == "polars": * try: * import polars # <<<<<<<<<<<<<< * except: * raise PyreadstatError("You requested polars as output_format but cannot import polars") */ - __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_polars, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L33_error) + __pyx_t_3 = __Pyx_ImportDottedModuleRelFirst(__pyx_mstate_global->__pyx_n_u_polars, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L33_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_polars = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1286 + /* "pyreadstat/_readstat_parser.pyx":1262 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18249,7 +17863,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_parser.pyx":1288 + /* "pyreadstat/_readstat_parser.pyx":1264 * try: * import polars * except: # <<<<<<<<<<<<<< @@ -18258,12 +17872,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_parser.run_conversion", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1288, __pyx_L35_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_7) < 0) __PYX_ERR(0, 1264, __pyx_L35_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); - /* "pyreadstat/_readstat_parser.pyx":1289 + /* "pyreadstat/_readstat_parser.pyx":1265 * import polars * except: * raise PyreadstatError("You requested polars as output_format but cannot import polars") # <<<<<<<<<<<<<< @@ -18271,7 +17885,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1289, __pyx_L35_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1265, __pyx_L35_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18290,15 +17904,15 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L35_except_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1265, __pyx_L35_except_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, 1289, __pyx_L35_except_error) + __PYX_ERR(0, 1265, __pyx_L35_except_error) } - /* "pyreadstat/_readstat_parser.pyx":1286 + /* "pyreadstat/_readstat_parser.pyx":1262 * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": * try: # <<<<<<<<<<<<<< @@ -18314,7 +17928,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_L38_try_end:; } - /* "pyreadstat/_readstat_parser.pyx":1285 + /* "pyreadstat/_readstat_parser.pyx":1261 * except: * raise PyreadstatError("You requested pandas as output_format but cannot import pandas") * if output_format == "polars": # <<<<<<<<<<<<<< @@ -18323,7 +17937,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1292 + /* "pyreadstat/_readstat_parser.pyx":1268 * * * if extra_date_formats is not None: # <<<<<<<<<<<<<< @@ -18333,7 +17947,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_date_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1293 + /* "pyreadstat/_readstat_parser.pyx":1269 * * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18343,7 +17957,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1294 + /* "pyreadstat/_readstat_parser.pyx":1270 * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_date_formats.extend(extra_date_formats) # <<<<<<<<<<<<<< @@ -18352,11 +17966,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1294, __pyx_L1_error) + __PYX_ERR(0, 1270, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1270, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1293 + /* "pyreadstat/_readstat_parser.pyx":1269 * * if extra_date_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18366,7 +17980,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1296 + /* "pyreadstat/_readstat_parser.pyx":1272 * sas_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_SPSS: * spss_date_formats.extend(extra_date_formats) # <<<<<<<<<<<<<< @@ -18375,11 +17989,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1296, __pyx_L1_error) + __PYX_ERR(0, 1272, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1272, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1295 + /* "pyreadstat/_readstat_parser.pyx":1271 * if file_format == FILE_FORMAT_SAS: * sas_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18389,7 +18003,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1298 + /* "pyreadstat/_readstat_parser.pyx":1274 * spss_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_STATA: * stata_date_formats.extend(extra_date_formats) # <<<<<<<<<<<<<< @@ -18398,11 +18012,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1298, __pyx_L1_error) + __PYX_ERR(0, 1274, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1298, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_extra_date_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1274, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1297 + /* "pyreadstat/_readstat_parser.pyx":1273 * elif file_format == FILE_FORMAT_SPSS: * spss_date_formats.extend(extra_date_formats) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18412,7 +18026,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1300 + /* "pyreadstat/_readstat_parser.pyx":1276 * stata_date_formats.extend(extra_date_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18420,7 +18034,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if file_format == FILE_FORMAT_SAS: */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18439,16 +18053,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1300, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __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, 1300, __pyx_L1_error) + __PYX_ERR(0, 1276, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1292 + /* "pyreadstat/_readstat_parser.pyx":1268 * * * if extra_date_formats is not None: # <<<<<<<<<<<<<< @@ -18457,7 +18071,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1301 + /* "pyreadstat/_readstat_parser.pyx":1277 * else: * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: # <<<<<<<<<<<<<< @@ -18467,7 +18081,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_datetime_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1302 + /* "pyreadstat/_readstat_parser.pyx":1278 * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18477,7 +18091,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1303 + /* "pyreadstat/_readstat_parser.pyx":1279 * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_datetime_formats.extend(extra_datetime_formats) # <<<<<<<<<<<<<< @@ -18486,11 +18100,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1303, __pyx_L1_error) + __PYX_ERR(0, 1279, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1303, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1279, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1302 + /* "pyreadstat/_readstat_parser.pyx":1278 * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18500,7 +18114,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1305 + /* "pyreadstat/_readstat_parser.pyx":1281 * sas_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_SPSS: * spss_datetime_formats.extend(extra_datetime_formats) # <<<<<<<<<<<<<< @@ -18509,11 +18123,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1305, __pyx_L1_error) + __PYX_ERR(0, 1281, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1305, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1281, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1304 + /* "pyreadstat/_readstat_parser.pyx":1280 * if file_format == FILE_FORMAT_SAS: * sas_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18523,7 +18137,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1307 + /* "pyreadstat/_readstat_parser.pyx":1283 * spss_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_STATA: * stata_datetime_formats.extend(extra_datetime_formats) # <<<<<<<<<<<<<< @@ -18532,11 +18146,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1307, __pyx_L1_error) + __PYX_ERR(0, 1283, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, __pyx_v_extra_datetime_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1283, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1306 + /* "pyreadstat/_readstat_parser.pyx":1282 * elif file_format == FILE_FORMAT_SPSS: * spss_datetime_formats.extend(extra_datetime_formats) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18546,7 +18160,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1309 + /* "pyreadstat/_readstat_parser.pyx":1285 * stata_datetime_formats.extend(extra_datetime_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18554,7 +18168,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * if file_format == FILE_FORMAT_SAS: */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1309, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18573,16 +18187,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1309, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1285, __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, 1309, __pyx_L1_error) + __PYX_ERR(0, 1285, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1301 + /* "pyreadstat/_readstat_parser.pyx":1277 * else: * raise PyreadstatError("Unknown file format") * if extra_datetime_formats is not None: # <<<<<<<<<<<<<< @@ -18591,7 +18205,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1310 + /* "pyreadstat/_readstat_parser.pyx":1286 * else: * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: # <<<<<<<<<<<<<< @@ -18601,7 +18215,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_extra_time_formats != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1311 + /* "pyreadstat/_readstat_parser.pyx":1287 * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18611,7 +18225,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1312 + /* "pyreadstat/_readstat_parser.pyx":1288 * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: * sas_time_formats.extend(extra_time_formats) # <<<<<<<<<<<<<< @@ -18620,11 +18234,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1312, __pyx_L1_error) + __PYX_ERR(0, 1288, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1312, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1288, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1311 + /* "pyreadstat/_readstat_parser.pyx":1287 * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18634,7 +18248,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1314 + /* "pyreadstat/_readstat_parser.pyx":1290 * sas_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_SPSS: * spss_time_formats.extend(extra_time_formats) # <<<<<<<<<<<<<< @@ -18643,11 +18257,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1314, __pyx_L1_error) + __PYX_ERR(0, 1290, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1314, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1290, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1313 + /* "pyreadstat/_readstat_parser.pyx":1289 * if file_format == FILE_FORMAT_SAS: * sas_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18657,7 +18271,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1316 + /* "pyreadstat/_readstat_parser.pyx":1292 * spss_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_STATA: * stata_time_formats.extend(extra_time_formats) # <<<<<<<<<<<<<< @@ -18666,11 +18280,11 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); - __PYX_ERR(0, 1316, __pyx_L1_error) + __PYX_ERR(0, 1292, __pyx_L1_error) } - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1316, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, __pyx_v_extra_time_formats); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 1292, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1315 + /* "pyreadstat/_readstat_parser.pyx":1291 * elif file_format == FILE_FORMAT_SPSS: * spss_time_formats.extend(extra_time_formats) * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18680,7 +18294,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1318 + /* "pyreadstat/_readstat_parser.pyx":1294 * stata_time_formats.extend(extra_time_formats) * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -18688,7 +18302,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -18707,16 +18321,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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_7)) __PYX_ERR(0, 1318, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1294, __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, 1318, __pyx_L1_error) + __PYX_ERR(0, 1294, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1310 + /* "pyreadstat/_readstat_parser.pyx":1286 * else: * raise PyreadstatError("Unknown file format") * if extra_time_formats is not None: # <<<<<<<<<<<<<< @@ -18725,16 +18339,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1320 + /* "pyreadstat/_readstat_parser.pyx":1296 * raise PyreadstatError("Unknown file format") * global sas_all_formats, spss_all_formats, stata_all_formats * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats # <<<<<<<<<<<<<< * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats */ - __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats); @@ -18742,16 +18356,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1321 + /* "pyreadstat/_readstat_parser.pyx":1297 * global sas_all_formats, spss_all_formats, stata_all_formats * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats # <<<<<<<<<<<<<< * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1321, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats); @@ -18759,16 +18373,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_parser.pyx":1322 + /* "pyreadstat/_readstat_parser.pyx":1298 * sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * stata_all_formats = stata_date_formats + stata_datetime_formats + stata_time_formats * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats # <<<<<<<<<<<<<< * * filename = filename_bytes */ - __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, __pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1322, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats); @@ -18776,7 +18390,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1324 + /* "pyreadstat/_readstat_parser.pyx":1300 * spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * * filename = filename_bytes # <<<<<<<<<<<<<< @@ -18785,12 +18399,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ if (unlikely(__pyx_v_filename_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 1324, __pyx_L1_error) + __PYX_ERR(0, 1300, __pyx_L1_error) } - __pyx_t_19 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 1324, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L1_error) __pyx_v_filename = ((char *)__pyx_t_19); - /* "pyreadstat/_readstat_parser.pyx":1326 + /* "pyreadstat/_readstat_parser.pyx":1302 * filename = filename_bytes * * data = data_container() # <<<<<<<<<<<<<< @@ -18806,13 +18420,13 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_3); } __pyx_v_data = ((struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1327 + /* "pyreadstat/_readstat_parser.pyx":1303 * * data = data_container() * ctx = data # <<<<<<<<<<<<<< @@ -18821,7 +18435,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_ctx = ((void *)__pyx_v_data); - /* "pyreadstat/_readstat_parser.pyx":1329 + /* "pyreadstat/_readstat_parser.pyx":1305 * ctx = data * * data.file_format = file_format # <<<<<<<<<<<<<< @@ -18830,7 +18444,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->file_format = __pyx_v_file_format; - /* "pyreadstat/_readstat_parser.pyx":1330 + /* "pyreadstat/_readstat_parser.pyx":1306 * * data.file_format = file_format * data.metaonly = metaonly # <<<<<<<<<<<<<< @@ -18839,7 +18453,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->metaonly = __pyx_v_metaonly; - /* "pyreadstat/_readstat_parser.pyx":1331 + /* "pyreadstat/_readstat_parser.pyx":1307 * data.file_format = file_format * data.metaonly = metaonly * data.dates_as_pandas = dates_as_pandas # <<<<<<<<<<<<<< @@ -18848,7 +18462,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->dates_as_pandas = __pyx_v_dates_as_pandas; - /* "pyreadstat/_readstat_parser.pyx":1332 + /* "pyreadstat/_readstat_parser.pyx":1308 * data.metaonly = metaonly * data.dates_as_pandas = dates_as_pandas * data.output_format = output_format # <<<<<<<<<<<<<< @@ -18861,7 +18475,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->output_format); __pyx_v_data->output_format = __pyx_v_output_format; - /* "pyreadstat/_readstat_parser.pyx":1334 + /* "pyreadstat/_readstat_parser.pyx":1310 * data.output_format = output_format * * if encoding: # <<<<<<<<<<<<<< @@ -18869,10 +18483,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ __pyx_t_1 = (__pyx_v_encoding != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_encoding) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 1310, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1335 + /* "pyreadstat/_readstat_parser.pyx":1311 * * if encoding: * data.user_encoding = encoding # <<<<<<<<<<<<<< @@ -18885,7 +18499,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->user_encoding); __pyx_v_data->user_encoding = __pyx_v_encoding; - /* "pyreadstat/_readstat_parser.pyx":1334 + /* "pyreadstat/_readstat_parser.pyx":1310 * data.output_format = output_format * * if encoding: # <<<<<<<<<<<<<< @@ -18894,7 +18508,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1337 + /* "pyreadstat/_readstat_parser.pyx":1313 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18904,7 +18518,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS: - /* "pyreadstat/_readstat_parser.pyx":1338 + /* "pyreadstat/_readstat_parser.pyx":1314 * * if file_format == FILE_FORMAT_SAS: * origin = sas_origin # <<<<<<<<<<<<<< @@ -18914,7 +18528,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_sas_origin; - /* "pyreadstat/_readstat_parser.pyx":1339 + /* "pyreadstat/_readstat_parser.pyx":1315 * if file_format == FILE_FORMAT_SAS: * origin = sas_origin * unix_to_origin_secs = sas_secs_from_unix # <<<<<<<<<<<<<< @@ -18924,7 +18538,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1337 + /* "pyreadstat/_readstat_parser.pyx":1313 * data.user_encoding = encoding * * if file_format == FILE_FORMAT_SAS: # <<<<<<<<<<<<<< @@ -18934,7 +18548,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS: - /* "pyreadstat/_readstat_parser.pyx":1341 + /* "pyreadstat/_readstat_parser.pyx":1317 * unix_to_origin_secs = sas_secs_from_unix * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin # <<<<<<<<<<<<<< @@ -18944,7 +18558,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_spss_origin; - /* "pyreadstat/_readstat_parser.pyx":1342 + /* "pyreadstat/_readstat_parser.pyx":1318 * elif file_format == FILE_FORMAT_SPSS: * origin = spss_origin * unix_to_origin_secs = spss_secs_from_unix # <<<<<<<<<<<<<< @@ -18954,7 +18568,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1340 + /* "pyreadstat/_readstat_parser.pyx":1316 * origin = sas_origin * unix_to_origin_secs = sas_secs_from_unix * elif file_format == FILE_FORMAT_SPSS: # <<<<<<<<<<<<<< @@ -18964,7 +18578,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; case __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA: - /* "pyreadstat/_readstat_parser.pyx":1344 + /* "pyreadstat/_readstat_parser.pyx":1320 * unix_to_origin_secs = spss_secs_from_unix * elif file_format == FILE_FORMAT_STATA: * origin = stata_origin # <<<<<<<<<<<<<< @@ -18974,7 +18588,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin); __pyx_v_origin = __pyx_v_10pyreadstat_16_readstat_parser_stata_origin; - /* "pyreadstat/_readstat_parser.pyx":1345 + /* "pyreadstat/_readstat_parser.pyx":1321 * elif file_format == FILE_FORMAT_STATA: * origin = stata_origin * unix_to_origin_secs = stata_secs_from_unix # <<<<<<<<<<<<<< @@ -18984,7 +18598,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix); __pyx_v_unix_to_origin_secs = __pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix; - /* "pyreadstat/_readstat_parser.pyx":1343 + /* "pyreadstat/_readstat_parser.pyx":1319 * origin = spss_origin * unix_to_origin_secs = spss_secs_from_unix * elif file_format == FILE_FORMAT_STATA: # <<<<<<<<<<<<<< @@ -18994,7 +18608,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject break; default: - /* "pyreadstat/_readstat_parser.pyx":1347 + /* "pyreadstat/_readstat_parser.pyx":1323 * unix_to_origin_secs = stata_secs_from_unix * else: * raise PyreadstatError("Unknown file format") # <<<<<<<<<<<<<< @@ -19002,7 +18616,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * data.origin = origin */ __pyx_t_9 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1347, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS @@ -19021,16 +18635,16 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __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, 1347, __pyx_L1_error) + __PYX_ERR(0, 1323, __pyx_L1_error) break; } - /* "pyreadstat/_readstat_parser.pyx":1349 + /* "pyreadstat/_readstat_parser.pyx":1325 * raise PyreadstatError("Unknown file format") * * data.origin = origin # <<<<<<<<<<<<<< @@ -19043,17 +18657,17 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->origin); __pyx_v_data->origin = __pyx_v_origin; - /* "pyreadstat/_readstat_parser.pyx":1350 + /* "pyreadstat/_readstat_parser.pyx":1326 * * data.origin = origin * data.unix_to_origin_secs = unix_to_origin_secs # <<<<<<<<<<<<<< * * if usecols is not None: */ - __pyx_t_20 = __Pyx_PyFloat_AsDouble(__pyx_v_unix_to_origin_secs); if (unlikely((__pyx_t_20 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyFloat_AsDouble(__pyx_v_unix_to_origin_secs); if (unlikely((__pyx_t_20 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1326, __pyx_L1_error) __pyx_v_data->unix_to_origin_secs = __pyx_t_20; - /* "pyreadstat/_readstat_parser.pyx":1352 + /* "pyreadstat/_readstat_parser.pyx":1328 * data.unix_to_origin_secs = unix_to_origin_secs * * if usecols is not None: # <<<<<<<<<<<<<< @@ -19063,7 +18677,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __pyx_t_1 = (__pyx_v_usecols != ((PyObject*)Py_None)); if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1353 + /* "pyreadstat/_readstat_parser.pyx":1329 * * if usecols is not None: * data.filter_cols = 1 # <<<<<<<<<<<<<< @@ -19072,7 +18686,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->filter_cols = 1; - /* "pyreadstat/_readstat_parser.pyx":1354 + /* "pyreadstat/_readstat_parser.pyx":1330 * if usecols is not None: * data.filter_cols = 1 * data.use_cols = usecols # <<<<<<<<<<<<<< @@ -19085,7 +18699,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_DECREF(__pyx_v_data->use_cols); __pyx_v_data->use_cols = __pyx_v_usecols; - /* "pyreadstat/_readstat_parser.pyx":1352 + /* "pyreadstat/_readstat_parser.pyx":1328 * data.unix_to_origin_secs = unix_to_origin_secs * * if usecols is not None: # <<<<<<<<<<<<<< @@ -19094,7 +18708,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ } - /* "pyreadstat/_readstat_parser.pyx":1356 + /* "pyreadstat/_readstat_parser.pyx":1332 * data.use_cols = usecols * * data.usernan = usernan # <<<<<<<<<<<<<< @@ -19103,7 +18717,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->usernan = __pyx_v_usernan; - /* "pyreadstat/_readstat_parser.pyx":1357 + /* "pyreadstat/_readstat_parser.pyx":1333 * * data.usernan = usernan * data.no_datetime_conversion = no_datetime_conversion # <<<<<<<<<<<<<< @@ -19112,7 +18726,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_v_data->no_datetime_conversion = __pyx_v_no_datetime_conversion; - /* "pyreadstat/_readstat_parser.pyx":1360 + /* "pyreadstat/_readstat_parser.pyx":1336 * * # go! * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) # <<<<<<<<<<<<<< @@ -19121,31 +18735,31 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject */ __pyx_t_21.__pyx_n = 1; __pyx_t_21.file_obj = __pyx_v_file_obj; - __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_file_extension, __pyx_v_row_limit, __pyx_v_row_offset, &__pyx_t_21); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(__pyx_v_filename, __pyx_v_data, __pyx_v_file_extension, __pyx_v_row_limit, __pyx_v_row_offset, &__pyx_t_21); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1336, __pyx_L1_error) - /* "pyreadstat/_readstat_parser.pyx":1361 + /* "pyreadstat/_readstat_parser.pyx":1337 * # go! * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) # <<<<<<<<<<<<<< * if output_format == 'dict': * data_frame = data_dict */ - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_data_dict = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1362 + /* "pyreadstat/_readstat_parser.pyx":1338 * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< * data_frame = data_dict * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_output_format, __pyx_mstate_global->__pyx_n_u_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1338, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1363 + /* "pyreadstat/_readstat_parser.pyx":1339 * data_dict = data_container_to_dict(data) * if output_format == 'dict': * data_frame = data_dict # <<<<<<<<<<<<<< @@ -19155,7 +18769,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject __Pyx_INCREF(__pyx_v_data_dict); __pyx_v_data_frame = __pyx_v_data_dict; - /* "pyreadstat/_readstat_parser.pyx":1362 + /* "pyreadstat/_readstat_parser.pyx":1338 * run_readstat_parser(filename, data, file_extension, row_limit, row_offset, file_obj) * data_dict = data_container_to_dict(data) * if output_format == 'dict': # <<<<<<<<<<<<<< @@ -19165,7 +18779,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject goto __pyx_L46; } - /* "pyreadstat/_readstat_parser.pyx":1365 + /* "pyreadstat/_readstat_parser.pyx":1341 * data_frame = data_dict * else: * data_frame = dict_to_dataframe(data_dict, data) # <<<<<<<<<<<<<< @@ -19173,26 +18787,26 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * */ /*else*/ { - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(__pyx_v_data_dict, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(__pyx_v_data_dict, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_data_frame = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L46:; - /* "pyreadstat/_readstat_parser.pyx":1366 + /* "pyreadstat/_readstat_parser.pyx":1342 * else: * data_frame = dict_to_dataframe(data_dict, data) * metadata = data_container_extract_metadata(data) # <<<<<<<<<<<<<< * * return data_frame, metadata */ - __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_metadata = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1368 + /* "pyreadstat/_readstat_parser.pyx":1344 * metadata = data_container_extract_metadata(data) * * return data_frame, metadata # <<<<<<<<<<<<<< @@ -19200,19 +18814,19 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject * def parser_entry_point(filename_path, str parser_format=None, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_data_frame); __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1368, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1344, __pyx_L1_error); __Pyx_INCREF(__pyx_v_metadata); __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1368, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1344, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1227 + /* "pyreadstat/_readstat_parser.pyx":1203 * * * cdef object run_conversion(object filename_path, py_file_format file_format, py_file_extension file_extension, # <<<<<<<<<<<<<< @@ -19252,7 +18866,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_run_conversion(PyObject return __pyx_r; } -/* "pyreadstat/_readstat_parser.pyx":1370 +/* "pyreadstat/_readstat_parser.pyx":1346 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -19314,81 +18928,81 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename_path,&__pyx_mstate_global->__pyx_n_u_parser_format,&__pyx_mstate_global->__pyx_n_u_metadataonly,&__pyx_mstate_global->__pyx_n_u_dates_as_pandas_datetime,&__pyx_mstate_global->__pyx_n_u_formats_as_category,&__pyx_mstate_global->__pyx_n_u_formats_as_ordered_category,&__pyx_mstate_global->__pyx_n_u_encoding,&__pyx_mstate_global->__pyx_n_u_usecols,&__pyx_mstate_global->__pyx_n_u_user_missing,&__pyx_mstate_global->__pyx_n_u_disable_datetime_conversion,&__pyx_mstate_global->__pyx_n_u_row_limit,&__pyx_mstate_global->__pyx_n_u_row_offset,&__pyx_mstate_global->__pyx_n_u_output_format,&__pyx_mstate_global->__pyx_n_u_extra_datetime_formats,&__pyx_mstate_global->__pyx_n_u_extra_date_formats,&__pyx_mstate_global->__pyx_n_u_extra_time_formats,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, 1370, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1346, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1346, __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, "parser_entry_point", 0) < 0) __PYX_ERR(0, 1370, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parser_entry_point", 0) < 0) __PYX_ERR(0, 1346, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_parser.pyx":1371 + /* "pyreadstat/_readstat_parser.pyx":1347 * * def parser_entry_point(filename_path, str parser_format=None, * metadataonly=False, dates_as_pandas_datetime=False, # <<<<<<<<<<<<<< @@ -19398,7 +19012,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1372 + /* "pyreadstat/_readstat_parser.pyx":1348 * def parser_entry_point(filename_path, str parser_format=None, * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< @@ -19411,7 +19025,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[7]) values[7] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1373 + /* "pyreadstat/_readstat_parser.pyx":1349 * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< @@ -19422,7 +19036,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_parser.pyx":1374 + /* "pyreadstat/_readstat_parser.pyx":1350 * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< @@ -19432,78 +19046,78 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[14]) values[14] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[15]) values[15] = __Pyx_NewRef(((PyObject*)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, i); __PYX_ERR(0, 1370, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, i); __PYX_ERR(0, 1346, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 16: values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1346, __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, 1370, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1346, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } - /* "pyreadstat/_readstat_parser.pyx":1370 + /* "pyreadstat/_readstat_parser.pyx":1346 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -19516,7 +19130,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1372 + /* "pyreadstat/_readstat_parser.pyx":1348 * def parser_entry_point(filename_path, str parser_format=None, * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, # <<<<<<<<<<<<<< @@ -19528,7 +19142,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 *)((PyObject*)Py_False))); - /* "pyreadstat/_readstat_parser.pyx":1373 + /* "pyreadstat/_readstat_parser.pyx":1349 * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< @@ -19538,7 +19152,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (!values[12]) values[12] = __Pyx_NewRef(((PyObject*)Py_None)); if (!values[13]) values[13] = __Pyx_NewRef(((PyObject*)Py_None)); - /* "pyreadstat/_readstat_parser.pyx":1374 + /* "pyreadstat/_readstat_parser.pyx":1350 * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, * list extra_date_formats=None, list extra_time_formats=None): # <<<<<<<<<<<<<< @@ -19559,12 +19173,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_user_missing = values[8]; __pyx_v_disable_datetime_conversion = values[9]; if (values[10]) { - __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L3_error) + __pyx_v_row_limit = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_row_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L3_error) } else { __pyx_v_row_limit = ((int)((int)0)); } if (values[11]) { - __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L3_error) + __pyx_v_row_offset = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_row_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L3_error) } else { __pyx_v_row_offset = ((int)((int)0)); } @@ -19575,7 +19189,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 1370, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parser_entry_point", 0, 1, 16, __pyx_nargs); __PYX_ERR(0, 1346, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19586,16 +19200,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser_format), (&PyUnicode_Type), 1, "parser_format", 1))) __PYX_ERR(0, 1370, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 1372, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 1372, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 1373, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 1373, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 1374, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 1374, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser_format), (&PyUnicode_Type), 1, "parser_format", 1))) __PYX_ERR(0, 1346, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 1, "encoding", 1))) __PYX_ERR(0, 1348, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_usecols), (&PyList_Type), 1, "usecols", 1))) __PYX_ERR(0, 1348, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_format), (&PyUnicode_Type), 1, "output_format", 1))) __PYX_ERR(0, 1349, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_datetime_formats), (&PyList_Type), 1, "extra_datetime_formats", 1))) __PYX_ERR(0, 1349, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_date_formats), (&PyList_Type), 1, "extra_date_formats", 1))) __PYX_ERR(0, 1350, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_extra_time_formats), (&PyList_Type), 1, "extra_time_formats", 1))) __PYX_ERR(0, 1350, __pyx_L1_error) __pyx_r = __pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(__pyx_self, __pyx_v_filename_path, __pyx_v_parser_format, __pyx_v_metadataonly, __pyx_v_dates_as_pandas_datetime, __pyx_v_formats_as_category, __pyx_v_formats_as_ordered_category, __pyx_v_encoding, __pyx_v_usecols, __pyx_v_user_missing, __pyx_v_disable_datetime_conversion, __pyx_v_row_limit, __pyx_v_row_offset, __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); - /* "pyreadstat/_readstat_parser.pyx":1370 + /* "pyreadstat/_readstat_parser.pyx":1346 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -19643,17 +19257,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parser_entry_point", 0); - /* "pyreadstat/_readstat_parser.pyx":1380 + /* "pyreadstat/_readstat_parser.pyx":1356 * cdef py_file_extension file_extension * * if parser_format == "sav/zsav": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_kp_u_sav_zsav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1380, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_kp_u_sav_zsav, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1356, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1381 + /* "pyreadstat/_readstat_parser.pyx":1357 * * if parser_format == "sav/zsav": * file_format = FILE_FORMAT_SPSS # <<<<<<<<<<<<<< @@ -19662,7 +19276,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; - /* "pyreadstat/_readstat_parser.pyx":1382 + /* "pyreadstat/_readstat_parser.pyx":1358 * if parser_format == "sav/zsav": * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV # <<<<<<<<<<<<<< @@ -19671,7 +19285,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV; - /* "pyreadstat/_readstat_parser.pyx":1380 + /* "pyreadstat/_readstat_parser.pyx":1356 * cdef py_file_extension file_extension * * if parser_format == "sav/zsav": # <<<<<<<<<<<<<< @@ -19681,17 +19295,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1383 + /* "pyreadstat/_readstat_parser.pyx":1359 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV * elif parser_format == "sas7bdat": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bdat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1383, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bdat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1359, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1384 + /* "pyreadstat/_readstat_parser.pyx":1360 * file_extension = FILE_EXT_SAV * elif parser_format == "sas7bdat": * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< @@ -19700,7 +19314,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - /* "pyreadstat/_readstat_parser.pyx":1385 + /* "pyreadstat/_readstat_parser.pyx":1361 * elif parser_format == "sas7bdat": * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT # <<<<<<<<<<<<<< @@ -19709,7 +19323,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT; - /* "pyreadstat/_readstat_parser.pyx":1383 + /* "pyreadstat/_readstat_parser.pyx":1359 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_SAV * elif parser_format == "sas7bdat": # <<<<<<<<<<<<<< @@ -19719,17 +19333,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1386 + /* "pyreadstat/_readstat_parser.pyx":1362 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT * elif parser_format == "xport": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1386, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_xport, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1387 + /* "pyreadstat/_readstat_parser.pyx":1363 * file_extension = FILE_EXT_SAS7BDAT * elif parser_format == "xport": * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< @@ -19738,7 +19352,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - /* "pyreadstat/_readstat_parser.pyx":1388 + /* "pyreadstat/_readstat_parser.pyx":1364 * elif parser_format == "xport": * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT # <<<<<<<<<<<<<< @@ -19747,7 +19361,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT; - /* "pyreadstat/_readstat_parser.pyx":1386 + /* "pyreadstat/_readstat_parser.pyx":1362 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BDAT * elif parser_format == "xport": # <<<<<<<<<<<<<< @@ -19757,17 +19371,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1389 + /* "pyreadstat/_readstat_parser.pyx":1365 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT * elif parser_format == "dta": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_dta, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1390 + /* "pyreadstat/_readstat_parser.pyx":1366 * file_extension = FILE_EXT_XPORT * elif parser_format == "dta": * file_format = FILE_FORMAT_STATA # <<<<<<<<<<<<<< @@ -19776,7 +19390,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA; - /* "pyreadstat/_readstat_parser.pyx":1391 + /* "pyreadstat/_readstat_parser.pyx":1367 * elif parser_format == "dta": * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA # <<<<<<<<<<<<<< @@ -19785,7 +19399,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA; - /* "pyreadstat/_readstat_parser.pyx":1389 + /* "pyreadstat/_readstat_parser.pyx":1365 * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_XPORT * elif parser_format == "dta": # <<<<<<<<<<<<<< @@ -19795,17 +19409,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1392 + /* "pyreadstat/_readstat_parser.pyx":1368 * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA * elif parser_format == "por": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1392, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_por, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1368, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1393 + /* "pyreadstat/_readstat_parser.pyx":1369 * file_extension = FILE_EXT_DTA * elif parser_format == "por": * file_format = FILE_FORMAT_SPSS # <<<<<<<<<<<<<< @@ -19814,7 +19428,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS; - /* "pyreadstat/_readstat_parser.pyx":1394 + /* "pyreadstat/_readstat_parser.pyx":1370 * elif parser_format == "por": * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR # <<<<<<<<<<<<<< @@ -19823,7 +19437,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR; - /* "pyreadstat/_readstat_parser.pyx":1392 + /* "pyreadstat/_readstat_parser.pyx":1368 * file_format = FILE_FORMAT_STATA * file_extension = FILE_EXT_DTA * elif parser_format == "por": # <<<<<<<<<<<<<< @@ -19833,17 +19447,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1395 + /* "pyreadstat/_readstat_parser.pyx":1371 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR * elif parser_format == "sas7bcat": # <<<<<<<<<<<<<< * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BCAT */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bcat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1395, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_parser_format, __pyx_mstate_global->__pyx_n_u_sas7bcat, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1371, __pyx_L1_error) if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_parser.pyx":1396 + /* "pyreadstat/_readstat_parser.pyx":1372 * file_extension = FILE_EXT_POR * elif parser_format == "sas7bcat": * file_format = FILE_FORMAT_SAS # <<<<<<<<<<<<<< @@ -19852,7 +19466,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_format = __pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS; - /* "pyreadstat/_readstat_parser.pyx":1397 + /* "pyreadstat/_readstat_parser.pyx":1373 * elif parser_format == "sas7bcat": * file_format = FILE_FORMAT_SAS * file_extension = FILE_EXT_SAS7BCAT # <<<<<<<<<<<<<< @@ -19861,7 +19475,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_file_extension = __pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT; - /* "pyreadstat/_readstat_parser.pyx":1395 + /* "pyreadstat/_readstat_parser.pyx":1371 * file_format = FILE_FORMAT_SPSS * file_extension = FILE_EXT_POR * elif parser_format == "sas7bcat": # <<<<<<<<<<<<<< @@ -19871,7 +19485,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT goto __pyx_L3; } - /* "pyreadstat/_readstat_parser.pyx":1399 + /* "pyreadstat/_readstat_parser.pyx":1375 * file_extension = FILE_EXT_SAS7BCAT * else: * raise PyreadstatError("wrong parser format") # <<<<<<<<<<<<<< @@ -19880,7 +19494,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ /*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, 1399, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PyreadstatError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -19899,16 +19513,16 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __pyx_t_2 = __Pyx_PyObject_FastCall(__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, 1399, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __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, 1399, __pyx_L1_error) + __PYX_ERR(0, 1375, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_parser.pyx":1401 + /* "pyreadstat/_readstat_parser.pyx":1377 * raise PyreadstatError("wrong parser format") * * cdef bint metaonly = 0 # <<<<<<<<<<<<<< @@ -19917,17 +19531,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_metaonly = 0; - /* "pyreadstat/_readstat_parser.pyx":1402 + /* "pyreadstat/_readstat_parser.pyx":1378 * * cdef bint metaonly = 0 * if metadataonly: # <<<<<<<<<<<<<< * metaonly = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_metadataonly); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1378, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1403 + /* "pyreadstat/_readstat_parser.pyx":1379 * cdef bint metaonly = 0 * if metadataonly: * metaonly = 1 # <<<<<<<<<<<<<< @@ -19936,7 +19550,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_metaonly = 1; - /* "pyreadstat/_readstat_parser.pyx":1402 + /* "pyreadstat/_readstat_parser.pyx":1378 * * cdef bint metaonly = 0 * if metadataonly: # <<<<<<<<<<<<<< @@ -19945,7 +19559,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1405 + /* "pyreadstat/_readstat_parser.pyx":1381 * metaonly = 1 * * cdef bint dates_as_pandas = 0 # <<<<<<<<<<<<<< @@ -19954,17 +19568,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_dates_as_pandas = 0; - /* "pyreadstat/_readstat_parser.pyx":1406 + /* "pyreadstat/_readstat_parser.pyx":1382 * * cdef bint dates_as_pandas = 0 * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< * dates_as_pandas = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1406, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dates_as_pandas_datetime); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1382, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1407 + /* "pyreadstat/_readstat_parser.pyx":1383 * cdef bint dates_as_pandas = 0 * if dates_as_pandas_datetime: * dates_as_pandas = 1 # <<<<<<<<<<<<<< @@ -19973,7 +19587,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_dates_as_pandas = 1; - /* "pyreadstat/_readstat_parser.pyx":1406 + /* "pyreadstat/_readstat_parser.pyx":1382 * * cdef bint dates_as_pandas = 0 * if dates_as_pandas_datetime: # <<<<<<<<<<<<<< @@ -19982,7 +19596,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1409 + /* "pyreadstat/_readstat_parser.pyx":1385 * dates_as_pandas = 1 * * cdef bint usernan = 0 # <<<<<<<<<<<<<< @@ -19991,17 +19605,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_usernan = 0; - /* "pyreadstat/_readstat_parser.pyx":1410 + /* "pyreadstat/_readstat_parser.pyx":1386 * * cdef bint usernan = 0 * if user_missing: # <<<<<<<<<<<<<< * usernan = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_missing); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1386, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1411 + /* "pyreadstat/_readstat_parser.pyx":1387 * cdef bint usernan = 0 * if user_missing: * usernan = 1 # <<<<<<<<<<<<<< @@ -20010,7 +19624,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_usernan = 1; - /* "pyreadstat/_readstat_parser.pyx":1410 + /* "pyreadstat/_readstat_parser.pyx":1386 * * cdef bint usernan = 0 * if user_missing: # <<<<<<<<<<<<<< @@ -20019,7 +19633,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1413 + /* "pyreadstat/_readstat_parser.pyx":1389 * usernan = 1 * * cdef bint no_datetime_conversion = 0 # <<<<<<<<<<<<<< @@ -20028,17 +19642,17 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_no_datetime_conversion = 0; - /* "pyreadstat/_readstat_parser.pyx":1414 + /* "pyreadstat/_readstat_parser.pyx":1390 * * cdef bint no_datetime_conversion = 0 * if disable_datetime_conversion: # <<<<<<<<<<<<<< * no_datetime_conversion = 1 * */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_disable_datetime_conversion); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error) if (__pyx_t_1) { - /* "pyreadstat/_readstat_parser.pyx":1415 + /* "pyreadstat/_readstat_parser.pyx":1391 * cdef bint no_datetime_conversion = 0 * if disable_datetime_conversion: * no_datetime_conversion = 1 # <<<<<<<<<<<<<< @@ -20047,7 +19661,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ __pyx_v_no_datetime_conversion = 1; - /* "pyreadstat/_readstat_parser.pyx":1414 + /* "pyreadstat/_readstat_parser.pyx":1390 * * cdef bint no_datetime_conversion = 0 * if disable_datetime_conversion: # <<<<<<<<<<<<<< @@ -20056,14 +19670,14 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT */ } - /* "pyreadstat/_readstat_parser.pyx":1417 + /* "pyreadstat/_readstat_parser.pyx":1393 * no_datetime_conversion = 1 * * data_frame, metadata = run_conversion(filename_path, file_format, file_extension, encoding, metaonly, # <<<<<<<<<<<<<< * dates_as_pandas, usecols, usernan, no_datetime_conversion, row_limit, row_offset, * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) */ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1417, __pyx_L1_error) + __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_parser_run_conversion(__pyx_v_filename_path, __pyx_v_file_format, __pyx_v_file_extension, __pyx_v_encoding, __pyx_v_metaonly, __pyx_v_dates_as_pandas, __pyx_v_usecols, __pyx_v_usernan, __pyx_v_no_datetime_conversion, ((long)__pyx_v_row_limit), ((long)__pyx_v_row_offset), __pyx_v_output_format, __pyx_v_extra_datetime_formats, __pyx_v_extra_date_formats, __pyx_v_extra_time_formats); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; @@ -20071,7 +19685,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1417, __pyx_L1_error) + __PYX_ERR(0, 1393, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -20081,22 +19695,22 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); @@ -20104,7 +19718,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1417, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1393, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_unpacking_done; @@ -20112,7 +19726,7 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1417, __pyx_L1_error) + __PYX_ERR(0, 1393, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_data_frame = __pyx_t_4; @@ -20120,26 +19734,26 @@ static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_parser_entry_point(CYT __pyx_v_metadata = __pyx_t_3; __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":1421 + /* "pyreadstat/_readstat_parser.pyx":1397 * output_format, extra_datetime_formats, extra_date_formats, extra_time_formats) * * return data_frame, metadata # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_data_frame); __Pyx_GIVEREF(__pyx_v_data_frame); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1421, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data_frame) != (0)) __PYX_ERR(0, 1397, __pyx_L1_error); __Pyx_INCREF(__pyx_v_metadata); __Pyx_GIVEREF(__pyx_v_metadata); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1421, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_metadata) != (0)) __PYX_ERR(0, 1397, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_parser.pyx":1370 + /* "pyreadstat/_readstat_parser.pyx":1346 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< @@ -20626,23 +20240,23 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container)) __PYX_ERR(0, 81, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container)) __PYX_ERR(0, 83, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10pyreadstat_16_readstat_parser_data_container_spec, __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 83, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container = &__pyx_type_10pyreadstat_16_readstat_parser_data_container; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 83, __pyx_L1_error) #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container->tp_dictoffset && __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container->tp_getattro = PyObject_GenericGetAttr; } #endif - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_data_container, (PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_data_container, (PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -21120,7 +20734,25 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":39 + /* "pyreadstat/_readstat_parser.pyx":38 + * from readstat_api cimport * + * + * from pyclasses import metadata_container # <<<<<<<<<<<<<< + * + * # necessary to work with the datetime C API +*/ + __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyclasses, __pyx_t_3, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_metadata_container); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "pyreadstat/_readstat_parser.pyx":41 * * # necessary to work with the datetime C API * import_datetime() # <<<<<<<<<<<<<< @@ -21129,339 +20761,339 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); */ __pyx_f_7cpython_8datetime_import_datetime(); - /* "pyreadstat/_readstat_parser.pyx":41 + /* "pyreadstat/_readstat_parser.pyx":43 * import_datetime() * * cdef object unix_origin = datetime_new(1970, 1, 1, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * * cdef list sas_date_formats = ["WEEKDATE", "MMDDYY", "DDMMYY", "YYMMDD", "DATE", "DATE9", "YYMMDD10", */ - __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":43 + /* "pyreadstat/_readstat_parser.pyx":45 * cdef object unix_origin = datetime_new(1970, 1, 1, 0, 0, 0, 0, None) * * cdef list sas_date_formats = ["WEEKDATE", "MMDDYY", "DDMMYY", "YYMMDD", "DATE", "DATE9", "YYMMDD10", # <<<<<<<<<<<<<< * "DDMMYYB", "DDMMYYB10", "DDMMYYC", "DDMMYYC10", "DDMMYYD", "DDMMYYD10", * "DDMMYYN6", "DDMMYYN8", "DDMMYYP", "DDMMYYP10", "DDMMYYS", "DDMMYYS10", */ - __pyx_t_3 = __Pyx_PyList_Pack(41, __pyx_mstate_global->__pyx_n_u_WEEKDATE, __pyx_mstate_global->__pyx_n_u_MMDDYY, __pyx_mstate_global->__pyx_n_u_DDMMYY, __pyx_mstate_global->__pyx_n_u_YYMMDD, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE9, __pyx_mstate_global->__pyx_n_u_YYMMDD10, __pyx_mstate_global->__pyx_n_u_DDMMYYB, __pyx_mstate_global->__pyx_n_u_DDMMYYB10, __pyx_mstate_global->__pyx_n_u_DDMMYYC, __pyx_mstate_global->__pyx_n_u_DDMMYYC10, __pyx_mstate_global->__pyx_n_u_DDMMYYD, __pyx_mstate_global->__pyx_n_u_DDMMYYD10, __pyx_mstate_global->__pyx_n_u_DDMMYYN6, __pyx_mstate_global->__pyx_n_u_DDMMYYN8, __pyx_mstate_global->__pyx_n_u_DDMMYYP, __pyx_mstate_global->__pyx_n_u_DDMMYYP10, __pyx_mstate_global->__pyx_n_u_DDMMYYS, __pyx_mstate_global->__pyx_n_u_DDMMYYS10, __pyx_mstate_global->__pyx_n_u_MMDDYYB, __pyx_mstate_global->__pyx_n_u_MMDDYYB10, __pyx_mstate_global->__pyx_n_u_MMDDYYC, __pyx_mstate_global->__pyx_n_u_MMDDYYC10, __pyx_mstate_global->__pyx_n_u_MMDDYYD, __pyx_mstate_global->__pyx_n_u_MMDDYYD10, __pyx_mstate_global->__pyx_n_u_MMDDYYN6, __pyx_mstate_global->__pyx_n_u_MMDDYYN8, __pyx_mstate_global->__pyx_n_u_MMDDYYP, __pyx_mstate_global->__pyx_n_u_MMDDYYP10, __pyx_mstate_global->__pyx_n_u_MMDDYYS, __pyx_mstate_global->__pyx_n_u_MMDDYYS10, __pyx_mstate_global->__pyx_n_u_WEEKDATX, __pyx_mstate_global->__pyx_n_u_DTDATE, __pyx_mstate_global->__pyx_n_u_IS8601DA, __pyx_mstate_global->__pyx_n_u_E8601DA, __pyx_mstate_global->__pyx_n_u_B8601DA, __pyx_mstate_global->__pyx_n_u_YYMMDDB, __pyx_mstate_global->__pyx_n_u_YYMMDDD, __pyx_mstate_global->__pyx_n_u_YYMMDDN, __pyx_mstate_global->__pyx_n_u_YYMMDDP, __pyx_mstate_global->__pyx_n_u_YYMMDDS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_Pack(41, __pyx_mstate_global->__pyx_n_u_WEEKDATE, __pyx_mstate_global->__pyx_n_u_MMDDYY, __pyx_mstate_global->__pyx_n_u_DDMMYY, __pyx_mstate_global->__pyx_n_u_YYMMDD, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE9, __pyx_mstate_global->__pyx_n_u_YYMMDD10, __pyx_mstate_global->__pyx_n_u_DDMMYYB, __pyx_mstate_global->__pyx_n_u_DDMMYYB10, __pyx_mstate_global->__pyx_n_u_DDMMYYC, __pyx_mstate_global->__pyx_n_u_DDMMYYC10, __pyx_mstate_global->__pyx_n_u_DDMMYYD, __pyx_mstate_global->__pyx_n_u_DDMMYYD10, __pyx_mstate_global->__pyx_n_u_DDMMYYN6, __pyx_mstate_global->__pyx_n_u_DDMMYYN8, __pyx_mstate_global->__pyx_n_u_DDMMYYP, __pyx_mstate_global->__pyx_n_u_DDMMYYP10, __pyx_mstate_global->__pyx_n_u_DDMMYYS, __pyx_mstate_global->__pyx_n_u_DDMMYYS10, __pyx_mstate_global->__pyx_n_u_MMDDYYB, __pyx_mstate_global->__pyx_n_u_MMDDYYB10, __pyx_mstate_global->__pyx_n_u_MMDDYYC, __pyx_mstate_global->__pyx_n_u_MMDDYYC10, __pyx_mstate_global->__pyx_n_u_MMDDYYD, __pyx_mstate_global->__pyx_n_u_MMDDYYD10, __pyx_mstate_global->__pyx_n_u_MMDDYYN6, __pyx_mstate_global->__pyx_n_u_MMDDYYN8, __pyx_mstate_global->__pyx_n_u_MMDDYYP, __pyx_mstate_global->__pyx_n_u_MMDDYYP10, __pyx_mstate_global->__pyx_n_u_MMDDYYS, __pyx_mstate_global->__pyx_n_u_MMDDYYS10, __pyx_mstate_global->__pyx_n_u_WEEKDATX, __pyx_mstate_global->__pyx_n_u_DTDATE, __pyx_mstate_global->__pyx_n_u_IS8601DA, __pyx_mstate_global->__pyx_n_u_E8601DA, __pyx_mstate_global->__pyx_n_u_B8601DA, __pyx_mstate_global->__pyx_n_u_YYMMDDB, __pyx_mstate_global->__pyx_n_u_YYMMDDD, __pyx_mstate_global->__pyx_n_u_YYMMDDN, __pyx_mstate_global->__pyx_n_u_YYMMDDP, __pyx_mstate_global->__pyx_n_u_YYMMDDS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, ((PyObject*)__pyx_t_3)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":52 + /* "pyreadstat/_readstat_parser.pyx":54 * "IS8601DA", "E8601DA", "B8601DA", * "YYMMDDB", "YYMMDDD", "YYMMDDN", "YYMMDDP", "YYMMDDS",] * cdef list sas_datetime_formats = ["DATETIME", "DATETIME18", "DATETIME19", "DATETIME20", "DATETIME21", "DATETIME22", # <<<<<<<<<<<<<< * "E8601DT", "DATEAMPM", "MDYAMPM", "IS8601DT", "B8601DT", "B8601DN"] * cdef list sas_time_formats = ["TIME", "HHMM", "TIME20.3", "TIME20", "TIME5", "TOD", "TIMEAMPM", "IS8601TM", "E8601TM", "B8601TM", ] */ - __pyx_t_3 = __Pyx_PyList_Pack(12, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME18, __pyx_mstate_global->__pyx_n_u_DATETIME19, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_n_u_DATETIME21, __pyx_mstate_global->__pyx_n_u_DATETIME22, __pyx_mstate_global->__pyx_n_u_E8601DT, __pyx_mstate_global->__pyx_n_u_DATEAMPM, __pyx_mstate_global->__pyx_n_u_MDYAMPM, __pyx_mstate_global->__pyx_n_u_IS8601DT, __pyx_mstate_global->__pyx_n_u_B8601DT, __pyx_mstate_global->__pyx_n_u_B8601DN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_Pack(12, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME18, __pyx_mstate_global->__pyx_n_u_DATETIME19, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_n_u_DATETIME21, __pyx_mstate_global->__pyx_n_u_DATETIME22, __pyx_mstate_global->__pyx_n_u_E8601DT, __pyx_mstate_global->__pyx_n_u_DATEAMPM, __pyx_mstate_global->__pyx_n_u_MDYAMPM, __pyx_mstate_global->__pyx_n_u_IS8601DT, __pyx_mstate_global->__pyx_n_u_B8601DT, __pyx_mstate_global->__pyx_n_u_B8601DN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, ((PyObject*)__pyx_t_3)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":54 + /* "pyreadstat/_readstat_parser.pyx":56 * cdef list sas_datetime_formats = ["DATETIME", "DATETIME18", "DATETIME19", "DATETIME20", "DATETIME21", "DATETIME22", * "E8601DT", "DATEAMPM", "MDYAMPM", "IS8601DT", "B8601DT", "B8601DN"] * cdef list sas_time_formats = ["TIME", "HHMM", "TIME20.3", "TIME20", "TIME5", "TOD", "TIMEAMPM", "IS8601TM", "E8601TM", "B8601TM", ] # <<<<<<<<<<<<<< * # "HOUR" # these do not print as full time formats in sas * #cdef list sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats */ - __pyx_t_3 = __Pyx_PyList_Pack(10, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_HHMM, __pyx_mstate_global->__pyx_kp_u_TIME20_3, __pyx_mstate_global->__pyx_n_u_TIME20, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_n_u_TOD, __pyx_mstate_global->__pyx_n_u_TIMEAMPM, __pyx_mstate_global->__pyx_n_u_IS8601TM, __pyx_mstate_global->__pyx_n_u_E8601TM, __pyx_mstate_global->__pyx_n_u_B8601TM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_Pack(10, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_HHMM, __pyx_mstate_global->__pyx_kp_u_TIME20_3, __pyx_mstate_global->__pyx_n_u_TIME20, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_n_u_TOD, __pyx_mstate_global->__pyx_n_u_TIMEAMPM, __pyx_mstate_global->__pyx_n_u_IS8601TM, __pyx_mstate_global->__pyx_n_u_E8601TM, __pyx_mstate_global->__pyx_n_u_B8601TM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, ((PyObject*)__pyx_t_3)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":58 + /* "pyreadstat/_readstat_parser.pyx":60 * #cdef list sas_all_formats = sas_date_formats + sas_datetime_formats + sas_time_formats * cdef list sas_all_formats * cdef object sas_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * cdef object sas_secs_from_unix = total_seconds(unix_origin - sas_origin) * */ - __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_origin, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":59 + /* "pyreadstat/_readstat_parser.pyx":61 * cdef list sas_all_formats * cdef object sas_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) * cdef object sas_secs_from_unix = total_seconds(unix_origin - sas_origin) # <<<<<<<<<<<<<< * * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] */ - __pyx_t_3 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_sas_origin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 59, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_sas_origin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":61 + /* "pyreadstat/_readstat_parser.pyx":63 * cdef object sas_secs_from_unix = total_seconds(unix_origin - sas_origin) * * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] # <<<<<<<<<<<<<< * cdef list spss_date_formats = ["DATE",'DATE8','DATE11', 'DATE12', "ADATE","ADATE8", "ADATE10", "EDATE", 'EDATE8','EDATE10', "JDATE", "JDATE5", "JDATE7", "SDATE", "SDATE8", "SDATE10",] * cdef list spss_time_formats = ["TIME", "DTIME", 'TIME8', 'TIME5', 'TIME11.2'] */ - __pyx_t_2 = __Pyx_PyList_Pack(9, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME8, __pyx_mstate_global->__pyx_n_u_DATETIME17, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_kp_u_DATETIME23_2, __pyx_mstate_global->__pyx_n_u_YMDHMS16, __pyx_mstate_global->__pyx_n_u_YMDHMS19, __pyx_mstate_global->__pyx_kp_u_YMDHMS19_2, __pyx_mstate_global->__pyx_n_u_YMDHMS20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_Pack(9, __pyx_mstate_global->__pyx_n_u_DATETIME, __pyx_mstate_global->__pyx_n_u_DATETIME8, __pyx_mstate_global->__pyx_n_u_DATETIME17, __pyx_mstate_global->__pyx_n_u_DATETIME20, __pyx_mstate_global->__pyx_kp_u_DATETIME23_2, __pyx_mstate_global->__pyx_n_u_YMDHMS16, __pyx_mstate_global->__pyx_n_u_YMDHMS19, __pyx_mstate_global->__pyx_kp_u_YMDHMS19_2, __pyx_mstate_global->__pyx_n_u_YMDHMS20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, ((PyObject*)__pyx_t_2)); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats, ((PyObject*)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":62 + /* "pyreadstat/_readstat_parser.pyx":64 * * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] * cdef list spss_date_formats = ["DATE",'DATE8','DATE11', 'DATE12', "ADATE","ADATE8", "ADATE10", "EDATE", 'EDATE8','EDATE10', "JDATE", "JDATE5", "JDATE7", "SDATE", "SDATE8", "SDATE10",] # <<<<<<<<<<<<<< * cdef list spss_time_formats = ["TIME", "DTIME", 'TIME8', 'TIME5', 'TIME11.2'] * #cdef list spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats */ - __pyx_t_2 = __Pyx_PyList_Pack(16, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE8, __pyx_mstate_global->__pyx_n_u_DATE11, __pyx_mstate_global->__pyx_n_u_DATE12, __pyx_mstate_global->__pyx_n_u_ADATE, __pyx_mstate_global->__pyx_n_u_ADATE8, __pyx_mstate_global->__pyx_n_u_ADATE10, __pyx_mstate_global->__pyx_n_u_EDATE, __pyx_mstate_global->__pyx_n_u_EDATE8, __pyx_mstate_global->__pyx_n_u_EDATE10, __pyx_mstate_global->__pyx_n_u_JDATE, __pyx_mstate_global->__pyx_n_u_JDATE5, __pyx_mstate_global->__pyx_n_u_JDATE7, __pyx_mstate_global->__pyx_n_u_SDATE, __pyx_mstate_global->__pyx_n_u_SDATE8, __pyx_mstate_global->__pyx_n_u_SDATE10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_Pack(16, __pyx_mstate_global->__pyx_n_u_DATE, __pyx_mstate_global->__pyx_n_u_DATE8, __pyx_mstate_global->__pyx_n_u_DATE11, __pyx_mstate_global->__pyx_n_u_DATE12, __pyx_mstate_global->__pyx_n_u_ADATE, __pyx_mstate_global->__pyx_n_u_ADATE8, __pyx_mstate_global->__pyx_n_u_ADATE10, __pyx_mstate_global->__pyx_n_u_EDATE, __pyx_mstate_global->__pyx_n_u_EDATE8, __pyx_mstate_global->__pyx_n_u_EDATE10, __pyx_mstate_global->__pyx_n_u_JDATE, __pyx_mstate_global->__pyx_n_u_JDATE5, __pyx_mstate_global->__pyx_n_u_JDATE7, __pyx_mstate_global->__pyx_n_u_SDATE, __pyx_mstate_global->__pyx_n_u_SDATE8, __pyx_mstate_global->__pyx_n_u_SDATE10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, ((PyObject*)__pyx_t_2)); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats, ((PyObject*)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":63 + /* "pyreadstat/_readstat_parser.pyx":65 * cdef list spss_datetime_formats = ["DATETIME", "DATETIME8", 'DATETIME17', 'DATETIME20', 'DATETIME23.2',"YMDHMS16","YMDHMS19","YMDHMS19.2", "YMDHMS20"] * cdef list spss_date_formats = ["DATE",'DATE8','DATE11', 'DATE12', "ADATE","ADATE8", "ADATE10", "EDATE", 'EDATE8','EDATE10', "JDATE", "JDATE5", "JDATE7", "SDATE", "SDATE8", "SDATE10",] * cdef list spss_time_formats = ["TIME", "DTIME", 'TIME8', 'TIME5', 'TIME11.2'] # <<<<<<<<<<<<<< * #cdef list spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * cdef list spss_all_formats */ - __pyx_t_2 = __Pyx_PyList_Pack(5, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_DTIME, __pyx_mstate_global->__pyx_n_u_TIME8, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_kp_u_TIME11_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_Pack(5, __pyx_mstate_global->__pyx_n_u_TIME, __pyx_mstate_global->__pyx_n_u_DTIME, __pyx_mstate_global->__pyx_n_u_TIME8, __pyx_mstate_global->__pyx_n_u_TIME5, __pyx_mstate_global->__pyx_kp_u_TIME11_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, ((PyObject*)__pyx_t_2)); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats, ((PyObject*)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":66 + /* "pyreadstat/_readstat_parser.pyx":68 * #cdef list spss_all_formats = spss_date_formats + spss_datetime_formats + spss_time_formats * cdef list spss_all_formats * cdef object spss_origin = datetime_new(1582, 10, 14, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * cdef object spss_secs_from_unix = total_seconds(unix_origin - spss_origin) * */ - __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x62E, 10, 14, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x62E, 10, 14, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_origin, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":67 + /* "pyreadstat/_readstat_parser.pyx":69 * cdef list spss_all_formats * cdef object spss_origin = datetime_new(1582, 10, 14, 0, 0, 0, 0, None) * cdef object spss_secs_from_unix = total_seconds(unix_origin - spss_origin) # <<<<<<<<<<<<<< * * cdef list stata_datetime_formats = ["%tC", "%tc"] */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_spss_origin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 67, __pyx_L1_error) - __pyx_t_3 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_spss_origin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":69 + /* "pyreadstat/_readstat_parser.pyx":71 * cdef object spss_secs_from_unix = total_seconds(unix_origin - spss_origin) * * cdef list stata_datetime_formats = ["%tC", "%tc"] # <<<<<<<<<<<<<< * cdef list stata_date_formats = ["%td", "%d", "%tdD_m_Y", "%tdCCYY-NN-DD"] * cdef list stata_time_formats = ["%tcHH:MM:SS", "%tcHH:MM"] */ - __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tC, __pyx_mstate_global->__pyx_kp_u_tc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tC, __pyx_mstate_global->__pyx_kp_u_tc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, ((PyObject*)__pyx_t_3)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":70 + /* "pyreadstat/_readstat_parser.pyx":72 * * cdef list stata_datetime_formats = ["%tC", "%tc"] * cdef list stata_date_formats = ["%td", "%d", "%tdD_m_Y", "%tdCCYY-NN-DD"] # <<<<<<<<<<<<<< * cdef list stata_time_formats = ["%tcHH:MM:SS", "%tcHH:MM"] * #cdef list stata_all_formats = stata_datetime_formats + stata_date_formats + stata_time_formats */ - __pyx_t_3 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_kp_u_td, __pyx_mstate_global->__pyx_kp_u_d_2, __pyx_mstate_global->__pyx_kp_u_tdD_m_Y, __pyx_mstate_global->__pyx_kp_u_tdCCYY_NN_DD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_kp_u_td, __pyx_mstate_global->__pyx_kp_u_d_2, __pyx_mstate_global->__pyx_kp_u_tdD_m_Y, __pyx_mstate_global->__pyx_kp_u_tdCCYY_NN_DD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, ((PyObject*)__pyx_t_3)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":71 + /* "pyreadstat/_readstat_parser.pyx":73 * cdef list stata_datetime_formats = ["%tC", "%tc"] * cdef list stata_date_formats = ["%td", "%d", "%tdD_m_Y", "%tdCCYY-NN-DD"] * cdef list stata_time_formats = ["%tcHH:MM:SS", "%tcHH:MM"] # <<<<<<<<<<<<<< * #cdef list stata_all_formats = stata_datetime_formats + stata_date_formats + stata_time_formats * cdef list stata_all_formats */ - __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tcHH_MM_SS, __pyx_mstate_global->__pyx_kp_u_tcHH_MM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_kp_u_tcHH_MM_SS, __pyx_mstate_global->__pyx_kp_u_tcHH_MM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, ((PyObject*)__pyx_t_3)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":74 + /* "pyreadstat/_readstat_parser.pyx":76 * #cdef list stata_all_formats = stata_datetime_formats + stata_date_formats + stata_time_formats * cdef list stata_all_formats * cdef object stata_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) # <<<<<<<<<<<<<< * cdef object stata_secs_from_unix = total_seconds(unix_origin - stata_origin) * */ - __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7A8, 1, 1, 0, 0, 0, 0, Py_None, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_origin, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":75 + /* "pyreadstat/_readstat_parser.pyx":77 * cdef list stata_all_formats * cdef object stata_origin = datetime_new(1960, 1, 1, 0, 0, 0, 0, None) * cdef object stata_secs_from_unix = total_seconds(unix_origin - stata_origin) # <<<<<<<<<<<<<< * * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, */ - __pyx_t_3 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_stata_origin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 75, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_10pyreadstat_16_readstat_parser_unix_origin, __pyx_v_10pyreadstat_16_readstat_parser_stata_origin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_f_7cpython_8datetime_total_seconds(((PyDateTime_Delta *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":77 + /* "pyreadstat/_readstat_parser.pyx":79 * cdef object stata_secs_from_unix = total_seconds(unix_origin - stata_origin) * * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, # <<<<<<<<<<<<<< * READSTAT_TYPE_INT8: np.int64, READSTAT_TYPE_INT16: np.int64, READSTAT_TYPE_INT32:np.int64, * READSTAT_TYPE_FLOAT: np.float64, READSTAT_TYPE_DOUBLE: np.float64} */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_builtin_object) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_builtin_object) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_builtin_object) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_STRING_REF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_builtin_object) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":78 + /* "pyreadstat/_readstat_parser.pyx":80 * * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, * READSTAT_TYPE_INT8: np.int64, READSTAT_TYPE_INT16: np.int64, READSTAT_TYPE_INT32:np.int64, # <<<<<<<<<<<<<< * READSTAT_TYPE_FLOAT: np.float64, READSTAT_TYPE_DOUBLE: np.float64} * */ - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_5) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __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, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_parser.pyx":79 + /* "pyreadstat/_readstat_parser.pyx":81 * cdef dict readstat_to_numpy_types = {READSTAT_TYPE_STRING: object, READSTAT_TYPE_STRING_REF: object, * READSTAT_TYPE_INT8: np.int64, READSTAT_TYPE_INT16: np.int64, READSTAT_TYPE_INT32:np.int64, * READSTAT_TYPE_FLOAT: np.float64, READSTAT_TYPE_DOUBLE: np.float64} # <<<<<<<<<<<<<< * * cdef class data_container: */ - __pyx_t_3 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_FLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_5) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, ((PyObject*)__pyx_t_2)); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types, ((PyObject*)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_14data_container_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_data_container___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_14data_container_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_data_container___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): @@ -21469,101 +21101,66 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_14data_container_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_data_container___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "pyreadstat/_readstat_parser.pyx":128 - * self.output_format = "" - * - * class metadata_container: # <<<<<<<<<<<<<< - * """ - * This class holds metadata we want to give back to python -*/ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_mstate_global->__pyx_n_u_metadata_container, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_This_class_holds_metadata_we_wa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "pyreadstat/_readstat_parser.pyx":132 - * This class holds metadata we want to give back to python - * """ - * def __init__(self): # <<<<<<<<<<<<<< - * self.column_names = list() - * self.column_labels = list() -*/ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_18metadata_container_1__init__, 0, __pyx_mstate_global->__pyx_n_u_metadata_container___init, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 132, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "pyreadstat/_readstat_parser.pyx":128 - * self.output_format = "" - * - * class metadata_container: # <<<<<<<<<<<<<< - * """ - * This class holds metadata we want to give back to python -*/ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_metadata_container, __pyx_t_4) < 0) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_14data_container_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_data_container___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_parser.pyx":157 + /* "pyreadstat/_readstat_parser.pyx":131 * * * class ReadstatError(Exception): # <<<<<<<<<<<<<< * """ * Just defining a custom exception to raise when readstat gives an error return code. */ - __pyx_t_2 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_ReadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_3 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_4 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 157, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_4, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_mstate_global->__pyx_n_u_ReadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_2) < 0) __PYX_ERR(0, 157, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4 != __pyx_t_3) { + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 131, __pyx_L1_error) + } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_4, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReadstatError, __pyx_t_3) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_parser.pyx":163 - * pass + /* "pyreadstat/_readstat_parser.pyx":138 + * * * class PyreadstatError(Exception): # <<<<<<<<<<<<<< * """ * Just defining a custom exception to raise when pyreadstat raises an exception. */ - __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_mstate_global->__pyx_n_u_PyreadstatError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_kp_u_Just_defining_a_custom_exceptio_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_5 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 163, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 138, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_5, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_5, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_4) < 0) __PYX_ERR(0, 163, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PyreadstatError, __pyx_t_4) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__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; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_parser.pyx":870 + /* "pyreadstat/_readstat_parser.pyx":846 * * * cdef object _file_object_ctx = None # <<<<<<<<<<<<<< @@ -21575,45 +21172,45 @@ __Pyx_RefNannySetupContext("PyInit__readstat_parser", 0); __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx, Py_None); __Pyx_GIVEREF(Py_None); - /* "pyreadstat/_readstat_parser.pyx":1373 + /* "pyreadstat/_readstat_parser.pyx":1349 * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, * disable_datetime_conversion=False, int row_limit=0, int row_offset=0, str output_format=None, list extra_datetime_formats=None, # <<<<<<<<<<<<<< * list extra_date_formats=None, list extra_time_formats=None): * */ - __pyx_t_5 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1373, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); - /* "pyreadstat/_readstat_parser.pyx":1370 + /* "pyreadstat/_readstat_parser.pyx":1346 * return data_frame, metadata * * def parser_entry_point(filename_path, str parser_format=None, # <<<<<<<<<<<<<< * metadataonly=False, dates_as_pandas_datetime=False, * formats_as_category=True, formats_as_ordered_category=False, str encoding=None, list usecols=None, user_missing=False, */ - __pyx_t_2 = PyTuple_Pack(15, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_5, __pyx_t_3, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_1parser_entry_point, 0, __pyx_mstate_global->__pyx_n_u_parser_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_3 = PyTuple_Pack(15, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), ((PyObject*)Py_True), ((PyObject*)Py_False), Py_None, Py_None, ((PyObject*)Py_False), ((PyObject*)Py_False), __pyx_t_5, __pyx_t_2, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parser_entry_point, __pyx_t_3) < 0) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10pyreadstat_16_readstat_parser_1parser_entry_point, 0, __pyx_mstate_global->__pyx_n_u_parser_entry_point, NULL, __pyx_mstate_global->__pyx_n_u_pyreadstat__readstat_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parser_entry_point, __pyx_t_2) < 0) __PYX_ERR(0, 1346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyreadstat/_readstat_parser.pyx":1 * # cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 # <<<<<<<<<<<<<< * * # ############################################################################# */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ @@ -21766,7 +21363,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_TIME8, sizeof(__pyx_k_TIME8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TIME8 */ {__pyx_k_TIMEAMPM, sizeof(__pyx_k_TIMEAMPM), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TIMEAMPM */ {__pyx_k_TOD, sizeof(__pyx_k_TOD), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TOD */ - {__pyx_k_This_class_holds_metadata_we_wa, sizeof(__pyx_k_This_class_holds_metadata_we_wa), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_This_class_holds_metadata_we_wa */ {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */ {__pyx_k_UnicodeError, sizeof(__pyx_k_UnicodeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UnicodeError */ {__pyx_k_Unknown_file_format, sizeof(__pyx_k_Unknown_file_format), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_file_format */ @@ -21862,7 +21458,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getfilesystemencoding */ {__pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getstate */ {__pyx_k_hi, sizeof(__pyx_k_hi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hi */ - {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ {__pyx_k_int16, sizeof(__pyx_k_int16), 0, 1, 1}, /* PyObject cname: __pyx_n_u_int16 */ {__pyx_k_int32, sizeof(__pyx_k_int32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_int32 */ @@ -21882,7 +21477,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ {__pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata */ {__pyx_k_metadata_container, sizeof(__pyx_k_metadata_container), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata_container */ - {__pyx_k_metadata_container___init, sizeof(__pyx_k_metadata_container___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadata_container___init */ {__pyx_k_metadataonly, sizeof(__pyx_k_metadataonly), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metadataonly */ {__pyx_k_metaonly, sizeof(__pyx_k_metaonly), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaonly */ {__pyx_k_missing_ranges, sizeof(__pyx_k_missing_ranges), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_ranges */ @@ -21922,6 +21516,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ {__pyx_k_por, sizeof(__pyx_k_por), 0, 1, 1}, /* PyObject cname: __pyx_n_u_por */ {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ + {__pyx_k_pyclasses, sizeof(__pyx_k_pyclasses), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyclasses */ {__pyx_k_pyreadstat__readstat_parser, sizeof(__pyx_k_pyreadstat__readstat_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyreadstat__readstat_parser */ {__pyx_k_pyreadstat__readstat_parser_pyx, sizeof(__pyx_k_pyreadstat__readstat_parser_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_pyreadstat__readstat_parser_pyx */ {__pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_capi */ @@ -22016,13 +21611,13 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, c static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 79, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 437, __pyx_L1_error) - __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_all); if (!__pyx_builtin_all) __PYX_ERR(0, 1089, __pyx_L1_error) - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1108, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 1207, __pyx_L1_error) - __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 1255, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_all); if (!__pyx_builtin_all) __PYX_ERR(0, 1065, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 1183, __pyx_L1_error) + __pyx_builtin_UnicodeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_UnicodeError); if (!__pyx_builtin_UnicodeError) __PYX_ERR(0, 1231, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -22034,25 +21629,25 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "pyreadstat/_readstat_parser.pyx":1111 + /* "pyreadstat/_readstat_parser.pyx":1087 * var_format = dc.col_formats[index] * if dtypes[index] != '__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 1087, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "pyreadstat/_readstat_parser.pyx":1257 + /* "pyreadstat/_readstat_parser.pyx":1233 * 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, 1257, __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, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); @@ -22128,14 +21723,9 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 132, 174}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_parser_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_Q_a_O1_Q_M_1_1_N_q_a_A_Q_O1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1370, 283}; + const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 24, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1346, 283}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_filename_path, __pyx_mstate->__pyx_n_u_parser_format, __pyx_mstate->__pyx_n_u_metadataonly, __pyx_mstate->__pyx_n_u_dates_as_pandas_datetime, __pyx_mstate->__pyx_n_u_formats_as_category, __pyx_mstate->__pyx_n_u_formats_as_ordered_category, __pyx_mstate->__pyx_n_u_encoding, __pyx_mstate->__pyx_n_u_usecols, __pyx_mstate->__pyx_n_u_user_missing, __pyx_mstate->__pyx_n_u_disable_datetime_conversion, __pyx_mstate->__pyx_n_u_row_limit, __pyx_mstate->__pyx_n_u_row_offset, __pyx_mstate->__pyx_n_u_output_format, __pyx_mstate->__pyx_n_u_extra_datetime_formats, __pyx_mstate->__pyx_n_u_extra_date_formats, __pyx_mstate->__pyx_n_u_extra_time_formats, __pyx_mstate->__pyx_n_u_file_format, __pyx_mstate->__pyx_n_u_file_extension, __pyx_mstate->__pyx_n_u_metaonly, __pyx_mstate->__pyx_n_u_dates_as_pandas, __pyx_mstate->__pyx_n_u_usernan, __pyx_mstate->__pyx_n_u_no_datetime_conversion, __pyx_mstate->__pyx_n_u_data_frame, __pyx_mstate->__pyx_n_u_metadata}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_parser_pyx, __pyx_mstate->__pyx_n_u_parser_entry_point, __pyx_k_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyreadstat__readstat_parser_pyx, __pyx_mstate->__pyx_n_u_parser_entry_point, __pyx_k_a_1_JJ_ppq_00AASSkkl_1_S_a_s_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -23533,16 +23123,6 @@ static int __Pyx_ParseKeywords( return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); } -/* PyObjectSetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); - return PyObject_SetAttr(obj, attr_name, value); -} -#endif - /* ModFloat[double] */ static CYTHON_INLINE double __Pyx_mod_double(double a, double b, int b_is_constant) { CYTHON_UNUSED_VAR(b_is_constant); @@ -24499,6 +24079,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); } +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, @@ -26924,6 +26514,109 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } +/* Py3UpdateBases */ +static PyObject* +__Pyx_PEP560_update_bases(PyObject *bases) +{ + Py_ssize_t i, j, size_bases; + PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; +#if CYTHON_ASSUME_SAFE_SIZE + size_bases = PyTuple_GET_SIZE(bases); +#else + size_bases = PyTuple_Size(bases); + if (size_bases < 0) return NULL; +#endif + for (i = 0; i < size_bases; i++) { +#if CYTHON_AVOID_BORROWED_REFS + Py_CLEAR(base); +#endif +#if CYTHON_ASSUME_SAFE_MACROS + base = PyTuple_GET_ITEM(bases, i); +#else + base = PyTuple_GetItem(bases, i); + if (!base) goto error; +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(base); +#endif + if (PyType_Check(base)) { + if (new_bases) { + if (PyList_Append(new_bases, base) < 0) { + goto error; + } + } + continue; + } + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); + if (!meth && PyErr_Occurred()) { + goto error; + } + if (!meth) { + if (new_bases) { + if (PyList_Append(new_bases, base) < 0) { + goto error; + } + } + continue; + } + new_base = __Pyx_PyObject_CallOneArg(meth, bases); + Py_DECREF(meth); + if (!new_base) { + goto error; + } + if (!PyTuple_Check(new_base)) { + PyErr_SetString(PyExc_TypeError, + "__mro_entries__ must return a tuple"); + Py_DECREF(new_base); + goto error; + } + if (!new_bases) { + if (!(new_bases = PyList_New(i))) { + goto error; + } + for (j = 0; j < i; j++) { + PyObject *base_from_list; +#if CYTHON_ASSUME_SAFE_MACROS + base_from_list = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base_from_list); + Py_INCREF(base_from_list); +#else + base_from_list = PyTuple_GetItem(bases, j); + if (!base_from_list) goto error; + Py_INCREF(base_from_list); + if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; +#endif + } + } +#if CYTHON_ASSUME_SAFE_SIZE + j = PyList_GET_SIZE(new_bases); +#else + j = PyList_Size(new_bases); + if (j < 0) goto error; +#endif + if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { + goto error; + } + Py_DECREF(new_base); + } + if (!new_bases) { + Py_INCREF(bases); + return bases; + } + result = PyList_AsTuple(new_bases); + Py_DECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif + return result; +error: + Py_XDECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif + return NULL; +} + /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; @@ -27042,109 +26735,6 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return result; } -/* Py3UpdateBases */ -static PyObject* -__Pyx_PEP560_update_bases(PyObject *bases) -{ - Py_ssize_t i, j, size_bases; - PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; -#if CYTHON_ASSUME_SAFE_SIZE - size_bases = PyTuple_GET_SIZE(bases); -#else - size_bases = PyTuple_Size(bases); - if (size_bases < 0) return NULL; -#endif - for (i = 0; i < size_bases; i++) { -#if CYTHON_AVOID_BORROWED_REFS - Py_CLEAR(base); -#endif -#if CYTHON_ASSUME_SAFE_MACROS - base = PyTuple_GET_ITEM(bases, i); -#else - base = PyTuple_GetItem(bases, i); - if (!base) goto error; -#endif -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(base); -#endif - if (PyType_Check(base)) { - if (new_bases) { - if (PyList_Append(new_bases, base) < 0) { - goto error; - } - } - continue; - } - meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); - if (!meth && PyErr_Occurred()) { - goto error; - } - if (!meth) { - if (new_bases) { - if (PyList_Append(new_bases, base) < 0) { - goto error; - } - } - continue; - } - new_base = __Pyx_PyObject_CallOneArg(meth, bases); - Py_DECREF(meth); - if (!new_base) { - goto error; - } - if (!PyTuple_Check(new_base)) { - PyErr_SetString(PyExc_TypeError, - "__mro_entries__ must return a tuple"); - Py_DECREF(new_base); - goto error; - } - if (!new_bases) { - if (!(new_bases = PyList_New(i))) { - goto error; - } - for (j = 0; j < i; j++) { - PyObject *base_from_list; -#if CYTHON_ASSUME_SAFE_MACROS - base_from_list = PyTuple_GET_ITEM(bases, j); - PyList_SET_ITEM(new_bases, j, base_from_list); - Py_INCREF(base_from_list); -#else - base_from_list = PyTuple_GetItem(bases, j); - if (!base_from_list) goto error; - Py_INCREF(base_from_list); - if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; -#endif - } - } -#if CYTHON_ASSUME_SAFE_SIZE - j = PyList_GET_SIZE(new_bases); -#else - j = PyList_Size(new_bases); - if (j < 0) goto error; -#endif - if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { - goto error; - } - Py_DECREF(new_base); - } - if (!new_bases) { - Py_INCREF(bases); - return bases; - } - result = PyList_AsTuple(new_bases); - Py_DECREF(new_bases); -#if CYTHON_AVOID_BORROWED_REFS - Py_XDECREF(base); -#endif - return result; -error: - Py_XDECREF(new_bases); -#if CYTHON_AVOID_BORROWED_REFS - Py_XDECREF(base); -#endif - return NULL; -} - /* CLineInTraceback */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { diff --git a/pyreadstat/_readstat_parser.pyx b/pyreadstat/_readstat_parser.pyx index 28e9049..00be028 100644 --- a/pyreadstat/_readstat_parser.pyx +++ b/pyreadstat/_readstat_parser.pyx @@ -35,6 +35,8 @@ import numpy as np from readstat_api cimport * +from pyclasses import metadata_container + # necessary to work with the datetime C API import_datetime() @@ -124,34 +126,6 @@ cdef class data_container: self.mtime = 0 self.mr_sets = dict() self.output_format = "" - -class metadata_container: - """ - This class holds metadata we want to give back to python - """ - def __init__(self): - self.column_names = list() - self.column_labels = list() - self.column_names_to_labels = dict() - self.file_encoding = None - self.number_columns = None - self.number_rows = None - self.variable_value_labels = dict() - self.value_labels = dict() - self.variable_to_label = dict() - self.notes = list() - self.original_variable_types = dict() - self.readstat_variable_types = dict() - self.table_name = None - self.missing_ranges = dict() - self.missing_user_values = dict() - self.variable_storage_width = dict() - self.variable_display_width = dict() - self.variable_alignment = dict() - self.variable_measure = dict() - self.creation_time = None - self.modification_time = None - self.mr_sets = dict() class ReadstatError(Exception): @@ -160,6 +134,7 @@ class ReadstatError(Exception): """ pass + class PyreadstatError(Exception): """ Just defining a custom exception to raise when pyreadstat raises an exception. @@ -167,6 +142,7 @@ class PyreadstatError(Exception): pass + cdef py_datetime_format transform_variable_format(str var_format, py_file_format file_format): """ Transforms a readstat var_format to a date, datetime or time format label diff --git a/pyreadstat/pyclasses.py b/pyreadstat/pyclasses.py new file mode 100644 index 0000000..8ba08b4 --- /dev/null +++ b/pyreadstat/pyclasses.py @@ -0,0 +1,44 @@ +# ############################################################################# +# Copyright 2018 Hoffmann-La Roche +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################# + +class metadata_container: + """ + This class holds metadata we want to give back to python + """ + def __init__(self): + self.column_names = list() + self.column_labels = list() + self.column_names_to_labels = dict() + self.file_encoding = None + self.number_columns = None + self.number_rows = None + self.variable_value_labels = dict() + self.value_labels = dict() + self.variable_to_label = dict() + self.notes = list() + self.original_variable_types = dict() + self.readstat_variable_types = dict() + self.table_name = None + self.missing_ranges = dict() + self.missing_user_values = dict() + self.variable_storage_width = dict() + self.variable_display_width = dict() + self.variable_alignment = dict() + self.variable_measure = dict() + self.creation_time = None + self.modification_time = None + self.mr_sets = dict() + diff --git a/pyreadstat/pyreadstat.py b/pyreadstat/pyreadstat.py index b02cfa0..5e349a0 100644 --- a/pyreadstat/pyreadstat.py +++ b/pyreadstat/pyreadstat.py @@ -19,8 +19,8 @@ import narwhals.stable.v2 as nw import numpy as np -from ._readstat_parser import PyreadstatError, parser_entry_point -from ._readstat_writer import writer_entry_point +from ._readstat_parser import parser_entry_point +from ._readstat_writer import writer_entry_point, PyreadstatError from .worker import worker from .pyfunctions import set_value_labels, set_catalog_to_sas From 03d6a2f67b91a278a1bdd86fcaf070c607221b7e Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Tue, 7 Apr 2026 16:22:06 +0200 Subject: [PATCH 03/10] multiprocessing for dict output format now returning lists and not numpy arrays to be consistent with non multiprocessing --- pyreadstat/pyreadstat.py | 6 ++---- tests/test_narwhalified.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyreadstat/pyreadstat.py b/pyreadstat/pyreadstat.py index 5e349a0..3038b05 100644 --- a/pyreadstat/pyreadstat.py +++ b/pyreadstat/pyreadstat.py @@ -15,9 +15,9 @@ # ############################################################################# import multiprocessing as mp +from itertools import chain import narwhals.stable.v2 as nw -import numpy as np from ._readstat_parser import parser_entry_point from ._readstat_writer import writer_entry_point, PyreadstatError @@ -615,9 +615,7 @@ def read_file_multiprocessing(read_function, file_path, num_processes=None, num_ output_format = kwargs.get("output_format") if output_format == 'dict': keys = chunks[0].keys() - final = dict() - for key in keys: - final[key] = np.concatenate([chunk[key] for chunk in chunks]) + final = {key: list(chain.from_iterable(chunk[key] for chunk in chunks)) for key in keys} else: #final = pd.concat(chunks, axis=0, ignore_index=True) chunks = [nw.from_native(x) for x in chunks] diff --git a/tests/test_narwhalified.py b/tests/test_narwhalified.py index ea0a80e..9721a1d 100644 --- a/tests/test_narwhalified.py +++ b/tests/test_narwhalified.py @@ -742,9 +742,9 @@ def test_chunk_reader_multiprocess_dict(self): reader = pyreadstat.read_file_in_chunks(pyreadstat.read_sav, fpath, chunksize= 50, multiprocess=True, output_format='dict') alldfs = list() for chunkdict, meta in reader: - if self.backend != "pandas": + #if self.backend != "pandas": # we need lists not numpy arrays for polars! - chunkdict = {k:v.tolist() for k,v in chunkdict.items()} + #chunkdict = {k:v.tolist() for k,v in chunkdict.items()} df = nw.from_dict(chunkdict, backend=self.backend) alldfs.append(df) df_multi = nw.concat(alldfs, how='vertical').to_native() From 94240e5f90a98c0ab17ba3dc5b05c0b4d13b0503 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Tue, 7 Apr 2026 16:38:47 +0200 Subject: [PATCH 04/10] setting link iconv env var --- README.md | 4 ++++ setup.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 87f1ff8..f61def9 100644 --- a/README.md +++ b/README.md @@ -201,6 +201,10 @@ pip install git+https://github.com/Roche/pyreadstat.git You need a working C compiler and cython >=3.0.0. +On some linux distributions it is necessary to link the library iconv, while in others it should not be linked +for the final package to work. Right now the linkage happen only for ubuntu. If your distro needs linking iconv, +you can force that manually setting the environment variable PYREADSTAT_LINK_ICONV=1. + ### Compiling on Windows and Mac Compiling on linux is very easy, but on windows you need some extra preparation. diff --git a/setup.py b/setup.py index f1dc4a3..b805233 100644 --- a/setup.py +++ b/setup.py @@ -109,8 +109,9 @@ def is_python_lt_14(): else: libraries.extend(["m", "z"]) _platform = sys.platform + PYREADSTAT_LINK_ICONV = os.environ.get('PYREADSTAT_LINK_ICONV') # Mac and ubuntu: iconv needs to be linked statically - if _platform.lower().startswith("darwin") or (is_ubuntu() and is_python_lt_14()): + if PYREADSTAT_LINK_ICONV or _platform.lower().startswith("darwin") or (is_ubuntu() and is_python_lt_14()): libraries.append("iconv") # Extensions From 2ba79454947fb710721d85e4fd55c6b49c339c99 Mon Sep 17 00:00:00 2001 From: Nacho Maiz Date: Fri, 10 Apr 2026 10:59:38 +0100 Subject: [PATCH 05/10] Type Annotations (#320) * Implementing typing public interface with overloads * added py.typed file to signal that the python interface is fully type-hinted * implement type test cases for pytest * sync type in docstring to type annotation * add py.typed to package files * change metadata_container to dataclass, added missing file_label attribute * add missing type annotations and retype dict output to dict of lists * add polars to docstrings * remove unused import in __init__ * add __all__ imports to package init * Add dependency groups to pyproject and document how to test with extra dependencies * import PyreadstatError from the correct module --- MANIFEST.in | 2 +- how_to_test.md | 32 +- pyproject.toml | 19 + pyreadstat/__init__.py | 24 +- pyreadstat/py.typed | 0 pyreadstat/pyclasses.py | 74 ++- pyreadstat/pyfunctions.py | 71 ++- pyreadstat/pyreadstat.py | 913 ++++++++++++++++++++++++++++++++------ pyreadstat/worker.py | 14 +- setup.py | 2 + tests/test_mypy_setup.ini | 4 + tests/test_typing.yml | 345 ++++++++++++++ 12 files changed, 1305 insertions(+), 195 deletions(-) create mode 100644 pyreadstat/py.typed create mode 100644 tests/test_mypy_setup.ini create mode 100644 tests/test_typing.yml diff --git a/MANIFEST.in b/MANIFEST.in index e470bfc..b7eb7b5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,4 +5,4 @@ include *.pyx recursive-include pyreadstat *.pyx include *.pxd recursive-include pyreadstat *.pxd - +recursive-include pyreadstat py.typed diff --git a/how_to_test.md b/how_to_test.md index b3c8bea..e870f79 100644 --- a/how_to_test.md +++ b/how_to_test.md @@ -1,11 +1,35 @@ +# How to test pyreadstat + +## Dependencies for testing + +Additional dependencies for testing can be installed with: + +```shell +pip install --group dev --group test +``` + +## Running tests + If you have installed pyreadstat on your environment, enter this folder and do: -```python +```shell python3 tests/test_basic.py ``` -If you have built in place do +If you have built in place, do: -``` +```shell python3 tests/test_basic.py --inplace -``` \ No newline at end of file +``` + +Type hint tests can be run with: + +```shell +pytest tests/test_typing.yml --mypy-ini-file=tests/test_mypy_setup.ini +``` + +To run all tests in place, do: + +```shell +python tests/test_basic.py --inplace && python tests/test_narwhalified.py --inplace --backend=pandas && python tests/test_narwhalified.py --inplace --backend=polars && pytest tests/test_http_integration.py && pytest tests/test_typing.yml --mypy-ini-file=tests/test_mypy_setup.ini +``` diff --git a/pyproject.toml b/pyproject.toml index bc1f36d..17092d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,22 @@ requires = [ "cython" ] build-backend = "setuptools.build_meta" + +[dependency-groups] +dev = [ + "setuptools>=80.0.0", + "numpy>=2.0.0", + "pandas>=2.0.0", + "polars>=1.30.0", + "cython>=3.0.0", + "narwhals>=2.10.1", +] +test = [ + "pytest>=8.0.0", + "mypy>=1.20.0", + "pytest-mypy-plugins>=4.0.0", + "pandas-stubs>=2.0.0", + "pandas>=2.0.0", + "polars>=1.30.0", + "narwhals>=2.10.1", +] diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index 8ecd1c4..89474f9 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -14,12 +14,32 @@ # limitations under the License. # ############################################################################# -from .pyreadstat import read_sav, read_sas7bdat, read_xport, read_dta, read_sav, read_por, read_sas7bcat + +from .pyreadstat import read_sav, read_sas7bdat, read_xport, read_dta, read_por, read_sas7bcat from .pyreadstat import write_sav, write_dta, write_xport, write_por from .pyreadstat import read_file_in_chunks, read_file_multiprocessing from .pyclasses import metadata_container -from ._readstat_parser import ReadstatError +from ._readstat_parser import ReadstatError, PyreadstatError from .pyfunctions import set_value_labels, set_catalog_to_sas __version__ = "1.3.4" +__all__ = ( + "read_sav", + "read_sas7bdat", + "read_xport", + "read_dta", + "read_por", + "read_sas7bcat", + "write_sav", + "write_dta", + "write_xport", + "write_por", + "read_file_in_chunks", + "read_file_multiprocessing", + "metadata_container", + "ReadstatError", + "PyreadstatError", + "set_value_labels", + "set_catalog_to_sas", +) \ No newline at end of file diff --git a/pyreadstat/py.typed b/pyreadstat/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyreadstat/pyclasses.py b/pyreadstat/pyclasses.py index 8ba08b4..11121db 100644 --- a/pyreadstat/pyclasses.py +++ b/pyreadstat/pyclasses.py @@ -14,31 +14,59 @@ # limitations under the License. # ############################################################################# +# Typing + +from dataclasses import dataclass, field +from datetime import datetime +from typing import Literal, TypedDict + + +class MissingRange(TypedDict): + """A dictionary to hold the definition of a missing range""" + + lo: float + hi: float + + +class MRSet(TypedDict): + """A dictionary to hold the definition of a multiple-response (MR) set""" + + type: Literal["D", "C"] + is_dichotomy: bool + counted_value: int | None + label: str + variable_list: list[str] + + +# Classes + + +@dataclass class metadata_container: """ This class holds metadata we want to give back to python """ - def __init__(self): - self.column_names = list() - self.column_labels = list() - self.column_names_to_labels = dict() - self.file_encoding = None - self.number_columns = None - self.number_rows = None - self.variable_value_labels = dict() - self.value_labels = dict() - self.variable_to_label = dict() - self.notes = list() - self.original_variable_types = dict() - self.readstat_variable_types = dict() - self.table_name = None - self.missing_ranges = dict() - self.missing_user_values = dict() - self.variable_storage_width = dict() - self.variable_display_width = dict() - self.variable_alignment = dict() - self.variable_measure = dict() - self.creation_time = None - self.modification_time = None - self.mr_sets = dict() + column_names: list[str] = field(default_factory=list) + column_labels: list[str] = field(default_factory=list) + column_names_to_labels: dict[str, str] = field(default_factory=dict) + file_encoding: str | None = None + file_label: str | None = None + number_columns: int | None = None + number_rows: int | None = None + variable_value_labels: dict[str, dict[float | int, str]] = field(default_factory=dict) + value_labels: dict[str, dict[float | int, str]] = field(default_factory=dict) + variable_to_label: dict[str, str] = field(default_factory=dict) + notes: list[str] = field(default_factory=list) + original_variable_types: dict[str, str] = field(default_factory=dict) + readstat_variable_types: dict[str, str] = field(default_factory=dict) + table_name: str | None = None + missing_ranges: dict[str, list[int | float | str | MissingRange]] = field(default_factory=dict) + missing_user_values: dict[str, list[int | float | str | MissingRange]] = field(default_factory=dict) + variable_storage_width: dict[str, int] = field(default_factory=dict) + variable_display_width: dict[str, int] = field(default_factory=dict) + variable_alignment: dict[str, str] = field(default_factory=dict) + variable_measure: dict[str, Literal["nominal", "ordinal", "scale", "unknown"]] = field(default_factory=dict) + creation_time: datetime | None = None + modification_time: datetime | None = None + mr_sets: dict[str, MRSet] = field(default_factory=dict) diff --git a/pyreadstat/pyfunctions.py b/pyreadstat/pyfunctions.py index 30cdb04..a64301e 100644 --- a/pyreadstat/pyfunctions.py +++ b/pyreadstat/pyfunctions.py @@ -1,14 +1,24 @@ """ Functions written in pure python """ -from copy import deepcopy, copy + +from copy import deepcopy import warnings import narwhals.stable.v2 as nw +from narwhals.typing import IntoDataFrameT + +from .pyclasses import metadata_container # Functions to deal with value labels -def set_value_labels(dataframe, metadata, formats_as_category=True, formats_as_ordered_category=False): + +def set_value_labels( + dataframe: IntoDataFrameT, + metadata: metadata_container, + formats_as_category: bool = True, + formats_as_ordered_category: bool = False, +) -> IntoDataFrameT: """ Changes the values in the dataframe according to the value formats in the metadata. It will return a copy of the dataframe. If no appropiate formats were found, the result will be an unchanged copy @@ -16,20 +26,20 @@ def set_value_labels(dataframe, metadata, formats_as_category=True, formats_as_o Parameters ---------- - dataframe : pandas dataframe + dataframe : pandas or polars dataframe resulting from parsing a file metadata : dictionary resulting from parsing a file formats_as_category : bool, optional - defaults to True. If True the variables having formats will be transformed into pandas categories. + defaults to True. If True the variables having formats will be transformed into pandas or polars categories. formats_as_ordered_category : bool, optional - defaults to False. If True the variables having formats will be transformed into pandas ordered categories. + defaults to False. If True the variables having formats will be transformed into pandas or polars ordered categories. it has precedence over formats_as_category, meaning if this is True, it will take effect irrespective of the value of formats_as_category. Returns ------- - df_copy : pandas dataframe + df_copy : pandas or polars dataframe a copy of the original dataframe with the values changed, if appropiate formats were found, unaltered otherwise """ @@ -51,20 +61,29 @@ def set_value_labels(dataframe, metadata, formats_as_category=True, formats_as_o if uval not in labels: labels[uval] = uval # if all values are null, there will be nothing to replace. However we cannot do replace_strict on null dtype, it raises an error - if not df_copy.implementation.is_pandas() and (len(df_copy[var_name])==df_copy[var_name].null_count()): + if not df_copy.implementation.is_pandas() and ( + len(df_copy[var_name]) == df_copy[var_name].null_count() + ): continue # replace_strict requires that all the values are in the map. Could not get map_batches or when/then/otherwise to work - elif not df_copy.implementation.is_pandas() and (df_copy[var_name].dtype==nw.Object or not all([type(v)==type(list(labels.values())[0]) for v in labels.values() if v is not None])): + elif not df_copy.implementation.is_pandas() and ( + df_copy[var_name].dtype == nw.Object + or not all( + [type(v) == type(list(labels.values())[0]) for v in labels.values() if v is not None] + ) + ): # polars is very difficult to convince to mix strings and numbers, so we have to do it this way temp = [labels[x] for x in df_copy[var_name]] - newser = nw.new_series(name=var_name, values= temp, dtype=nw.Object, backend=df_copy.implementation) + newser = nw.new_series( + name=var_name, values=temp, dtype=nw.Object, backend=df_copy.implementation + ) df_copy = df_copy.with_columns(newser.alias(var_name)) if formats_as_category or formats_as_ordered_category: msg = f"You requested formats_as_category=True or formats_as_ordered_category=True, but it was not possible to cast variable '{var_name}' to category" warnings.warn(msg, RuntimeWarning) continue # not sure if we get into this situation ever or what would exactly happen, maybe this is not needed? - elif not df_copy.implementation.is_pandas() and df_copy[var_name].dtype==nw.Unknown: + elif not df_copy.implementation.is_pandas() and df_copy[var_name].dtype == nw.Unknown: msg = f"It was not possible to apply value formats to variable '{var_name}' due to unknown/not supported data type" warnings.warn(msg, RuntimeWarning) continue @@ -74,7 +93,7 @@ def set_value_labels(dataframe, metadata, formats_as_category=True, formats_as_o categories = list(set(labels.values())) original_values = list(labels.keys()) original_values.sort() - revdict= dict() + revdict = dict() for orival in original_values: curcat = labels.get(orival) if not revdict.get(curcat): @@ -84,11 +103,16 @@ def set_value_labels(dataframe, metadata, formats_as_category=True, formats_as_o elif formats_as_category: df_copy = df_copy.with_columns(nw.col(var_name).cast(nw.Categorical)) - return df_copy.to_native() -def set_catalog_to_sas(sas_dataframe, sas_metadata, catalog_metadata, formats_as_category=True, - formats_as_ordered_category=False): + +def set_catalog_to_sas( + sas_dataframe: IntoDataFrameT, + sas_metadata: metadata_container, + catalog_metadata: metadata_container, + formats_as_category: bool = True, + formats_as_ordered_category: bool = False, +) -> tuple[IntoDataFrameT, metadata_container]: """ Changes the values in the dataframe and sas_metadata according to the formats in the catalog. It will return a copy of the dataframe and metadata. If no appropriate formats were found, the result will @@ -96,22 +120,22 @@ def set_catalog_to_sas(sas_dataframe, sas_metadata, catalog_metadata, formats_as Parameters ---------- - sas_dataframe : pandas dataframe + sas_dataframe : pandas or polars dataframe resulting from parsing a sas7bdat file sas_metadata : pyreadstat metadata object resulting from parsing a sas7bdat file catalog_metadata : pyreadstat metadata object resulting from parsing a sas7bcat (catalog) file formats_as_category : bool, optional - defaults to True. If True the variables having formats will be transformed into pandas categories. + defaults to True. If True the variables having formats will be transformed into pandas or polars categories. formats_as_ordered_category : bool, optional - defaults to False. If True the variables having formats will be transformed into pandas ordered categories. + defaults to False. If True the variables having formats will be transformed into pandas or polars ordered categories. it has precedence over formats_as_category, meaning if this is True, it will take effect irrespective of the value of formats_as_category. Returns ------- - df_copy : pandas dataframe + df_copy : pandas or polars dataframe a copy of the original dataframe with the values changed, if appropriate formats were found, unaltered otherwise metadata : dict @@ -122,8 +146,12 @@ def set_catalog_to_sas(sas_dataframe, sas_metadata, catalog_metadata, formats_as catalog_metadata_copy = deepcopy(catalog_metadata) metadata = deepcopy(sas_metadata) metadata.value_labels = catalog_metadata_copy.value_labels - df_copy = set_value_labels(sas_dataframe, metadata, formats_as_category=formats_as_category, - formats_as_ordered_category=formats_as_ordered_category) + df_copy = set_value_labels( + sas_dataframe, + metadata, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + ) variable_value_labels = dict() for var_name, var_label in metadata.variable_to_label.items(): @@ -133,9 +161,8 @@ def set_catalog_to_sas(sas_dataframe, sas_metadata, catalog_metadata, formats_as metadata.variable_value_labels = variable_value_labels else: - #df_copy = sas_dataframe.copy() + # df_copy = sas_dataframe.copy() df_copy = nw.from_native(sas_dataframe).clone().to_native() metadata = deepcopy(sas_metadata) return df_copy, metadata - diff --git a/pyreadstat/pyreadstat.py b/pyreadstat/pyreadstat.py index 3038b05..d94f742 100644 --- a/pyreadstat/pyreadstat.py +++ b/pyreadstat/pyreadstat.py @@ -14,28 +14,146 @@ # limitations under the License. # ############################################################################# +from collections.abc import Callable, Iterator import multiprocessing as mp from itertools import chain +from os import PathLike +from typing import TYPE_CHECKING, Any, Concatenate, Literal, TypeAlias, overload, Protocol import narwhals.stable.v2 as nw -from ._readstat_parser import parser_entry_point -from ._readstat_writer import writer_entry_point, PyreadstatError +from ._readstat_parser import parser_entry_point, PyreadstatError +from ._readstat_writer import writer_entry_point from .worker import worker +from .pyclasses import metadata_container, MissingRange from .pyfunctions import set_value_labels, set_catalog_to_sas +# Typing interface + +if TYPE_CHECKING: + # Setup type aliases for the public interface. + # These are not executed at runtime, but they help type checkers understand + # the expected types of the public functions and classes. + + # Since pyreadstat can work with both pandas and polars, we define a DataFrame type that can be either. + try: + from pandas import DataFrame as PandasDataFrame # type: ignore + except ImportError: + # Define a dummy DataFrame class to avoid accepting any type as PandasDataFrame when pandas is not installed + class PandasDataFrame: + pass + + try: + from polars import DataFrame as PolarsDataFrame # type: ignore + except ImportError: + # Define a dummy DataFrame class to avoid accepting any type as PolarsDataFrame when polars is not installed + class PolarsDataFrame: + pass + +DataFrame: TypeAlias = "PandasDataFrame | PolarsDataFrame" # Define type at runtime for introspection + +class FileLike(Protocol): + """Protocol for file-like objects accepted by pyreadstat""" + + # Should work with any file-like object that has read and seek methods, such as those returned by open() or io.BytesIO + def read(self, size: int | None = -1, /) -> bytes: ... + def seek(self, pos: int, whence: int = 0, /) -> int: ... + + +FilePathLike: TypeAlias = str | bytes | PathLike[str] | PathLike[bytes] +FilePathorBuffer: TypeAlias = FilePathLike | FileLike + +DictOutput: TypeAlias = dict[str, list[Any]] + +PyreadstatReadFunction: TypeAlias = Callable[ + Concatenate[FilePathorBuffer, ...], "tuple[DataFrame | DictOutput, metadata_container]" +] + + # Public interface # Parsing functions -def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=False, catalog_file=None, - formats_as_category=True, formats_as_ordered_category=False, encoding=None, usecols=None, user_missing=False, - disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, - extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): + +@overload +def read_sas7bdat( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + catalog_file: FilePathorBuffer | None = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["pandas"] | None = ..., + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PandasDataFrame, metadata_container]": ... +@overload +def read_sas7bdat( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + catalog_file: FilePathorBuffer | None = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["polars"] = "polars", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PolarsDataFrame, metadata_container]": ... +@overload +def read_sas7bdat( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + catalog_file: FilePathorBuffer | None = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["dict"] = "dict", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> tuple[DictOutput, metadata_container]: ... +def read_sas7bdat( + filename_path: FilePathorBuffer, + metadataonly: bool = False, + dates_as_pandas_datetime: bool = False, + catalog_file: FilePathorBuffer | None = None, + formats_as_category: bool = True, + formats_as_ordered_category: bool = False, + encoding: str | None = None, + usecols: list[str] | None = None, + user_missing: bool = False, + disable_datetime_conversion: bool = False, + row_limit: int = 0, + row_offset: int = 0, + output_format: Literal["pandas", "polars", "dict"] | None = None, + extra_datetime_formats: list[str] | None = None, + extra_date_formats: list[str] | None = None, + extra_time_formats: list[str] | None = None, +) -> "tuple[DataFrame | DictOutput, metadata_container]": r""" Read a SAS sas7bdat file. It accepts the path to a sas7bcat. - + Parameters ---------- filename_path : str, bytes, Path-like object or file-like object @@ -45,8 +163,8 @@ def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=Fa metadata object. The data frame will be set with the correct column names but no data. dates_as_pandas_datetime : bool, optional by default False. If true dates will be transformed to pandas datetime64 instead of date, effective only for pandas. - catalog_file : str, optional - path to a sas7bcat file. By default is None. If not None, will parse the catalog file and replace the values + catalog_file : str, bytes, Path-like object or file-like object, optional + path to a sas7bcat file or file-like object. By default is None. If not None, will parse the catalog file and replace the values by the formats in the catalog, if any appropiate is found. If this is not the behavior you are looking for, Use read_sas7bcat to parse the catalog independently of the sas7bdat and set_catalog_to_sas to apply the resulting format into sas7bdat files. @@ -79,7 +197,7 @@ def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=Fa start reading rows after this offset. By default 0, meaning start with the first row not skipping anything. output_format : str, optional one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the - user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a + user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a dataframe is avoided. extra_datetime_formats: list of str, optional formats to be parsed as python datetime objects @@ -87,7 +205,7 @@ def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=Fa formats to be parsed as python date objects extra_time_formats: list of str, optional formats to be parsed as python time objects - + Returns ------- @@ -99,27 +217,99 @@ def read_sas7bdat(filename_path, metadataonly=False, dates_as_pandas_datetime=Fa Look at the documentation for more information. """ parser_format = "sas7bdat" - data_frame, metadata = parser_entry_point(filename_path, parser_format, - metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, - formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, - encoding=encoding, usecols=usecols, user_missing=user_missing, - disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, - output_format=output_format, extra_datetime_formats=extra_datetime_formats, - extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) + data_frame, metadata = parser_entry_point( + filename_path, + parser_format, + metadataonly=metadataonly, + dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + encoding=encoding, + usecols=usecols, + user_missing=user_missing, + disable_datetime_conversion=disable_datetime_conversion, + row_limit=row_limit, + row_offset=row_offset, + output_format=output_format, + extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, + extra_time_formats=extra_time_formats, + ) metadata.file_format = parser_format if catalog_file: - _ , catalog = read_sas7bcat(catalog_file, encoding=encoding) - data_frame, metadata = set_catalog_to_sas(data_frame, metadata, catalog, formats_as_category=formats_as_category, - formats_as_ordered_category=formats_as_ordered_category) + _, catalog = read_sas7bcat(catalog_file, encoding=encoding) + data_frame, metadata = set_catalog_to_sas( + data_frame, + metadata, + catalog, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + ) return data_frame, metadata -def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False, encoding=None, - usecols=None, disable_datetime_conversion=False, row_limit=0, row_offset=0, - output_format=None, extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): +@overload +def read_xport( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["pandas"] | None = ..., + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PandasDataFrame, metadata_container]": ... +@overload +def read_xport( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["polars"] = "polars", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PolarsDataFrame, metadata_container]": ... +@overload +def read_xport( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["dict"] = "dict", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> tuple[DictOutput, metadata_container]: ... +def read_xport( + filename_path: FilePathorBuffer, + metadataonly: bool = False, + dates_as_pandas_datetime: bool = False, + encoding: str | None = None, + usecols: list[str] | None = None, + disable_datetime_conversion: bool = False, + row_limit: int = 0, + row_offset: int = 0, + output_format: Literal["pandas", "polars", "dict"] | None = None, + extra_datetime_formats: list[str] | None = None, + extra_date_formats: list[str] | None = None, + extra_time_formats: list[str] | None = None, +) -> "tuple[DataFrame | DictOutput, metadata_container]": r""" Read a SAS xport file. @@ -150,7 +340,7 @@ def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False start reading rows after this offset. By default 0, meaning start with the first row not skipping anything. output_format : str, optional one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the - user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a + user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a dataframe is avoided. extra_datetime_formats: list of str, optional formats to be parsed as python datetime objects @@ -167,22 +357,102 @@ def read_xport(filename_path, metadataonly=False, dates_as_pandas_datetime=False object with metadata. Look at the documentation for more information. """ parser_format = "xport" - data_frame, metadata = parser_entry_point(filename_path, parser_format, - metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, - encoding=encoding, usecols=usecols, - disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, - output_format=output_format, extra_datetime_formats=extra_datetime_formats, - extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) + data_frame, metadata = parser_entry_point( + filename_path, + parser_format, + metadataonly=metadataonly, + dates_as_pandas_datetime=dates_as_pandas_datetime, + encoding=encoding, + usecols=usecols, + disable_datetime_conversion=disable_datetime_conversion, + row_limit=row_limit, + row_offset=row_offset, + output_format=output_format, + extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, + extra_time_formats=extra_time_formats, + ) metadata.file_format = parser_format return data_frame, metadata -def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - formats_as_category=True, formats_as_ordered_category=False, encoding=None, usecols=None, user_missing=False, - disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, - extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): +@overload +def read_dta( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["pandas"] | None = ..., + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PandasDataFrame, metadata_container]": ... +@overload +def read_dta( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["polars"] = "polars", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PolarsDataFrame, metadata_container]": ... +@overload +def read_dta( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["dict"] = "dict", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> tuple[DictOutput, metadata_container]: ... +def read_dta( + filename_path: FilePathorBuffer, + metadataonly: bool = False, + dates_as_pandas_datetime: bool = False, + apply_value_formats: bool = False, + formats_as_category: bool = True, + formats_as_ordered_category: bool = False, + encoding: str | None = None, + usecols: list[str] | None = None, + user_missing: bool = False, + disable_datetime_conversion: bool = False, + row_limit: int = 0, + row_offset: int = 0, + output_format: Literal["pandas", "polars", "dict"] | None = None, + extra_datetime_formats: list[str] | None = None, + extra_date_formats: list[str] | None = None, + extra_time_formats: list[str] | None = None, +) -> "tuple[DataFrame | DictOutput, metadata_container]": r""" Read a STATA dta file @@ -227,7 +497,7 @@ def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, start reading rows after this offset. By default 0, meaning start with the first row not skipping anything. output_format : str, optional one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the - user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a + user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a dataframe is avoided. extra_datetime_formats: list of str, optional formats to be parsed as python datetime objects @@ -244,27 +514,113 @@ def read_dta(filename_path, metadataonly=False, dates_as_pandas_datetime=False, object with metadata. Look at the documentation for more information. """ parser_format = "dta" - data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, - metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, - formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, - encoding=encoding, usecols=usecols, user_missing=user_missing, - disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, - output_format=output_format, extra_datetime_formats=extra_datetime_formats, - extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) + data_frame, metadata = parser_entry_point( + filename_path, + parser_format=parser_format, + metadataonly=metadataonly, + dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + encoding=encoding, + usecols=usecols, + user_missing=user_missing, + disable_datetime_conversion=disable_datetime_conversion, + row_limit=row_limit, + row_offset=row_offset, + output_format=output_format, + extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, + extra_time_formats=extra_time_formats, + ) metadata.file_format = parser_format if apply_value_formats: - data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - formats_as_ordered_category=formats_as_ordered_category) + data_frame = set_value_labels( + data_frame, + metadata, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + ) return data_frame, metadata -def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - formats_as_category=True, formats_as_ordered_category=False, encoding=None, usecols=None, user_missing=False, - disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, extra_datetime_formats=None, - extra_date_formats=None, extra_time_formats=None): +@overload +def read_sav( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["pandas"] | None = ..., + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PandasDataFrame, metadata_container]": ... +@overload +def read_sav( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["polars"] = "polars", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PolarsDataFrame, metadata_container]": ... +@overload +def read_sav( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + encoding: str | None = ..., + usecols: list[str] | None = ..., + user_missing: bool = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["dict"] = "dict", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> tuple[DictOutput, metadata_container]: ... +def read_sav( + filename_path: FilePathorBuffer, + metadataonly: bool = False, + dates_as_pandas_datetime: bool = False, + apply_value_formats: bool = False, + formats_as_category: bool = True, + formats_as_ordered_category: bool = False, + encoding: str | None = None, + usecols: list[str] | None = None, + user_missing: bool = False, + disable_datetime_conversion: bool = False, + row_limit: int = 0, + row_offset: int = 0, + output_format: Literal["pandas", "polars", "dict"] | None = None, + extra_datetime_formats: list[str] | None = None, + extra_date_formats: list[str] | None = None, + extra_time_formats: list[str] | None = None, +) -> "tuple[DataFrame | DictOutput, metadata_container]": r""" Read a SPSS sav or zsav (compressed) files @@ -309,7 +665,7 @@ def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, start reading rows after this offset. By default 0, meaning start with the first row not skipping anything. output_format : str, optional one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the - user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a + user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a dataframe is avoided. extra_datetime_formats: list of str, optional formats to be parsed as python datetime objects @@ -327,27 +683,105 @@ def read_sav(filename_path, metadataonly=False, dates_as_pandas_datetime=False, """ parser_format = "sav/zsav" - data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, - metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, - formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, - encoding=encoding, usecols=usecols, user_missing=user_missing, - disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, - output_format=output_format, extra_datetime_formats=extra_datetime_formats, - extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) + data_frame, metadata = parser_entry_point( + filename_path, + parser_format=parser_format, + metadataonly=metadataonly, + dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + encoding=encoding, + usecols=usecols, + user_missing=user_missing, + disable_datetime_conversion=disable_datetime_conversion, + row_limit=row_limit, + row_offset=row_offset, + output_format=output_format, + extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, + extra_time_formats=extra_time_formats, + ) metadata.file_format = parser_format if apply_value_formats: - data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category, - formats_as_ordered_category=formats_as_ordered_category) + data_frame = set_value_labels( + data_frame, + metadata, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + ) return data_frame, metadata -def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, apply_value_formats=False, - formats_as_category=True, formats_as_ordered_category=False, usecols=None, - disable_datetime_conversion=False, row_limit=0, row_offset=0, output_format=None, - extra_datetime_formats=None, extra_date_formats=None, extra_time_formats=None): +@overload +def read_por( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + usecols: list[str] | None = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["pandas"] | None = ..., + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PandasDataFrame, metadata_container]": ... +@overload +def read_por( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + usecols: list[str] | None = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["polars"] = "polars", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> "tuple[PolarsDataFrame, metadata_container]": ... +@overload +def read_por( + filename_path: FilePathorBuffer, + metadataonly: bool = ..., + dates_as_pandas_datetime: bool = ..., + apply_value_formats: bool = ..., + formats_as_category: bool = ..., + formats_as_ordered_category: bool = ..., + usecols: list[str] | None = ..., + disable_datetime_conversion: bool = ..., + row_limit: int = ..., + row_offset: int = ..., + output_format: Literal["dict"] = "dict", + extra_datetime_formats: list[str] | None = ..., + extra_date_formats: list[str] | None = ..., + extra_time_formats: list[str] | None = ..., +) -> tuple[DictOutput, metadata_container]: ... +def read_por( + filename_path: FilePathorBuffer, + metadataonly: bool = False, + dates_as_pandas_datetime: bool = False, + apply_value_formats: bool = False, + formats_as_category: bool = True, + formats_as_ordered_category: bool = False, + usecols: list[str] | None = None, + disable_datetime_conversion: bool = False, + row_limit: int = 0, + row_offset: int = 0, + output_format: Literal["pandas", "polars", "dict"] | None = None, + extra_datetime_formats: list[str] | None = None, + extra_date_formats: list[str] | None = None, + extra_time_formats: list[str] | None = None, +) -> "tuple[DataFrame | DictOutput, metadata_container]": r""" Read a SPSS por file. Files are assumed to be UTF-8 encoded, the encoding cannot be set to other. @@ -386,7 +820,7 @@ def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, start reading rows after this offset. By default 0, meaning start with the first row not skipping anything. output_format : str, optional one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned, the - user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a + user can then convert it to her preferred data format. Using dict is faster as the other types as the conversion to a dataframe is avoided. extra_datetime_formats: list of str, optional formats to be parsed as python datetime objects @@ -403,23 +837,54 @@ def read_por(filename_path, metadataonly=False, dates_as_pandas_datetime=False, object with metadata. Look at the documentation for more information. """ parser_format = "por" - data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, - metadataonly=metadataonly, dates_as_pandas_datetime=dates_as_pandas_datetime, - formats_as_category=formats_as_category, formats_as_ordered_category=formats_as_ordered_category, - usecols=usecols, - disable_datetime_conversion=disable_datetime_conversion, row_limit=row_limit, row_offset=row_offset, - output_format=output_format, extra_datetime_formats=extra_datetime_formats, - extra_date_formats=extra_date_formats, extra_time_formats=extra_time_formats) + data_frame, metadata = parser_entry_point( + filename_path, + parser_format=parser_format, + metadataonly=metadataonly, + dates_as_pandas_datetime=dates_as_pandas_datetime, + formats_as_category=formats_as_category, + formats_as_ordered_category=formats_as_ordered_category, + usecols=usecols, + disable_datetime_conversion=disable_datetime_conversion, + row_limit=row_limit, + row_offset=row_offset, + output_format=output_format, + extra_datetime_formats=extra_datetime_formats, + extra_date_formats=extra_date_formats, + extra_time_formats=extra_time_formats, + ) metadata.file_format = parser_format - + if apply_value_formats: data_frame = set_value_labels(data_frame, metadata, formats_as_category=formats_as_category) return data_frame, metadata -def read_sas7bcat(filename_path, encoding=None, output_format=None): +@overload +def read_sas7bcat( + filename_path: FilePathorBuffer, + encoding: str | None = ..., + output_format: Literal["pandas"] | None = ..., +) -> "tuple[PandasDataFrame, metadata_container]": ... +@overload +def read_sas7bcat( + filename_path: FilePathorBuffer, + encoding: str | None = ..., + output_format: Literal["polars"] = "polars", +) -> "tuple[PolarsDataFrame, metadata_container]": ... +@overload +def read_sas7bcat( + filename_path: FilePathorBuffer, + encoding: str | None = ..., + output_format: Literal["dict"] = "dict", +) -> tuple[DictOutput, metadata_container]: ... +def read_sas7bcat( + filename_path: FilePathorBuffer, + encoding: str | None = None, + output_format: Literal["pandas", "polars", "dict"] | None = None, +) -> "tuple[DataFrame | DictOutput, metadata_container]": r""" Read a SAS sas7bcat file. The returning dataframe will be empty. The metadata object will contain a dictionary value_labels that contains the formats. When parsing the sas7bdat file, in the metadata, the dictionary @@ -437,7 +902,7 @@ def read_sas7bcat(filename_path, encoding=None, output_format=None): Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an iconv-compatible name output_format : str, optional - one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned. + one of 'pandas' (default), 'polars' or 'dict'. If 'dict' a dictionary with numpy arrays as values will be returned. Notice that for this function the resulting object is always empty, this is done for consistency with other functions but has no impact on performance. @@ -450,23 +915,78 @@ def read_sas7bcat(filename_path, encoding=None, output_format=None): Look at the documentation for more information. """ parser_format = "sas7bcat" - data_frame, metadata = parser_entry_point(filename_path, parser_format=parser_format, - encoding=encoding, - output_format=output_format, - ) + data_frame, metadata = parser_entry_point( + filename_path, + parser_format=parser_format, + encoding=encoding, + output_format=output_format, + ) metadata.file_format = parser_format return data_frame, metadata + # convenience functions to read in chunks -def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, limit=0, - multiprocess=False, num_processes=4, num_rows=None, **kwargs): + +@overload +def read_file_in_chunks( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + chunksize: int = ..., + offset: int = ..., + limit: int = ..., + multiprocess: bool = ..., + num_processes: int = ..., + num_rows: int | None = ..., + *, + output_format: Literal["pandas"] | None = ..., + **kwargs: Any, +) -> "Iterator[tuple[PandasDataFrame, metadata_container]]": ... +@overload +def read_file_in_chunks( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + chunksize: int = ..., + offset: int = ..., + limit: int = ..., + multiprocess: bool = ..., + num_processes: int = ..., + num_rows: int | None = ..., + *, + output_format: Literal["polars"] = "polars", + **kwargs: Any, +) -> "Iterator[tuple[PolarsDataFrame, metadata_container]]": ... +@overload +def read_file_in_chunks( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + chunksize: int = ..., + offset: int = ..., + limit: int = ..., + multiprocess: bool = ..., + num_processes: int = ..., + num_rows: int | None = ..., + *, + output_format: Literal["dict"] = "dict", + **kwargs: Any, +) -> Iterator[tuple[DictOutput, metadata_container]]: ... +def read_file_in_chunks( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + chunksize: int = 100000, + offset: int = 0, + limit: int = 0, + multiprocess: bool = False, + num_processes: int = 4, + num_rows: int | None = None, + **kwargs: Any, +) -> "Iterator[tuple[DataFrame | DictOutput, metadata_container]]": """ Returns a generator that will allow to read a file in chunks. - If using multiprocessing, for Xport, Por and some defective sav files where the number of rows in the dataset canot be obtained from the metadata, + If using multiprocessing, for Xport, Por and some defective sav files where the number of rows in the dataset canot be obtained from the metadata, the parameter num_rows must be set to a number equal or larger than the number of rows in the dataset. That information must be obtained by the user before running this function. @@ -474,7 +994,7 @@ def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, li ---------- read_function : pyreadstat function a pyreadstat reading function - file_path : string + file_path : str, bytes or Path-like object path to the file to be read chunksize : integer, optional size of the chunks to read @@ -488,7 +1008,7 @@ def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, li in case multiprocess is true, how many workers/processes to spawn? num_rows: integer, optional number of rows in the dataset. If using multiprocessing it is obligatory for files where - the number of rows cannot be obtained from the medatata, such as por and + the number of rows cannot be obtained from the medatata, such as por and some defective xport and sav files. The user must obtain this value by reading the file without multiprocessing first or any other means. A number larger than the actual number of rows will work as well. Discarded if the number of rows can be obtained from the metadata or not using multiprocessing. @@ -500,7 +1020,7 @@ def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, li data_frame : dataframe a dataframe with the data metadata : - object with metadata. + object with metadata. Look at the documentation for more information. it : generator @@ -509,7 +1029,7 @@ def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, li if read_function == read_sas7bcat: raise Exception("read_sas7bcat not supported") - + if "row_offset" in kwargs: _ = kwargs.pop("row_offset") @@ -525,7 +1045,7 @@ def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, li if not limit: limit = numrows else: - limit = min(offset+limit, numrows) + limit = min(offset + limit, numrows) else: if limit: limit = offset + limit @@ -534,18 +1054,62 @@ def read_file_in_chunks(read_function, file_path, chunksize=100000, offset=0, li if limit and (offset >= limit): break if multiprocess: - df, meta = read_file_multiprocessing(read_function, file_path, num_processes=num_processes, - row_offset=offset, row_limit=chunksize, num_rows=num_rows, **kwargs) + df, meta = read_file_multiprocessing( + read_function, + file_path, + num_processes=num_processes, + row_offset=offset, + row_limit=chunksize, + num_rows=num_rows, + **kwargs, + ) else: df, meta = read_function(file_path, row_offset=offset, row_limit=chunksize, **kwargs) if len(df): yield df, meta offset += chunksize -def read_file_multiprocessing(read_function, file_path, num_processes=None, num_rows=None, **kwargs): + +@overload +def read_file_multiprocessing( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + num_processes: int | None = ..., + num_rows: int | None = ..., + *, + output_format: Literal["pandas"] | None = ..., + **kwargs: Any, +) -> "tuple[PandasDataFrame, metadata_container]": ... +@overload +def read_file_multiprocessing( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + num_processes: int | None = ..., + num_rows: int | None = ..., + *, + output_format: Literal["polars"] = "polars", + **kwargs: Any, +) -> "tuple[PolarsDataFrame, metadata_container]": ... +@overload +def read_file_multiprocessing( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + num_processes: int | None = ..., + num_rows: int | None = ..., + *, + output_format: Literal["dict"] = "dict", + **kwargs: Any, +) -> tuple[DictOutput, metadata_container]: ... +def read_file_multiprocessing( + read_function: PyreadstatReadFunction, + file_path: FilePathLike, + num_processes: int | None = None, + num_rows: int | None = None, + **kwargs: Any, +) -> "tuple[DataFrame | DictOutput, metadata_container]": """ Reads a file in parallel using multiprocessing. - For Xport, Por and some defective sav files where the number of rows in the dataset canot be obtained from the metadata, + For Xport, Por and some defective sav files where the number of rows in the dataset canot be obtained from the metadata, the parameter num_rows must be set to a number equal or larger than the number of rows in the dataset. That information must be obtained by the user before running this function. @@ -553,16 +1117,16 @@ def read_file_multiprocessing(read_function, file_path, num_processes=None, num_ ---------- read_function : pyreadstat function a pyreadstat reading function - file_path : string + file_path : str, bytes or Path-like object path to the file to be read num_processes : integer, optional number of processes to spawn, by default the min 4 and the max cores on the computer num_rows: integer, optional - number of rows in the dataset. Obligatory for files where the number of rows cannot be obtained from the medatata, such as por and + number of rows in the dataset. Obligatory for files where the number of rows cannot be obtained from the medatata, such as por and some defective xport and sav files. The user must obtain this value by reading the file without multiprocessing first or any other means. A number larger than the actual number of rows will work as well. Discarded if the number of rows can be obtained from the metadata. kwargs : dict, optional - any other keyword argument to pass to the read_function. + any other keyword argument to pass to the read_function. Returns ------- @@ -576,26 +1140,30 @@ def read_file_multiprocessing(read_function, file_path, num_processes=None, num_ raise Exception("read_sas7bcat is not supported") if read_function == read_por and num_rows is None: - raise Exception("num_rows must be specified for read_por to be a number equal or larger than the number of rows in the dataset.") + raise Exception( + "num_rows must be specified for read_por to be a number equal or larger than the number of rows in the dataset." + ) if not num_processes: # let's be conservative with the number of workers num_processes = min(mp.cpu_count(), 4) - _ = kwargs.pop('metadataonly', None) + _ = kwargs.pop("metadataonly", None) row_offset = kwargs.pop("row_offset", 0) - row_limit = kwargs.pop("row_limit", float('inf')) + row_limit = kwargs.pop("row_limit", float("inf")) _, meta = read_function(file_path, metadataonly=True, **kwargs) numrows = meta.number_rows if numrows is None: if num_rows is None: - raise Exception("The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data") + raise Exception( + "The number of rows of the file cannot be determined from the file's metadata. If you still want to proceed, please set num_rows to a number equal or larger than the number of rows of your data" + ) numrows = num_rows elif numrows == 0: final, meta = read_function(file_path, **kwargs) - numrows = min(max(numrows - row_offset, 0), row_limit) - divs = [numrows // num_processes + (1 if x < numrows % num_processes else 0) for x in range (num_processes)] + numrows = min(max(numrows - row_offset, 0), row_limit) + divs = [numrows // num_processes + (1 if x < numrows % num_processes else 0) for x in range(num_processes)] offsets = list() prev_offset = row_offset prev_div = 0 @@ -613,13 +1181,13 @@ def read_file_multiprocessing(read_function, file_path, num_processes=None, num_ finally: pool.close() output_format = kwargs.get("output_format") - if output_format == 'dict': + if output_format == "dict": keys = chunks[0].keys() final = {key: list(chain.from_iterable(chunk[key] for chunk in chunks)) for key in keys} else: - #final = pd.concat(chunks, axis=0, ignore_index=True) + # final = pd.concat(chunks, axis=0, ignore_index=True) chunks = [nw.from_native(x) for x in chunks] - final = nw.concat(chunks, how='vertical') + final = nw.concat(chunks, how="vertical") ispandas = False if final.implementation.is_pandas(): ispandas = True @@ -628,11 +1196,24 @@ def read_file_multiprocessing(read_function, file_path, num_processes=None, num_ final = final.reset_index(drop=True) return final, meta + # Write API -def write_sav(df, dst_path, file_label="", column_labels=None, compress=False, row_compress=False, note=None, - variable_value_labels=None, missing_ranges=None, variable_display_width=None, - variable_measure=None, variable_format=None): + +def write_sav( + df: "DataFrame", + dst_path: FilePathLike, + file_label: str = "", + column_labels: list[str] | dict[str, str] | None = None, + compress: bool = False, + row_compress: bool = False, + note: str | list[str] | None = None, + variable_value_labels: dict[str, dict[int | float, str]] | None = None, + missing_ranges: dict[str, list[int | float | str | MissingRange]] | None = None, + variable_display_width: dict[str, int] | None = None, + variable_measure: dict[str, str] | None = None, + variable_format: dict[str, str] | None = None, +) -> None: """ Writes a dataframe to a SPSS sav or zsav file. @@ -640,7 +1221,7 @@ def write_sav(df, dst_path, file_label="", column_labels=None, compress=False, r ---------- df : dataframe dataframe to write to sav or zsav - dst_path : str or pathlib.Path + dst_path : str, bytes or Path-like object full path to the result sav or zsav file file_label : str, optional a label for the file @@ -674,27 +1255,47 @@ def write_sav(df, dst_path, file_label="", column_labels=None, compress=False, r sets the measure type for a variable. Must be a dictionary with keys being variable names and values being strings one of "nominal", "ordinal", "scale" or "unknown" (default). variable_format: dict, optional - sets the format of a variable. Must be a dictionary with keys being the variable names and + sets the format of a variable. Must be a dictionary with keys being the variable names and values being strings defining the format. See README, setting variable formats section, for more information. """ writer_format = "sav" # formats - formats_presets = {'restricted_integer':'N{var_width}', 'integer':'F{var_width}.0'} + formats_presets = {"restricted_integer": "N{var_width}", "integer": "F{var_width}.0"} if variable_format: for col_name, col_format in variable_format.items(): if col_format in formats_presets.keys() and col_name in df.columns: var_width = str(len(str(max(df[col_name])))) - variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) - - writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, - compress=compress, row_compress=row_compress, note=note, - variable_value_labels=variable_value_labels, missing_ranges=missing_ranges, variable_display_width=variable_display_width, - variable_measure=variable_measure, variable_format=variable_format) - -def write_dta(df, dst_path, file_label="", column_labels=None, version=15, - variable_value_labels=None, missing_user_values=None, variable_format=None): + variable_format[col_name] = formats_presets[col_format].format(var_width=var_width) + + writer_entry_point( + df, + dst_path, + writer_format=writer_format, + file_label=file_label, + column_labels=column_labels, + compress=compress, + row_compress=row_compress, + note=note, + variable_value_labels=variable_value_labels, + missing_ranges=missing_ranges, + variable_display_width=variable_display_width, + variable_measure=variable_measure, + variable_format=variable_format, + ) + + +def write_dta( + df: "DataFrame", + dst_path: FilePathLike, + file_label: str = "", + column_labels: list[str] | dict[str, str] | None = None, + version: int = 15, + variable_value_labels: dict[str, dict[int | float, str]] | None = None, + missing_user_values: dict[str, list[str]] | None = None, + variable_format: dict[str, str] | None = None, +) -> None: """ Writes a dataframe to a STATA dta file @@ -702,7 +1303,7 @@ def write_dta(df, dst_path, file_label="", column_labels=None, version=15, ---------- df : dataframe dataframe to write to sav or zsav - dst_path : str or pathlib.Path + dst_path : str, bytes or Path-like object full path to the result dta file file_label : str, optional a label for the file @@ -722,20 +1323,34 @@ def write_dta(df, dst_path, file_label="", column_labels=None, version=15, names and values being a list of missing values. Missing values must be a single character between a and z. variable_format: dict, optional - sets the format of a variable. Must be a dictionary with keys being the variable names and + sets the format of a variable. Must be a dictionary with keys being the variable names and values being strings defining the format. See README, setting variable formats section, for more information. """ writer_format = "dta" - writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, - version=version, - variable_value_labels=variable_value_labels, - missing_user_values=missing_user_values, - variable_format=variable_format) - -def write_xport(df, dst_path, file_label="", column_labels=None, table_name=None, file_format_version = 8, - variable_format=None): + writer_entry_point( + df, + dst_path, + writer_format=writer_format, + file_label=file_label, + column_labels=column_labels, + version=version, + variable_value_labels=variable_value_labels, + missing_user_values=missing_user_values, + variable_format=variable_format, + ) + + +def write_xport( + df: "DataFrame", + dst_path: FilePathLike, + file_label: str = "", + column_labels: list[str] | dict[str, str] | None = None, + table_name: str | None = None, + file_format_version: Literal[5, 8] = 8, + variable_format: dict[str, str] | None = None, +) -> None: """ Writes a dataframe to a SAS Xport (xpt) file. If no table_name is specified the dataset has by default the name DATASET (take it into account if @@ -746,7 +1361,7 @@ def write_xport(df, dst_path, file_label="", column_labels=None, table_name=None ---------- df : dataframe dataframe to write to xport - dst_path : str or pathlib.Path + dst_path : str, bytes or Path-like object full path to the result xport file file_label : str, optional a label for the file @@ -760,18 +1375,31 @@ def write_xport(df, dst_path, file_label="", column_labels=None, table_name=None file_format_version : int, optional XPORT file version, either 8 or 5, default is 8 variable_format: dict, optional - sets the format of a variable. Must be a dictionary with keys being the variable names and + sets the format of a variable. Must be a dictionary with keys being the variable names and values being strings defining the format. See README, setting variable formats section, for more information. """ writer_format = "xport" - writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, - version=file_format_version, - table_name=table_name, - variable_format=variable_format) - -def write_por(df, dst_path, file_label="", column_labels=None, variable_format=None): + writer_entry_point( + df, + dst_path, + writer_format=writer_format, + file_label=file_label, + column_labels=column_labels, + version=file_format_version, + table_name=table_name, + variable_format=variable_format, + ) + + +def write_por( + df: "DataFrame", + dst_path: FilePathLike, + file_label: str = "", + column_labels: list[str] | dict[str, str] | None = None, + variable_format: dict[str, str] | None = None, +) -> None: """ Writes a dataframe to a SPSS POR file. @@ -779,7 +1407,7 @@ def write_por(df, dst_path, file_label="", column_labels=None, variable_format=N ---------- df : dataframe data frame to write to por - dst_path : str or pathlib.Path + dst_path : str, bytes or Path-like object full path to the result por file file_label : str, optional a label for the file @@ -789,12 +1417,17 @@ def write_por(df, dst_path, file_label="", column_labels=None, variable_format=N In such case there is no need to include all variables; labels for non existent variables will be ignored with no warning or error. variable_format: dict, optional - sets the format of a variable. Must be a dictionary with keys being the variable names and + sets the format of a variable. Must be a dictionary with keys being the variable names and values being strings defining the format. See README, setting variable formats section, for more information. """ writer_format = "por" - writer_entry_point(df, dst_path, writer_format=writer_format, file_label=file_label, column_labels=column_labels, - variable_format=variable_format) - + writer_entry_point( + df, + dst_path, + writer_format=writer_format, + file_label=file_label, + column_labels=column_labels, + variable_format=variable_format, + ) diff --git a/pyreadstat/worker.py b/pyreadstat/worker.py index ea003ba..546763c 100644 --- a/pyreadstat/worker.py +++ b/pyreadstat/worker.py @@ -1,4 +1,3 @@ - # ############################################################################# # Copyright 2018 Hoffmann-La Roche # @@ -19,7 +18,16 @@ Functions to work with multiprocessing """ -def worker(inpt): +from os import PathLike +from typing import TYPE_CHECKING, Any, TypeAlias + +if TYPE_CHECKING: + from .pyreadstat import PyreadstatReadFunction, DataFrame, DictOutput + +Input: TypeAlias = "tuple[PyreadstatReadFunction, str | bytes | PathLike, int, int, dict[str, Any]]" + + +def worker(inpt: Input) -> "DataFrame | DictOutput": read_function, path, row_offset, row_limit, kwargs = inpt df, meta = read_function(path, row_offset=row_offset, row_limit=row_limit, **kwargs) - return df \ No newline at end of file + return df diff --git a/setup.py b/setup.py index b805233..475653c 100644 --- a/setup.py +++ b/setup.py @@ -168,6 +168,8 @@ def is_python_lt_14(): ], ext_modules=extensions, packages=["pyreadstat"], + package_data={"pyreadstat": ["py.typed"]}, + include_package_data=True, data_files=data_files, install_requires=['narwhals>=2.10.1', 'numpy'], license="Apache-2.0", diff --git a/tests/test_mypy_setup.ini b/tests/test_mypy_setup.ini new file mode 100644 index 0000000..2868ef8 --- /dev/null +++ b/tests/test_mypy_setup.ini @@ -0,0 +1,4 @@ +[mypy] +ignore_missing_imports = True +strict_optional = True +follow_imports = silent \ No newline at end of file diff --git a/tests/test_typing.yml b/tests/test_typing.yml new file mode 100644 index 0000000..996e25a --- /dev/null +++ b/tests/test_typing.yml @@ -0,0 +1,345 @@ +# requires pytest-mypy-plugins +# command to run: pytest tests/test_typing.yml --mypy-ini-file=tests/test_mypy_setup.ini + +# yaml-language-server: $schema=https://raw.githubusercontent.com/typeddjango/pytest-mypy-plugins/master/pytest_mypy_plugins/schema.json + +- case: read_sav_default_types + main: | + from pyreadstat import read_sav + df, meta = read_sav("file.sav") + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_sav_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_sav + df: object + df, meta = read_sav("file.sav", output_format="{{ output_format }}") + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_sav_buffer_types + main: | + import io + from pyreadstat import read_sav + buffer = io.BytesIO() + df, meta = read_sav(buffer) + +- case: read_dta_default_types + main: | + from pyreadstat import read_dta + df, meta = read_dta("file.dta") + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_dta_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_dta + df, meta = read_dta("file.dta", output_format="{{ output_format }}") + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_dta_buffer_types + main: | + import io + from pyreadstat import read_dta + buffer = io.BytesIO() + df, meta = read_dta(buffer) + +- case: read_por_default_types + main: | + from pyreadstat import read_por + df, meta = read_por("file.por") + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_por_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_por + df, meta = read_por("file.por", output_format="{{ output_format }}") + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_por_buffer_types + main: | + import io + from pyreadstat import read_por + buffer = io.BytesIO() + df, meta = read_por(buffer) + +- case: read_sas7bdat_default_types + main: | + from pyreadstat import read_sas7bdat + df, meta = read_sas7bdat("file.sas7bdat") + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_sas7bdat_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_sas7bdat + df, meta = read_sas7bdat("file.sas7bdat", output_format="{{ output_format }}") + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_sas7bdat_buffer_types + main: | + import io + from pyreadstat import read_sas7bdat + buffer = io.BytesIO() + df, meta = read_sas7bdat(buffer) + +- case: read_xport_default_types + main: | + from pyreadstat import read_xport + df, meta = read_xport("file.xpt") + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_xport_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_xport + df, meta = read_xport("file.xpt", output_format="{{ output_format }}") + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_xport_buffer_types + main: | + import io + from pyreadstat import read_xport + buffer = io.BytesIO() + df, meta = read_xport(buffer) + +- case: read_sas7bcat_default_types + main: | + from pyreadstat import read_sas7bcat + df, meta = read_sas7bcat("file.sas7bcat") + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_sas7bcat_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_sas7bcat + df, meta = read_sas7bcat("file.sas7bcat", output_format="{{ output_format }}") + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_sas7bcat_buffer_types + main: | + import io + from pyreadstat import read_sas7bcat + buffer = io.BytesIO() + df, meta = read_sas7bcat(buffer) + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + +- case: read_file_multiprocessing_default_types + main: | + from pyreadstat import read_file_multiprocessing, read_sav + df, meta = read_file_multiprocessing(read_sav, "file.sav", metadataonly=True) + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_file_multiprocessing_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_file_multiprocessing, read_sav + df, meta = read_file_multiprocessing(read_sav, "file.sav", metadataonly=True, output_format="{{ output_format }}") + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_file_multiprocessing_invalid_callable + main: | + from pyreadstat import read_file_multiprocessing + def noop(a: int, /) -> int: + return a + read_file_multiprocessing(noop, "file.sav", 1, 1) # ER: Argument 1 to "read_file_multiprocessing" has incompatible type .+ + +- case: read_file_in_chunks_default_types + main: | + from pyreadstat import read_file_in_chunks, read_sav + for df, meta in read_file_in_chunks(read_sav, "file.sav", metadataonly=True): + reveal_type(df) # N: Revealed type is "pandas.core.frame.DataFrame" + reveal_type(meta) # N: Revealed type is "pyreadstat.pyclasses.metadata_container" + +- case: read_file_in_chunks_output_types + parametrized: + - output_format: "pandas" + expected_type: "pandas.core.frame.DataFrame" + - output_format: "polars" + expected_type: "polars.dataframe.frame.DataFrame" + - output_format: "dict" + expected_type: "dict[str, list[Any]]" + main: | + from pyreadstat import read_file_in_chunks, read_sav + for df, meta in read_file_in_chunks(read_sav, "file.sav", metadataonly=True, output_format="{{ output_format }}"): + reveal_type(df) # N: Revealed type is "{{ expected_type }}" + +- case: read_file_in_chunks_invalid_callable + main: | + from pyreadstat import read_file_in_chunks + def noop(a: int, /) -> int: + return a + read_file_in_chunks(noop, "file.sav", 1, 1) # ER: Argument 1 to "read_file_in_chunks" has incompatible type .+ + +- case: write_sav_types + main: | + import pandas as pd + import polars as pl + from pathlib import Path + from pyreadstat import write_sav + pandas_df = pd.DataFrame() + polars_df = pl.DataFrame() + write_sav(pandas_df, "file.sav") + write_sav(polars_df, "file.sav") + write_sav(pandas_df, Path("file.sav")) + +- case: write_dta_types + main: | + import pandas as pd + import polars as pl + from pathlib import Path + from pyreadstat import write_dta + pandas_df = pd.DataFrame() + polars_df = pl.DataFrame() + write_dta(pandas_df, "file.dta") + write_dta(polars_df, "file.dta") + write_dta(pandas_df, Path("file.dta")) + +- case: write_xport_types + main: | + import pandas as pd + import polars as pl + from pathlib import Path + from pyreadstat import write_xport + pandas_df = pd.DataFrame() + polars_df = pl.DataFrame() + write_xport(pandas_df, "file.xpt") + write_xport(polars_df, "file.xpt") + write_xport(pandas_df, Path("file.xpt")) + +- case: write_por_types + main: | + import pandas as pd + import polars as pl + from pathlib import Path + from pyreadstat import write_por + pandas_df = pd.DataFrame() + polars_df = pl.DataFrame() + write_por(pandas_df, "file.por") + write_por(polars_df, "file.por") + write_por(pandas_df, Path("file.por")) + +- case: set_value_labels_types + parametrized: + - backend: "pandas" + expected_value: "pandas.core.frame.DataFrame" + - backend: "polars" + expected_value: "polars.dataframe.frame.DataFrame" + main: | + import {{ backend }} + from pyreadstat import set_value_labels, metadata_container + df = {{ backend }}.DataFrame() + metadata = metadata_container() + df = set_value_labels(df, metadata) + reveal_type(df) # N: Revealed type is "{{ expected_value }}" + +- case: set_catalog_to_sas_types + parametrized: + - backend: "pandas" + expected_value: "pandas.core.frame.DataFrame" + - backend: "polars" + expected_value: "polars.dataframe.frame.DataFrame" + main: | + import {{ backend }} + from pyreadstat import set_catalog_to_sas, metadata_container + df = {{ backend }}.DataFrame() + sas_metadata = metadata_container() + catalog_metadata = metadata_container() + df, meta = set_catalog_to_sas(df, sas_metadata, catalog_metadata) + reveal_type(df) # N: Revealed type is "{{ expected_value }}" + +- case: worker_types + main: | + from pyreadstat import read_sav + from pyreadstat.worker import Input, worker + inpt: Input = (read_sav, "test_data/file.sav", 0, 100, {}) + result = worker(inpt) + reveal_type(result) # N: Revealed type is "pandas.core.frame.DataFrame | polars.dataframe.frame.DataFrame | dict[str, list[Any]]" + def noop(a: int, /) -> int: + return a + inpt_invalid: Input = (noop, "test_data/file.sav", 0, 100, {}) # ER: Incompatible types in assignment .+ + +- case: metadata_container_types + main: | + from pyreadstat.pyclasses import metadata_container + meta = metadata_container() + meta.missing_ranges = { + "var1": [1, 5], + "var2": [{"hi": 1.0, "lo": 0.0}], + "var3": ["a", "b"], + "var4": {1, 2, 3}, # E: Dict entry 3 has incompatible type "str": "set[int]"; expected "str": "list[int | float | str | MissingRange]" [dict-item] + } + meta.mr_sets = { + "set1": { + "type": "D", + "is_dichotomy": True, + "counted_value": 1, + "label": "Set 1", + "variable_list": ["var1", "var2"], + }, + "set2": { + "type": "C", + "is_dichotomy": False, + "counted_value": None, + "label": "Set 2", + "variable_list": ["var3"], + }, + "set3": {} # E: Missing keys ("counted_value", "is_dichotomy", "label", "type", "variable_list") for TypedDict "MRSet" [typeddict-item] + } + meta.variable_measure = { + "var1": "nominal", + "var2": "ordinal", + "var3": "scale", + "var4": "unknown", + "var5": "another", # E: Dict entry 4 has incompatible type "str": "Literal['another']"; expected "str": "Literal['nominal', 'ordinal', 'scale', 'unknown']" [dict-item] + } From 627941c30ac40db3fe8ac9cffe3a08c887394f43 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Fri, 10 Apr 2026 12:49:44 +0200 Subject: [PATCH 06/10] added types at run time tests, switched http tests to unittest to allow inplace testing, updated documentation --- change_log.md | 1 + docs/_build/doctrees/environment.pickle | Bin 24854 -> 27174 bytes docs/_build/doctrees/index.doctree | Bin 286627 -> 857730 bytes docs/_build/html/.buildinfo | 2 +- docs/_build/html/.buildinfo.bak | 2 +- .../html/_static/documentation_options.js | 2 +- docs/_build/html/genindex.html | 30 +- docs/_build/html/index.html | 107 ++++-- docs/_build/html/objects.inv | 5 +- docs/_build/html/py-modindex.html | 4 +- docs/_build/html/search.html | 4 +- docs/_build/html/searchindex.js | 2 +- how_to_test.md | 10 +- tests/test_http_integration.py | 48 ++- tests/test_runtime_types.py | 336 ++++++++++++++++++ 15 files changed, 494 insertions(+), 59 deletions(-) create mode 100644 tests/test_runtime_types.py diff --git a/change_log.md b/change_log.md index 49eb29e..02fa8f7 100644 --- a/change_log.md +++ b/change_log.md @@ -1,5 +1,6 @@ # 1.3.4 (github, pypi and conda 2026.xx.xx) * Refactored pyreadstat.pyx to pyreadstat.py solves #299 +* Adding typing annotations # 1.3.3 (github, pypi and conda 2026.01.23) * bumped narwhals requirement version to 2.10.1 diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 950d86059516c40ec1e61eb56ec90583d9d90190..564b1ea6b7ab3aa614ab51176a876b9f02b6ca2c 100644 GIT binary patch literal 27174 zcmd5_d6*nWb(dD!`_wI2KE{@?SH?SQNj3&wNR}*PR$eKV32{|AnB!rLy^5rHZBqZeb>gt-A-PO#>#^{fo zs#jI7s@{9`>eZ{)rTaTyx7Az0|0QdqDs%nWyyKs6!@#dNew-#FH`Uy7>1G4;Xu9L2 z>FIPdS!GwN>15Jxm4ad%I!?(A(`3CwQj6Vk-m2O$E4zg>>9LN);bG*`N6~WSc$#!o z=2%d1(xf}I{UUSFwtw1odoE?Wl3t#&rYbQ;wHc(Xg^s0WZB4ml$G3^c z8}AK+AU>VHSCyT<7j!+HCb?-Rj*+zNayd9@P1R1FnzLd^L{zq8PW1WYd?RmRR@0#q zMOLwFN0Aey^GOfkCLzSgT)*VZLS`y<6gwdYvg^TaLEWe}HRaAic$3xnFe2#&syM6_ zV~o2*<4B`q#F;IYYbA$-7dQmp*_x#HD63TpQN9G3?9J~#0*MYn2W%d3{iX&<$K{uU ztpg=z%C41TD}+oCiR@Adlk|%;H*^qUjWLI&aV8m|vPw{@K|+XX1X~*iMJp%}uOS+7 z=yK>q%}^_1AfG@;>!TD@Y#02y0BtJP6bR%8v15hKl!HDYXi?QJIw0NvZzyDlh&fc9 zo2HcyX^ZDD=A=tXU9y%zh{_~Ln!^wdIYG!p2is!1FHXA`fE(DPKN`;7w zIfLiaF<5RnRks{WqZgioG>P0=PA5_(5D06kY@_2dAO@&shjWl4LC%iq9E3)!Mnf@R zq5~D%uVSf3RxK<8eUILgb%boT~WH6TX^&l{28gh$*F27bG6*Zr%6Dccl zibz={rwZ*ku`(Hy@TnlIKqZnU?nWIVIp%moq;gLqDG&=1Tsq)R=Q*e|whP47o}={3 zL4D9T&R7AuXa?;Mx={?WQ%NnkpkmLu6?6_QaG3Q90#`5YRA=h*hn z*h0@Fxyr>dx9}lC zHY}m_p+Y&5k`om}m+K%Rh5%xx#}Y4K$A)q6Sh9xKJQ=zq?4)&puMgX(dkXdJGG%D~ zl1(E*2U=lVQlR0iTx+(=#=*RC^i;CPVfBnx=dd&TyYoADjYn?mj6vnj@afu6rW(D; zanY;Lypu^UuLK1ZKAZDUu9Y-XzCUM6t^0g`k zQ+1#fz`_|?zUz6-3}o@?B^{sn1QabVi>hTemMor^FtS!Gv8ihuTtoznkORI^wC8(2 zfh@WIWA~4-)yq-R3?Y|(`70CMC?oGAY~helzpwOtM*YOB=Gl2`m-b zMld8fC0@p@ZNLO)NkGW}0rdn;f?8ay(YCKF!cJ}xLR)bB*xn#d*o&dCiI9RBVzVG^ ztmfL0&nb*@G)nhDhyYB7kw9sp3n}GSS+p>bhZdy@9<&0TB+}$M7RS}-+VSyX$Og80QuQ5okHTWV zdk6LazQIwGk_$P6(JRXDqVi)X*UiB`+S}xoh!(qHfGChMawX454it!v0DS9)94J_g z)cAa|R^{oOArCxflJhh)TX(S?0?PIFCRGgcIM$Xloe#DgxZ~i#+~nTdZq8kQ^KE-? zJ-BD@{{6S#eB{WDSjkx{abkguW>+9L2lr0ia>w3V(B$C3J!Ll^gwv=#Ocotz5)^CP zRwSyx%!ci#PHK6Sr^)6FklQaSi`lX<8~|;<22~rw3hWaIrK%edIUFw`7+iJ0Fxo1B zv|2@~0=pW@qFk%^Al4QEjDu>~IpLJaY9g}IQED<-FAAIWk$@YUONWo6(>eo8Dh;L# zH;n}try((EtkjJHWT-&BEv^wo+}@J5G|5g+AqZvwggD~NRSv>1I2l2Z`ek*#pL-oE zSFBLO;CqlMvXVRk&esLVGeQdy)&Q1TW@T>8fNI+|c?O#5M*RGRRgH6y8-jLRjSm^+ zIAxN3x+MdJ&hZ*q%M7P;vUxy{HD;+euE1h7ps`zVpxDxh3r*&`HtlLtWF34hEA$rXHi4CWl#8N;RrG6iDPNa7Y8Kw zltT-1n}G+uicsT-EIYzECYZr#e?IAjfXgkBuMalttps0>rEJWeSV>|(NHsF)n@`Ro zK*gTH#v|mHd<94a*gRlbV^O*ORM5EaBw{uOcR=ot?+`7VoM8s#f~lNz2jt=WxXq1< zP8r((SP}8{w^m`UUvnc0TqpAi*tDGV__8S_J?iWUC8HYpn1K`9ZW-&ShIwsP1;sFc z!Kn|a#CpORD{2%OSsqFEI99=)ACz_*IW3|_;_8Yj1&pbJg!Vk$UWe9yJ|#A9flJ4&8fVr5>~8pzB8KiS z7DlK)PM#lkKw7*`}SB^;#d>C9;JyCus3QeZatVLfFs3i2>4K z8I~R9l&jeG{Sxd@7zEhHGH}T`K|TY1=I?a;F|1=aml|8C(`T}BCyq;5u{=VIWRRJH z^jjExgiZx#Yzg0#)fMg)rJb?$WX5o?Y+j>z;AWQ1iZT#EL#47r{d0Hm&$4=7o=hIZdI+( z4=om~stg0pWU9DAmb+V_EskqIK5iNt2`cUi08M(cmdSS2P?tj~=)<@r%+wSY2k;bS zz3`=nbqE%5BVuzi7U@VzI{A8m-KDBX_aFQ(Fr-2({_|9c>*G!V+q<43R}HF^+=)(j z0={_Rpe1S9q6$ej@IjFak$j<~RFq%enht_#2%E->!p*u6I}1*xX4!?hOu30&`2OJE zfa47HNF_DZfZOo|87NCuimFc0g|Hiywrfl@1-k_QCqJ5V8_1cpY1^ThW<4%Yj~vBR z>C&Z;8GAJBlDe80I-T6s)&a4z;5-3`b{#Y%Dg(N{4l4K2I--MLFks+Ch_sU2pc~Z* z5S;9~pjeCI0NzVsOOY!vVrR)ke z=6wX_9FlolnXD#NL+~rvxc4yu-^q5VD!bWLDtUDVea55$Ze!b3@@ec+mAr;MQzf4@ zpLEMZ8ufDRyehbXU9XbYWyu@avlVod?NG^^*glm!z;02=TlFZOdq%+~bn2i^-Ntmq zL%RFJI`uQ`b~W)M?5IL?2Ya4MKA+vGD!gz~rS8)0?`FqT&3km87JHGZY3tq#I#tva zOUzNNFP~()K%yx&&405|yYn32u^IkbW)=SH>mdXaD;1I|JFb$aba(ganlIL{(|QQ^ zv6rYO_iNxwb;XzI)C0Qo|JV%zsi11 zC4Zg$hD!b>`?N~_mTvW#c?J7z_F0wu9Qz%WeEf_`eO{-&z`m$}Kc|7es}X%k!@jIj zzsJ6!n*2U=om7T@poj5Qo%%!F=8tshk9F!#*w<9!ud_c@$#3ZLKVyHcfZx<8|APIc z0)C6_;>+c)bc=6i!})9WVO8%tdSU*Jp4Z>9zf;A3&%UdY-(&xvlK;g1Stb8Xb*{aI zyR`35)%kZ-hkgHy_bIVG{D)5cU|zxgQ_J~(u^%dt{%`g_s{BXne`PWmknSiS=Sm1x zPql<=OPp}weZ|WBKlWq#^;V-Vt`EIVT4r6e%n06%1XqX3nMW%H-h~nz4ZK2+ZrF>| z84l}1%In7;o*O_y)Ey-Fkb)0WZbaqQP;RZtZJ-=^w>XB4l-s0on<=+N=8_>XJuEC? z7@y|z^3J15TUC?uDR+U&T}Zi$R4zxki&gFt%577*?MO_l$o83RPnBd=5ANO@P{53jLX!>>{)#E!uH#$gZU1B`Ha zxuTb+cQqk+hC*;H<*rk?>nV4G%H4>B81l0TzDL3LA|Zx#ldiFkYV4;!!i4c|rt|>= za0}8(7QN?C!L3H=bIsBTDmZAA-bU$318|7acN%~fAgxxN_d+VT%P75@(#H(IJ(RW# zz>AR9?QLYl1PeM)##6;;R#BgGytrgXXB^ zDg5DU^IjyBlJ;I~WRhWdj5qK|weFoZ>UsAeACg6(@vyiD5lZQO7m5qPaH=U` z;f}l0qR9JKDhHW#tl(*MEdwR;;%Xqu7t@JV$!0lw4P*$5g!=`zKr53?jfJi_k5ie7 zwbTs}Z#vPdLrfJ|*!QTvr2$vwJ*Hu(AWhYbE`HOAj$}haE8(F{CssH0Pa%V7&^W9p zE&=lHcvZ8&U_y%{{`v5V;5AGpO3fY(!S_ z>t4D!+{pd6F5);sB02&m$SGXH^w*hjU}7)h?o95=VXMv_Bsr)~$*}7YDa5uTY?6Y| zEER=TOM2kbw-oWSI2rVu6I z=V}1))hbL0S^&N@2qa;oh-uc#aiP0`>KwPj9TFJXn=0!S_qWXjL)AGI>}oVS%OJfg zXbNNWCr^LI@h9mFI07-I7oQCgp9xM4egU+E1-azo+3j;Jgz5kRp}k!*pE^?5kzYA`A!+G zY$u2K@XSp6_Wf^+>irfML)0j=Kk4EZfpO|R4|t*i;xmk!P*PQ^TwHVFO0-+b1f@I0 z4un(>;{LJ>-M&E&Q2koc9ox7UMaZIe6sT*32%#SVf=S7*qNgspMXV*o`m6nhPpQ99 z!_pB!PnrgDz-Yei2B=<`A1!t$k4--G0_$l)r5@T@z2A$W1 zvDHFX%2J=Wt>ctuyK0_~2Hpeohxc_qQnj}Fk|^%eC{A${UW}gw33eI<;J#Qh8My?{ z6mj{m-bOfEpS73)Su0653@;uc4;dVgOIpX{^x!gAMyPf`Zfy}Cn)L1y7jV(FxT~Ko z2L)^_UCb>(TO&0nv1mY#2pzz-g3#1HA+~{Ers#}5EJtGilvTZWA0_G}v~@dV!F0)G zn_M?8zJeK--@uF;U%;RU!NCY3RWViLP%P1SW~PamznM@khj$UtnX_N;&S`__lKrz9 zMU9Wbo5Rn7?0?B(1utK$fG?e`w@Iy;JH$VN$nDRr6Q!~eQ}{B_JSnRsIe(kd++*TH zj4|U%Gi_Q*U&KI`#g1$#J-%ENEwf|PTP8m?9gyFyL=EwLV&f3J_?IV*7Z+?3-^Yw) zivqj2S|82K_{Zf^GGoT~IEqE}+UTMpzZ@F#J+50ugJepwZh!Om!st1G=;VX$j8nG? zHmq)U6-fDAhlYZABS^I;zb$S%$wk{TRvBE&>zOpIrNQ>cvM!pT&>vx4%MVl1GZJ&g z)jp1S8C+e)!dZ{L7SxHHk;7{Gc@pE%9d-PCHk!7l)tdNuefu1#xGVGwtloE<%87MLt?B)~s$;n_JKjD^QyFvWki*cNz_`R!bp0p}{i)|)q zF3pnn_V&lpqU61$ZOl!Q_mk%N22LkB8&M!_k>Rt#sDb@oJ$LqhrES8r%Kpn2*?Sh4 zR5(n52!`%A8s4-PZRfXOVPmnht8e* z5425^Cyx7=P&4=MZ+}27a{qMOn4fa)3wb^ZX<2 zkEKPPf2eKDPdU#AxO$wWk9!)p{;hN8`ZwFAN2^@Fcqvnl&!(C0-)Mg{E%NyW1a3i(FsbHs+ret~Z$V{Zh8_kQL)T-nYf1bps_F6N@-Mq5{_Jv5 zG!lOq{38*d0J&iVP0>xZegITP#7(S=k|8R?ZMTR@qF^}z!c$ZRXheox!Pn0pD%C-C z$LP6Jx&^>j)d7Na#iP1FGDwk7fbj@N9{0FL1wPe5`$RA`k87m3z?DS|VKnLIFS15+ zl>)te(iH!lw^UKr5m84+*-<+qjZj;_8Iig`Vy4^AB;A3@McZfhqt1!o3aUiO#uY)QyL{5Aoj$mTd z1|gsn^DZKRI32%_$g>FqclF|N8X4A3B_*gnR znyjwc^m6nCBDUu`BSh5*6G@ZvmyG>kyC!3hy-R#emnJ(@Tt#k_$EfC9e__P+puGLct zM5e!qnlBzp+PSSDUs%QsGv2C zcf4qY?09sGgpj_ZGZ&eGN07#eYDouP>ZBcGEwnB6-)^Ct>bBa|{L?L?(jcB-w(uIE ze96Vwg6P5Stm0_0VZo84i+u!^^ozLTn-N$(hk(pc{%MA{n|6XOF|u?%#zzxp-9x+x zZDjLnsJVRaNwi*M<<@T!CW>pt2>2!=M{qVAd>b%v+|Z0;sl|u=A~l=uq2@j6`yM%n zHng~jYu`e++E&db#sdpsTxxo>giHjtE`(qa8rN%B6U)J6VIdW2VmY)BmZc^`OV&hi z`$7oLt_)2ScPxZrNxji1Fn6|%p^+zdwT+>X5ce#Ep#}A1Qo>#UN6ni86pE*cAMZHT z=)aBsUk(eX4tke_ulq&rJ172;Pi1R;7LCMbEdN=+?0CkD&tK!ymd!adhkHL z_!idt3Wmr-^@_CO#l0o-+}2iMOOv@2h-d3$*G#!r$M{9ma#Z zve&w<8aqzb9p>LH<{Emd;bS$N*fP3sVn~YMtN$<2IKRwCfgBA-jtRN1QSR%qtfo$A zo%Et1Ka17y_`G=~_Se)sG;T;I+l{mv4Fw7rHT}%{L6lN9}prBM*#3)r1v1@e^7FhpKkwUdaDAuZ=EX(Zdz|LgZ!JXNPF@|cQ zDRoU-??_^5Ytp9G#Kfw!+D7evG)?-@A0KRMqBZG*CQY0EB~9DdbMF8<%nt5e*au$b z?3{b=H}{-x&zUplzI}}u_>@V1KK)2GcQ)N&V=4wKY$elLc)7bLAoOaH9MvBZIG-mV z^ISlSWN-noD=2qrku&LaJ7@R&+$WLO(X!~Vo?ZBv7`c@1*`@mBprfMP z>F8bN^0+D;0Wlcvb#w*8rHYK6E-gW;N()fxl50#Yy1rx`Q;&+uwlR;R-DR`#>r+!w zlt`K?^NO}dlkV73QlwgRs%&Q2IvDXgrS%}(nq8^|8OaKWis}(np<6@R!o9GS8ss9BcZMZ5D5Ma+5D*!Dg%brKSVIuqBM>5ika!R#Gs%1@03wnBUVBCj2?oP-Zw>o| z?CTIrP0Su0x*2`$e3N+{`71W}5p!My{kY8W;wKXb-5h~p8^j}?6sc20T4NM+M zF5_@WEqZC`^xV>nc479ZZ0p4bpHuWHct4 z$X=lF2b5F}NMFTfR`yeYSR}4}Gyq0JqVH9z#FY$IatSL6r!4jIoNA)x{rgjc3s|=n zhnn|joINIb5xKPM7=`;F!_k`#SryV5{SA@;}jE7+2&Zf zNd;y>(G41aNkWmH;S}yUQyAr?$FJ1lWw>0xNVpsz>|A;(Cd1`WfmpDTMFTKNSjiz7 zt`}ZB=Jd8EE-y`S(_1x-M+h(HHk6p7WjPgy1urfdfF$rT;o|I<#u<8X7KqD1Tna>L zW4-I%zgA8lR=cc!j_KjYCMJ z9B-a)jub=%Vi74X(*R5^T4G-;SCT->XEY8OqGdL^<+G^EKBj`QAm=g-KoZEAa2or1 z(@Z^${T`o*c=7Qoweit3cIep!=1BRO2F@yh-K7Dz9~lX@WJh%xqitQi<(43Z^)?dg z>N-Ys`U#RWW;dt-E!#3j?@KOZ<5zbh-$*2Y&TlC&_a+wrNW$fv(aLDste6G@cg)9Z z>yE?OUUY105%VCry!BhA8NJf7o;iWOZ~4aNVbST4K1ROt)Yo?Sml8eq{X@0uwF%~2Nhd+UvwV=Vf?TWQoBXHg-)+^Bg2 zYbx{L<4!ZezlE1B$%EuSN_`R>$GeQ{PqFBXuPhH&Gsg9&bv3-xN2$+Zb(L}byDa+6 zx3te-#|1DllG!=bk=OcF=-Py(OQ7AONmoEfSMiMOM%fn*2=ze~j{6WCXpsZ9!!YD` z`kiEzBK-k}ZVf5nNNPw?Nuce}VMg?d>ce_;QkaGveo-i7a?o`_nwpzI8n4nckWwCM z?wp%n2tT2jYZ^Jw*v5D;9 IU4J$6KS3OD5&!@I diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 33a5ad4c661a7e385da255d84b4458a7e70cf6fe..82165ebf4d2a873d71661490494a507a5c38a4cc 100644 GIT binary patch literal 857730 zcmeFa37lM2nKqt%X_f>q0mI@2BpdU`Pl%ghdU;*s1QmovKQ8RZ~lnR*2w& zL`&Qnal}#FX2ih-SC~-&1yM&uR0hX!8DSj90Ui9rzn|j_^MB8B>zs4z)Kll&Tiwlk zhTo4))vbHZbKdv7=Xu|=UqAPj88c?iVE@$*94-yjs<}d?zgQX$D--nv?7?VQtWLah zqUVN*>n6JE3(J{Zl~S!d6i(D<&>KV9Tw%Bz7ALk&bZ2MO=MR-ejRe`b^@qpC%VB1? zQq5F@D8o!OS1JahnMyS*2P3&c*cS}ZOVw~V7##1ajAe7h-7BxD<%V`pvT`+`mtRJ| zU6L6OPFfwDaN3&HC#^Ygb#UV96Hf2%y1G;ghBCzBuX{cHb z!)?KEt{e_kb34QSiR}EX6C~@LtHRw(Gym@i_=X8q+4Xs28LHXpM0UT*V5Z)csaDH5 zQXE+ZvxM2X;R@9{Re2#(snA3EJhzw`6`vLi*T&SB!OYN(ayY`@S-5+&u%Z65uEUtH3Uw{1izi3Jz)ZI-|ug)Hq zot<5NX}0^)+F&NTl=PfEjErp={eJ}ge-!;6Y@MiOUzqKu*N+#kXIEsqFPhIqTEJ|+ zR4Wc^1s5{a7l~HYpBWyO&3nEy?xuHJ0%w=h=W=aQwUcF(bE2~M&lQIXwc(I8WM0P$ zMl-vI!?9|1;-Xn(Ak-|Gn(GVKQ~RQHl{Hio+Y6<^iM{oC+1&6j@yFi!0Wz1yg9XLf z=wMh5hbJzYQSajQQ7IJ*Bqd+DtDG4d z3(FIkxO&er)l1b8HndVdZkMoxmDSQpWeF=QDD#Gko z4fhHfR))GNdQd<7lCVk)Sj_~N4d%(PgAHM2sGJk3=ajV=zoX3X8b32EYK1(Io8dxY zj?8w_ZC10b`gP}KhOzh+Qor#VPTj|PU>KqOQE!UgS(brBdvKc znFQB1*YbXYh0@TDfop1|s!mj!Ph2!(MsHB0rz-JH_FEx$sO+e^;+?*3_m4s=3i{O~C#JrIE&C z_PLSGAh}=4k{VheH^c#14x^>v+=%=h%SHdmA*Z2Ip*C6^;NB)!LsnAARjR=*atj<+ zJeLI$?^d`7B3U6b7#1p)bmG-O{N5*(p(W(`4pd76S`NcGZqk|ZxWG4xMuxj192c6D zKggu?%g#)p7FI|vO!EU_afsAIjf9C)A)cj=4S{&wL~ry_5H%hQhCw(wRvoAGf-?uC zpe%!8kSpr?;H1iHi)(;^%0%VTF0P4|DcB4B!386YmdfZjC~=Mnc99shN;piqsKK&?DV-g%e2gKNnumEqnM%k4 zJNYX4Wg-`H(3ECZwnQe(bj3)5Lc%O#dZL*TY74u^N)%Kwlco>+C2kTsGv!=nko3=M zBVMth26z2KWoE~u zVT@M^DSplkvldOEtq4>rHDXkePk*qHWT|8-rw!8ELMT=fyK;qs%CA-=7hPeP;#F#p zyyCV~WLxC$q^b-Hodyf6uII-GG}hPx}y4nE6pln?Kzv-$&ymBM?)3@k(rLw3cP#7 zw4bBW=ZZoO){kPHA8JCZ@i77?>BuUW*=R3OmCKHej?OBYS?Wl+G|E$O`(Z}GTMkuf zshrzRmQbKJ5$S1sEEI&v>zA8{_(`aUN)Wxv8XJ`+LXPs1&63&ca5z}oP5|43v09lz z_>ecmsK1yDv`PiELNePU*H_LAiH>G)h3uF1=SV#*iW6K=46a;vB{$eBH(hyULpZXj zsA-X}p-LJq)rdTTZlbxcoEvH?0ufLT^Td+SyN9wAB~ekzKX@tkT-?~D>m`d|mO-9^2YlR0RBX1ZM8dNC`hpdO z(h4rsifnF$I&FEN-u|&;c(r0TPQvoXPE+DRZz? z%@SsTB1oQ-Y?vW2;3y3|FvRMvQV~OVuUgkby#!eg zOu4%9NZ!Z@q)=4ljRt$wx~ta3YK}ZXR7p+s!pwz{&p^YElAZAf!_+v*8SBV#T*mj2 zv5@W}5*)}Ba@&i{v>a8(bs=RDfdn(r;ap{`K)ylCtq_h>Y2b`<4$FN35p|YE%F02l zxT9FwRn&{XEF!Z#9N3i`u4YpeL*_)>M>**bvV0wYh$L--7^OkFTA3P;6E)e@*vO;E zJYS~JM;fD0n|-JZWr)5F1&)>nDC}yGp=e>IE%Lfy?U?sdD=fMltre;{8hTtwt#FLm z75RiquIM2{jZA`bJWnX&y6&M`nT@rvXqtu8mD(5!QK>O9qPue4OWD8VNqhQ(ORiAa zP?pT-GUYPkDn9nZVgM>aCEOX7GlhVtk9ekmE1N>2qfL`sDySk!b-Tek@1sXNxpxWq#8W~*3iZhU_hNIfg^_Ndxe_NF7 z`e>vl`#w36F`1BRnBsQ-VTwa&nBu+hLAUq_+k51g27CEd8qc^blCOR?p9)Amx)9gb z=cK+;=c|c9L9p;8hJu$Bw1!k{9pKszmz2UxvTi>WmEi9&0(cx`Ni+?F|D`){!=O- zX?98l|K+cOLrJRt>#73wvZ;bCx&<^wCscP;dT>4@qrWPLCCJB-=P}htakmJ@VtUFS zMDwOnRg((a&}aS-hUh#+6pb1mmR*uxL@8ahO7F+Cx|Vk$qcKM|s2Fu(T}CD2dh1qt zOPR6KOm8C1JfAeP+(R?;eoQkb`j5B9)p52`N0Qu>4%Q{o!7|dpS`Qu2`=$;yv-Ja$ zGlES0(#aV==6&W)jvmJr_P4&_w1{++~vDx4-n>lGQ(HmQ_uCUS_hYHKzt^L= z)B9#~ua~3M2FVr?i1`*aAIO?gloy}p6)SBlD;Hv|DF1mTI$JEhcv?!M>fr7~b+DZ3 z;IkfeK<}G%u=yBDJq>F)HqxA#rFy1jC5Qhyj+oi((^_NEFIxQ~w6=Jkw%oL($l&2b zWUzwB;O{-ifZjLBpf1)Y@pZcP#Y(YukpBfMsG!gGX_b7xOe9|~$@heZeDr=yzU6K! zt>RMtmy*&o2PNyXiDW&VWc^PMS?PUK*3AoN&6p9b4VwJ*VpG3bZ0gsFO~*>H4y_Z5 zS@b^R==egy|MkYPc=JKiz!;BT|L#JGcHHqvUHX#Eu`g;#-DIpY-Nzh_Wn*kdi&$&h zYK5sbE3$;_!+&bKk31Q(EZ3=RdOzmLP9r}Ud9vs7D%a=W8rL}Q?^7jTew$>uuu$dV z&HGfCT!ktsUYUqXP9QGn@!%4A-{g||^^M_WZIO10waU>#Xe~Fqt)WFavne_Wj1Kl%*w{8E z{KMkEkTRxSMp?Jwn(fL%gkG@2!31}~^I>$xspjt!QY^!4PYP6J^ zZ69I}X~$`%P}#WVB1JFDbGUndEVF(YpEPP=S=Sp5SAx z*~kvgrh1hMS9M!IJlcl5QXJs5QXG>aPApT0r!`&+bTHL9du@2{=7yCem>oLD&qR+P(9^a#ct!qiF5Hbrk}po zU7s_S$(1MSN74?_S|L0`JDjjzolZAVKSKPjomi*;oSk=Rbs|GY=jAuE66ysN#}VeQ zrst7!^eW#xb|40wrC9ITNN15;oZCVB;rXGFY;~0?p;nrniTY92ANr#lCfb&l)H;V* ziWad%d$`xrQK$6FK!wg_$k5?)MpX0s2%@_;Q{GOel=SxQ*u_5eaJ%THd>8T5>Hswj zqP}s-drbCNW}vSVufL`NRKLdSP*7!A+EJloeQVfhq2jPL@}uf4%`i3l z>%M3v*U~|#{IKqMJ2e5K*d*I(g zeZPIAxlhM6m%ocWi9}h*MTyI?AZid%$<+f@)~~fG>jG9*QP2eprF9t}z-2s`myw+> zN!}wYvlvTP`l48)!%oF?^ zDJc4?@Q%QEGwA0gJgFmr=cyz7dj0wQ3=--G6vKgrL5gm{UgJkPsVqltZKu;5M@KUg zH!<@22a=q;vm!sO2`k+EPOd{bf0hnvCXrIQa`KhrqDm64jXAjd!Fm&>$ z5-Bo|gsGJ^T@0;Br(Keog}~G0o=C$N$g)zCNgBT8tE{H`S;wWD&WlqDwYf!hFle?k zO!3>X_(h&ya}XDmH#!45KThBg+ek~u@6n#sS4ZASl(3R}6`c>o4m`b9Y#m=4tURGF zSk)7(Jd5ms9bV2OtNep{CUcl{k%5RWs=miyeRt;{p`7yHqd!Koid?RAXN5*4^_^25 ztVm^ZH=ln@7yPhR`jT2Q$bO0SW%;JT$aC164Sn)2N}q3RsKOT3nP4wHe;A>{%yl48Puy2Lf^_gSM&hi$PWJz8?=Wo-s*CGP`D+rSRYs#X@-N+DF zq8Q4gF@ngNg{~=@*`JQGWd{Tg?52^~CbFb~)7g|rllyOBk#x?Y8y>=u;nFBwgD_E_ zH8xHsz0(6e_L)D2a^b(zoebMUI!>RX)c2zoqJy^RZ1#l|NlTZ)eFB~GKfXq|5bhqB zFSuJM^|SO3QIm^OABGY@rAm}{Q4SH6)Ms8BnJ0Zx_VE*p@UJOIx_-U>jEcrwX0}_b@UwCy_20h zZ?1?bA`fEDH$Xd)jn9Z-XRdA7$y!ad$6yo`!FmwMYK(&HM4-?F&b(Za-+7^NhAjU>F8rUzm<(#CU|$q2rXD{vODxrOKy6xtxCmpkUy0)zc+sx{na}hDuBuFp`RLK z24eU_-r=BmqWWAFZRM?WC0|gr@kaOB(416^ubQ2d#7V(duXEJ$4NL$!SApq=pVFnN zN+~_Roqp%T+uivy=wtp&`eRgZ{>Aj9Rd{E8nqRJ&Xa`dj~p5@P{kCE?`{svr5lRuB8R2f8EtaQK_zgvVC z^F)^+-YJzKNd6us$$aubA_VzcE*Ojc^zX&eN^vdC-unDvDf)O|^mrvdl9WP|{pF9* z_k-vS+2gDqJNE#D>xE5)xtYeij|tPvyOfQnvSAk#Ult9 zJqt~k0+jKHwPMX^S1Gs$`4oyaPqugWktLVZFJ&fzjU8Rk_O1sSG9aWTw6 zjDiePqNFg)Dg@W7c1jI%j8{^u!-a-(JoJ4t6d88wB#KM7?!6cVb?ZE2`4~oVu${B1 ziALdAedg+@$?TWT`m>Kw_%aTbNOlmT2|y@;oPIQW$XtNa8Umc&5P*M5D!_THOV^oxTwk;e zl=bCkos$?5*XAR&>9f|$ouW*dJ8-O&g)UyA zYwE(vK&C=vVApyMu0%9S|y56YQaZ3L2y6 zznE?)p&MYftPt8=!K%wBC%*};p>&xZ38oS_zs#z$?aO>_wpybLbGB^amau^q&u(N3 ze3bn#MX{^7!?Ii&m;a1D6W3}n6(1O0TyOQWik2=X0zo4W_YzwEKKf(OP~_|7x~fYW znM~o7f7GNWWPD&uY%fs1iV+v}K*_$XQEc0Qf#ax)l084b@@pOe*<2?A+Q&Qlc!%A< z_*~!}If!8lbesnbH0~4|-y04w8YHz1kQ`v-9d+7bPgS$r37aJxE-6z|$8o&ZV-z%8 zB2iq1OWuJ|P?uMt7{eu}oAFAc8f2`}_};2otn*Q`DYe#r{xB@E-sAHdWML>^E~?eE zkG6{9QWinW6%@CNns%v!d!RsY2t}fpD|(FmbDD@ziksnwpcF19W>r{|ueuB3B-U0(e3faw z_NMqCEWeAMT$uqwVdaarr3PFrVifBp5yeVY%J_K#i&11vPhdL$)v>yBLTt40(wLSSwS;{*xT7n65A!;g?S?)GzVq=`c zS|yD%(E0_XlsmCf5EFfrk~%Wc-(nQRL=we?iN20ekU2?|R7~_E2tPec^bfp_JebHs z-OoUIArnay7bcq31zja#A`e*>V-yF|@nNE)Fj@j85~8MJqNCeR%i2ij5KF3vf2_YL z>NyQ-0a4FMl+=-W&c!H*dL)Vq^<0Tjko`!MRMZnf`01gZ46h>(>hVzbYoNT4dL)Vq z^}Ge6AnNguCtEcFCw!M(BU9;qz3qo(#|DVJBW}j zprnq3v<0IeLXs#hgp|W5$f_htDnfcSgr6Ql+QsY0gOEJbeG8NqhC&j>g^)gkQ4k?{ z$Z{7(aWEZ&klKs~-HXu@P?8We6(t=G7OUDwXhHOT#5n4KqL&|HNfEvLfRZ}W%fDh2 zL@yG>gyh;J1Ag|&f%d0R7G7*Vlcokt9av^%$PHw_j34Dquf?3PDy*bQew%y}k zb1d`a#)!zTG`=gh@&PO?aw~sHNgdtFCou}*5sBi$iC@Af$VeoL;Z_#McaumJ+sTF> zdaCsLFf5B+`F>NH946tE=HJ^Y%)U(R30Qo%?n9zjwG?x~zlA7?m6XN>TXke#8#DI+ z6hOG>$i=7+!6?Y6t+LqH#vF}NPy>}HF0!n`C=Rk%ttw97YaxuQS#{RY3oV&006KaP z-g_C87dm>0;^OE-jDj4!hb$G0f=ooBxI6kAFjfLbFN$E+vTknAm?B7L69i9D0F$&@miQ>W~pT{W3P$Y`s?0uIkeI3HSn-5p8anHiW zYZ23EPZY0w3X6z%?734uG9=iU&P+UkV62*m7<}HFT0U{L-S)PYc9PGv*l@@239fMI4kckj66`34j zIhDo6CSB^ih)(oJicikKQX)P%jgmU@$psh%@rgun;ggqP6l50?B?X`4Ao#TKNysb6 zgHJqk{W>TvO zB4V4^Q$;vm!)ic;^A$?!NH{;hD2Q+*iVNX9j!}@|NECx`4r`@-sdnoi@qC#`+h_g^ zES4)3HH{M=Xdd>J^iYAPZMA5hty!=bh7+h31q$6>b7NG{CLlSLneyKf=h%sCJtoZYb zSTo4+-%Uv!9sf5m3L+he;zFQ5#3;z3B#PnqQ?1DOcUTtPQv7CY(yYk%S6hYIef+bq z_|W4?6f1wnR%Gmd5Q-!cD=E#246BapQ9%Gp@1i3YqwdEj$f&Kd*rS3oF$!v+62(Q9 z3o(j=ELN+EM+KW9jH_8SMcS#N0-+_-U%;rqgZIi%UKkZf6ql&rdW?di0uNbk#wf@{ zB#L`f@Lr6SASw_=Fl$-2H;1U;c;(UC9-C~72o7#eA4LPUpHw99Ijjv73EV|V9V3CS zViZI)62*mR9>FNciX=+sB7rAhS#;}|x=7$>whFUH0)K$Thh9#iSUEcu3CunCITs07 zb!3kOo)1g!q9YfhUV%}NQCnrPM*^o{6x2W^ii<4kF^YpMR;!9f0+&M=*S6Q$NI+=G z^bs%;@Zh~2P+k}bNEDYyU>u{MNWepuH)0fIA`-5zJcF?ae(BNIW(m z-MyYZ76}+XsYu`xSQ{u3_!uR1j0C=jQ4rBc6c?iTCPqP4BvCpS3H%tAMYoQriv)gX zt1x>c@H8ww^l}o#%Gt3<;8}>0SV?Kd1gtu;M*;^Qg5nq#9l02FfKiZ9TV=6F0{s{T zHBgD-BFmW=#X%OURmCHL3n7fFS#>rN5Lz;Q1dIeccyAcW3nKxE;t~mzF$#(VJY=~Z zqaYKJDDIKK%@`{|Bp`}l*0OGI)<^)q-r}}E`vpA4ZGpYsmn>OZ*Ib^BHo5(As5V_( zFV`k<63)ckL4|4xM(n=repr6U+Y-g9r$w>btTc^13=tD+tO>D`y6cPL$C-VaBu_v| zTy*E+Cw_}j5DB0fIygFnSzRxtiS|DbG;t-_Ks#Aa_Soc*=OvC!ga$Dwv85IAeoiY9 zsnq%N>G157_j6|F<=4-l3)u!KD{&*|N)nHMy>TMHk$$RoMK_YwF3iKRlOT%mgs*9I%b#OJ<1ji>9~WpMkWO3-!yKg!)HXZ?~y zUbtzvB=Ka(A>DbWOA=Q%GSM#z^uM+6oJKw=ZY{JI<}sZP_U^m2@XzYD)aNt{$T`2~ z>Xn6?VVi`#+p8#PQ@FmS5pu54;<6Epf`%p}ic82@#V9D`lqkm7;Z$5%cq1%w;(#^H z=-F#UwYn($J+Sm}&_bfP95eP&jDn2ELzd5D6l6RS#oD86y7TD)h?BU+)7|;xp{F0h z@^`Av{}rQjsLr3kC`s$wb}`zlC8#r(xY|2$F`Bh0+J{}1LMhvt9X%mGa)R{86iEZyEyyfjPX3k*$ z<&BPuc_*RVVq-p3i$`WHMS%$v@mZ=t#}43PjDoCJqPVogqc94xUWsDp(f8D^)ev5< ze6LBhR2LQYQJHFk9=q2))O{h87j^|Cip!k!W{iU7tUY8I!6*)_!g`bw2W;pC3R$?+b{}ZB8lR{M0a2mWKI$#6%+j(gr6QJ`U0;b4<_&Sz8Jk-4n$_uGSqPS2`5u+gL@sQgXR0qM{18?G3VPm8NgbKzE{uYhN20he&%GE0nU6$C#XOHd_~~Ju zZ}U3xU>*;3KMCc9%p*};nCFie1u>6@Eb|Y84%oqT4Ca9s6)wS833x{cnu>RxGZz*1 zW9=Y9>ZPQPgmflGL4+hxTnOnxjDoC6qNF0ES3vmbA*9W`jywp-L)|-}ypWJ2iVGpV z9-|;a@{r{n7{$SK3_@x%9&|fKOF&6N)Kru-DHj#qgC#}u@;OTCNG}gz6hto)#f4rT z#VE)|B#J>V$u27VB`ic@l1VdJ{)DI~7Zv^qmL5`uL~)rrTljn!T_AJtkmXQ}g3Ljp zSm(~-JL8UnFs>Ee*`0Bs{3hGLsUwe8b~cn3nutVk@hX>K6y#MrWZ8mIkcmhX!>b6> zXmN&K4r3+oDWV8wE$jB?Fr_(J7Ztu13ya*!9!l!yR^EnD5RXU{7fyU1MnOg*Q4F_| z>R7x_!LsO;?>D8H=2*NtZ53u;ul4{eK3o7IQLL04Td(##h>}=IXXNA^WB{|Za* zq9Yfheg>l;qqfRoUnDbYSz<>oQCwtMj8Pn9v07E!(H{k2T+OPpj$UZVbOF%Od+^@r zP+sWhC5nrq--uC=qxX>IDvW|mM54Gm`az79z|o5$n6<3in}egD%!>+NjRi)|eitQm zboP5O3Uc-m#f3|5#VE*7B#PneeU~iV0payJ_w(;*E-L&8uOp8kDi3vk70L@aMxwZI z%p({Dag2v7Kf@>vreknSn<1)SW3&V;BScNbGS8Wd3g;aT0}n(=vnZ(}B|Q(LAWD)b zE|hc(MnQHZQBqOT$q;^eC}}mXBM(aQQ1_)!UPwt2#f6eyfl&}8dB~E-C=RCMLrJ?a zS^`QEqNbvx&R$gbb}S;|mA6n*M_ze9MnSwHQCxWC;}``QheR=W#qXlRdm(sYR!MVF z;otEJ@*outUH>B#7m|uZaUqpoViZIw9NDzpLob}Jw|b`8y7yg8KWfN6Cq+MJ~`gFWpGWPuF7jZLq#53VziOieS~u6DfU$D zE&FS%1H?8TqNI*&^Er%y*hZqbu+3L73bGoBVrcT9Ce=%QTZe`%*AqSp%i~HwO{2pd zx}NY6TlLxJXnq9+f%6X%>n6IhbL({Jps?lWAR6^R8Rj1_=CPDvMpvPB z4WU&s`^?JRBVkB^3{#+(Z5@uYdsy=Gaj_gM*@eqjU=+mV9>%g6qo2Az$hp>@Q|e+qd3T7L`D9EU-ve+YmM==U&pc2JJmM1WZgDh67ibn#! zg)pvW)!9fuXvy>uFcR?Kz5QO0I1-R3E|I|VF$#(VJY-pcQILs96!%Er6pWQ15)ef& zYgxB9_ej9$;CkE0Z{o}8F2&kFk-&wN)G-ox1x7(cBT-z4CXZ2&6-kuNMFQ8tvgp<^ zb&v7Tq1#kF$#(V zJY)$l3NjIi;vNa~W2^*`fGC1l%euW;BLVz+i_7Wk_pDeir*psD#@f1?E~mQ$s!bQy z%eAGuobCcDR8ufw_iY(ie#qMr#j2-8n@mM(_iL0OVq%RoAtoHJwCc`&Io<1^Brdvh z@e^;yD2N154cYFAQ}c%JhoFfo$p+fVda}nRpMk2|3nh+&ggINUjhTGo#_aSf-j?6A*C(*9L>*)v!YUZlY%w=XQjQ zPqymc`3vmHMoP}!u#F=gVB{UKMC_>|hd;pf2>Z9cqohp%yZw5)xktnPEgGDVC@w+g zAs7V(of5?uJ)DZ`>5hX%)-dkv!kg|!+r3yHfKZ96y%YCh z$;vmIqJ7}yb5IJ{DMgJWHmUGch>}=W9Uw(hNA`~UW3cotI&z`jUtkmm(=}zWPb&Nl zqjabl&O8Q22M)4Wsn^yF7eT1RrZvUQ@K`8?i-}nk*5s>BfH;Y@)e&E1nyQ8cqK-0Fke#^dsEC{lnyn;5=L>5#cEl$>*=n8P>GFelCGx{?#mn%b?60v0MtH|>@O*)W54f{7zG)vL~&_=U&1KJXeEl#@AEz4>0t=3 z*SS|8F4e7cf6wd4W2>@j|{ zAVxvdBT-za=ld81*^fj?MLoZO@Y6#*Kj(GiK|LPo{vRkWq#lXlLOln(5QZm+dOTz~ z9HTgxjt}+pV6+6(BScL_JyU%v-8onZhjw938Nt9ktiRxgj3{o7_ z?LtV$ViZJ39mV7#VE)eJY@MiMnUEv zQLIyD@hx!=Kp58w@9dU1QGSzc;M9>vEBh&w7n+Dfaq%ioVHD(5JY@M#jDk!=q8MHU z9+R_RIrPQ}e2OT7SPShS!6=B5B#H|q z-H%a_T}hNwl=OWFKRuN6Fs~yIO7c+muc5qdS=6|ZPN-dK+d3$0xsR?2OXEsCP2<8Hx{q$mR(bZ> znVX;>aOOdx828c5Tfx;CS!VQAndG}L9=eOpDwTac<--^SnWR85TR0qD_psr+aj_h1 z*oDErhEWiMd&u$wjN%}R!Qhdl$eZY*ugY*9$9M_2TnKB{wBB+ZM%bSd_t5QRh>jM^%Tect`m7zH&@iQ*#5UX0=( zi`A;)^X|7o7+14uimwDr!t;WKmP~&EBLffKy9>$-$BHD1OJr~_MnRE*hb-U5D9A)4 ziV+#W1$O_0u@XcDq6lU!>-Odl6-?VbbkAUIph)0pO4{UD?B_?$IzDkEAW>Y1W-&%V zRwPk67YQ5#%c5Jy)I|bEQJI=5%pM7x3X2cDoJ6s5b}SOu08tVvDNQ6`)sa0C*bGbW zq9Yfh9>FNcsI9WtBY`SLL6Lw&agpV<7{x&rt5wA#fww^zSF`GDBp|e8`Un^ac<|oG zpu8{=kSH#Zz}*-HMFJkOd<~-@6OkzHk-!fyR)R=C6v3=z-QL_I0jHz!ZR5R(@1grO z)&`0Menm-}9E&{?_!CA!L?cmLh-P6Qj5m-KNtDh-0*Ax0=+-fHk-(u;rltzBM*^#0 z@u8QKC|1snMFMLfN@69Yi3F@VvPS}!!_vFx$i=7!FbXnit1R|NU=*XE1}afpWO+44 zagfDoRq;q*FNAS5tIkFOLQAHPfRTU)?|lf$3nKxE;t~nmg;7u>;33Ps7zLS#L~)M< zzKyXGL;|7+W-aUXW{m{!>n-k~vtOoS+(UOswKi4=x3GD(&Rue2ZGcTz)jb6@t82u| z`=z_8?%$|Tj_z;9N*GBXI+Q3@J)YaC`nKNSs_rujpd3#u$sIM?CuWNnt-4qz&<4{5eL&VXQcA=&PxPmOA3QbaOG9&u38ri zS2F>-ODtMg)#6uWLNohOsH2+@=_>o0?DG0Gt47DOrO|LzIa3_UhUHb;bJc8ZupEw+ zD)iG>ZE%&cANxnTPjSs~X^5^$qx%+v(nz2Z&`*uq64{3Vl4v5^ebLP9lKivM7;1yr z8TGD_Tv!+$;4bQ&6OlS1{miJ(<-bqZev(PqU2fX%^{!2sGCit>RXJ?m->n-yZKfk_CYlKAE!_l#9rjo1Z zrRU+KEORV?y&{&ox#&CA!t$F$NiX3gZT+g=Z>rB48y8d@?j9@ThH}-3z4iI!aD+mJ za3UY4_xx3qw;4j*R9{FfadJ!SST=mIpq-9V|`X% z5H%O}QB_fqiK3~swKNPt3N8_vYrq7Rx6w$AH{F5rnk3NIQli>m>r(1E&u^!fxf0!U zegnOp-$8$F$`{y2e*5w$eM+p|TPg8mX?HQZ%~I!xsDhh+P}Tj>BnA2iC7LXqe~j`@ zr1Lq9{UVXY7bWI>NyK!t>cx!8t$J_zK^5qcBnA4;BOMx2T1_qoC2 z*S}Mz70WxXoMiW4aQ@FGwe_|U=v#{zt^xi7|UbeNLe>}Q+x>PKT2i@${ zhQ6RQR?U@)nF4p>gX6()IFhLqs=>xgp%RkA-WXKNwXiQJmIAtaI}_~66$;Ehv(PFS ztWiL~GK+HV3o0xG$W(*zQY{$D6a(rH1Q|*a7Q)f6Sgi!PBJ=xQQ3@GX^aoc_;J^_^ zSPa#`sZjb|6d&?nVW?Ctvmj)sRH%&>0~UW(cp+rzWSo#+L#k-Fm;ECsR??_Znh#a= zELi13iZUvgLy0U=0eh?ytR*TieUduQgUnWZQ6)PvmRoB#qdCK6ykxCkP2-VXKzX-i zN1+;1%$ENClq4cbgm(UZL1gHW1*iu~#~YIrVErWO_K&J|BaYWA$yzEF zk`&WMg^fHy6agY*G72Qe#S1|pGZ+>cuSFqWUsrA< z$P~u|Dpt8PmLp0GGG!W}D%Fb7sFE2i9%2z7B0uYIO6~v0%km}f{f2A4iTBv!&hg&- z)n;z3$xP$DIh1I!de#dm@3y=rRO85dFGwPyMCb_btxi&am6NFB6Ww(j=e@Y~*?7qfPzb%nl0pMA#-`Hb!9< zR;3|xk>Y|8{-KYUu$;>b7I?f!J!Z+Af=7qDBw^-g0H5=6mB!k4(o_X?|E=+5u1F*C zvh2Cg9xonZ5wpRTw%=6cZ1-v}k}ZdLdud`z_PBFwd2K8=C$=2tC2Rd^nkaD(<=vJo zg=!qxaw3U{5}_k(`H>_A_~0b!_^;h{9B0e8_1W0c^3KOJwtTKPebsE^g0$zXq-|i4~OM&7}Kj9&aALm#b`)V&?O&GRE(L;>||5PGXK_uC{ZAX7^4BoaG2&Tsl!d|8fB>afj$~8%@i3LF?%&jJT9rcFNoY^m7GB219CLx zSs9Bu@grSqhLux0>*QwwJ`TLykxCkO+(zjqrBS^w@{5EaW6c5=~ZD;t0yy zQO9xOj$5CNxGnEI^JhsaiU8s&Y3~9aZPUhFT|oW4d_f4KPO(ZQ8r0{rR~y9C73ca( zOGP$&H4@PLQ6H!J$~cXTjtXM0RYLxZDl%83Fu0McHhj9h7FH^pq^p#XAa}7eB~$Fm z4V8*JR}Pg%Y2GkL5jUTT;yl`I4ks*#vW`erJx~h0+^bDVM!kf$sU}8ckG&WbEIb*B z<>f>+L%dwAUrocOS<1U@TNjFPkK-C%vllPxe3YmyqP zn1XHzGQedOW$WpZ(H{%<=pzk}hGpvQS0&9x5>%oRTKnPq>)MM*)qJQb`V6nOC7Ja! z-nN>Ul|A-jR(`8b#H{>_D%qx3ZceTK5?->_ucl$vD=6=_tzM|cky*1zM3e{}Vb<{^ z1=u->I)1ggj^oT4w>}%QHovoZ0nv>%O3DZD{%qNVwZ2jcAp6=VL^sH0Q)~ zsfwjfeT~&kv_phQovm}?J$$*3L~KhDt3Zu-S9peUIGQ1LXP%@sI!I+BZ&IYy*)(*l zLy=<{r6mN!=*eTj>J}y1R78k{P5^(%Dmj$!*Wk+SsY%4~kziR_mIUAN>E4BD~GEM0;OdJkZg4!7G6R@{f zZ$QYL86KuEpXU15Ky_Fc<4R;h)HI4gy?|V`Mnf5;BJ~q!OIFB6naLM(e=LD00bAJ1 z9u0=$B~}+CV<9)1qa_}E3l`tl(u54~7%f`0(J0vfuc0A0KgA-QwtzNxa)NG}z zkr`#qy?HrDS|#OPMui(Gly(JSxlD^aNG)n>SC7@Z9u6!ra<=dt<>5Z%#lF(_-pN~6 zlka7ZJLh{JjOEtap=uHLS9r-&CR+LW8>X#NaKqD`tJyB{o z?j+Msw5Dsu?9%5PO^Ga_#Q8tlzj9qu0*PGb0Y_P+$lc#WGt`N zB%?*Zck*(zel-mr-9>q~5v^E`#`I}$y;i368GO*C zt1;+8!w$v9AQ8oJG^{{_6>R0*2#plbI0Fqq&>=Q_k#m3W626FoA+w=~kqoT@DKjiS zK*L5k0zR}7J<>)~*ho+p%S&uHq12h3rJOpB#9ZldfT6gESYuCBEiXFRN1& zBq_j!lc?j%+;tr1*0}B2xV8D6&4naaw5b}_murW`!W72+{DdfD?OpT=aV8xOF-A^6 z%-_nv^TwdC9Iof&6I&{`)Q%eQRI8tr#$NB$tYo-)Jy#l8tr@Pe$6k~Q7oz+{EVtH7 zsRgX>;w5YSY8q0#jq+|wszNm;snTIKBl^iU^hH&`T}i~0DD8+9EK~eS64-kuQM(T$ z)o#m^F@BUpL`Ti4gD~V|zj~mm_Q@m#__s;a@vq%=9Cumqwrz7+mUmY9a-7m$Jh%2- zeq9^YIdl2didEHqY`&H-DUZt&d&CikF%Fm4h%ma3&?5e}{iHN>%qb?{wx&HT96pK? zS;ArVxO3cnS}ZqQG8qt`%uCk#)im7wBFeihcMH{caQ9_N#FQv0xO-a?*sYVO-NB^V zZOPrclZfc3Sw+==yZ0t3z>Slr<2SqOIL_Viwr%5X%R9$AaCd{(6f4DZYR}t;w^5rf zZ?hF15tF8fzxhHD5PK)S{^>q1+mbQ&7rBzC>dcs%J?^v&0*%pi`CQBku(5geQ-7B_CzQ?@ zm+K?>)IoH@Q-5%AskDQZkMaS1IuoAG5HD8wQbslf5RB4FOIkW8{6Eb-h#66EJbL}Y z-dioV8DJ0GtuE9I*~&c*c$d7X4dEJaH!d%aA~)pjyf+r7MO z&eg_}h-zz%lJA*KaYZlvVIJTXv(B%Rg+>0BC1a;Jzp8!NB8R|O*2^KZE6 zGW!1r`u`~UKiE1^pHF_FOb1y_u=Y}=g!R+-{UB_K{6MZaFqEwocT|XLXvGe>4R)1* zw%}a5R-|X5-lJBcYd`c`@|(!cyRxKTdu<9h(;6xwQb4V$(h($< zu_aoVz@(8$`}_MTW$%t%bUzVg8>OIox5$y7MW;K^l_InyV~e=(a1%ctcLT*A8`)9h zZ0%Jw!$SgE98jh0Bw=|g*%as9&uH~jUuw6Ch=W`Gtk~~`)I@alGpVdQe=nis@1s9P zLyInj{51VQ_7yZTsb4#_H|>}$iC?-y_a#24tLPAm9Y^}H{-%_3QbR6r$x2)~k1*wY zua$Bhh$|<5BFm5N1)?H8rWJAX`bKNp*RsahYQp|RElW0#pJ=MBALqnaGNo~s_5nu9 z$YNqom91O=Z3W(&doCqyy5-Y;EBVVX3cBS}qPScP7h)82F`Ps(G`ZC7Cb&v1Hxy7u zy;TaO?p?5mh8JE)tF(qoY*XGu{_E`CxYqX!wFEZr9@=Z%J@f^NSX$gYRN*yi(uRX6 zv<{Ra;{CDUmUTS;ykYUDb5685-?-y#d>2mF)(93hGK(63_C(djZLl_=#J36&%)1xu z#(xJ!LB=mpT#Ww<7zG)>L@|tir5OMEw9!6+T7^V2X&(mG!d@qspIaxR2QTP#QoW$Ddh_5ou*WMI=1&u|HFv^oCPv`?UGuK8|N}rT$3>^vLzW#F#lddQrul?ux}ZK!3}QzDMPHRv;~4KE%FK|een_P@#?ICp zsEpDE-)m|my1H$G&tIHH@6yn$5H=OJEQ$@e+c;&Oc&8zm{Hi2-2bOFGjmsF4vHJR* zsIQwTsUw@*j!_VsNE8<~`2 z7zI&_L~)^(2QUgU5s6|@i@G1&-qnd;8U7CtJ~6onn1r33@9{eFU>6T{KMm!D>>^QI z*yUM_g4o4Fmi^CwfrEqT80<2auepiZp8Td7-7<`pfMtZJsaR&IeSwgTVGb}}jl_&S zRpOq6#YG&mijq2V%sPyMI7XtlaLi>G1sRG&F*wF=G$jMU6EjSj(Uh&cf;PfE;U$LV%L7r=}WY1oz}Eh=yEUig_gDl-J8zc6r6Oz>Jxh=*l7M% zF(GjyA;x#Fbk~>e(6U?E$YUbUjKx@bu1(~;&XSd0o#BC>4 zKqTtIbd@ed>0%;RLwR99Bq>aHzV#N16}Dp(6cBmPaSfv&6OkxJKs1}SutiM4KP!@W z9Y#tJ4v7Mob*x*PgDXEk?Y5&`cG71UwKJ=?Hxh__RPwwR%Y*9Y-ISC%(uO0OCwBcs zSkYI7_c4rzI_?tBB?!11qab3EC@wANYZwJtolSSMqq?)tH}Id8B7X?Mbp!Hp^Yn9Q7mKs)5!zBH0*ufkid9>4`L1A1 zRWF1%iB%;s!BLV|5cMb^dVL z^_F2rUUcWrAP&x-Nq>xyn*56yH7~KAP%x2ayq%qwU(b@BLRsZEuuq>R@%YypC-NJ4 za?9@hZZV*A9dl>P8$OJBphwD$codKsr&-+G*k5lRykYF{-glZs<1`C#rN&k|0VBFz z!{;muo_adYvbYDf4ac)AKG(>kVOeBOojOtCp+@d0PL!}0(Ku0JUBlw{ohT7MQNr1} zWgpVmT|Z^#N&Ey_3hYY!BPDg5+*%b7SBPqTIUYEhRiTD}IB9uDM66f^p^kM+L> zqacg%kmW5H1zC(lv65iZ9^Km@PU0F*w@24QPoIS4?^KHL(6C2rO<(o~>KJ@l$Ca{h)^B`1W)0*ODxCKh#Vq#W>HTkL>#7V5Jj`%9m zeCf-6Ly#yb2;^rFd|C+P zpLhj%5QvAa{|Lo}1R_yf2xR^_&~YOI@sMQ+Msctk7XmpJqa+{@Az~^5nauMf&cp&E zYB`;fI#SDp7zI&_L~)^(%@_rlh(s}{#rHgkJcLh7E~(Cw7~yr~!7d)^em#^IvWrA< zVV8Gc6vQqbvfPeQ98AYxmp11~d;+5-U>PB5DwdhN^CTX^;v$auDkXK~m`5=R;uwkI z!ZA-^6l5q8#o!pf(Ujjq@Wc$0W;Eruyn;Lk#zWVO*2BQULDwz>b0kJV1mhvg@fgKH z7K32u6bU(yLZ8$a%8M{c0%8#&rXrR}IZxsWEGgoYODU-%r)0vA)QOt=E`@G%J4bB8p(vvTkqf=lmLHM5H-S;z%f%ULf;4iTtf>Tf90YVj1NVU+CDKzl~mk zCqf)*Nv4Cg*FydHmM20quN#&Ngbhy-JNZExKo0P91vjNUxp6|;QqsH)1TFSt6lr56}+?~m3PjZ*g_`-m2el% z6};+VftTHL=b;GDb4wJfwwewI*bQ-9?Yv1<=?)0+&{G|jKe3(`Z8Ggr8`gUdL`*8M3I#-*N2r*21i zDlH0j8QK8>RySd$hDQU4&HjvYqH_SgLE8_ta{$=aj-CVX<(V^P*v=E!cMd?Nx+d6T z9&os2#c*z@x`Lkqz(1ig0QL-(3Wac}nkyA6{h7g`{^-1)E&M2(Ei8jAbmetlP{>uP zTOuerU}@{tzF?1WM#NAdQ>lcN{^p}YwhEK)&VOdMcCO)4BQ>kbN;Ok$oL$!HXT>u6 zZ$xphxu-Zcz+Ob-+<>)>7P9Z$fY`YKZmmHMQ5id^r|ist)zC^{ z@1l>AI!@r7g;7wqQKGoS8y8~~6mLirqs!fDBR=bb+mD)Sl|u2xD`626M<=a-6GkX6 z=QZoGnn0+}bmY1)v7wf3o`2r3_~|$^;I*(epz-e!BADToeaz%-7zG)>L~$|x_hA%d z{1U}5{z*GC;8U=iy3wHFm8NcIn(eW7in?^s@&mB+aQ0H7m=K`C%z)ou4WN0@f2X959oqlGD2OH`iVNj+ou4@JkSIn>@3+eR z2neoMv|pf3*Q_NyA^k8alGg;NhptbB;=(9TqPVQz*nm;cssImJuD~eBy+{;e{YG?1 zK(zMYgw^anEyCZ1@e-`v5XDHvEgd;CU>r+^*rY~D9ogiK7zMG3L~&u0TQCZ;3W<_} zP5v5!PYauTh*yxuD3^z>?}y?-HjyYUZ1ONhL2Tk7%TF+hgWVWx(&Eg3CoxI_4iO@z z;*j)b2F$qtx^P4wGbpJefgFrc5P?V(7Xk?|3Ni$Vl7c`^gy7RcApN|8JP5=?*B3)^ zA%RE~7Xo=XMnMGPAxjpcIM|H~f$YR62?#`pn2JCq^UQ#^Vu2C0yqS_ZQp;ar6hti& z#f4h_2BRPokthbW_?{W?B?zCGTvDAGa1XB|4|efT_hV3A$SxAag&;6{8?Skthbo z_>HEV55W^NOqw$THt-7aAQ%r_4?=Mv!AKMrf*Hdoh+sTq*@ICW?8YD%Iw?R7q|hfd z1ysi<35Z3An2J~?<;;MOU`Y|De1MWVa>{2g3gQ%r;=(ESV-#c?62;(@WM>9^9~NR- zxaDC{Q7$U{B`iIp3W;J)jM(S(eveU*Ie5r2`yv<}Aajr?)@iEvUhsn;jBABA?NUv3 zW`HQa$u@BM$fK1V59Ng>B2iqt$%`-w@+Ka#oQF}6iAWT~o4_*zUV^a__!LnDvzB#x zYd`1Lkuw9vpkR7|@RGd^yd{|q+FlFw6|K$;h^-lxi-Qd>5jz<`Mia58 zDzdm4DhsyJH*rB@+t%!>9N&vk5Wz|m7iaM?jDlK^L@_kEsBvC^P`lK&m4q#)1$+^f zMz;twMcTx}9Xc)GZd>KqS2=wb3Idl6NEG9=fO%pcNEGKrUzJJz6yu?j0<2Qm7ehRS zQIJUr6qDy%T8fJe&$u{okRWZ?#hV?7QII$DXpcu=6o>X`c(ce-qM2rCN6K(|FT5q`yT%O{Tfc01&R7+=5QtAsCd=?!G5b1Bnu1tBmz83d#jEDMO63+~_?Y>|D zqo9T-QC!;5C`LiHXVabEDFLs6;JN{MQGW+c33xS?EFRN9>JrNEYytT77N-Q*cas^X z1Z1apTcFj|tL^@ZdG6>)g`X2YS>Ui%yC9RUk@^U){#eLn_xfLgB0;Y&QLNf)I%(kV zA&zTXX;NLflLkEW^fOrg#Cn>;Voq%Y@YfI~v6=)-!ku6qTAFzY3~LbSBWvPo*i|!J z1W^(ziKBE6{k3&#bTWj*OD~!VuS|7F0(TK%vBKJcHJ7tIur$xcRv34GcH6S)qd!C1K1Z}p| z&O>2e)1HTNKEZE%%p0QQglW8-UvOG9*6Nv^m(D2)Uv z0sYiCUPPQ3Lkbwk6$gX@CbHcZ&CD*zKPih{8&s;@d@h}=aluGXtFT;0YlUiVtXvuj zE9`q;FhY9XJXR`K`+`mMF;g54DkMfQ9FDM4Rd$9!C9{+3yAtdoxk9RyFeuhW2g5Qe zW4W}e!fJv&9nMrUm9QENWs0S0Fc=1u!vBVN4Ce4rY0eS>KI(jQ(S;egh~ROMTz2rV*0E4AYFad*tm#g!rfzq+)%DM zv9~_I9FEXoSK&lH9v|h`Q{MR>zQrajDBGw_sHP2CrbWtDy43q*jA*m z*Mw+sV`q=`yqb(XZsUARL5{@7Mlo)V<%P>7ZTQW+T&-W#Z8-l@dYSj3-E8=6^mQ4$||naQ55X^c5d$;5|HB1_o89(ytId?{#D!p3)1zP?zVxO|e4dwBU;znX?K z`YG?Wj4Tvnl4DCo-jGB@iO`Ob7ep2msaQQwI(|u#0$eePI)0hEj^q3gw?P{}Sl(F% z8kbU3JYjo!SlmWS&h&73X=H@;;9GG+HB+wgs7&;-Ww4eRVM75!VVR8@L>+%Q#$Y3j zc>*OemguX}K;6q!BwgIZl|VIN_EOm6PSeE)VtKaa07hq$F5bt>*ZS2obnzj|yDeP^ z1v%2iJxN5A2pyq|Zzd_gLzAfEZ@KF@P8V?-w9$p-os;NTV(<2*T2Va5_B`^2HtKWc zk!&G1ngcXa8uMe3J~5n3UBb-pFpW!AOBA9orn1q?Tn-+wi~Oe4GINtj2(4SB7K{8h z*Gv<+u*aPym!)3iljL#;C7P`M%VCsvTXGQ!awM1jBqBzPN~Vm?$#*y&|nGJYv@^J=0P_SlPJ)b4l6OMFo!dvh!|On#DFZsH|t{c4)X zzVTXGSqaU_=yB@s~~bc9?!o1_4DO`?uJ@2=xGxx}r{MlP0jR=Bn_Wts6@+7m~q zjmn&(mF;X6Q%?)OagyqUAl^+Ew zm9fmOqLo(;Ft8(Hi9Jp0FYaT~Ppi{+hjI?x!E z(Z&JVQ_sJ&u~=8?+5BsoAZ@InXff*2W~D@{H6j6Zz=)nogN597wk&6yuNh%8XL3ad zU&;~7oR)xqH6U!ENHxcXjE$4{lyBo8ByJ#&A?UXbqmrsc2%Cy>qgO3L#dYy6&Gjx$quucv? zb;XyPWQMA2AxcbKzDS8NHj`#oSSa)d8*-JQOqq2ub7BxYmV`8fm&mYkF&*-SJ6(F% zNJSTmQDTGW3kZU*qKW8VJy1rv&8yW*=6?lm^-avr9(S7gYq30?n7_=+*ZS2o%)g8B zZp-{aL5|G-mLwudgpM%(`;rvkwn^0S?e02`Gk@F$ZOq^N&gO3m!fd^Ytv}dDi2thy zQBhpHy4(BVtJ~PNs~@hvN$iyjy4kLr*r)-E>V=cp5ss6ypoOgE?X}Uc$X7a!(cN=w z5P>-@V=Y!cTVpvO2142LO!iGquW+|RgPFs+uNfWjeAJ5>q<46PYp=;W zu*Y8BLF_S-or3tjrhkv+)|%|K9>Fhp$y&df#xFcYdAIcoLN$(lVb&F*a_F>jN$aDKPYa=aI` zUmlY0?I$A@t6FP=Fw6WB@#=m&*Y?YB=Utr(3&V{ixY1Xopv_+9xlEwHge6)YEf*$B z%^y!cG?tM5us7)KW&M$X5w;e+w>RkKU&S}MmX`g_AJFs>twdxL%^r18+Gs(0FI#mh zRw9a*q96LZg5cs(iFyV^^DJR$h;zPJjn0-98b8ERiy3erJ-({ismf;`)WWZtcz8S5J!HSoXTzI@`eu$PPZt%jRqcEJ>3coYN`VQQYt? zCQ~yv%o9ja4b7s}@k$Sm#Pk4#%1bWz4wt_v2xX6Totnn7U$5fVs4NQ`kF+8^5z7V_ zNpeA>NUH@Gc#yYJMqB`Aqd1ys_?uiQu&_Eguq47LTBGE9W>ZYoOMh5&af`_;Bkl2` z0D}2trvSpBE*49$>TH*Cv2gy;hPY^(N^7xLM17vvWO3warpcIzy2YaS1&#eCp}qkk z|K+))9ky&fe=qxV%$4-#zQ(8f>C@i)SNPwr^1l!8zYp@iU*mrtVt-k2c9V{|=`P8i z$3DufHu-BI2&GVOvkOEkgXbA8(dl{hQV6?Pahi=<^!t+T7iG>#Y8pVr8v{@Q8SMH_1cd@n8a5+2kH zu>Sm())#pV@P^{@3mcN!cFlF?A0f>A_vnwoDbd+s56}n|1eF}=8d z_%m%1(#DM&!H;v&g-mH2gBIKTD95E@PgUh^gOv-<&UytUr8+c^x3C|IR>Uaid>o15 za`42p7zG_XAyEuXwz^oJsnoIoj)J&WDU`ZzhD9`-;6mDUIb0g0MdcIuud}1GT5rQ_ z37qgGnK$v8HEGeo6wHuA7bYTu9}6XJgi&?chDg}}v?r=IJ`HOFO8f~Sf{XFrhf$F6OB5I5{|-h$#xGF} z4X#X52hGE|)F@)xKmQq)Q#Tr8n7dsI;3x^r{l}s%U9|iREImApTcVg2V?VHc)>SA# zfk(Y~$g&utAd8VG*7|PRl6n-xNnGRU?iKdX(}}SBovQN}V-&;^9^BK69%!%=8XedKVqJ zQ19&+#ldte#l)-%Yw}f3L7c?e z>WHs0&DY)(XS^h3V)L{Gv70Yq}T~Lbm|F2%ZX)^ccnSMMb%& za2qT=jOHYY*$(Y)q=-?FIe5r&Ek;4+AW^LK9lvtvO%TSl!kf-e6htBt#f1=OzZ8ZH$U-Da2YkvBSO~q!r_84uL`9;Ca#3LqEIlL) ziQ?i@PQxh396V$>7o#9^kSI<*ii=NqHAX=` z#Y2|87zLS#L~-{iw_>aWK1CG4tYzKa+WVA_T;um?D41R#e2w2HDWCX4W`}G1?zAM+ zLECGgzB0BhpmCp^bv=N!Cuii)=*gK+RmbDIP-U>Cev6CiG*|gkjDl!ZqPVz>r!Wd? zLlVXCx`(w=KI+$5ZuNT>7E3n}XbFt4eF$%Izt1R|z@`V_sL$YkfC=RkXg)}1&CUM(I z)lC+4VLCe(qI5Bl>!G|bq>&Wn64Km^QBX+ZLC5dKD9A)4iV@PxrUh^jQ}EA3e_~4Wsk_#!t%o@Jc(k})1ufi zVr^dfB8Zq+V@-$&mmOJkXTP{>07~MbI~O_{#VCl5Pz~XWyIu`J6IYTAw3GE@kIml- zg>k4SOiFA!!VR?1qSbn8l{$YSEmX^}jTP_?t@;w{h6!=eM|NI*J+VdpV#-Qft91v7 z$G=9`Y8~Ekg?V?+1S{=zY{BR9#*%L;_{nkw9kGV7TjH!go81y6I-Q5@mRK9C7!#iz z_Db*kufmrbNGbLz*o$lIRrtNr`h2>mEV>9LzNmRm zsnXwA$SfB&8_&ezX0bU3t&r%z_8n(~l!Hmey6q|3sqh0>wJ<*XE+uV>QtW~M;}``6 z{u0H-(>{$+kf)U>MyILOzJoM76=q#MDdA?Tq9*js&+?k}*r_1YryON`?_sR7{4HTQ zhQ&|EPKD*LHlXnzLrEQt|747Uj9;R-82>pK1sT6YF^qrGb}C#2%b7SbO|vL>lc-A< zEoWir;pm)1F~>>l1Gqae3bGgvSzeD(ki|$8YuB-9_2)YvPU0F*xBAmVPk#l=->EwP zEJo>2oqq+RB&~DX66xDQ<>WKq*{I z%&M>^U$qV5B-U0(e3faw_NG{c<#*7N8N)k-z-9tnLk>azRP0oE2UZE1+PayNItKZ- zV-&<262*lBKY>vYZ%7m)$WOLY;XYUh-2%`Q*E#Vi6TTlJVTbjLqM}?>_ybsa7|lr( zvmM&q$m19VnS+NcPh%8h4id%6it(Ka&q5g23U6AzlxhivD8ETQkgYsg*H!T+F2GRM>(gMLy+al+@9u zV0iUuL7DBJ`Df20B5EbR3!oP&2hdxE3xcHR6!6?WaJY=~C zqabsTC{8}*AqeAI;hps5fI%s<>)Q>lI6s!r< zV)^E&PdUeFc!~pz^wGl3*i*H{a|2WuY^N{g!aD6!xB{afl9ebf4r3ceK`lt47@9n& zN%d0SRw}k^P$T)%w{9BS^v$BOqK-GVigY0d!Q92@iJxA1L4oDvJoRi#sad12=s7 z6t~C21s9(GQ_Jmp>vr|mr|RCBMF04cN%!qr_dDm*sqdUxZWSl4-Gfn3TytoZ4`CFB zE=F97d`0h;7hQ;)=f@b+Bfcqx&DxH)Utb;ktcIn|0y33>&PahSs3nvT(gGlloej9EDA{aQ!q{Rf$B)9;xe4ei*4Wiq%d# ztTqiDTeyBcMC5vSi^W-wZY3*p5R-S7Q`JN2rEuYsjN`_!$W5T}d|3 zEbGahv)v1oVbl{QrP#uCD-oHc;ga=|T!b!sJ6xZBC#}(otxp$UCt-d1+W%kHr;9TH z)#`Nlsq@-&ahuqixhE(W>y6XSX^f4CvtDVl|Fvs-f^&>F3Z zpwwTZaANJ=7zM>zjbe10+N}pqvvmCcD57^{ZYQc|bbh(4S%;D-w z-}0O6p9X6Kc8}hmRN(Y`ix>qtzeeFW{|1bLoL{3D&Od2O*Drx`#+?Rrky|+IehQ4tPJr@viZ7%K;ti^ca*s zt2+NBM#-qo|AbL|>)f_xc6J}iEWE2di#4;>rf45wc_GvS_C8S~Ni1Do3{kvol>sT5 zbY<_M9}K1E*oZ^DM`IL*>zcaQsrL;SC8K7T$0!V4tki33hII(#?OIdZ3@?IOa9qr4 zu$EZ08RB?bE0b7dy05({ejLiru#=g?Gg4r)K-@x%q<<=wuHTPMf+n}_rlQOq?)NYX z;th?$;lQ6_6vP`E#Ypn~mahK+3K91Jw+ueTCi_pRisG1X+tX260<$@dVzxtj7KrUB47-iekz*6=lYh4`CEUA{vE5 zh&Nyq!(Z9hHhER#Vv*C|-n75W#8`PO#XFQBdpAD263>Xf9hPw(xL9i`K8URi1sI_BN;p9Qn{F#-jB(i={ckCF|kW$R)pm@z8>Gt5){$oJTMU za!G|^@*Jn7aD4bzSS*GQbE4UwF$#)i4()N9e(%VvQH*F7dWxpB@N48ayI?$zh^E9a zYdYR?8C;%Xv3f7o2i4M2D(bvg{Sb_Y`d%8(Ot$T@;B^=UH9U>NX-8`?3Tj6-+qo@P zFG29Q136KD28-2)NU~&31F1_H!?6Y6+uJNwx36F`7ONkpc3BtkBfGVS)=pK+diIG- zs&r+x>)9`rwVBAk>_PlvP<|N1HHy_vvqW9Q7O{UG!f-vm#Y_subIp~5l^%rRds`_n zC;ccy@itPLIcckn?5q2K4W;MUh{NB1!6=Bop}&gN$}xYPJAhIY@2Z$3VJ6>ScZcG0 z>cZNpWweX(s-+NxYowN*Oa|f1>bCZL|1hWo$5du=V@EkQV-$N6JT)~6rwJA?if&BWdWst|kYMtsfY zt((_UVzlJ^iL)oV3$qJzL=UgKa9(&}&1uu8O*=848>|O8xw(E&tOO&uTCQBqmxIwd zy?7D~kCq!ny=A_55v6NYwHB-ysn!}j!D{-Ls|*J9>To_7%n#)U8pZYbpq^VVpH>ex z6!Nuv&?w}^s)_!5EvOC!wd#htz!6smbB$a*-v|bBm1-mC&j;21My^=N4+cZE>ae^e ze7B{iOB4{o(G_|UJ+MzcYIw9Ri;Cwos-%d9%AYx!D+eSY9T2gO3N#8i1qwy!4NflP z8YJIPwKkk<6sr}oK)ulwm#u$HN;X=jr}pRR#(Yp4tyF}y8iis#7#gjRA*z+|(6Z;u z+*0G&nmJ;*k3$ZKvm7<&!nuV-;}eav(^%;g#_JdH2R z?`>(er3IF2yTz`JcdZUvM?D+_j9-eZ^d%Q7m3AczlI}K9Xi;G?2`ffG_K6`YVkul6 z@=8cF?>8?*#4~=R@yb-t9hs@wdX@ysmIb+(EdxZ8E)EnM6PJu{BThOS8_BB^jpXh6;Iq>I z(6dWt5YEM=GW}KWl@8OV<3-%OS-fDnOQ~tN=}Um!$gs16C(gSp!1ufe`$lA|WWAVy zI$aZuw59JcmXEC2?BKvU2eZ5%NkDH>J0a z&_xl$M5GfX#b*jU!liA#zHRgAq1VK&MEWlpH2t!@1Bj~9KK^1VWbtuv*~!Oc-&qeV zCwl7#C!U4n(ms5kl&k%%aUU+tq?=`5k>|sQ((N66SQ*A_$TNC^um;4($n+=qsHhP- zv4>uut8Lq|EO^idI!A?)qnPmqlE%72zSf;3+Dm9(^(C_KSw3nqEj%yTNJAl7e~1Kn zhmSySn?$?6i*I*gUW1vFt=-1VmV0(XJQi6hS+X-P@7cjjY+fD{y@%#GU_m#nKN1m z>OhDK1J&V?QR=ry7wRsVIg24p=w#cQS0lUK>viUud z@B4{owkK;5Z#1tzEahu|YZ~TxjGo<**Oh^oy#ADriW;F4ug?vAFf?&=A+qs|yjgGU z4HvWV-zU+=vq&JOjgu^s^g$cTSnfG_QkrLE;v{5edb+)XeYy0s<})-bBU-;4-{?qA zmI0OC;Pw6G;<{X;S{n;!fTGiI42{2l0T?k#)5!G%_0fSskgEqY_#=p}D>3Y|Q49*H z@t|-3NObe_G>}9CC32WX4ezK?lJ&XrXkM^r*sW`3y&I?pP7Ae?Lr-oM zkRF$ul*?TbEKvR zu&0vLBAQB8S?758vJU>qjfdkWow0$&@asXhSQL>+(sPwC7MzhEBTgR-=+@EUd_~R% zjL-&I;fRVcGH9jij=PS2(y5ths=iK|fm(q%TqrI(QMFpDq5J#E^&xjBp4OguV+rA% zQnL29rXlHj>De7gTA7AP(vSJ5s1Y(D>0kQ@@XJZG@o)JyPLg!e`)nj_x#vLd<`xl2 z^0A$XHU1Z!?YCey#KPZfU6+GZ(WSqy6xarCrpmH_KZ)Pt$C3V!kn2t2F0m zn%^T6?Kfm{L;EHwTC<*@=@o_G1Wj||cYKq`>HCJnWGb;LeU=~fluPq_ATn{84U0=% zUEy4;n3++-*6NP%dT(%SwMt2~8WEu>G0DSf7FF~@hQ(BAY-&}JFqk(QKWORFNYbTC zgKqg%3cD0bt1|AU#-(F~b;R^{X?*`^Zf*SeCP0{{cSWeN;oQ|u)$(@2A!j>|3RyCB zaoM2%kHp1#UQEwWrfr+`5)-LE@fhqWA5Mt0=Mp*5l9Lnh${UO-j{zm+g-t@ttd_n& z?SUo>cOn}cEo}g0qX`wG$SP&F=G@BoNlQaFTbi-|MNV>ou%>hpqc*xC=&&;8hQh>5 zbdgV8yhZ6bZ~S$#Dza%-5tE3=$K8xwZ97x7ohM~uSDPrJs;xarX~|5=3zpI!LE4+m zI$x=UMN<%>n3$t`RcF~k4j07e#NqA57j!#M(S0~uA5Qn;LPyP_df27(ijz=vbgLPw zxy=dge0=hy^rhKkIx(kJxW8mU#fv-#=E^y!k)UGneU^6x$J@4fQxee&=9;;+zQ zBUONOi(N`biI3rw^&9C+V$yzrSUa?kR^{zV|Lsoy?Lq$qYbVCHp&Ywb%-1IbsWzzK zc#ll6X&9(`i5OESz8@T=S+~C4&)55Mb&{bnNdJiM zjpA@Vd0%d1q&(Iq$H@BBQlxtF7JXSfY=EA!j>h_$x13xXC9v2X)G?x^Sc9#1YPo2P zZlGEw47uyD*8liwB~PM@e@OCTJ=af*S3-&V2C9|y`C6UkOPa9yVKm6rS1t}08!IT< zH|Pob_K0O)ebu2MTBQ}cn0OsC-0ZmdexNcE?Vo&>6rw3heq*DSizI0psIBl(fykO2 zZWguD@n*_F4hz)F6RTx~9!d4SN~Beh8wf+mRc$qDI5N207<19_1$K7|15LZ1BZ~i- zX3ek>n|#gPmAUzl@iV7(MU-smv;d0M6x|!Q%iOTthL(sfM7saJDR!DIo|_LTJuN;e zVd7gnuQ`c$Wq!bEqh_Xme@5{k_G7809L;oO1ERLnH*7RXU|nIE(HVVHC9J zUZWV6JkZP@n$@5qXY+fzYH1yiq7j(H0;vO`$Z?Yx19cCOZNO4Jh2r@N%_~&3atwYf zlpgLdqft!fvF}=TDn>!hjP$Nl@;=>Td+g1`K9VwbNQn|hu zc3&GCB6<=^&#@7QdY{244A(Vvu~YAy0?ZCFYKA*w6oxKV>a{h)7egp-*P7yHxIff_ z<6>5WwZy6;A&$4TGKp2D``Vl08Yn-W7#G6iH zADkIP?9{6=`ir}^A8xdD0k@0a9`*pui%~V))V3Og^`T~;rlQOa;9VF6d9Oy{w8U>= z6y&`c#pnRe663nkewO#VDD11>BU3&B;p27g)R|K-p6>cXSw{}NdIxj=4eATK0vd(0 z-&R)<<{)S%CkI^?Vibn!82fF_mc!&>+tc47Pg#V~Ja*ess-|L@MZAd%8{;f&S2VOh z`x_#oyb2oyZJ~8A6=gEfaTo$ot{XE2%v6Dd_wG0|Qfr$%igw3DS&$UoNKBIc5J&$4(L_HdXLp?voD9C>_N-FAk2EuO{>iNB_BM0hnF!zonn4U1q&7qzEqaf;W z(4`lnFm!RDo7K|2kTeR1koLzYh>#p~ zITE8VT*n}!4&y;5Vl)p*QmUq+B=J%=Trg^5qHT1ckae2hBZfHxD~lLr9TjCV%os*N z45Lvv4091iL2jZ^42GGPT(GK5Y@Jk58|6lJeJ_;7pKgRqzI%IawpEyYZNVp?_;9jL zqgbt!SX*!#MDaFKnzaR18`&o`zX_%1*ofoQKfox+sja%$Cp3SBQBVWbC>&k>j8Pc6 zSiLHF809wQEJA(DHqWUJqf}NhLjVl*4!pM))E9<&jlv1_%P|TH^$xlmicye@XcQyV z!^0?#!B`%FUWs7Va-7B()5}ZP?|s-J{%)Xjm<7Olq6jvKt%EXy)2S#kGpJz{L_8XW zLp#p~c>tp@ zT*n}!4ty+vaT{)5NYsyz)D&BI1=_QBfwZJd05fuV@qw zuRL!UWg5`YHHyJ2GsXGl;*~Y~5*PV%WXKmmaBo(TD4q*kUPvN24QM#n`T(dd$JQKD zc@0KEq~f5O%QZW^u^d{bE@9-|WjcO8S3X1?t3rZ7LBf^L- zTC|U&9t9PFV}u&TIC6OIV!cB{7!sokk$;|oG10NZR?Y0Ap92^L`KLzV_~)4z1^K5{ z7yIbvxfmrQUEYCF7`j-SPjdA0{Sd~x?W7w0RCQtUJRJRWps>$DePJBeD4aNcH%38m z+(DObV-(~f8pVj?aP;#>7|SD?D-q0Ej{6&9^mBQ%ag57`4n`1KV1GtPneBd#2=p0j z85H1uPeqvleohsp5r}j&3Wq><#wf_6G>T!{RCA(>pe%7uaT^9rGbj3DlBuP_?6G_W z6d%TNjbi2R#GL4BA&R$=(#(lkZDh|1-UOxR*ofoQC5(cc+Nz5^E7*upPy^K{99=eH z6oxKVuS#YG6A*^$RxKHIs;od+$&42;D{$bwPeOfRR-jQhS-}@E3d#x`ba@b?AQ#an z{H)+njOCFPC=twBj{6%UE7&KB=pA>6vvu%yY%L#V1Gb-{OyDVO4U`G|hKjZX7W;-w zf5#|@Xfz6kXtp1L`3CYLjgnm^uqTuy?j2K?3G7BPwN#ir6L>ikA4WNiV&&{aCU7`J z@itPLOu%X*dnRxSl%8WFj#Cd{6y(%aUF?~_nHU8%P>sUTkb$VD^?KNENmV|io(N(8f(?%+hu}Vg5M1C#K1sP!o>rIB{YbMnNQiYG}uB%ev?!g_vpw zLs0KZvVmqWTdFWm;A%r_yu;ilVF$^T< z4>e&DNf;-)T>RY0E)98*4Bil+r{jydTj*q$Djn5ar;}X{4Hl26&*8}l%>!oiz6Ib+ zn$~gjjyK2q(`|2#AL}B8+XBbBj6f=29_vzWKBU>Es3EzZvvN-JIVsLru?u6Iv$FcR zb5{Nlk7?Sf8?&B)Gd9iLiVj(sfK3bbH7}*2Ey=TeB=0JWf(8mS3MT>lG)6%Qphhu9 z@}}aDmAjzG-sxkSv8*qtYULRGVJJNuLeMCj?Zy8Kqaf#T(B*$I3UVHeV(s6xY+OIB zJ}JGrbQ{+@*lA}de^zz=VvLeeo$rfLeCynHy2D`*%DbUwak_)GDcT44PlQ^)4kBtK zi2?r8A&R%HG9X2huI!!Y29%y-BM$XmfKeE(YwBVj;J*~3WYi2lgi#o}SgF_63~zu? z-mW#p&G1gB1;@p#25X5`-+(yY*2*MSneJJK;okt7q8`S=kjrc{|r6ovot6S2RM|@dOgpqc97^l}b$NjH|5M=q66)*(!%Y z>%)HE3M$I%_Z^E-kke`uP6Ip@qo4+;QH*|{>wY$62p_L=rlhQq9rm;NG)D87I##NtVwo*{w#rwqQP5hld#Nas zi5|fyh>0``hlzfMQII=nlvGUgCkVe~nCNL)M-EKnVD9;&-r0&q;V{vj7zHtrgD%T3 z3d40=nCM`P=D|ct)l^J0WC>-j!4x=FIanR*vjKXjo7wWkWqj^w|QZ*IzO!e6+Kf*>p z%<~u(WiroiFbZNGjlyA`zhV^RJ{lzz^K8E!B>`K8dA22)oOb?mF!y4pFJvB#!eO3Q zVid$Y4!RtHQ5ddcFb_Oi-`N zl%!NmMM)i(Z0Z$FMjL6KrJ}bBY<`d48TT!pRQm|M1j^!1H)-|}+LL5zsWAJJf&-xVu);Kob;c>Nq~J9W#oI_}mK0cRWS_@; zBb1(FBaTzA!zjq9t-9FfF-I{9N&z$qN0$pR3PTsGS0&#Wd^d#Qx>dIC3@R&`App+j zIq=@~P+u78H3}!x--1z4sCUrievE=#M57p?Ub%)2e@Q?29>($r^hyM?mgD}$m|os$ z&Q|#?whqb+o}{8JfyTZD`EM8n5syaU5Kq@en13Lz(kMn|;5rw*JA{ur$kfe6FC>|q z216Xoy+70!5|T#Y5Ymwt1rd^iE+=9XhU*xF)S>TjI!5!LB&BL9O3LkV>1gRept0Jjg_;n2Jm?KU-zi7>wOwxzC>%aH6{8?NanPlJQ5b&1;gj_k#e+|j zimCWypSEYKw7!698zW5|q0;GKm3LtqAhvls6=kx`2Qdm_8;!zYo9i(O@*0g|u+9AF zU=?k8ZEx$Kjpam@+o3#M0%{qz$>>CtTWr;5A3gmxR0NI;YLw)OD$1bJo^io3$Np!Hkixt>T=GBe7)=-@lrQGWq^QjDnh#M&a=N=@TZP#feiIZQGQ38y2F1ku*aSrJHd31TF{_R2vEpM; zdX9}aPW^d|f}Gl_i+z6V9*lw-s7B%F@(@O0=wkJ%~8TJkIf;TS>y%b}4WCcnDvzFuj#>fh` z*f|@AVr!sG;2%mj|XD2Qk@3WsRkh*6LiX_V|Tfis{iaqpPAOkka@!t9yAxlnu< z>rA{vdtA(|603i2Y2l3gY+ z2xWg0qsu)Qg`tbptCE?(LlB1RR@r6(%1UO8fSG^;@BJF;3o`+Y!pQ{w zf>F?zfP*e`&xZL1auJQf&jc1=ERRe;iD1@p+~2I30KUD=IUDx9rmg2}$muoK2H)1! z)pE|pE1}uq>NA`rO0jb`tVCp% zh9_*OGc#7kj?*}gHmZvqry;(kKThM?=Z@3(M?OwtusG0AhiS-9Tjx<4LbTKBjapA2 zW^PYAr!h8CtgP!jyfU_SZBKBHagxkHIajae>%FZ<|ELDtUAmEuifNviwZJGW4wb1l za*f__5ly?FBX+wD5(4wIjW0AGlJ2yPuQZ>N;9hSUx8GnCG*qBbI4R&?F$zinHHtBoHx(ysY<~{wx_T#& zX-2cQC6TCFIR@VgN)HDSGzw>r>E##&Igf)bhhh}uJQ~H?!)w{S{1}MiUE}F?FL$t0 zACy0U;8P)l}VHDpww{7u%354>l_AIve*OhNJMf)(w2cZ_Qi-;OYVu=5Gh~jOl z3`o(mk-Zyz2b7*;BM$X`9iuQ@*VM&6#QzvZ$*39r5~DD5u~M(C8U6`EdArsWH^b+h zi?Rlei&+iU602SaalEaSNvty6*WMJDLHRj$;xxsBF$%+dOaQB!;aMq%h; z^(@;-8+i!j?Oc;|(uN9O<`^ZTcVrfbE0vhmc|>)ljBes&p0sfZv_91AtyGlR@B4R* zf}B>Pa2nu$U=-xE8pY`Mx$bWA1qdInbEmnjR3~lRDC@}K#bF0?e;euxdjJ}RGj;qU zjDn_)9d!8(Mq#*)F?HNwcay(jG>^$+rD`gc+0rL%?0g0`` zhl%#ZD9D{ON-8E=3E{U46CEb&$bpF*%>5>)FJvN(!eOEkMnO#Epvy*#!f+iICfbD2 zJeWwSnu>|0{G^Q!V=Ex)c|R3pQqLza3Zfp3!l9nqFbeV?jgpFbz7FBH4E20P){z7C zIGFptp}vrMGzy1${(w;s^*HD<^L!YA8Ls0(J@YY|2lXgbQ&G=UpR}28dI2uY)G269X7ZQ?2;SkdEE`Ui2A|wZ0UWic`u452Vhw-4r7|nx{l&YyH zX|hh*cr{iQG0Y)Ul*us1V-&q75P@1V<$7zMeA zMlnJ?+({_FSRR31iD1@p+}{|}%UjJ!8wX+Qpv>TvRFs(+9EDL3@n{qd@tlHDkXLCG zBQtQFi(Uue;|?-)bI}8`jvV?P4(2`|>I(@;qi_i6T^I%RJsfoTAVy)hjzLHr`X1L~ zG!IHrs-~i(Y){&_2djv9@2{=u*{hg5dOD2P-Xbm_(@3|$OTX>-!X{usrBOq7bL$RzWVHeQdl zM0|1#6=m|tT8x7DM5A!{t``5IQO>?55AVie?(3dL;UaNNtmhmXZ#F?^WA z;HP2~#NZCP6fg=y7lXk=Ptm7qgkK}aSNxLhe~)^xn(GRD5PinBG|g)M_v{_Rw> zg(&Rr-hU9IpeChJI4plXMnPVsQ4E$(H6wOAlqK#dZi8THX2fo>RhXUGzYWEQ%&t+a z!7wo+_9KYmZKO0aVpbd3y;BenxZK@C)+M7nIAHf{Pe z@xQ|C@##Sr&FNFb$1lQgsHGzJN=}XK17W!S)sko_7|+enl>BDkfGL6l0lo(63w=eS za8iVmFbYZ$9CXQH6yzcr#Yhq0)L0c`d87wQ1hbao{>DfTw%8#X7h`Lnl;AB?l$jD- zj!_WfXq1R?+7r!3F$(e`jgnnT@Odap+&iW&CHSnZ!t5!*gHU`J?lcM~C3qB~cpE8A zN?^5-Jtg=xl%8WFj#K{yqadfY>S9j`=3WF757a<43P+a(7=@vW)vJ=3z)K+v*R8V6 z1eBG`7y&Z@2i`jj>I*Xgjl#(Uj>RY_6L8SwRE&aLM5FLCfda^EfW&$sQFkH9FHWN@*GGheH1RQwp0H`m_1T+dK6L<|qL79MqE+=6Wu`kPZ75)5aki$2CSr%K6j8gj;r7e_I=1%Q+n9LCeN1;uQVT zox^b!3DuIX*u&ohlpj*NMzPvymZ*!^80l3I#@kE^#&ht}!AhTp;(J>uktEy$QM`?m zCP}c`$bKrxqfmN|jW~hz=NJXCCiGW16%~!?{~p44SH-L}GhWuZu(#^Dmv|>R$VxNm z6opu$UI0Xb%4h-^@f$Cs>uqS8~^6Cp62NMkBDwS$O+*Qvv z#QjzJxz;?&WeSiY*WL^(KJMC7hlO(si^k7fK0H>a4(FHGa+Lv+d-=LzqcGZE%a2s+ z^wY>_|MJMM?H_wb##Rhg2k4+2VUFrh5EY=GnrGXH4}E0ni9+`=(+j(l-lJuu>~el@ zOI?)~Sg!3ByEfjnI#4WAxu3`IVz+_k&3BBtl~ z_J-J@krP)VJKyVM=Yy1;zf6Tj`wR2NX9V4`d_Y_->|K~ySfoxADz$bEN+-l+m6@qt z=a$HY|1nwZApq1sk6+GNxEPzj35o94Iy>E*amZmLH<*BR^3} zMvBto^z70ZgmZDJOn=phX~XpCc)_eU6LFCPD#Msc&gf|_8xbEP(?9K_qDJUsS-m5; zwr$HkM0w3FWkPr&FQP{`R-Vty}sXDJPRRo^|KYv$M7C?mj9qtvfH-{=;V0 z`a@LR%X|b{I*B%4?rZZ|g2h6W)t5-k*Z8Q(wY%W9ILC%U%xn1}66jxi1UhLF?Y@R@ zccR$oOJbBE>=b8M`h9lr#Cey+X~lBSn_X4^(S4kxvX%%cH}UK%^ga zDTJ1;x9j+7qd1UPB2-3)`}4KFT6IIc`MBe&6_E%x^W%CjSS8&WK_RzZ6w3#yl*svH zLBgxnC_~nAt28AP-kM@;7yc?N6E;EfV&oC;aB6-!!MH>=zm^0;T#mbc#{?sK+n=7L zzC@B;m3UhF$QBENAC{7}zcoz|{3t!UV-QrPVWt?j`lzT8I;9wM!-f@lKy)Fp@mGBW zcwiE3{B^#KljNK9J{$SA-m_*u;-%+k$CY*>7fPD6b4c0L!GE|RW&BE_>wLX0SEnvu zWsv?6-^I!mZfqHnu|=>x(RdhG8q{mA4^?Y=q(VJf-Xk8p|0{@y>kScnh@nMEI%jui zh=M|q_*=#zDoY(pA&`}x7q*i+Y^d#Th^#*2?IzW>XFNfUnzsK>8oq_L#pUd1`vp#t z>AuU(R0w4mX=wX}^z4qbtxUtD?d3iyYJ^N^`_(=I96E_MUdgv{lD3oHXQOS)Jq-(I zPkwWb8emeS&b0T}tZ46s+{j3ItZ#j;JeuzlM3tkgmYGd!6BR{HOG)uSAy-+K59Fi5 z%vdJDDhC!!Mk(o-x*;g%`t#-HZDE$#(^VV_a+R@w#Hv+CibRQWw0EdFS{bx5;7%3= zLh`fz7MXp6ljm#Rt4q&s;XQFVJKh^lJPk9l=Dka#WbJQF!+Y^jbf^z@`uC9LK9K+p z5bLa~);f+VoJ?a0)YZ?OK?$Eq+f>dbD9pmDG{CP)96cmI^bix)in)F$jqDwiR88Ideaf;b&{rvWXs8M6YxI9mzqP<-d;R<5xl*UB!gS2vhI^4vr;REAw zpod0;a}|L`%-$#vk83LL3BoYhpdb*&fFcd+)-*6tR& zF=@Dvu;D$C2jrZZt|soavgx)Ex44`gaj#E2jYZsbDOvkl(-8MYdUi+RR;FPR_d9)5 z)Cidn_lJE1_`oFE_)5Nwlf<3$J{xgc?)m-ym!uLAK++_gL%^vW>Yp0|#?KqA)07kS z^Si}r*u(@~E)W-0?rThf5%?FDB<`=}bMZ=ggvU*5WWNT%rWI zH#j0kKiBh>dQl9b?j^Z0v211=EmX*(&F_)P9(HOqnlm4gR%_u*aoLSC<;r2bo?6Q@Dl}Qi z?gDx?)5b~8OnRSjXO8-22cPD0)S9zrOq(`Xtc#9#bJC}8pjrw0 z+P2Y9N(4n0AhwcHWuRj6J=bXDhezZ}Q}vXFniT43&il|xzY48fr5PZZ=j!!f@-^p6_t64QHESU?b;~`xLPZ&E7HP>=8%O>WP^I6N;!SFo**2?4VOxiykSWi zVpfA4ePYpFy|?Q~X>yTOi#aSg(-t#2CD8f7dN4X7BZ18HDF!H=bAy9K?j)Z`;q&DY zX+)8{570W-*SDd zT%Z}=9&~Rg6bA|->zDVaRmWrbTrJpd-=2N<-B;CYy{q{!dbp~yB3YH{;PoWjP`SDx z$k%E#3{GZ=*4-|#=l{SX!??8@x+iK{$2hT>j%7zlHfxDx;<8&T6AN=ffs?B;PES0I zMf7W>WbJQF6U+MP*&TUSnT8q5Hu|Wj5i*Hom-q;n%xdKpk zt@H{-y*!cv+rG^)uF;APa@M%CZ4)#k_1KljEO$Dwj*dBBl$L3UIpVTY%xRv_L64H3 zBe}kpcvkx`67O0_x!T{FCgMCo&+Zs;lwp_==QlnoYJ^N8&j0xc@YhMS@w9icZJdla zN#CxbXB&w9D1l&qro70gj~T~KchG@BGP_Z3_?Thm33A&>WZWb=_r0F zvfwMp1>zjizA=k-ulZ;{Dr9-}NnDOUtK-UKz(=o3JPXUE7kV5eOKODOrniP`8H1SQPTHpd}O)jjHzs=QL9Tz(wVnhmv4xO*C(jEzgR7>T^w}liGn3Pbgf#>)#{7I>rd)*2O4gnTjfCy^j@;~ zm&O=!v`R!W7>&t{(5kgsEjK3K<5UxV(fD*N-x#e`^sC8T%|RC$cBnK*ZfG=vvNIa2 z5Ob14G*Uq03^W9h(?c!2!6|h)T0+QTC}Jo_D~D?WOAKDfcbWq^v=Uy5ji!i^pf2$& zwG@v^=hjz?^dg9rRUOY;xz4G5X>PqnRy4V<`C6&C?8dG1_H0P~iPuW+NIa`OVa9U3 zFG{)E-A_=CPlQi;C)GZ9M^29ieW90soL;33>FFrLeA zq*pMaVST--LQO{s?w4=+8$ltwg*cPm3>={#Ks+oKim12tn}fo7xL%S^VuEpj9W~^s zc0WfJ+w)x}4Yuc_Sh~6!6|$tO;<6K^su{;N(~qx6JPk{x6W0BtWbJQFL#q4JvpbTi zGL1>9^fL2M{LN>#lK5A-|PQ(g!LRjkqd+H=wx6jwQGurKhFzTZs)3VW9iQ0Rk z3sKc>@)6*|Nwo3Bd>bc2RF$^qc>IL3KCx) z*VB}0dzu7?@7RhK^0)1$$U?U}`IkNC?}aXCBgekk#@_JkZuh`%W%YkzAR z?*1-4yCZii(>QSVlRj!{loZ_kS0C7CCegaj`dYUwckgtm>5lEaBIZC$%SKcUxcj9( z0_;VFCTn5NB6>E{gOl8yY}+>Ow%oH1gS(r&7O_(DNu7E7^Br8%mAAzTj|_NQE))T| zwvm2I@wZAnDZ`bJA9lc(e#(}pl z_EA%#q~PuM`oLa3iPn9;uXWq<_Gf%lWLlQR+jsd0aK|Lt_#VEElf0d5+cw^|+|!A- z4PJ{_Dfy(%ynS*9vzfe&pSPJdW4gKXrcI@#y~KBFPsY)H_{h>O>ei3Sr*_^%a+?$7 z$a!-I$>#USMBBXEB-{3!C$bW~edH`r2yP!4?M3?UV&uF}4V`yKqv$k{Cr0t)Oae^^ zG)LFC#B_rAvcu`Bf>RrCiDsU&YX-O-g$S`-weUOXK@T zdxMTY-$V=}ubg{O7K{zDEOM&2w-XNe*h{F8Wt2-?HX`mv;$rP&Q9P7weoM{8L_9F@ zSnOLLPKemOL~hvD**Ri}Nkw355w|m2#@mbKdytWSwNARzyPL@p1oS zS6eSt+rLQJ*wrSAsA_AEQd%;Ta5|f2^6%a9?>+MGz4GsU^6&lPuh3y5Re*GhT}nrZkKt~)Z=^4Y-G~>Q zO&ee@q%GxlrT=!P|MsB&g0&Ol+fWp!(F^?(f^8dAaC|?xRdYR8KcJspA|;lgl{pk1 z21jYr;b>ubY;Wf!6XP$j{?KbYX`(Ra_{Ky|2);&0tA&nl^E=iecz5ZX*tPLzj3;&* zI~1=F(=EYSf!tY{{ynE!?-kpt9!t9`i^E*jCa=jGAw9+JdgI>$X*Ql~2q1_la#sa(8A-T2tIii)@bW05#$K;6a(jA0Wx|9AG z9vmLX^I7_VD)9@=hm5bE+TFxM7nNIz(=Ofj#*MSR;VGd_5?3QrJlNDi?Kqt@#kYki z9%^Tbdy=LoeMLNvb~-1q9*K)}+dr_&Y9IVTT%V($KFQ|S{N8MOVH?xWHVzX^Y&EV& z?h;p{D*Q35LU?f4<5ZMt$~=E#Md&osSH#kT-(nPWETcx@oQ&}|jDk+a&?tr_4>Xyv zSq+*Mo8Q}2OX~m#^-B{AVxIpV^7t5;n=QzQIor|-q`|6q;cTMxfH+8_{chmC7&0VC33ZP2UNn=h%otz2Cqn4A(Vvu~YBk7$u`-_#{SQ=whW_TQhtH zLV3H^6gR`|E<;%Z$HlA$Yl&66LL6^vWfH4Q_q8|0UMN4uPMoHA2u5MJuc?c@DZUP) zWYiSbU=)TfR?nK-?6E{Wk0A)`hOv2 zCT(7;Gbgf@o1qZ#DmUi$C$kH8ld33=3BLxVhv~dV;gHvVVie>K4!ZmTqab(CDAxK; zp8Ebr2*a)LmUCAXj3+%Q`AxRrv}KNq%$tDO1~RK|Wt>yr_rNIV)OQEQ=)ouqUHGTI zufSLyr@kvi&03E88zZLlCI;R+47l6EjN`j#Ct)*8qoJ%^TnRDN@w5txucxBSfRn>0 zh+#Aerzuo13UVKfVg#Ip?W~W&&o;VHtjl>m6f16A6oOh9>G|fQjPLlu*|u7=k1uS7 ziok?jqr6~VG>bPrH=IUlCPd8(Q9^Vz#(W7qu*E+Y&_$ZXv1(@TihKs6Apg`T9RIun zqagpZ>SFJTd>x}?q|0L%g`o>8n*S2Qc(e8igOtmticAXs$#sYdP+3)@Y7zFYQm!^pes6^!H*BM;}&kG@5OWPqAJ= zDbrcj;hi@})!QkFkuV z^lHHbyI9Bg)T!ZxIi({+(XY{?N=M31q@Mh`X`-}B6yL#E<h0AJVKnsEVdDM&XQzAB9nn^El{o3PwTB zqfxBcYs*CO0L1aG@pKc#4tClA<!BSwy5cB2<7culeDNwg|BG*MU1>KdPin~xKfEB>))x) zl+jI`ltoQfLbF4aK1fBG9llRt6y&WMh12qG$0*2KHHy*U^IO#PO(;aX%AJPo(_|}O zRTafC;ZLFTFrC*Z9P)Y!qab&1(B>;VnxDQcZ&@`AxRr zv}KNqEQb0*7tyVZGY$GmjDn^?9T?*XjDlQ5qwuFePrz6n)1XQOvzFuj#)v8Vv|ZHH zI_#~7E)9-!T+vj*Hb5(yhNvhr+HAxqh+Z@bryXp<5Z`vnR-Ej*ObQl<%8_1Q-iZh(rwG+m=4moh1XhBK|Swn<-zmNMOnG0{>ct7i5N z$O9M!Ii^A}+d5=)2Ty(+i^cF{4x>MbQ4pg$=<*CkVd!EodgLqmb@1pyV@7YWr8 zX6!t55R@PClt!`IX@}LOp<`<&j)I8Z7HdKDTsUF1oqd7JX;2f6?KmO2h*1z3pc=BR zHHp|@0|fQ1BpYa!^<e->IsulY=MiFh|JP(X-nyAG-Of|Y!I$v`Kh=Ntz!{i zvsuToW@kDj;~#J-i#+Z}E@Y9PV#`>>cd=(tk37Wwv~W+M!z*KJ*Y*VG7>kAm%DH-- z4liz9<)vJxyOiy&LDxeUWUh3%w)v2(R=V8Md}4}~E_Shul`c2^L#%X3xYky_%H^A| z?qFK|RVvz&AJ|v9`~ah%Y+s{rV%)DV3W{+W#ps4k#VVI)p~&75GR+X_pH;PT3_kyT zFxy84*C?DJ(mgQ>avld=mSGfzF4h#bW#;f;h~r)3>1GZc?DTplKOFOPsPnZLC8Ih& z1EcuXxovuV3_^KVdlu8{)@rf$^WFiqfH|;6u{M&#Dwp>|6mMH)K#C?^+4~8fg3@zr z#G&5XF$%+VOtDqv88yT2V-$uiR zDi;;L%t07N@5n3=S1K`XeZR`OCx4a87&JRnX_SgGJA4;m6y&WMh12pjV-)1A8pY`F z`K@xf777usa;LHTG}+44s-ie1ybVeZ(|L`;A+N7s6yy#Lx;%nWkUMA;D|sbXx%>>m za4WoJb~)857bU;RHk`K1ago16eW8o!R>qkV-Tnh8*C?SmQ3uA@4Wl3z(J028sH!tP zADZ-&B^b+NE>wwN)^gn67%^pWyHzgsVM~J_9ap%l#QLKZE{9Q3W~5n-Q4qCg6iyp> zGe$vvqfrb??$BJ}qRj5NzGVbT6ZZ%da#|QDqxCIiTjklu6W#(9feE@sG1j-tSuD*N zu5JmxMiY|n!FXtGi&ZOox8oxi1-Ya`FVGfVqg;5ZXJLvK)jKa{x z;PKE?G?Ry4Bggq6#`EBErL0-g@s?}la(sK6buIRpHDg`Nacbih(R#9*`?MxgElXdX zg_ez51aaBQY?r?LnS^SIKXwY6|3R3ypvJCItah3u>LRw@Wlsp>Z6*cdxp>0CN-u}v zL!w7kN(>wy4pF>~l%^|YwUK=x&?!)Qj*U2(%m79~%!z7ZmN>9I=C5Z$81Jf3Fq7}E zZ-wG>>cZNpXVNl~n2|1nC|o18!v@MH^GMFDhP_D1F#M#Bn1yNJrh)+We8IFjvtJnfPYer?3c3hx$8x8-) z7U+qu{tNV8OUY2UCtqQX$Z5L^%`-aJ{M(Fa(@xCi27_F1(%~ls;ZbgZSX|W`oJ{B1 z*7A+fT7?eXiyeNup;#^l{rMn2Jkl6bw}q?TqN7CV7JY6WJzOL(bee6hHrBO1S02sx zm2>_1a-9yrrIT>=ZQ@&A9D+NXYt(y#Hx%-fU?f+o3vBU=6pqg0lfw1TA-VEu2;3vT z8923KuD_h`Yg83lgp&(~b0fh}tvVd6&#AkD3LW_uG^&OST}M}fYHcuI6F=leM#^LI zXF85CSFVy!>TW}>V6;w><{N$bCV@^j&|^rKx>7MLFN_?}Z@Eg4tF4m<0e8_eqZO1w z*}-BhKhP+T^>&F0iWjAVbXM?SacHPGFj{T|w8?zEC#Y9RkLr*RbeL|hhOt`kV!+YH(6R&7$+Y=Fby|COX+^9i z#uF!H>S3kC)yU2(o$P#&IzRa^Dr7k@U0jYI23czDh?Gu<%PM=fTEaws`VEO^wLe%= zBuA^2TqjGp+TR)<#u=Y6qPr;hjUq%88xxm+BPmO7q-U4TAe@U!W%{dLbQq>j#|r^& z7H>T4Qc{L7m7LKNgrmaZV`Taf9~Cu1C(G(}F50#&t832pfj-Bt0B= zXKUT}`l!gX?!09C4=cF!hp4)*^AYG;Duj+yk9)MM&2R9v`7DuNhAOKsk(zh;sL8c^ zl4C<5=C%9~3G^Kwfxb0~cK;sV?&565B{9knc8W7B{XRQ*;=Ie^v|_pE&66C4B4a1P z&7Ns%LbFTh;0~4+iO>6pS`U=>fq4Caumhn(b#+Ac0n0KDADJJ@QLlx1L{)hnJH^}~ z(Q#7!xcXSVLH!rm(G)!@(f=FF578OygUwUmsWU@2iJr|+ux>P8mmS4ogC5if3e>Gq z@i|xNDpCh?{j!1TFd4llIwPX5Cml5rsiV`)G)+erB7=5)*sSsP!A*oA9iQh=AxnG~ zm*d`(CO+?(covpR$LHOpT4K zBZ7i%qA)>vOM04nri;L>7Ai;rR3D82Ga^Ciu~bHfN5*KtrV8^nXw^LZ%Luer&y~e^ha9r5Y58X6d2SbsEXn{1aO*v5b`#X2 znB|G{t{BNx26Oc%&U{TZXt!?U%lbk#YJaStk1W&&V_pVk-R+@$)uQj{M5bxpZl%8Y&S(WuyJ@k)>VKt$WE^JCE&cbE2HQX%6f)zegsT@ez{< z+cT0NuU!@X-$iSLqk7F5rtxQK5+m0)B*qxYL+P{nNKPp{Qg#JsdZ>9_20NMU)1{!B z;)(c8P4-Yk8pzf2VveI3_;RtpwWPPJE1V7rmMsgzn|x$=J)Er??x*-=OhwVt1+HjW z?PsOBj;&VD2xwYHidY?xlQwcLL&nKrIXhC3Q7<;Z(SD3`ytZ^{WT2%>gKqiNu+h?t zjidr?vxZ8$3l|Xcf~E2OqXFdc=bMs+;khdkHx^I#a&n`$6Am?wJ*beSQzR}MvH2r$ zv39Z;D3on}N~gl>Uf-z1ejCowTrM z6ju~Gmw@JVmMx6mA}Bh=@Al%0P&-eB+HiWWut;sEg9{y{COyJ)#_WZ<)v)y3u=h4$ zo`?1&I#^BKQMyBX`Vd*5bZ7I^m+8|brMu+cyXD_|`^8_O!$ztA=@z?` zjuIcW4y8BJ7jxRLu;6T3m$HzSd(npB@j=P)ZSobGdCS))M1X2g!SVf!1rps$f^J&X zFkBrRrI9^j0g||{-pDnUOpL$8`a`erq=~|u;~Nt>A@~|0trmLk!px@NV=aPr8z;G~ z*^O>69@;I&!NquEpBV97A=Xv|X9aT7lK#!`Ft?Cr#4?W+L4UPcrjyxL<;o&oqOh2+ z_vPv&gXk>uiSLc#a6WmTUc=ERWS%rpN$ulBl69#3rzc$SBg7;8{JLr_lK z6Qjy%`AqWGT6IHTxj0;Gtf0iTL7MK{6Nqcop&=UKj$JecKvo3d{$kA+f>eDiZjm#; zk(TH*tFccT2q+d6VBahpq~pz$njRK7AM~2-MrdEqd>*z^Gm;Ta)en;fYP=@7*P13x=)eJj%ymLx(R3K1xMfUT3oJ)b}JtL9a7u6wV6x zXD|v{0k2Vv*J-C>r@pQ$bz-YCS~KJr`K#E1d9XU1D^?~-4^VmzRy2*LdADc|iA2@P zG58)(diV~%MloN~u{#xq$pce3D7}Q7-3q(H#QM_%H z0V$d`vcFUIMJPSTMjYyW5Th_$*VM&My^ms)jGE!kF$zN$EA`r%;qM`ow`)ytGn{)B z${IK>W;Iw#tXcqZysech$te*@|ZdjQ(poE?82$0%sW9|zZY5~DC&$Jp^_wwyf( z+n)XwdCD^w&11hGrD`gcStRBmI#24@7-wO-qM-%a-w+vP{?#yhV#H4$z@|d{ zbOjY<^3!z~1@V(c;qcSV7zH_*Mlty5RpuguW|eTONY{Jq$gzi(d z%dz_pq4bcbGzzDS_-l-Ue8@qUzhD&PLmI_e-z|d=b3cmm0`D46H~8RSr`@6aS=ISc zjFM5EABa(W>)bX%w+cdeS9=yCbk?S5A1FT+Y5_-{P$Nl@VgaIf+bRQ6H0jDdI(HV7 zo?{~p^}Y?GFkIKv#XdTB1xCrJ8D4`?7`j-g*VYVgf>7SBHO0;F0jLGX#jFNviB%6n z9B*r7601!2wKv5lq5K>>ahl>Y7=_`!rY`oTIOji5-jJ0pJ7W}vE>_R74V1qaLU}va zBn^~1WJvo%#j?tfj>IS#QS*ry#n&H_r$3wyVYt4~vbSrhQ$kdYn>~Lx*6h$>{a2_j zbPT8{f0 zV?Has{@%Jm-!@jWQ*6u*uD-j0ocMs9AQqRf$-uVNI$FB*jtJHL-nkn?C1 zW8}tlj_X$tKJEuoH^=qgvW^@^mL1GJ`x=-;FwD*2ot-cW;vENF_QEI(T}<8)@6v=V zaF+ZMHM!*&%Y%26qN#XiNsL19dp|Y;+6|Nr%>eI-tn*rI9Yjb+Qc)%${R>7xgrre8 zgfxgzkXLDxRD`r1!fzQus>wQXAS4HKUkdewiI7I&5YmS*3L+#2U2ecA4A(ITsl%lE ztr*RNl9Z~cC}}tFexZ$oqW$B*hH~G*nj(7nCKYAU%TF*0q8E+Ap_kub6yzfs#h@3z zLpY~ji?RT3l1VeZ`mCxbjtO^x(nHG7D4gMzmtYj+4i38Phf$C_XcX&kOR{_YDhR`^ z@NB!+N`8}VVE5XgmAw(_3tdE`aH7gOjDn(ygD#^O1-XbuF`^3WUSEi@JYtFx!K~%D zzj3l!N)~A**p6f>MvsIXVit~q1d_2ysP^?x;OmY4iqIerA zO$fHy$Ud(!?PDl`;Mj=c)X&E#$f>Qm*ymMt$0(?QY7~wxOEC&V7pqq#1O0&zhU-?@ z26|;BGX%gu@4$N}LVaPN*C?Doe>z4%f!;xv3PwRLqEYyP{w$2;5$Kf&W-Z74jS=W~ zZNIyWEyQmZzdele=EW%3Z^jCvVE=9^$_(~bV-&|Mvq?}qU4 zI(Lij^7RzY_2Xp@b>I*qWqi{IpR~Q9xjDs$J#wZNeF*v5f5Y;vxhiQTb z%P3V-vCIK3z;T%CE}Iqv5JUSuBD<(UbzLMAYRcZ9A3E}qaf$dC;^@hkOQAM*!mo(F60x9!r_x~jDq;YL6`So6o%h$_~c_4#e+|jimCXd zH?dV^hrM@gRFgQdNKf@Au119OWo!mSIJZ+#CgFS&qaec3C>+B10Y*WNqfrdPS=i3{ z+U(Xr;%#)HSmgR06pKqmE#t(`Z;Xx5xmmp-pl6ozD_bqvXKQ9&57P-$iyGwx^I{9B z=Y~g-g&{Gz5c%hPjQJ9JU@mS#v0?fGx=0(QTQ#%KvFwRa7@BeXa~VcK{%O_4KF4w} zM#)H*qcI9Y7i;rL&au1!!o({cjeoYZ9R-uB#h5$~=U5yl>`bUHjN=-G6UWcRC@79Q z=<*JXf?PzS7;zjfrg%Tb@`&b21hbao{>GSNSsrb4&)UD<7S0#gpAk}KyPqQhy$M?e z1^7=>QD%U@3!@;?(I^}O{T4<+9;H!?0H12*#S>7LxThdyS~-h0VHUeGH*&Rg`NqWf ztTZbxerT&Odo2GW6d$fC&?r{^POQ9`bpy&6yp5D*<%QKo_N-tbl%8WFj#DqfD9EX; zy4bUVS6~#>Ks5?Smz5ZWp^Me4l3BrO2*Y)&Y_kGoB{N>YtiXZyN>E>z6=)PrRWN6=h}uw_y}SG#Z6NG+)6e$cr>ecA3CqP?orNOkF1Mh^@lxnZWO$_%O<86f0*Z zGJ$6yino!{WCB(j*)xIppFnvG$3`5d-V>uBr?%>1&jglX6x2X93P+cNF$zN$t5+p6 zfukV|*R8V61eBG`7y&Z@2i_Zi`oc^=qi`~TGcgLv1RQiZ7o#8-(J1^(;2jvtBNI>} zn6(`DH-0AIJvN}jeY|`k6EJ>?GJ$KbHBcsS6%}P>0ykk4L^K+OLo|0`6y!x3CA&=E zyHJ+6cT8O-@GV<~*)xG(K=EOe(Qm*fW7e7zH&@2VGu)Q5d>dy(*artb{OJx5_pXP*yTy1k3~+c<)V6UziDK6iy~k z!YC*caL{EVMnNv3QTUm_CXD5g2`CZFT8{ghH50(Mm-eS|;Y&&f(BF&2jON3%0TsiTxkYY;kp+LYv0%oQb=Vglb7f?6K_@C_jvC8pUd- z9ahUjtdGn!a;s`|uy)L1_d`T)i?twTX}g{(2n7W zHsXlv2AzDFufXYp7$y5+(cOrlae5!^NDNP5m8jS^hr92C|B5Z z?L>F!VB)aSA@nC7w`S?pbY*;(kuh<2biI*l^hO^iN-OEd!kp3(qUZzksM3+*)83?> z{JLqPv`Q4;!8m!kd&z{5@N7Yqi%R!WF>zQl3HxdBaqq%RVv2KO8~LqSNMFn+Ja>xp zbEilL`}PFUYTXq9{}kzJIajMMUK<=5EFMvxdxB`JKHe2y5hUOFr$XY@|9F9plLO(+ ztS2uCmK_%8+&~J~3|T!vD?=)N=`P(EYcJyqq9z(^t-WE$X!mn8?9c=Gsk?Lsp_T5W zKL%BV>C(q0bLti4gzS~&)P50oAbwrCX2HfSHgD9CvnbonGkLC&L5tUckD^9;TSalC6h-FXHM zcKQ~SKdURvD0@X(Rh^!@f{@j*U3fdl*JxxUQ*-eJbQwjFM3^JQbrbbg@#etr->| zl(%b5aWgy%YQb?atHD}g)!QJBx3w~fRi^veo8pI{{2V)Rn&J%@h2g%YF7~E)D@Mtv zDL#Nv7`j+J%Xaq8!w|~bxhCoC9TmQ!v0O2V%jg}M1>#DD<2R41@tfCDen6e6AJDfY z=TDqH(OsB5KADHq{{>nfYW7De%Ix>e{fu|MpiwvtZ~;a^PODLjexK`RWZe)xUgu7I zxKxMKzm#Me?RR*o-oe}}p}w#Opiwwe?5i;fnqqg*<;@s{;X1|?dxy=)${5XKl3l5q ziedsn^yFyCIafYfW)8JOpaNaWSjGT4L4fAda`SGKp2D``Vl0o1y$1J8_y~ z8KW@V*VM({6#o^YWYiQd#wZM3te#~XD8C#+c{|r64U{`%NY_EdvdWNd#wZ#2!+jXV z*B_FvbA1=WaD5@$*SS=Un>~Lxf#A?#{VmiNx`;;MjPU#oqo5HU2VJ^uf;j?m5shMu z@F>^N8<{5kWFf}#7~fGMn6(`DH^zKc$5pI)t)wx=U_FRlYi<24T3EdwHUb*CSw=;f zBR8+YD2QJ)3MY0Rhf$F8XcWV$u5(;{5I*h)Q#Z$Tnye#-k!1&Sk3oGQ?`RYb?_7jY z5brqXvKgZ=T*u@cbV&Wx7|Vlql%lD4XRA4+{)^Z;h>&ikqD(@15ThVM(kL84dK9A| zuhJ-~2llR8VbZ-9qj^x0 zQZ*GNP0AtlM`2A7y&OSBne=iBMnUwVQ8@H6fKiZ-XcU89{0^xfg+h3fOq%i4GgU=# zOn3>D9_BC_g)`jp?-&KSgM%*rfl-hjDn(ygD$_sD9A-LiV;;{_xev5%Oj>J5zJbS`x~cw-Rad$TlczoD824d zH@`>S=y{)qsRs%x+fh+wSlI)kARf^u98T=PD9A}PiV;>)ZIyl)lqFvIZhh)BTcxkC zRhWH>^F$~={YvyIQ0b>1v#}<7yG=*r5FV@ zP>sUTSp^Me4l7apP2*Y)&Yy-Wrk{JSEpm*TC`=Gus&}$SumnSd^ zauJQf5A^?ou{;9362YwHxW6$1{bU|ezwH;igZ*qO$_(}|z$l1IGzy1H_Qoj4Q8bDX z>|Mvq4}kFTI(LijX%4A>xvV3HAu0!Rp8)lR9HUV<9MgwU5XU&^GK^6eu48aahaswe z!)P8Xqf|}BGF#0d^%K}SsQ+;(6=hP=RTu?Pl1AZB(x)*B@+*y!ijwYv@LPtGz9j3& zfs!1|{W#PYQj$jDP|}ka1yPcNF3(^ThU>Uc(wv)N9^gSqO4U@9l&ln7^5KP&?pA4xE)e|90d1fl{AOcA1y1$fm9r9y$-4iNkyY@NM#hG zAX0JAO% zQZW^u?9=v;`qmwAZ8I^6v*2y;U>&%*tgL1v#cdG21#EXLs=AYq3}iPv&s>=P(N5atB@R#wZM33@(p+ zMN?aJA#$E?V@wZbR|=c89dE&m@%F9a!15=tWf0&0oQg8}{uzvdnw3W3@co=yVJ?C^ zOQRTkpK2Cdy(&2izX`%{-Kr(eQZSwe%P1?E z@d9QC4!rjfs4wj4X%tR&@JWniE4S%DJ4tmU}BF|vX! zc3}BWu{BU8@FObP5?Jh8_CJMD5YcE94$=G_qaZKRDA{EK^KV00N!&Z8E)&?EWNN7} zdnT|q6dy)8jbi2OL?-ZZh~jOeG?{?aM)pkLC@4M0MjWR;1*0IRw(4Tf1O_k)YM>g0 zqsy5Xg`tbptCE?(xe$iyR@r6(%1UO8fSG^;@4Xl53o`+Y!pQ`##V9BfaM0y*7zMeA zM&V}ycVjG%OhAcX)^gn6_?ZCfz%kp%ulIrFk7H|~OyE%}+7ejonZT161rd!#;SkL; z7zKHeM#(M{==$Q;mkG=vnOZ8$o(b#$#fMQ&qgXjRkqPublz0vEI-|0>+e}sf$2D#rs`5}R8 z6sw(fSZx|Qb}06<5YgLWEr^~2msZ=^PcEN-JIZf3w&MhhJuwO*0aQb_L&T#A#AOiF zyOM06S=N(1NjV%U!>A`rO0kp6twdy&hG&+mQ^;4w4k$l_4z!6KP%ge^bU^t5bVkl| z2b9~6i0^&w_~5?k&`>?!h@B~%SeA88V{C-ZKJIO<5gIHGG}Q6r@>6(x_+YM)XZ7gg z1t#rqav|DjbXs$dIwCz(;_%AY+O<8wImQv>1La)3p0D>#)%oQ)$WqMn%hxs^lGXX; z)#ejzXH|BWzD+bzdWim5k5#{iexPI3?P3|{mp}5{`Q;H8Jx4(QOa!C{D~&_xjv6YK z^Of9izHcPgD1=AI_m4I5_28^vHC;Qlct&1u)!O)Xd4sqTdWdZxbbI63;UdGt)hO3{ zD{SGgUw%FnZRu#(hd(dFC}?y=qi~YtD=`X6mNkko{5ch8m){6Q_D;3a3;=#gRV&Bf z_e1I7aEnIa?2h$4jDnoUL6@Im6y!V_#o8Bc+2;N!h~r)3>9)Cdu+!`>!G15pPMkX5 z38Q3G=X+rkhA!4Rx19yC971_ldlqLwSev4KR^$k%1?)_tMv|BnIRT=0+bRQ6G+oy| z;E;#Xb8N(+-a1BMxUQ*-eOBarjFM3^d>2Mx=)!J>AB0fet~JHY@H0>gj*D3h))K4k zfH>aP$|P2q?rU#~-+}UT?8Iq`Kfx#r_ce8~H^tv!l#H66{Da@b_ZQ9 z!zc{bF(%nN>``?kM)R0vSE{CBnJs;G`K{O}XaU~msVI|)9>6Gwi8Km_i5|u%$elDw zDkk~`gx@ku^k1@$9GJ+#+%xV(DFkF9jlyA~c^CyTk%KOKU=)VyxG+%dy~@@M*Fq?7*P7yHcqY_><6>5WwZy7( zA&$4TGKp2D``Vl0Wl(;OojC4$B}QSmuc?c@DSis0WYiRI$0!V4te#~XDE}&i@^-FC z8Yp+5<{v@DvdWNtgHbZ_hrePJUw=rx*|qImD6io9Lbfk-sTwzX{%``pp~LzTs4sL8 zjlvn>*$<mWk<4Hab)(%&%(A|#E%A*Ai^ zMwtj~AsQtWA?*p_w+tceMly}|I}nnCxetQ+a?H&kq@yqjA|wZ0PQfUMkTi-xNF65K z2QZokB`G0NQPQNGU49nU6w%8@D$1mnw_y}SFB*kIFIQj`2)Yeyz<@p)M<82ui7fiKE-(v6d%tS zC=@FtC#ElhrEP?CeW=idht z5{9`sl(Z*CL6qd6%QB3@(8Yz44#sF6l%!NmMM>G7U4AlF5%J1uD$3-QevE>6MWb+d zWdx%j=g=qyuehCEegOpcW|cH&m!Bgm$bnQGZ2bYKF3fW@3Wrp#!zhSU9CW!EqcHr& zAeA;}m*0m`Jjg_;n2Jm?KfC-#SWCnwk5N%3pZo@+AU@G396tFgMnQg|QBv^9_V=Tx zy+!zBTN24>YTv=ui=n!ZPc#aLPhN>p5T7{cas)dG^_v8=xX^=0T$vrkvH00sM! z2bU{l&6)kQ7^5Js(kKSYr^UetWOj{W4Tgz%_bNp3Hd2~-cdL!;apFQKJ;z2Ir+zm^K~8Pe z#Xj%;VT^(rs7B%F@(GN>(8cOi$$9tNAPm>7TJkFe<9V2jvXU7uU}oUJd*6fl!oHnG z;baCs#V9Ba3L+Yf!XcVhU=-v<8YR0-U=@@l?j2K?39PhLm^~9X6^aj|oJO&7b|MofKooBy zrO5=WHnL{|XF=&XHsUz-+b{}pYO5~xOyCNPf*Pns;plP=Mq%h;^{Qkha1(^#x>dHB zfU=SqBVZ=rzdeEx&pnZWi`l$i&4Fv@8ZD`zJ%fgD8fHd2~Qz-l9VCNK)6=h%qj)E8nDHh!a@XV-&=i&|l>YR5Z2v76{{A6|>SzbXn`d-m0&F;&bZ4 z+Nx*LfzPoDA)$-k+jB!j^?Or6a_JGwBGf(vi)d#Mey|rB!rc ze1}>-H`rIt)eq>WGwr*VOb9{Fo=IgFHIG^+nLhmyr9GuBuccy3&Yw7YqPsA=Fh{I@ z=`NfXUKl^*M0#G33r;%xq#%51AP#Qs?K-*<z5CY6{^Ge<+WU8ppdUEUsr4tM*C~|k!qcO8X4_h z9=W9bWADh=ioxmt9dTW(tP83`K~#W#66UTqNLRz|6NT<$rjwaptOX`B&+lz9b7_I) z+HSFH<6WzBH9CB|k+0Q5TgER%mRaFqnbNL=LDC%{3N0!uCSgVXx=##QIYQy`&<{e# zc)xie<|tPgr+Ek6WUrn;o&(+^&k0{vrh~$RYJVv|&okCEvw^ifeGbh518 zzFgb3Wz+NtALw^GShsX8-7J$Yo^>y$+q1Rq4L&L|tvhcug@$-r4=cF!hp4)5_Yvq; zDwKTrA@2Nfk9M{B9lkc7C0Hy}S$&Dr{GN}RT)PVjwc5Sqhe)8G`v~;YNwoVf_;x3X zoxUVS8NyC+hNa(U2Tz=LS)5iZ_q;hwWhN;MMaE8on^|Gpb5%mKOX>IymKOKDkErz+ zd0(M@ynZ6g|ErbqSkNuDYUl~7BaLFUk}Jz#+&>l!=7(~l&{gdvgtG;!)wegkE2GUyLfYc-Kf3{=ab!yH`b*PS~_dI z-!6m_l7@}aycku_i@t99Py0|Qf|`!@FQh`2XfH0ueX(P-k2dijw^d&v$zGOt8kS7Q z`{h!y_P3^C$5+s^J4PgB8fLtIosWtdp;Nq{8#;RE0nvrX#;5rRux1i%yq0g{BoijR z&&Gt7d%paS&jC?=CiUw~whKB`CYx-pBreO>`*QWZkz8ev{t@5BnhY-S4oTt_lt>&G zvTlPqwe_KDP4{=yqvbu~(fhxG*tOme%uJnDQL-n<4-FAx7S~h9N)R=br7o8c$jX%q z+esa^n)WwDR)3FEE7BbLPHA{@QnSY-E@#J~*Cw9Uo)`tYYYzRWl&t-&X*l%b^z4ot zs!YS=&^vro)Ciey=(l_X`1&N;_#wWHlN_4#J{yNx?rB&!bn=^X)Buwrb*8-ywyj`OHcA|(wI^Jt6_3=^%4@>d!dI=)&F8SD_{t_}I6NAc)L zu2#>hd{RlOo=B`nS?x$UH=ur8pDT~%>s?frvQt2$n`@@8l-f!idxGLnkgJRZxsj1t zb)-m?8xZnPb+j@lp&JGIO8*xkh{yEj3%T`0B4Lpq=W6+&T&P9dgZYs>{i!s{V_ih`;>pdSTA>GJ&3$1tG^%27SdP< z=|ypakeZJWHD?bH+l5aRw}e5#ycqf6Hs3JGyFG{gKlZ)^POhR_KVc2S76^%K;zfZ> z!Y~OgfRTN5VUwUlF~rVHPo_IF-D7u8!YE)6<$=t@ZE!_VeP2mEw?I_Om9nt9LcnJ>=g*W z)Y<-4U05z12KJG1b$>Na7&w6H&I|*}Fw8LU#1IuVLRJ{am^wQp1p34tTKBZVt-Crz zMW%H-XUOy%W#=D~o>mJHXnhZDJ`rkjICXY;h?-oxcg&E*cJKH@V)xgD2sG0}yT2jS z?p-J0-yfnP)8@$-T-!Q%kl6Uv5CJ~bLmPjNZ(}>56n05RF;_y_`Oc~rQC9UxBDCca zp~M;O#>q~t=VW*yH?^L=U5xuF1r>7&l!cYo)f?_v-1Ec~ZL36UuWInGM*ftjip(#a zzeO7 zCYD;3+zE&?Rzdlb-c4_ zi+9|lE85~^bKCbb{GH8hoAm99QNQ^7$yz}xMdBf`7j2?4Hck;G$z5C{jrzFcG%?XR z7@Z~d3D90^B0BYYvi+bkK2dM9#8kmaCHix-Tx(WDa(SSOzjo9@#q`zwJu%s{y*ya6 z*E!OIJJ?G+_F^yfshA#Js$UYx)?2l)I`^oQtoy5Z_-mZ%&g@&tG)(@wEJQ_(PzZm` zgb47e9@_Y|d>h;RWqY5CzZ~xj&r0V^+}ai)o1@Okus4^ZRxP1HI59$F&3Hv6N1P3) zG_DofMQNZrBnU^87dupC<`vhYXC}pB`fz!S*oemV^ic@qRW-E)FUQAX>}!_ji-+pE zlqgea4$yKw6|Y6*3u&`eG*O{Jxfm{2YHA!zn`KoZNPA$#-c%_cRb6hCXzx@h>enD^ zq^?S~C4D;k6X_oPNOPj)1`YScmVngUD&gzG&Vl$YY3s$LYCcRF`YT?2OEc>iWm|VJ zt9b0ktnwDPm|5j7iDdU#wRNY;7sUX5CD6XELiY4U<{_6r!R=D1=#ey31^_ z?uJX*cn2!ftITj`s+(zJn^|q|b1`e@JFDgq-Pqf({%zSL>3z1PvID?v8C{PZ050BU z&Ya;&Q!FaAH^Z(GgJJsAQLw5j9?&$WT#-t?x>V#Vwo{c_G$@~tTclJiEwx#8puHcK zz6~TU7dvC+z+Qhrs6I$k-whaPt_lc^@_30zT?CNH@wFry1(6zk&qH&@g1ciViYMdI z7|rF%rxY(zJHQMeHH9D}m-rrneh|5KUpk(Y*3xAf;wiyY)>Y_h44S4@%Wry`Hfpx& zBCOfbMt@vMkK>YS;*x8`XL>Zde6lpTn2n(Lq;?>uj846*DIU$Dv;w>=PH!Kl~73L(W@F}qA5ScYK@LE^4 z1?f0e8L!YrI*O^VCi@;}{FyNxIhYUZkr-?$MHTJ3_8_TwKU~ zmQ@=o9GoL1>;7t=kp`7jaTm^5;aZFI#nW4;%YJ@`gXf#BCau01><=fciBir{}eB^j%{cQHrq}SP!Wb@YJGR)59tyKrn zG@Ee~sB3oxeTOF!qs8jO<$coN`KY z3?C)GpbfIa7T6^Y(W;19WhbAk; zj=K?>DWG`h-`YWtpxTRY!bwLmb9 zB9hIUUazQR^QJeX$wWMtbRwP;q0sN57t?Q&RFYr+m53!F2-|4cVc_){9>NU+(@&%)}9pB)Af>ktQ~TT+^8{6b^CK-vAw=& z(qMN!N~NpwsgNUG6_33r74AP-V%3Hv(+TS#QnK!^<{{NXsqRctRi-gXl|JYkNuPyA zza$NCLWr6gC5u?W?!G1ock*N91bXYttj=R5T)z+PmQwi~HQnK!^=Hc!yQQeu`txV&=-9HLZ zQ={bI?%#yK{;G%8eJIqrUAcSSw@i2J?iDEqVp^8P-TQV< zQITm`7H@wvM1Wg*XycFbZEW+l-M3x5?RY1Pw+&uPc-yWio422qVK$Suaedd&@y$=o zKIXZ)bddN?-QqAwC&?`mH+bw#_u=eI|Lsrz9YFs@tK|hC3)QPnl(lAGJF(+AWifN! zzH_4edt#!$c{!K9aN^IR5WH|Axp?HaV&;5}nmX@KX3=RPPt4-U?=)#apgp^;pR08N zF*h&%G}xD%EKRpd=>3s$=^);sul8h&m*wWp_D0JlZJea@{??3@)|SVTFP_8>)2WE| zYS0&*G;2ujREFa-RMfG7m1bXak`C4rC#dwDPN(_N##FgfKsSicy%aUNDMaj{q;w)0 zr#+msDN$t>^iZv}f-5(spT2ZyVw9yzqkj3TGLhDQDbp}&RMob2bRfI#{yEheb%%6$J>AI?KO^da_p?ECY z9vwcB67evrS}fvqmWcgJv<7&R)_uP)IuL-6*n$ zvS<6;_vxFK#;(3p+_3V0q7StF^8cdr{id(>CH9Y9bY9#dDL+{m;+bcu#-2ZYgLKTT zy={}|Ap}o%Z+5RZl6u86q}J?SA&RJ8(H*6_WLrwEm(o8XP+wzqsa>_OXgDj1y_kUd zvSo|owg`q^al5V{r@HP=HS`%{B*iJ>wNmtYWtbIVM{)Bi+w89E((hsVCthpaq|0$NPLGE z9iuMx&|gwGj;FWZqt9B#rgUzkr$p>m^yBoobnREv;Y6u7>?4HQZ^}cK=)8Jya~JJH zi_IcV;~=TU{|$(bXXumk<_h^mdu$y0jrJF&cGcih5BpWI-%W1MT_HZ!Bz)RWm+XN{ zJv26JtcWhrH*20=p*f|^n49aEGZCAlV`rns+qFKVbCve*-I}Fy4w_c?+vA|BFk$O z(~B-@d(lNHFFFLHATRRJ<%t-Dp^LNOJ8s@Q5#j{5xW?&yn?D=MUsRh9W0Zp0yn#_d z+k9Tk5h*9$1fhbPedp9@D)fqRXIDJG-4)MIX)yz}fLDxb6lW)Cv!f!#>mf?8tt3jm z4r0=k8ZC&0oz*EDeFRF+u@Q%QZ^I}I*EMxwR7QPtPfsLB{G?%REW z(=`M%@BGyxK=WZ@{Y}vNP_v7uD02XKHAX>Bt5G-|@LG(5oK~Y41Hj~(V#f^`6z%Ps zi{A&~({1iGhEp(s?s}taBXcy#X;hB6?|}Nk5r8)LPtr3NbB}4Kn#ZKlsCzKVuc?ZT z8H&xSFL}7mPcaI^b&jK@o_Hl^dV4v`AM2xkOFG>{80{HUm7&x00h3I0O?ziP?_UZmYVw9b~3zHc%6}2N3 zWirt|7zHtrM&Wdg#TW&-lSawKL{EnBTZW0AB-_Y?i9F1`66yY4XF z81Dn9N2!{NdR*5ujfHLIas4e}o&&KF5c52miZYpJ8Ad_Oqft1_ za|}j7?xRt1G0#~Le#-a6(YAb2mG9)iJl66?GdTL%%+yQnCWkp3H^AVSh8 z974JSqad%+D7gsf`w)K15Yj!ejXVg+!`#1v`a(j|C>%oC=KC;hK!oI>%Y2N&a298?XcP{;ti&kD zM>L8-FMVpik=Q<~&Ffr3vDV1TP>5iX$+JdYQVqp1;S`h}Qiew1ESdcWMnUf2q02QG z1-XMpaklq%(jk%_^mYitZSZ+CZ7f$I=)l!=<<`u!f(cw@Q1Y8>16LV5dfBI-zR*Q9 z3MZ<31*4#-;-Sm;FbZ-JjbcO<)n=M)Z9n-r#tMijN(8f&)BeU-$;|w+!4+8A7wTzE z+rKBBV$T1-qyUALzmc7oVP!Xrf_Oxua5!;)jDnm*qZnajzPJ@Jz2zAN7yEj^K`2YQ z@%@%Gg-oH_)RvM=9S!E*rgkC}AMX3mC{9YYLh#uTCD=%LLa@_D?!7U?P~j|hAvL8vI+cJ2*Y)&VgtRhk{JSEp!eXtk3fB4pw}pz zKz|!XL4n>wm%A|vauJQf5A^q8tbjnTL@--9?Qe`gzpprxI=%w4J%OI=is-KzLCU<| zQO9}nVG`{Bj1@+~{`XY0BX+pIS=sSkm{K4v(I^})S%^`Pqi7Vvj=o!#7DM=SoBPFg zc^78jVB&Ekll?(D%K^)_u%W90ma2-Bx$lJfLQ2vo97_5=MnRP1q028Y3d41LDCrLvEr61gs<|j>&(0$iT-=ko zPf;YyZ-5ua++ zCy95|g;J4gB@~NGMIH0RyO~FPg|60|SPd=*AP{^``ky~c7KMkz>_n=lGP z7iage*H}IQVS@XPf(aZKsJ1Y99?pMyP}sMjzA%n!6iyuf2}VJ2+(Vb&Vie>e8pVj? zs?Bsfv;E|s7%L!}D-q0APWu~Ujb&MKW*O@UL{~WPc6Xe%L$^OC1iJT+V4i~l{9aU) z8Q>4WD2Q}43Wq?Sh*6M7X%r*C=h}I3DwHMdDSj(6d3Ii$=xQ)`EPpN(AI5Tx;^c2@ z=fx;Q2{uxmofl3UxwC?cp!6IYah&?)7zH`CQx|tu@Oq4bI;ckB=<*JX!qCO(RW{q- z0%5pr)sa!>$_kW~%yt65Mx$_u<}i$c zyhx)ImkAsPWl4L->}3K^aW$Ab6Icnwhfz+WI62$O1WFJk*hqOY0jG`JnZP8Jo?|19 zQ(uNrkW)K#ac2Ur!YHVNY7~wx*I^WfE>5qqGl82R4A-rS%>$a{=r;Xg1Kn+UIu@T3qFTyCushzsGGl7?56x2aA3P+dMV-$uiPOq{vfpF#=`+9=vxe)E8y~8ikVyd<~XG#C6=Fs69(7)3aBxgX?49q zo5l%TiQArp>PSZ1vF*`Ne#qMz#c8MAt-GpH7CRIo23xEHu}Iqu#7psW2U40G2Q}f? zjuR)&z$l0WPz&uDpUs?H9+pz=d)nD_ zA1gJQi&xV{ii;=I&!ppptww2$I9!=E5>FS%oWPG?X4Ra&0#ORL1+GARCFBt16^PUA zO4^-~dZ7QEgl}orljBZ8w=l+?gjW(Bz$@P#xeN7Q>Mqo+ng#TlpK-y&R&*iZEwE3* z(e2Gtv?E=2f86~!jDn^nGzur>{02rrDW^s;<_>#%A)&f*Ycmu%IAP5*d-g-stQ>>? z0ZI=iEi?+}II-=1g2t*a5BAVyPmF?`N254LlpS|FMGz;r#q-_m59%yVl63bf+)eZDu5JC8@Y$= zGf;YtjX2bMJw{=;uBnTAN#SOUQcySiG)7_Q;`Az4H@p)<1-sTPcfXiD(g0eiM_ms@B(OksM&L=D0AF5hEb5yY7|Z^d?7|b zPODLjai8y@Uegdh-R53vX}Rtpyh65-$H(a&=6(m%7mffl3TLVM7L0%~83i_h$ek#gjqCa93#6%i}!$jNP4-*dLP8uZ_ z6FmyTZy6?9Kr(q9FX&1LOIRm3GT*rrr&c|p0Or%uJ#YD4y z4`B;i0a4Ec6=hP-OEAjy+d0lWxP~6mg11KDP|qtd3i2O~l8bt-hwxj5dfp=2$Ri2z zF!v{+zL0t}3Ws{Wj8PEvcQXhfxqAdFb*WMq#*)K}Z?%L4U(&0hFXv%|%H) zxrcD!&tWEl=w%No%A}XaVH89!8ihkIhhr4vBO1k^m#}*XPl7@OlT4m9^5axPaZGp~ zlpa!sM&T@(l`#r(2M=AE7zMe5MsY5g*&oDR3SqbnUhD^PN`8}V;L?#tFMAWz7rKZ> z;Y5{pV-yrsJaqXeMnNv3QH-dfT%*g;dADP%fS960Fk3n8Z;X}9Ufo0ZL#!+cE8nN0 z%&_uHjDmPXqi{I!FBk|#wf_Cow~U9#$13=PzTj099_mR3PTsC zSJ{F7g%F18R>cN-WhFBNz(DW8doxg980a+$C(vJyQBa`w(B)=~f?PzS@B{s)F;+mJ zS0b3Loc1?Hpzq~9gx|pmqhS9{D%ue{+@Gr4k5LepXcP{YJd9D0qi7T(*!yl-+W!Cb zCcfvnhj1>*V(TDEx`2u@DQNy$~B;)YZQZ5{O%##4}u4?N}hWNA4MX0*ldoYE#3vrQ+>22de#7CD2QW$ipC}b`@yVfG z?;-3wI>mKIfpy)WUU{;fCN~po`@b;aBewY`nUBdfdtemAHX4P)Hjlw5$ZIr;!8Us& zmk?^xYkNDVh8?#L9uDQ<5>UtNa6z{Z9!Ao2G@pBo<`k$1Tz}9g_U(hppz)E1bo-!w zkT~W_jEQa^bZX{aSt(%@C<# zQ(N*Nah~fiW&pD*h0WGZ_h80+`&Mx$-N&$H5Z~WIMLP(?Ju&|UjDotAM&a=Nw=fFw zERACDeXdpbpFvsDp5iwpmS+`yv#Y_}4F4A>K4f@};tYz`D*U`(qGTi3NO@M_oi=jE ziv6MV92;?*dMQRhPVLmiy$XL6MnN4^qi}RN6{9e8ae9@#3V$wy;ks2vo~2*{&kj~r zGUElz4m^0T2K9v_J&nT24lcqdC_C`b<>eR!xrjzFvIDr??)4ZeAS+NJn5~@lH%3;l z#qOm00Ja9o1a6|D%uL`j7zGiHM&S_6S1}6mB8^g9Ch#LDOWHeTFBAA5SA)4Tfrp{^ zFv@8ZCudukz}#PLb(w(EM(#{tA(WnDBaTx)4x=EacIx8J1P;e2sDo-0jxNVx6oxKN zud*|NGawAN?-iQ~C@YyU0%igpytfYO3o`+Y!pQ_CF$&5AJaoAXqaYX2DEv&|RTwKE z6Hp?Ut(^8ZekQ;=uiiED8+<3-jo2C}6L<#|Wo7~&!zhSoGzy1kzJO7X7ipB@GJ)?x zS<>DydzrwuTn*;V1bzv{hfz+WI62$O1pWe1f{m1CPQYm+cP6mggD8*T*ofoQ`(qU3 z)J|R8nZQzvf;y;1;plP{Mq%jU^eQ_OI2FQh-KyA3Kv~I*5ik?*;JxQVePJe`Q8<}E z4Wpn;z(bddFbZ-Jjl$0aUXHN>G65xm*~)2ub7lhg^)7ePxvy7o-bp8y*I0MjID1#e zopkSpW=pH<725LMN%vnQR7W!6j%}ZU@p%>guXNhZ zeJ9<4 zOJ~HzMcYp=G75{E8=I|CYcSq@)9ud*EiQvh!n~R8&~_#HZl*h?T~Cgi>D4w(~(d~@u>W!%tk@!4^u5UcGG}bIrC#ntoE8R@D^^%01>ocw!*otnYTM7Fk z9N(TrMLQC9_l}|xMnRJk8ikW|)-ei7IyH(hdpH}n(p?Hg4o+F~%%5GXnw4YlYoPRS z+Crmn4wrg6MnTTwq00v_3UVHe;v7?U-1PGqh!fo6`EL60u+ul8{6)3-k1#+U~p@N&ei0iO)7sn^vF*F&ga*P7*S_+qF9$Hklm>xfnV32}n0 zRY9S?v_91A&s3B-?%Vmd!TEwl;dH=#FbZ;7 zjbe=Ze2;iK6vC(5+-o&0*R6DmNhYtO4?N6$3e*>l05l3`v3ey&L5tNMx|A>q!*z_s z>Wm|v>KH9xxmu~3i)FU-t#nslqoDn3FQuYPCVDMKLE%%QaG2-@jDp-rqvT?uk3je> z!$cpHZRBxif`_@k0riDUq)|9b^h1n-n8-tyUt$!7>-aFyUoct#6Dd`5G108wO1I!4 zn4Tc&*`10qspmk9f~ZHMaHwY)MnV3gQF2kw2@rnEP|q>4jXbEw!`$aXeIfN|6b|)N zFbbj`4_!856o%{gP|wRSS^)JZRdZ3#Y~M=v7HkB>Ja43;Oy+qnMnTM@Q8>)=-xvkC zk4DMGJa4C)J+N273<=XV$dF^`8X+dK>dFvE2W=7G1;&Bs^) zyrUG Qgt#nJUbr2yPOhuW5bRjo=uH?cfSZ)6 zxwxq(*VEmCHAOsgGZkg>%;zu);u(#?;hAq>6yzfs#o(E+>*+Q_A%fW^&tmxxRYP%1 z_y;IGqzsM1Sv%YAcQDOB?%<)zo)`tWgGO<#o!Q^UMG%JD;KhC$r{p);2CgA_^s*ID zU+5wlg%eeticwHh@zCYj7zMeAMlqraJTGS$V+F(%C4$+?X@6rZY4+-Rx{I;0D6C9T zQD#`V3Zoz%(I^~Fd;>;7PNGqau#)Rwy!Sv^(v9!8wwdQ(ymz`9%)MXjGf;fE0YsxX zDcRbu_Em@yY@|FP*l8p8CYc{Y={YvyIQ6eF3UX?vF78b-f5#}OgK89xE<67orV|WZ zoL*%I`h6e_*R6^T^vX(R2!Mg!gZG{Q^@V|6qi_QK2^a+hdJkRB!YIf^Gzve^uf|vb zfnJGVwsP9v7=gZ**VApl3Zr1(prXuR|5A*CxJ09Hxa8Fs1v!dFF@nAC-lZELe7ep3 z;(MOEpx!Fm$YZX`!`z>S`a+J;C>)Nt6QdxG@zCY_7=__F2FGMfQT+m=1+a`#H5bcl zHP_S4{R2!15GDPc49ldX-7yNHB#pwMq(@^EL zNJ$!nLrLdh6huiLx|A^r!*zTpsfp17C`qZBi;{}Ho^Beeh8M!7F~()BQID4`!7-*VBDOHjqc2<6-M>L3JUiXcP{qY{n>vR6KO~4Mt)3 zjX^41uBZD4MhPGjrD85JDg1i6NBuE4Pgy`knS63EMnQa{Q8;|^1dM|GLZjs1lT#r0 z7U7cT|$?2HQn`Cf0Vhrg^Dtn=4On7m`0;;nC8oe_SJOC?AqGSNnyvu zbl-r|aH*$bUbvu(>F#tjo_lrXr%(~N@}N16^hxz;q1DH5ATJ=V)!tJ!5@oJ5QBT@vK*r@bTJq__7qKN@vn*F9EP?ypu9F}il6y#MJ#bEhd>+UauvZOu5 zZ(csny8ETB26Hp}8=&}**)@tY7+UM@?}RA9M#{79?zE9RPJ9AN&#@85slS9#kW)K# zaj(072cw`4s!=$)+>cQhx;VYcUUz>O!f@THBfnBGfd>aGE1B^EW(FR-x9gu_!h+1I zQ8<~wei#L11|GUB!6*z}jLZOTusafC1!M(EQL~lP{>I1(w%CPqXJc!iOyG1X%FF~V zz$l1lGzy1k#xM%}3K?SA)4TfvceSFv@8Z zCudukz#AY+u#xg)0!|ybGl83+^c)*;oca?O1v#}-7k4J`C5(bPs7B%F@*RxA(8cLh zb|!E?gyFhXv6+Cfk{KglCg8z)|AhL&^Fk3n8Z_Z2rzux6SI`^$A#)Wiev?eFU%IAx9w&HHPadyCtJL{ebEt|H8SMWRI;@CNeC0%6x-!l=yJA&yH|e$iqB~aXRqFt zE)Gj|>K{TBu8}&jkG|xVvY8^gwmY|d2r9ubm3h>I8)eSlU`m0qPG_^byWnoQQ8-<2 ze~c2^1zq=9CLMAq1m*hLiF6yJjKi%`V_ms5Gricj#jg7mc(dS$$3hJmj)=3X)XkdC zjLIzSd9&tmbWD8eW=-*H(9N1prS^$$7#!U}Y<%e--4s8VUV0AQG8mPjm1nP988u5A zqIx5Gq4@v)q5AklqfFNq4ljws^?J>Cx0O$k#MxHErbs&*S#|WqqlZktVA=T8XnnlA ztWl~Bjg}kB)>T@glWQC0iF%X%G%>k$S>kE#9|tFqA{wEL`ebqQ~QEN z@xvNYdS&xV_(GK1j9y^~TMKQNO&{a_v;B+#HC`F11Dv z8>_4@NAwY)N$3VbKJ=7`5tAYqTt1aJ@JfJ*`IOZ;jS#(c=e?l<(?x zsWcJ3zPbv@x+Q5~ay)qTI? z^wXJw>pmtf{#{sAhB1}gW*~}NLHwAQ{u3c8YJ@Dy>f2?sZ9DF?xibX%OCHv(ew1F8 z=@iepU!&KHweC+tRAgFrzTN-h2JZYr(%iof5$GW*WPfv+cK)N2_lW9d`Z`hU+$AZ>5Ozv4 zEd71^X!EAmq-n+R&ILUVLy56%a5K+Kd#=i57FI9M@Nn_o8;M#klkbgokJp>ytEB6- zv8kwE9KJ9R)hAk&daX1jgYnv_Xt+F5njCAX3xFx`o*K0plXMestsc=`+NEe?Wo%5u zS&{cdYbPnNi^}4f2co73<)v0MRiBK8O0|g6`lv)j%46m6a;?>jDm4+m`{EKhKNyV8 zr364CjEMZFjnky^8!35{L4T;;XozHDs6IA1UW;n zL`98|74PT8jvjkJ@*uJCYeEEgWe;t94d2E#6WZSAVnW9|pZ&kj0ZDt>`el>tnHi1A zCfm0WmzA4qO3gJBrP?t4pZHzuvfvW$h$LP?iNtX+>$Ye-+Z?Gk^ms>AE#DDUAMr$D z*JevFGmTe8NxH#(WP}*AvVjI-f~cu14Y`CsPOjX$o78cy>Hb1u^)Gw%BF&*+kcRKz zQ1Q4p4*ii;TX$kirC#?+$-2LqheLl%b!T#@G7XbM{}`g8Mks_s=l#QMvF?UT*?4;@ z)T?Z=kLqUH*yd2%`&=CAc&Fvy(B60FqyyR_Wz*j0Gkly)d+#kxOpHyf*-#prEUytn zRic!SnQCeiRYbx^8RO7sskW{h$*SVCQD%rLK@?0ziR6@eAsQ>KEswQdi&MUVzRE~c zs!c^CR--;qAxex&4Vr1HPuASCLkk=V#N_AvTVnR(ygXm?-czLKckrHgTpaJ6Yt_c; zlh2frb$>Mv?>(F9&g_%QG)&$b3sF%c6vBHKhY0Y(9@_ZDd>h-mXM3NE_Z;uMv^($3 zVy8|zq%C4L4<41#9&8@GTXUaC0EdWm*3}!CL+*2FpiSf8(t1kxRNAI;HbG$yR;8(L zRpMzQ@`nLp!bYXEmX=%8h*>kI;?dzgO_&v$h?l(FqB-*ow9G)me`kJKsnLwOmc3GT z=Zgy*YPQ+Z^|z#PZt?0bnk{dZ?bE@Q;&E|o`6a8i?i85HV7?$F>;7sUw)_g!oynHU zG)%VqafpfNIPjp1^mJdEj8PiHp8>fouRu_h6$rb{`Ym@wvOX@gkj)%ABLM2(sv#%1N& zC#e7pb@jTMv2EYl@CO5m~2rHh+{y7 z<~*Ad@gRPrPpp(mY8Qk2ls)1w;~d!UmwM4QTuj*Tox}r{{L>`c?wlv+Q4{yURLHR) zDjpX{+{aqAVafE$%2T9d-CxZ^+{aVhnZ&J3!zAu!hp4C#3L)-wAp#8d(8d+Mjcww# zz0XD5j(2|dZ%HZ%0oW$V4grtNXn$@9n7)>XwLUDUQ|&g1C-vp()yZn~^_rr3 zT0a_)RNtJUnbC1Y?32y1d`1mfsZko-t~E7%x^9v-FiDbbQOr=}uC|zzYJHWVdTqmD zVw+Q`RiTVqE=5TmwKki~i>r=FHhGX3^etX}N;B#krA^6Y%`GP4u@|F)EhZnb>grCC zsYLi@DOdMb^YH11sqRcZRfb{m=~qHj)Ch&}>AfKWe6NQ#{vqGSHlNzQ=i*bxJDaw6 z$4$DTEnYUay)L6I*xa^>Scw+4X}VPGO1D<#OObe}#`VVPH&K#YiXUmz$0etUjUI#1 zSz@t=Hp~&xsn?S=q{{e2y+MQj!RVwC{kd7LH7jC)=s*{L?Wl!{>8t&FVzLEve`lI; zx_A9lKDav-a^!>Jak{STC3CrhU+>~l+xZj8`mNfqWI7)_SW4FY)ja&Ql87_|z8_~#~cJ@+URg)ujwFyZK zea#Ym@yfU^CCXH2|1m9b(|=L%~oyQnKG3WzEMin{nb3AdL7lBNvg^;Oj7-Dh>9Aa5K{d@ zhyb7Op^fk0+t?;m+xuLk+WF3^ZE3PEH9;!p?*1K#B zX^OR__CBUHVhF64k6clJ<~GHwcIvYkHTJI6X+vm>hT;=MpR~XvYiX%{P6O?&O!Qd? zF}T>&B!~0*;}7*MiQ4jMB)2LIG|J;8qH+;7Cdb#3Y!o_bv=y7?iPKONMaF5r0CBi@ zN>L)UIlur?69+P0iLI>kgUGP^(ov+emd;8SPYI^7u0k7W+pBPTZZ>MR>LQrgF-CtE zLyzNnf}STqOwPL?JYa}Z)%mfSp+GCIu(mxr6tmEW=(ROz#)T`Z8dr{q)(N>v;8Euz_sHhPNiMCG(5#XpE+V~j0jqPY_d!H-X zcD}Rf3?leP2wM#f9wF=^2sm2BfH;25r`y+IZ>0%J}5C zP8LK|qt|7m6f$^4Cy7}aUaX^IPEE2-N6ZnA zy<$%LRy3+g{+!75A68wgi1Sh@SNB)*jPI_bx-%n=G7K}~Ton z2l+O(BaZERu88A!=cFQfU*fekLN>{)&oC!K*HNdb9I+HrJ_bCgpUpm5#X^@s8^$m#Z))b#x@_>zUSg2$2;q1v!5ot&Xy#bx9-bu zZ7y%gxqRcIH`ksD+D0J~qs8i*vBgn8P27v`gO?1@v-()6(OfLPbys(4$(effBOMDP zj+~=8h7xUjmJCL7G86P6Mx#-h5{GuEJ#5LcBu%GJHfS@3oOJ1HPrA^wL#;hYM6($* ztw56%Vw>Fv%@oi)15H7c^i<1W^enk!Lm-Q(h>;R)`Dh3%IYA?4IU+f=5Ootb@yG;%FpxaUz%H2$^O;Bt>UpCx6)B5v4qwcA}_G& zVi8YG%GLeVJlxu(x-lc-t>A!C7U`} zHPU2SUvCsvyHEu8%VV94jdt-X#F=yw!~_KawOFes&)bv2db(bckF_suksCGUscwHx zEOwVyx6+jQRcW*iN)?a2C{=AVi5E!a7L-J?pINnaXUcRoCnf9tY93Pk1=XENs>(Db zsnW?cBk5yo=$Ayze}t&1QL=~?>`C0676#L8)!k$%>+V8@dX=i~L3IaNx9hQ2i$hdo zS~fZLLVIuWAZgm8LIikH4{f}HZ(}=T*?rp;vK;R$^X0h2dUkEuT>j;Z&d=uZ=OnC} ze0(i84u=uMJUCqvYW3n?hi3?4fnvA8OsM+(~hcdXk&1(rO*)?VJ_GpILe0f{!@F;+{v!YQvK0o!*a;l68MI4{sktb!YOnGK~js zuLx07qvYW2XN15$wTIR{BhcIwoJuJ~4d9bL7l< z`?&D-?}>>%?&VzitniPBLh!8c6d$teOonE;#cF3jT z2>Sv(HSwOl?PKpTnyD{=j$3D5EKJHoyNlAPgXW>Waii=)g{0p+UA9RvY9%Bjs!z+r zZnh^yA=gvMqg0yp;YCe1DDE=3mxcjb;r+u@@827qeX|rhmby zUi9Bxe9@cct4I;wIT2qgfD4_bPU64u+vbPjW}$v{R{Fe=$(mfnohhe}rmlW^dorCk z!M^$#@zc4~I@Md-KYf;dy0ZE?`S0iDzqiSMZ;!9Ve z7}}OYv0-?UKHo}qm8Wj;STZy1{zIyonb952Y|WH}$g6~$THI78t4?)@++V#U^=#D& z+Gd*)OzhVeXIRq_v8~Y+Vxc9vD3TXw(EndjZw`u6^iQWtG{h}>tL-&DE96JY zv9QJ)V6VQ7BsMI`{go@khjxTP8={g;OsR*)8vKgr5`9nA=@nY^FO8ia?^zHgGGs}n zEz{#%Abe6F9-U{t%&M6Zi(?~oSK`_7Ox}~JkxmuIpC@f5KC@}jS1siR`MS&|K9usP z=|%3gk7Gl(KPRj_Zn3gSvHjK05L)$C`o|!E_&UiC(jTZNRN9qHi|ch}@#Y=b!{yyO zbe+xZY0LB_9WAy-`cYzmi`v4gOId6S+$AhG9&Y!GGT#ueYt-_g2I`Z|;gza{5+`f-c|FD4c8Y-iJ}pwRjrEu;fu@bZ$3;j?C@fyERMa^c&5J zSlh8~g(4dn&rY=eZMZHzcbuu-A#Ty@ele3m3B0-Sld4%c2LBe69$p5mQB3D?-xt0a zqaf$;(B(H61v!sKakh8IHBCD(!RGUW_rJyz+#3-R{J};(* z6ayX&p@N%z=hToP^oC4lS9ITMdp6Vp-jInpiA9PRK$KuxNtApY#H1^go{OpQ)v1W0^16oxKN>UDL)8zEG%Yt3>u{4~^p<6=&Ob;PPW zAx^Nh3W-&w`?|a0eNcXmoj6_bL5#w1UsD%%SNt1BDX1&QRcYs=@eU$K*HlG^ zE}Ok|c`HU?xXy93su3?*Om8m_t%~*0za^dSeHiT-RF$FA^n&K(gjmp6(;TNyieE5U zr<>tswzi*avlEQQ0Wn31V77AF-xy=)%#A9pz|ubQ zUTfO^J?RwtVP#QRc@!08hLt541@VYR;c()S7zH_rMlr(5eDV2VdP@)rF7^TbPlK|g z8{aR5m0xTJlFccu26HcvtcK#l8Apxcq+}}uuZJkXM#>X{oi=jM%Dxy%&#@85ss9tB zAg6Zf;+~a#6GlNDRHJZoc{fI3=;HJ$o4`K`VYqHpY@kWcXA)M%Xrz;}|&V6Q%y z2BFMgJ{4tV29L!kh8M!7J^vjok}&)^W#Qh2X)gB2fZKHv98&o`MnRA!`RC38-rBlE|>jL?BH6ST6)|AqXdwNQZW~q zEO2}f<6@KaQNNl_(vK28S&Fqpd~ygCW%9{U7zOc(M&aEEBI%aToGrzM8-Dv(JS1Y>bQU3@Pfpdf!I>tzM&ZQqCPqPV+(Va3F$!`Kjbg-c)n+=L*?#g0 zj1>^gl?Y}lr~QpF`?)OnV4d|Hx+|P_JAql-q1&Gm0(}>@3<~f!P*G-p{|H7wq@z(d z1bQ1rK^~=1i~yf&P4pfpOWITXra|+piQesMFn26}0E!P|xkhpFx3wnvCx{Ykq&#b) zP8+$if?alnxd(D;jlyy2eK87hYNsylte_vG6r{@$7=@vW)2nQ@KN-Ss-Kry_&XpCY zwlL!b%nCes?*gbV%nCFLCo34kC@3rN(B*{~1-Xbu;b#R`V61?wK#5?sa@yY*S;3)6 zR*-p&jVmK?o$0N!0oR|BOyF(U8YmNZGZkfK0`JEth-fqlhcrKhQIHpDl;SdhuR~eV z-Z6Wbz*k%i=FS9u0>y`!fJSk0wv`F|7NP_jDNiQgw2?a#*nYR*OhBV>oO%I9K~C+| z#hnQph*3}n_0VM*Mq%jU^eQ_OI0nLS-KyA3Kv~I*5ik?*;Jx#pzAzKeD4a~7j8RY~ z;Gs(sqaYX2DEv&|Qj8Ul2`CZFR!;jHKNAR^8wfr?{*BNY*UX`NpT+;6)4rDKV5S7` zf^aaxXcP{6egvZ+chV@ur380CS<-GYdnv(ft_E|b1ouMmVS{NDCwW^b!2=K_*hqO& z0;i4KDZxLW^c)*;oO+ktVd8CD<3Epp-zPaCGU%C=6YkUS+2QM?e^^TNRrU zC@Y!4g2S#Hvz`t0g(-pNJx)q+0Y*V7fd_|=VHD&d8ik({ybxmrqy$O?vz62S=1d9j z>(wLZc!(>jN7BDnh^5VY)L{zAL9gj!PG6Ef^FewQlx>Ox?;v}M^baj|c zP%4RY;`^&lAr7k^P5&4tSXYmyC({d^=R?g@PozJN?od5R6upG1s-7%<+GjrfB!0bo zrh2LPG;Cl6_pBkcwmq4&l4_CyoLS@1_bauz%tH6zEM$u;ceDKqNa z_hQb1S9jH~rsL$}d+P_HWI~)Z6iye&oI#IYX4RZN2wn=h1rCCb$hp(kbC~-@nFqn| z->#(H1<3Ei&Sf8L*OlX3cDF#rx$J+ZNe6fY_aiqkq%K`>Y&;)`tlguXH!*D0y-zQ8 z8K>=SMTfGV4Eq5b%^gogJJM74q3q{i6f_jqD4Z1Q`4|PISQ^EcE1Qi&*&9&g-~=tt zY*9@$E63oML+RllU88VLxS7Ey$ay?;xgMh+=g}z65md)Pw>Lwa;1uIQd-*k%uu#=#*N>Lk__`h18IY^wrD z(X^3!n0gSDo?{~p^*$b>FkIKv#XW_7JVq&~8=i?#7`iyA*VPT52cd#pYnHp=1k{4# zVorl~#HvdmPO!BKiB+ciy1U}5q5K>>ak}DLF$%+dO;Wpu9QXYV zqadf%D4Y)1wkke`uW8CL^bjg zvow1$MnOxn9Z8Wq&*r zBA8_I%+3s|hT@p;R46^942{AWteuNdkUMzjvKFHtchD%#!J57Ga00?`8@$-9hf02v zZD3UK=w&a5`a&1cD4eMBdW?diiia-mz$nN?G>Q>blxuW3t>6}n6%bRD2xcp%{f#k( z?$x2}U&YFzu<|7;$_y+2gHaHVXcP`7{y&U@oJ6A-VI|iA1b>CHq#NIFFrDWBf|emvL7Bnls3pLP(xWFXI>?7xw19)(1g#A)jaz z4xc<8qaZ%<(B*iH!tfgopPY$N0{BF!n2S#iwLYs!js@@hoW^xvn|1cOo)fm7Cdag` z!!|%{Gekw1Y%_^b5Zh=J4%=LYQIOYY6oYN{=rFyuw{z0QaTNPCP#!J;bTkiruN1d(QKAjDj3fp_qLg&VYG% z^7pV<3{U28`Oh&5;&KmNeveTYx)@xZ_=={sfh`*a6)O_l7wV$^`bHqRdR-aTo;=jYi=R&EXgY zd67mbE)zHj%98eu*~oe6vZ!f@TH*i1lK$&3*&6Y$`@uRwia zCZJI`nZWlj3d#gLbon_(K`x?E_?f`(F;+k(phPfRIqh%!On`NEm}}-Y_<-)+_6g1e z`lu)~6WAZ4AfnMI9HLo@QIHpDl;SdhqoFKm@0h(z;3!vvxif*Yq4+S$X%r`CTbaNG z5GB}1c`^Z~jog_)14_@a5yz=FVHD)lPF>uYz||N9bx@7M(dAlW1TPR>|Gt_a__n?N*U7XdWE)p=W_2vLUkk~?$~x9lppf8 zMseC{_p?nyr;dDH1`&fT)`1u}U+J`+`&{mmpe7vKapJ@?F$y99)IzQ!vXgbgH4rqo zkzAlfwv#(IX+mWf?Sx4wbuPD)h|JRPL~eD)_KB(Ex0lngJE`Nh#jiyizy0h-j^Cce zgv;9>M?5}=^PJ&-@>CDA5{iEAYFER>? zQ{$VhQfn~Y_0sLn2_3x#_F(4e+^=X?lK*t>x3%laaXPnKAmeoIKRe0#EDoC2MfQ-?RSs<;HwQ%x&m314##9p4vU4qt!nysdy z%yC~Gqadf%D4bY$F-Ad7t5J+`pYQo0uYmCBHuqXR%5^gLRkDpdKK1u7_q(CKa0H-H zIE%9%#VBZT)m;9>43LVY0)EfYAb&NU55OiF$G}_eQKKqL(HWWzx&bFbbjYy5h zqs!MY3PTsCSJ{F7UI@c=t6~GavXU7BV4(Nly+1&GVW8J2oIt^*l?Y}lr~Qo)=(n1axu1-!gEE6BQBh`Qa2iHI#G_F-#PckSg1kzj7@2|Z z%=$VApLP(xWFXJU+(WXBJZ9EC%zY`;7ZQ?2;Ska*FbW!ZcG9tRmu-Td63MSMJ6rh*vZUhga^yD9AZ9ioq*>Cv!gp!Gl>P&&k{m z$_DZv6%SkQ62bg~VQUVl?2Azlsd(tpk5L%97^KqWWbPv{N&uNC6?2hE;U{ySg|$R{ z@(e1<3+@$>MG&b6cO%xXxy=&fm^DmHYcxf5bHRP*En+`~ssO zrqL)IruhR#K^~(~45rz=eJZyyySBD-y2f!P_q+p9Z0Ax>$Ba!uXL4^x(seYRd){<^ zs0f@B)F{T8+&e6m=8V5hjDJnOMO=#U(0SZWt=u!6M`0A?k_yG_;c(u|!-r4DVljM} z!{E=wD2Ty5bQ#4c3|$Nck3B_GTKsF`I2$lt0GBIe&6ZC0T*lnjR&f^hE3jn{%U?xB zJBY&lCE=Sf3hGiCg~Rgi!6?Y9G>XCUxmLtJ1!YNlir*wyo)xi=yBf^R>~}%&A+u`~ zXE3x@#C`-(f{m1CMa*dCh8l#{N zioD8R5jzyZaNVjSzfv%PXQn9m&3FMb0}tLi1?mf3M5AyrgOwNsWd)!&IEo5rRUg)+NjKa{x=~Z?na1eyyx>d26fU=SqBVZ=r!F$I-ePJe`Q8<~v z=@cIop~OxC^2L8!1mF;IxrD z6SyBr&#@85sUOBD$f=#WxHEyd2L)#W8ik|F?ihuki_@#@OyJQFhU-?vW&+AeW{iND zfCuj#3H61UfJWhD0;gaUlnHp~vJ#^p7ttvEOrV6Z0x|(5g4xPxe{*I6`1LMlak~$- zG|u8aqcu4(Rz6>>vlVyXsIvoh9M`=GS~hJFujrTWxbBNcsE&Na9sXvZ{E*r;iqlTp ziMB|c(S1FH2{x0037ow2u+m4M_`z1Pl7!nJO0bdgBneI%xeqV@E|i{QBTiub8Ad^@ z3H?>BKqX77zk@KrO|e~`g)V1XxO?@ygM*VCWTkEC?B-ObUIbCNM(W5u`dU*HmD;*N z0aj$!cIUQBp%NUoH9x|3qa0N*in|M*nj3}F1<%DOp$bNhn1K0S68I; zoZi(CJ2tZQG_mvTUUq)6vh!!D(B#_D`P17({i*0H9*-V8y6xy8>c)U-XChvGW?EL6 z2kOmaR_6JAt1ff5w$&}FXDhkBBjxJ;YI?vkz0HIU=H&|~#wtUV*36aDJ2uKA6zj_~ zRhyTq_fp-}^@MXpb&UR1*O-jcPiG1q`y47EkaxzuoS$7AjyIAY)AEF}Dy7TS+ zA2)F4ACl%iEJUECJ+%3yn|kWCv8kwEe8oHv)hAkXu}W!72II9;(QtXBG&$CaPA!c!%M^G| zjarRKx_qcskLaqRQnax$HYVb%$b6!;lN8uRWpT{|QB#ESQY)IOPewzfT0|*(RH7o~ zvGRDi)@nwTnuyI*vBUn%=SN3<7@)4rG)?UV1@sV?MJe%WMuc}8Qh$@XpHVz=g+Qj-QpwPE_d_@Xy1@s3F16_iLE7qf1Q zMzl?FQ=A&_sH){VVspk3Pb7A2wgfZNh*gxNOXEgHh%qZ0Xdottn#$6UO9dxddWf&%(-4LRpMks{OJ{%&z z2YYDakMeD7^O@~?E#PiRt z{I#PNDyFaY?}^EN>E*$iy?!CB*1=xlu@`%(<#RpFs(wi%o7->J)}53@rl|Sr9~teL zhrhNZfin3^nTE+<`-G^d5enh2r6B?=rb4~Sc?bA5w)xBUJ{NyE-Wi^i&Y8HiEkZU& z-JjvpT#j0GG2Q7tTxpglh!U%Qd768(+p=+T1zL^ zNCK`mD(fmV@8qwj)2bM2iu3EO)*RG5zS8Z0IU_@;7t< zSau=Rof*rNX_&F>>JSw*LLss2x)1@b?V*j|#<#H@%WUs+#j?(KR-Hiv{|I3}LfFL- zc0yscyJhDs&&}vt+`MJ_`HlLS~(&abHM%!s25!;CoFE-}s3UG9{M8ljMgvsZ`!dr+ZXjh+@! z-Ao(X5y$pDSHy9=b5aq#FY#I%A)92rp5d}=lDSg!_xi|)*i+zOnI`QpZnaZ%$uOl6 zIrbPOQc>jwqZ5-o5|k^)M5D^KH!6%&8cnK-l4LQ6YOb$Li0$!|J<}#e`oYOYeTj52 z9i<;77JP=6Pij6oP5NX9ABo3B@zL|Gx>%icwUn#-t9kfnE!CabSCnCxd~{)miW;F1 zKDshQfXjPm;66Q#7N{ zC{2m&)ih5sMr&(OYE3q1RZdR2^tC5lXxgFHo+P5#44Mq0$%<%#b_~-@0nIbe z6hui+wG2kjl1q02SxiNYlxXd*A+W^cMP1BtL~?2+ew3QRqIyexqAs;jj7pa_)GJ+g zdmDy}iPbuRIBDfuz518t)=$cY?%-DO*pFLjQ+q6-wcGpKR$bi*Go1)Yxw^lahg-ix zb!T#`G7OVje-)ylMks_^{}CdZdvn>W2)QOV{_ zZ%C7gcrNKgJSRe--$gH`-z2Fdzy2!`OF|H~(Xzw9$1^;H8wRFJ3T^%)&_}1Zq%5ky8St^*ptYM(=^zf zj|6pTNg1E@5WQM))&K1w`#+Z>E*}Mq-5P+%|oiEQ{9SGubDH4 zx+47#d`qKjWU?!LY%r4k@_>FxT4HU8z8WQqVZknyW(e#=56wK;HnXR7yMC#3RfvjA z%O)F@wHqf7lBT^jM1VK+(8h1!+t`j>b|-hmF2_5|e911co?TlusSjqDj!o*%N$7P= ztbp8K5=`iNy;6NXYLWS#ooF$UyZ)3|=$l^trAhqj(n!>N=2wv7ad9O63#+#7%$&-M z@0XHwe>D$@KR|V7X2!}i9^5_WP}6ALWlyQ8QF3ti9wD&1QK4SVe=eZ9gRI+?yO)Hh z$h2%i)quNKga~kC4{dxj-^Mm~+kM-`-Hvw-jj0bLs%>6NSjny_o44=G==i?8ojwy& z?F$UzZBb2IKjA8F-cF-gylwm`vCs>=d`t88xb&?K-WHFG+E|2knUt*it9f|) z3aUGkS(Ir!c>66OYHE}my#4+V*!T9(x*rI&Zdcy^Vu*@N%d&X;yCDL6yN5RZKHtVR zZ`*y_#oLZ|vUuCzwS<-InzDJjnqfARw{d;f(8tmr%l@dkx>TK+Ay4H zAYaWss2%(ln!7((`PhYw;5q;^>s9*l76wy*HWs0w2Xxk>$ zBZd8B^qoE;IlE_iHxn_AymApjSui!paX@qW|vV3#Oj0B1L>mSbP!`E_9kYJZWTm)ExclNTGQnlQp@VJ5x@dCQ|+M_GCJ7 z=uq`D;-`<1TGd=+D8_^X3ZqSy^0*h|KD=WL>TJiZ(h%eoQ+M z>2Ew%P&jST!^59MkMtJ~^uYox;kWBd>XAQ*_b-ZQPk)IvUW%H9#75QQ75S;{8nM`~ z>LSUKTEx1Fl(C~=TL2Z{(}g-!ps0PU#FaeRU;R+3DW(^>n>(h|Zhub5>@Lj@vAdeg z)L;D!p;d3Ce~f+;ABz1!`UAPpSKF0LH)idW!L|p=Lk8*GzT4A=*(vpBiawONr=BG0 z-`AF0ojqr(f0t1I?r!SeW~*QQk*JT(JS1_xlM-ju^Qp@`(ouTbQFQd0gMSn|PN{o6C6vT*yJJA-Y;kx)DZl-#NIPSLlDT`^Wz=M_}63ot# z7;W4=Ly0N!Ud0g)Dwi;v^T=+o(vFku-&Krsx$(TXuGpEA2Z{Bc3at;-Jz3g^<Ih7p!`L( z`8^n=pf>+0MhR{6c`+ZP@`Z;WRB*HJoEkTU9^UTkitY;+b{GuKM^GoRNO3QS5^Spi zNYSJ#8aSxI!`#)WmhOkr!<p9?uU1PO22r-2mTDf;ks4F4XFwya7tUTpqV_w0lY^#_!_7$93E*D&hY4M7zGWFJal;ZBOesoVCwyQxwm>Fo|j5jWkuev>T%C6G<#kVsw|06c7c z08|&UiALeD$pA({Y~rEI3XH<=8-q=@Is8d+hZ8?0eeJ0jCxA(mlDU}V)b`H3Tw4cS z^s~@eb!?k1e@)C)!sbHMw3>=Csi}@p5H)EO4mDkjQILyi6oZ=jlW8!#u~RpTJ0TK9 zQ||c+C}S{#<7O0bdg3=5q$at{k{hthLw#Bug- zVie@;s3q)aj2}ao;HH=@fBiiapVJm@e>KyRZ6CkYr6szJIiB<=C_T(FoV~(5tUVZ` zpb+4p%M&n4Xs_5_Zs$+Y_z4gvxLatPz*N-P8g7ny7L=dUFF2kxgi%6U!-^I!fGELj zQFyd)PhGtXO3!Htb5hBT@|xTzoc4YjMq#wKsf(LQ-j7iVVvd=76R(T+ypQ0U1R1<{U1 zF~+cT5m5Y*V|!;o{8^#Tu=UwcthC#BO}ynA2Atz+JNK})3dM&(R--t{+)6|)gebvA z%9DsVZRAb~r=j#58*%*mjTi;_H);uc=gYewOmI`=+WF#a3%9?15{l1h3y!~j8KMLm zsc?UFr?fwW(sOKNCYx@QU*<;P^oqY=6h^Nwb#W)o^PULv6%@g=?{aimgi#o}IDOYn zoDYI9T<0w|aaL9`Q!1D^dn5+OLVaPfsZltI^XV7`CC(nYJQt%N7ttvE#Ca5B1tiW& z1hbXX{>Dh04{I;la87b?rOUfpHN>fM$MYmjz7$&mrO6jlQD&O_3XFnCMx$^@=FJ!d zd5}gi(&U9nnw;A4?2{nB9}1LqkJ(F*-{WdEcf#>`C_W6P8pTQ4R)TyNLuCvhQnnCEUsOvx4x=zyf|HaTj!_U_>h|V% z)o~bwp^LMB+ez6O5Qghk#U^FSN@lo*Nts6&S_k!oNts6BBxREr1tn!3x?F})kc(&( zep2=-j1`cSDG|(8PWziPDZ{TB#Q$3OXIJ!giBvEuTRaHG%{PYcyQT}@QO!ZVzeCPJ*UHwaDM4MeK z+U$_FNF?Z&skAt5kJ8zvQjxgLMt6{hO^$AgA50%|o;X2|?n6tR+bV8Li&ma{!nr3z zbh4g2axPB1xvwYr_&w}aCr!jLo?GmYG&0*awXkHiJ?PNI*hg{L!^^ z?PGe=j}oK&ua8mUlX`z43c-_lUuz27KiWRbRB4cE_a_XG&<$PjQN8l)+xBnb8b0Y_ z;)iBwgSfKmh4lY=q_84ondziLuI1r8RRUIH{}pXsSDX zp1kb(<7DqMg#aI;o=i^KHqzWBsl6Juja;X3JKj04ZK?&R;TLA3#%N5KNHD#7KY5T?V5OJGXszSUc3}bfPu4nge3Q*ulVYeKC{cfB>zcfHXsiF3a@L`|lJ=iB`>Cg#pRBm(_+h(I6hq1`{pw>x!r zgP-l*?&4?1J5eT;CFZh=XVdfP8Mb26^W&2fSzH$lmm+y&u{^zB(6M;il})5ianYSI z{U}lOw_cv1dH7dS+YTNUkBj2r9gZ~X>Q1gH9^RG;^@=IxQQet5tPEpPVpkqMAVfut zkj2BSJ5-j12r$q?8z0WMvCRs$@3~mP@y=e(4wZBdyGS+@JWvo5ta>q>H2TF$5huc7(H7bV=nF>rx$DWK8+Pu)hN?7<4rnJp02lDJ0;H$m$wm%MUwdX z^7!3Yq^L&NG+3?;$8WU%qG})Pds;1OP7aMmL#3t^S6o%nB>1RSCLl^jE487q$>DNT zq7*eQ-F%87NM(syy%v=(r1Q~9xW4u)?Yq<~>uPiX%5bb#w6WBvRch-*WT#8h>kV}s zik013$JA(YwVoypG~(6AG{3HueXN6D#bYmiRr^o0i1wbB7g@Ej81_ObS@&1-DCP)z;ElJecusk->wntlOZZHZOe*aUkwr9 z%RRL5*ZDTKBbeR0T@kGFomJ1GF!2caS4wNg$_0~uLgKdBv$KFT89v4y51gZq3lNvG z&;=nz%#Y`k;*myuJUU8*NpTg)aCxL8rfn#I>JOo9c4zJ?m<9g-Q^LsZlVSuu>ovnPfKa9j^1eU}J@b0Bg&A zI-wV17Q%>HQxk-ls!@~|55@RK{H(?}G>|ZBcIN$Ejz-XY+2yZE+fRA*AkChWvImia zn)BV_u@`&7JoRd;w(g{unrXR8O4j|=JpB1esymZEm1&s#`Hm13H9{f$`Oy#oZt0Daca*}VMoqImh2F)yxBUwJq=xmj*CWwxr{A(AY$ z36;seBK3{2l8N{@F;^T+-!%}WHWmE~(iVjj=3un4T#n8;<%E;ZIEAJh%B@zK)b&eE z`hy%a4D^Xm;l63ynuO^17)5h&$MdAQhP-;B=HWH6CwB0#cw8J0Uuf0F;^9dtS@&1- zq}4B^x-)rLnTE;3uMAO9BNW2JZwnFNEj_gH+xa%OdD!+o7Y{q$x#M4k5Ry)9tC`Kg z&&z02GdITdT|>L*{+zwrF215%Y$j!1QGP$8R((Zzyni;nFBytl)mN0qdzIaV`qj=e zctyF`o2ITPe@J+;yrNwGwDnw3PV?IZTv1N76mUiP^pDgAav_s(1MpUOKY4r^xr*Ui z@-Fb5SD10u40p`Cz;|p{GV9yirSGWAw_SIE%Rd`;fr}>zyY1VSJjY$&iTc%jM17ri zfluH0ujG+>kDGC?agIy3m%}!IpL-2ZQRcVJ$6^%pt)52Ve5-dlMnNB9X%yqz=G1-K zBK>xJAwZc)>ZQc7FMxuiKLRk)*sQC~Qdofp9X?k!nMpH@HtrsC)o53r0aMtx*h@?%Ac=H$yptJ^uf<_bp&@ z71x>4py%j;1PEhZxyZIO1EUcJV+jecc)!FTB#eg$-1KzcneJ9k_iR6qM0m)=2826) z(E`FNe8eQNV^|DvAi)dR!93P$Z{i088~Y=~S>o7BK4)Q&qQbRdwBS>sH^9 zSg-g#T0PZu>zq30)PGLZtvc1q0rf9%UD`+$$7s?(s9;!Zx@*+kW=4!D)vfC=SyfRDe3%Znu@E=O}G6Hk))i} zp2lsz#-V7=+OdJ`1(^qd8YJ2Ysu7Zkv#e48MHQ~hxgy3$?rmgb1HDr;6${f<`(lRP z>uD+}4Z{{q#iB1p=rs+)yGT;brnQ%c;lpGvY)s53ur6QqWs;7wv{La^s`;9S;$M^e zTgXWb;4MO6^#NHz77>5?mu|mF3xLYN^-u7q^>p#Ug@DNm#ke+#i z==rJUl8z*a%X&^UGwsDC9R@7vZ`?@>O(5&{liekQJVC`K&CFRe6)Me4g1&5~sZicU zP*Kv%L|(dm6-~z>#SACk6Qu0JOSgB@@}RJ%36EN0&&@Oy3VQ?<8|>LbQ=x1~P*Jca z-AlLsm}Jfwn|ew;{D&qDn&%WxlI)XCT2L_tGa7)uNK$bYQZE2*l#w}*`2oqjjf`xp z{3kRO%F2y>G0!P}NmHRlte|4km$|1pM+=ly@qN(YiuE#*jI&wwl&0RO3-j0;B-yvI zE1R*mhNR*wq}0crISc27B= zF@m->A-amB;w+?If-<9w%t2X$pe%tK`d6~QWKbrk z*aT&>K0rEdDkw|PmxE|3l!*u`_Cc9P({c#PI18$lWqUIQWpwq3)ad3-tUaYh{{Sft zxf@jQknXTq4?O9wdSp%lfr`}VMyZ7IE%m_`q?A&l9|=wI)aV)Dv4nqWsnKy~yOJ6` z*li4lBxZ@dP!P_#rbgeiWsA4z;>|3LB|oAI^N#4$=xX(F9nZJcIvxbs7pc*MJ>wv@ zF~KZ|ZCX>KUz0>AL2C5v_)uD@(TB{b(IGbxCLV;;M4jB|!Jc{TKwxA}^gW6CCXW4m z8Xhv_BEsTC$Nr=Y=;DB)R1zBH=e2g#{l_u@NC&b1nDH20RYt9(InloWZOaD$*_hXJ zqIZO(T6dby3OCKM^CP;JDYvS-ojbh7Q&n znTR*ceJ*SzEC?m=I`Ao*V6^_xRD?PIkatc`4ui#VTZRq%>hVrC=M&6nv&>&;ZP9#* z)LL&bzM`wjCR}^y zw3~q0P$x1OdI!ovap{l8!}IrJ5WpIq_jWS$U5PA1;PAD~GC=TZk}fPx3y1e;ZCQcT zXBc16ReM2-JD}}Yq~L;4Au$q%A9CrUpb&?{Rw)jja$(@fX_WCZ_A=H{LAN~0ip7cWl}v`-f4bUQG;B&?;9PiU zx?-_~&~_}sa?z*=OU7c$UAif##Gx#iWb#B8!pBded{1(fZ=?si(4~u(vbFMHSGX{6 z`83M-!}c=PJ(xbaO&+Yf&i-WR({>X^I3Li(9v=m~nNk$c+MgjUNZTe-#07VM5gF2M zON0u-=YEo*LYL3Q;$%LT-H9RQoenxoA|M8|f3C zap|I<5a(~Le8S(jF!0T3l<~LiWvu%I-TF*E!BFQnF+-Z(&3FuM#pqO>iP7z0hO}Ga z*LZ>qY4}dbGDBL!qE(S0EqIM)PIjihUJ)76f>)O2hamM7&~K3$(y#{4khc5`_{K7% zv2Smm3~6w|a0(gH*fqs-MjGub&Ui)-U^nKTi~qoF*n#{?JE1_kE4g&NR5p51-;5bN zNgA^CHcv^Ft4`uoX7zR6ShZUAPW8^omh1kISF3K%MEzE&HvDxSq)YX#WofIo!q+R| z`$)CoLksxNP$%1}a`l3ogAM)UR=D8>9vm-Mvv45;Hq+Hkkh!~-txWj9CVLEO4sp^_ z1JDrX>3Zdg^jtYxulx03kw|+pw$n|f6J_L!^{H}pXJ&gb-zdoBfKnH8ou?-KY`s|n zsf6s2LfQ8z>DI$omhD=NFDz5it?4wf*HhB5!5W>Cj{U5pq{EUhq`#oUc@HV+!tR&O z$M(8Y(v7YIFxU?Pm_R?nFF}xp$bJZD$l~ZmjFfW#UPT%`xv%jGc+_$ee}$$(ZAukX zY&NA{OH-kC911GRCVna99?sniTL>WbmMVov@(Gd=IVw{oYSW(s@K&ZW71u3v932P; zyY@s5z){xzKF$I7C@FoiyAN~z)qU3H9DvWzR49`cRBTN8n=}>5qy-hlq^B(h;A6zdddO#ZIcGg zbBdpk?32NapkfSWGywl4NyS-6y#TmTM&>|f(b>*{jG$s;-z^&ErAL#T*`2T45-@CG%C_v~b?~G9?=0SKl(GOU{ zw@`{vT-qRR4vQ)X0iNosCko?*f^jB z@biMI!4~SUAbgv>f$k(V0XhX9wVVKr&{Qb=5L9gN;|iJzWgLQvBEMOa zt1=jO;;+zB9;K-{APetmPsnn3^cGMPx-68d2R&5_!w!F)?l6Ti&%>jZDDw(Ug+duY z#Rg^Gps7%%BB=C)GQT9r?;Di)Inz-Blu01&gU==73JY=Dpv*Be6$)h%^kp?o#iB1s zQ07#cngh!4uJ(j7@3PoTZi1Ux_*?)p{ErY`E~9%&!OLcN)Dm9uG!+V71Qi>2snJv@ z8xd3#csZ1BkuMkP4SCzX5V3K-q|L%VN;2dOIK8Zg?BYtZ5$ByG_hgVFsMySp|A?kS znMQ)X{25J!G7Uk+sBgZ89*(B3l4P6}-qTXOQ5WV_!k0+)$#oY>O4_LS5lO{aNGXg8 z)n3hOQ~ySCZzCg{u{Y;DXV-1iw|Q;q5SmI#V{bW4#d+-E;VJ2u%JC!_TeC`cZHntc z_4?%6R03~z0oh*?o&^<~=x&szLPd88`Z7*ap-eALr9Q%E!_H`&gDxQpCsux zYh2LjP3P(~$Ba=QA^Eo%7dG1XBu&Lt8=AMcm!#sXi`2b^dBXWcl6xCXsQNZjdAesR zHv0YsO~pdrYG2Gq@_m|0N=Wi!nuEcSedz^M zJV81eLB(cT`&%>>YFeA1FRN%Ol!*u`_S4$+G%bf|EoVX1vTSb_)7pz2QqoY#XH4_k z#VULq3|%E%l&K0$JCBO@E* ze~zX?89${7{iV)#NHWf<=;@`7Q5R-={YR308(o;~Rh{AfD@ny!NWIK(g^X-0ssBRf zpu?yMb6k2DO@(p^3Hq{vrs6s(x@NfVBk4G6ytf%{0y&*W@=peu33PrLO(i9r=V>ag zI@f$sjilnN@f3WL%^1IlH7hiimSdC%CVianDq!r&ROxt#3r9~UEDMd zQ1imavt-|F+@rcAVW#q}o~hWF_-iy33$sxBVs>M1(o|A1@n6wYEc#*$TlD3X{*9F9 zw>9l_mshy;suOQ=c_qPw@!e#9NfZ=RY?fC}ps7&HD+&6tfu=&4h@fJ>yfQ-5a#&vB zET~$R?ag9&<$ax3`w3FEYORF;KnDllaV@**c$Fxf*gB-_m1TQK>wNo(c_=;uiGNe?Ti7?E5HP9G!#eWbRXrsWW+aTZi9%l2jwsSS4mEUW7eOflLLy@?;55(%RWU5gNn;q@Tg^6b{|cJ!Wluu24}uNQ=yDVP>G7mq-^p@;aoeV zEP)%kn(QwbmkBC1aoI;{DpXvSpf8`HsZb^&sMyD4_tUf-;xf*Hs%6>UEaI|NouJC* znkiFQ)^)k2xX-eyJPgYIf|djolzj;vwG7Ihr>RgNBdFMb%y(%jlm!VYDFk9F+Y#$v)}k1QjD_Yl~&`FQx(xXCd_xlo@4Y4$6)qxwny#jb$H4Q=u$7 zfhJBSsl0tOVGhbJBDqgX6I*F27Miemty!e0P;c>ZSM3nlWQ{X$^edg4fNy#IKt*UnzOx?C{Rn79SSTw*ctF<{wFM$laiVhjfR{ zkASDd7I!H{&`cobPhhgAiULgu#Gyq4t2JobN44O z`aW^F7=*Lu!6Vu|!G&ExL2LL!wPM4sds#1^ZDhx5*-77PRN>Dpo3?E6;I2}yTJx^K zf5(eue>hkcP5M|EpD%{qMBn!+%L?zszM-&UpWWyRVq74Y1u-ri*2P#lw5w>Kbc9sa z>fe+_fj0bFJrJB+6bj{CNrX~59B2S@9zL|9uoA9&#c9iN66L}iHc`4gP&5B~pm4WZ zAlbo*`EhTcV*-QTs#U5%Fq1>ekW50%*w#seTYdTQpsV;b?BZ#Ox_C10;yQS!IR-bu z^?3tQTUadHkRcCd=@OZ%`JJ8x%t<97k6W~Mqj3R8-6qcCCdOlQRT<1$eN#L6YgT{9 zRJoWdHrl&eb8G&1W9O95$3Lsy$krx&0E7=h+of$l=ay0#J~1w-G+)A^?`3>N zSCuWgRDjBCUZ4Q{8jAi2mo5ql-Qm7UR9vdP<^Gnv+yRFb zoYqIX38xKp2CN}16r0{mJY0V?MrPJ%lt6sReM2< z4bXNh9&^E{&=`rwm$`INP>93hd4bgg+7Amt-A}kMke@~w7wu)Nql0dHCUh{=Im9@i zLJ{eY#3RA-82Q*D!RQTetxv96ZcbJ>9Mru5JPnQh2lw(0d4Y-B%NEF$Pmti0$e)hb{Y+2?!3ebyieqPLBCCuR89DR))RHvbAD%tPE4% z?M0|qsrCz6K~pt<3Zg{6((v;TU3!=hao9V5oN?)~L~?a6s2i~4Re&~3rYrfNM&}pa z`f&gG6|dgR6}()w&e*N_Ua=13y^0TnAUrKra^+^;_p%VO22a=5bAaTMs8lPSzXOB@ z%=LGwKtJFKkU?>xQmsK-qF>(jY^_qPOrV7QTCG~+lXwkT7b!XkhL=_v8qj@-#+ZnA z?_xFtCalipus9LE^25C%DANxVKc=-74V#Gk0%0FvoJCjd1!2DgZO0-k7mbRrWK8yT zmu?CwaVX2vg9Y+sx$Q#Dzv@Exm1&gk4_)OO>A~J|>7u1E2`G+pzGxzM(y4eK6EAKfMo)?H`xgWx9igFp9B>4JY~X1dtpqkubN#<6V_&>9Qw z0P+U#8W}%Z(HuWG_C~DXrdXJa)$FsPI!|pU0f||HA3BFX+G0h*s zn}&kX7w{o1D4ddL^aqO11e;kH2A zvFN}Bq0By%26&H{tQvJ}Si-JNbNcGPy4E%H&W&AUH8S6-;+n@=l40Rd-Qtj2j z8xBLArFd-ne2o09vF#GPeu%B8;`E*`q>Ov)jacB-!~!d;DAmEgVQ~ar_2=2L1FoDz zExVGJ9Ie=*0!Q@7#X&AWXgNG&SZc-ML?A@G`dY8GMe`*V0@gCVqO0}-KBq$4vEai6 zqk<2)5U|Cin}SLl0FetVc^AUjX_W7H5Aq$CUw*+K;o!d3rJI)WC9L=NT*%%!jne(3 zt8^oS{0CjSXen8%Apg%@7hKZW>cJkHnZT`;A8arFN50~yE zYnPjRg&$Vl*;lc!-+7@R-T|;z1C!YXEcFNcieHKqHVp_j+Q0PL}!hK_(lW2^Tm63b)dFvT&BjITH^5*D;3Ki^HD<48=NpE*jP0M?&V|E?pE9;+(w| zWFF_jzyLfnT`SY8>}9M&rfz*E$n35&I)fn)4og1r|G&hQ5D#<-#ruN)5i{hheZe(- zGiIpy$&F5+S%+7@uvlEIz)Mk4A21ogd)T{3yf`-c26&TO*U_5+FuqO=P`#hO^X`r*iU9T!{?)fty&h3R_@SYqd_Q4wfNL1w4U`-BR%Y$}8(ex{-9qvB|*liTxeE`gH zVHwUJABWwb#jE|HKq zi^I_~mIzP9fc!?zP{`C8RWnp)WPwHVEp<^)NX5A=b79~hcxbw&itm87 zEoH1bH{JS7&dpG#whsn!IQ(>m;=%5(V=UYn?7kD=R7Pavi-I}6JvXStmb4J&vK^p{ zouSzQ9iJ=JJ=nyHYi7$U)yX0pK3G2FEw9${!Pj~&TlSaZv}t*>vaM3xURe%|^KC|h zMvUxE4=B*F`-f058xxHTfs5y{kVSS%0o-j>j^T5DFI@nObUbk$yPF$ZnOj#(}m zOI+OP(nUcb6h_V0ru6u_d%)UpA z|KLxC0q_T+0Q@R&01G4}2*3G5#C8 zu`z;gR~9gVy;|52P!2Z~Qsg(y=^U1ZM4Mj*(54mhq}bS+u%@R}B)C6jqEB21erAKbI$t z2$IB@9~$6C`{#`}D-4+1Y9gDbAR`W|QFQRGxG zjJyX-@9biFpme=dHhMg~Ka`pr$d9k{&Vt-K=it)TkQZc|ScmU-ylX{bi)+2>tMy?# zE58v^TWp1&@U9c3jAg*Ma)@o><3}rb6Q_DBR}P6C0^-Q!I`*z9XazS#;CJxNyjeWz z=$*<=JPvscJS3UHcU%ES%FpaTHiweT)v%HTzIvT^Jxt`l#}99W)IzmvdFx3--r6gn z#kKhEg&(`j@MqSsEg4bNVe8^)j16&?<1tB&twW7!!Q^Y#YUkyhHsGS@Y7UtY<0-8 z`Rnl1&UN`}4)lN_5rR~@rXX#~$rO_k6>i1iEg3G<#++l6HI05$hFXMbPN(;+^c+e-^AK4DaN@b%1`M&s`EGZ zPbM=C6Do-bTv!lF|20zjWOrZX{M(rHn=}>5qy-flll~P=g)(VDMKS4B;4h>|p(AnO z&O3iA8t9%-f!%A_qZWUN@{rCJ&!{-sdOxrP@MI(9wAx70an`t?GyOWhisU~nomXfoDe3%Lnu@E==LL8mdGcFHQqF2$ zAkA4^ZyvL{Gcqa>ZPUzIkY zj+UxU0FPE0%Hw5P9u)R`8y>a9o`0aJP}n1=*kI59qNz|eB&aCZa}1tQAzuy%`5WD| zo{w+#SY37F3K<(g1uVNyS-6y#TmTM&>|fJ;}X| zjBKp@e3}Yn<;K34=M*2JsZb+UP_gNYPgAkzi_xn1@z@aL>LeLwv*Ki?f9%~%vTtKo zMk#4yZx2buSxBjmJ@a*KpCh@qk&%tPK2B3{wO36OUn8l!eKcW4!BF6?ZyOa~;ip z-9s`VD}Jvn!`#UgWh25zNbX745L9eD%TqKJ${Z5(<-gHXD02{0jFF>`7~dnw*eX0- z&%*gvF^BXl2}aplWPeE$5manEOW#&9ETB9~g1#)FsZb^&sMvd!qiI?Wo`tiZYFV~7 z3(vB`xOKB@%cjZ29BgvYD(+7KFN!08kFzpf}+LhPF~lS_*s+c%nNQi$&QfIC{CqtX6qe!zn;s~ zixZhL-+`Rr7r?Y{YX|$uTQg4zEEc|n_PLuR-5phClzEE2+yX6x0$bY=*jhiL*A!^|YS0y@?Adp$X z?ye(;;{8)sd5ARcq$NRl!e#KNr6*iTQ=tZqpkm_*Pok+%wj-!0(p+Xdl0tbzedYUH zk|EhVD0g@UZrz@b*YooGcw0TKe4lC3n%N0%CD|t(grH)azi9K-B1y$rNWH9l8)am6 zqSuk!+sMeqvOi8!p)5OrCVro!^7he$**QN%a-Wtao}{T*Xu@WF;zgPYg_lC#HdggA zO~s-w#__GMPy7Q(#@4L5CIy^~yg91Ujx9OO;M!hVm_41t*ZQc!+wS zv>pUnIt4zIW3HtQP|{i^9Xbuawo4co73P%A#7D1zrb=hww*v6U{=BJOItL$LB%gC0 zY@^n$L#?goFa@lRiNjD3(4Gem1zIc2L1P^#>P0C`@e`{eK^Jn!tC zb^4{JZ#nx?Z=jLg2H8k3Q!moX<*H3g+dJNm2XZ^PPT>X2ENrIUqo-s1K;;A(B>(DH9`7sHuP#d>^!#T0HRtk{P~tHD6G33kCi zmqNCMz#h4QmJaPI8Ymqhm9_deW$|P`oP@6j3n+3?D3;$%B9_wOJn_RWd}u{sC7ij& zDdBMvWzJyXc9r3Q!rf|tG{RQp$03OjjEZsOm|Yyy`3uu1v*Cz2loxAu4bf}-|0o50jVTZz++mw>h5J3_YuiNR>(&fkI_|S7t!jQ z+R2wt{T*<}T&~z??2hJ3^W{C@stBGJ^Nrvmu|= zZSvJNhB`-dBxTTdC@KBP(6i`?Irs=(R=OibOjz$O=uMl|BW(2I;NUU4^$IWLL!SUC zqwrYUsxoB9@Ty}a$R)+hcf1LAVo$*@*c}9RxXcgl3}pr!dEZrd{#XP|VL>Q^p8%(_ z6-Ju?Doa@O8@zk^MHpBtw-syAY>q9M(`NNEKCHGy^ChhKKNw%pRb?wKy#SS2^lxXy zeZWwx6?4I;!#467jKf^IC@6GKoK&LX_>Yin*P)|97t$->Au4$5MY_kiN|(G<>~xoI zT1t3{K2ifv?*1VhZJS*fx_BDpeyP3O0ecl})iDT+nULgbRi`hrq2e*)hMY4ybT==#RuB!HqHUu|8zAeGa>mOW;CGb5g*@H2 zwekCuSU31Xb#EYeGgluRf*CizBd06|Y&4Kb>i~B$7Ne{7f_e8s z+p(C(Wn_tYkGXVFP)G&yo^@g1E7K_B=j>&yW1en?Cd@O``Axh$Mek-j7~c@1Qx%Nq z_VDtQPshJ^3NBB<-7ayLn~2L(uCr)$3Ex8#Z14&0@E}<(iOW-hZENO-2KY;I^70gX zjm|GmS(b%w?D7=$Ese`l!afX?CScE9>m9*8F7;J#!vx$SUuk6V+F`iXMckz#Rq@m+ z*}~DV^V_=;ckmSk3(MfT6L#eZ+jev&#Iwh$TZ#q>tAm2pLFePm^0;je?oMaZ_0BdZ z(@$ZP@NN)_>?)#x8o3$L?Fc!V}sdeBwIM}i7stF&~%k%z@tGFlZY&R^e z!PfK)jA5y~yS7sbI5ID2PzuRE&|%DY$wq6|4q&B?+1K;!)?D~pg?}siG0|_G#`kuf z0>~f%f1=AG7wh;X_^8>y#?m3rbOYL4%U^ z>VkeS(p5toD4h?#+v;u#>bmIeI;1fdbcI)>f~C;9D{aNMS-O1F8!XAj}cPnDB z{bzVCsltMuXzJPo;{1acHe_{S{ktvd2kOH5p}IoH5%`4w{7Zx2M@q-S2U6Q3jnDvi zW!Ky~2nHqs|0)3fRRZ|gmUG-l+4)s=3#6L?G>>KtjG)@A2-!Os<@**Wp4npeG*a6fDF$t!j--*}vKcdG@vX3)yn#&)Kb|@WL9z2mwa3 z9#op$nw|H@niJ68V)2q1YQPTqNhp~Q`pEg%CFHMI0ik95N)Ew&qTQO`Y>cm3y9&

%dN4&16c{P zcGP}YG*$PT`D$jzBpTEbhybc}KO;ZMtR&aSTwSaexy>G!$rtPFHn3@(-pkiIl&$L)D|NqyktgT|Tg!vW7u2%bJAYm{v$Yfl99Rx+ z>wqyZ2^*y^TC%dWc*>v3V88;y6p#ftUx+1R@X9EIL!)(Aq0yMCuUowuitBJ=TB870 z$5v|-tJ`pt1!^(|pk}7wPl9?HppJP^zUn>4zYpZOxHg{Cn#Yo``4vI)_?ik$cAH-t zF8YmeMgtIGb)hj?24eF8?_d<=8-@0T^IAuNO-{mkix`}p4rJ<6Xd$~>OX@oz8sCvA z6ekL0_#f4`7-G-|wTk|-Y z!0-i2M5h5`qmkjEC+pl&U!5{v(xe8XmFOLBk<#I@#DMbJ6rRyK1N&2cNDhmW)JLUm3Om>aChZl;8qHS z!f~vfLWMVSF1CqtuELDg91%f>iATh#jNl?mRqk2U!5 z>NtG-9ezCeY4~^?KOVjxJ|4r5Klv_vJcJ+l*&zEOe!MUQAK$=_zIE_17e7uo13uQ^ z2OeEx*Df+eu}NREwMZUaOy7&(bOnzAzy^2;f@n~W8>d3p&MYkS!3q&R|eaATIak(HRNc<{BUVzYBW* ATL1t6 literal 286627 zcmeFa37i~9bw4iKI>(o6A>#u~`@q_jS8MqI8-oDZ#$dolEQ8lzSoiMq?#yU*W;}YD26>Yf?d z5b?pQnVzb8uikt0t?H^*@9kf6`{An&Sw;WrA60J7_qx@3XS&fWN1c`adU~)FHM%P= zS($v+%FQbi{SEDKZ>QO7&qpi$RVXoEsn*NwsIl_2m5Iu#{<`_*Qldg-P5;xa<#rU7 zJKeAw$Ogl1wb=-k!cI482Mg7DG!@LFP&Xs$+T8$!uf=bd zhs(ja+k>;uzi|7x7oM{{IA{CW7fhF~YxaWqun~miu+7I8Gx5oJ?cjF<)GUP zmceyUukNlk7N>%_UN@+AgHEN{tCs^XR*%3-X};O$hSdhzh=O*r*$r;!Hs`zTD7qmi zSKHBix4I{qUa72m+6wx*`kH7TN#?h&gU?$bW%t*%LTI+TQaQXc7xqhGx7)5laIg%r zgu|-k4zv!H*TYT+5Ak_TBV6L2)|Y!N^<^%c-`$QDSeXs`mg*OFS|M4``c^yYMD0D% zO0U1J8!l3fmCA<7=E`CH4YSf%R`6}DG`feMwX|GmE=6ax!^V6iYM-@O?N)ko?Woo4 z;HOq^?kr_*XQ7GCS=B~4+Be(xfI@`N?LIWpD`X|&mht-G?OvX+!fmb|80 z?bajhr~Vn&Ms=7}M8>2@Z0RJ8`V?*+8~YR1;`i*obD#nj_XK*qz4GA7VU;tks7zeZ zn+q$)LC%%qVQeSjzX#yIlks2hw3S}v^vX1fpUI0?wp1pbu#RUCzE(Cshq*YLbmj1QRIwZ|D?;K zE)cLA23OA2VA#PWQD?qg<)UYhwb5NhncHn3tkxTX?z zOQN_y?+%0Sg=W3p+{*}6qk0)8CuDFhbD^aCEPp9KQ&{sxm;{qHlk(wn_2&HU*&BP! zt`1Z)=N!Fi)z+Yar=1J=KS8q{qf{rD=wjju!Ujq(L+wmr2JAvNm|-Din*3-a2h{}> zS`H>Utq!!)CYwkZe|YCFPg+at5@e4L26;C zS*|XK??x;7PaZAJH|xEn#w?p{f(v0K^=hXZ?8UUe=4HRd56 z3=-;22RMt5afg_0WQi#(qLzcXD2SF?-DTA0m^mvtN)0rEYD1R?168IiCIKQUDz%$? znIuwcP=V>-vW0l05*!CjhB3ijbfeda%8*r;xGDw2*A>kMvm`PBPKHP`O7m>-1uLX- zWh~U%OPHO@i~v?^K_eoA9IRJuplP5%*y~5Owg#ax6*_OldK3Nuq3Py z(gS7|Fc$W;npjklN#g@6#7tsO*sg|ikU!IgsaUQ7roy?1G$M-!%oL_rdt8s`5ETfq zY6K87&50j$BjDOcUt;~E>r8a9Ldoo?H-vbd2buBJJZ3X=u0Q; zoIi)syi=r!z14bMwbyH4itZ3iUK9h8DQ*!f+Xf>KQH8X0o~t(aDjn)d$b-ZtyB^y= z4U9x7vRu`B#v+pwbrv#Y!V)E9_ownniZ9cd34ld8t!VvX1BKZM`m`5oMQ#}|fTggD zUbZ97wNSbo$`~^{HP&TU2e?o6iFJNDcp||GHwYpCmhJO^`TwyO(jI@py| z8I9*kxQD8O?WKs8Krqu*ug+eNNcvT9Uv2Py(0dfU{9p*t;3EJ>?_d>VHd-O5T)f!m z)Jf4~sSEAq605=Nhm3-a94NKft}en7>KGGJPRp%`118fiGY|d~7ZEs+WofX18%bHV zC59#0YdM$t9I>*I|rMRLkn{alvHl^03N{vU@mG`=Lc8-08P?NEC79CzJgT}SZQNQ z4T4=XxkB@#TD9x}bYB2KZFJ8)hjFk_Z$h5bLnf#$gDb)xSS|a)buhtcOhSRANDgHv z!iEGl+zE7Q5|cZdU8vwvwL=TDS-e;+(#k;}zp1D<9Xy%MT+Gn7s<71I9E6 z0>va|GCL<>&NaIg(5zzx$yyQvGXerGVdH@)cK0@es2M2J|q8290j)SKuQWt)ky(fEQ&QVmLuU1{6SCpxWs+@m|e3rXfHOLV7^^N)_n9 zgu^h95Cgr0f;!bQy=_Tu2ppwNunzD#!x=_w^OA#!oy5RXSWjlTRCn&eTuM)G65p@c zIf=Ifp$8JKE|%`D zXwb|T)~6sbEVb!FXFddcCj_|Ep2e~&217o=lD5cnL*tmer*>#{yVR?9tJr$nhEdqU zxWb%p`PGv!RA~|n<5@+quA7+ewP~-7R@1bk?(|x;M8#kvpxd?c$@DK~(#h%I@~c%d zXp)RBY_|!k*xnDV0l-2h+7q?IdI0DH&ct-ZP>5f&L9)F(72F{DdBYT;M=P4gs~G@9 zLIt1QIa=_QA&6jn5>G)yFZGNAf%mLU3?#NC)VUBX-azx!4IoqP%mSz?&2DpPnZDx< z0JdA^>uq|#rY3wKpuRzJJxeciHxTO))N%Re}1*>?!53pF8!x|aA=LmEMWt7F%g5!H4t)Xv}rVrRD6jh3{Z`%f9)`!?rnzuf7m zyjtvJjFY6=rg%;MZHi6Urg){f>1OV*y8LzCM|gZ<~fn|oTO0RBe^plEYS z1i#2Hg8QRaKlK#>6;6uask#NkyA$elRm|XQOGYm$wk0sfVdhDS5$kTg7&GKlI|k>b zLR4cV8_Tn{i70v>5y@TS<13qMN28{%R8iiL>JIi2Dfb*{Q&GOe`s_-Ya+^?c8?s>~ znXQE+a{?rDMh?lKydjx$^6$5r;&_x2N0HW)40aZh!HJN;jvO*T`J@bH$bVowJIHu1 z9nbzTduJZy?y;fNgEGPX6qm`ygR&r5s9`!&XqcXaVR}uDVT$s`Fuee^<5wy+qaCOd zj(7$=VCNg!DF7Wy4Sl*{4)24q#6eZTlOhQV2W2>f3>BQT3c<

p1?9B0~9nXIU>abTI zBnRxM7l#hQ>izWy)&fK^eJZq=x%z3Jv$uFx+36W4NPya=7=~ z(%Ybz69GSOq4Pi*O0q3>&dWV*ES?L-D5~8}T_(J zFmozu-wVDRm*ULKqMife$&ufW!!VnJQj48_UEVKTY8wwq%THPg3_e{547LCaKAr;% zP(BF;eeR#c{B-TkO2#;-eVrKP@R?m#_3s;n`nMJR`}Z9ELwTcrXZU$qnZ5jl>ZNZB zs;|E))Ymi7*Z;}USCmiob!Nk%t5!+hpz-^Q9e8iC1Me$#Z+ME0$WP3$=!3>Fa!117 zc;nbObIiSf829YIqu#`gJ9emxFO@2NQ7(1k@H0J#9I@LN-Du&ywrL)w+NsE9*hl`O z?J3M;WLdsP+bD0$WancZlr!0V*~|4l=;LbQ{y|YP_uC@w!d#RaXAX+6xCqs%cv~SX zIU86qnFC8uK8Yp${qgp)=A=D@ud;N6)>?DBd>bROb}7y@*Nj#CErdV z`91{lZRU_K${X_C7u#=qi(v?KiQCA&31Q0pRweg)k0+&%=NHn)L!pmba_9r)llqwX zH(EQ6@`i}i@5t_ljQV!SsPBf1;bzEq?uEp+FJ``aQ0d|(aM24v_j#o=xSPPK-M{}Y z7~R@C_+18$A`H^eEbPuKf;Zu6Xag~uWF#;I_Sz6%8{_lC#{N1XFRjf#G1_!SHLAUZ zN^hzqi@2S0C#Cs92aqe>Ox$z?efd3(v_O7579&1I1TH~MY@56tK`#xj8RCN zL*gPn{7RNe!oQ?J5t&3dI_WomA7V&Z>)Cm%wIc1{QP8UpxYBL^BzX;a8xP>MjfY9$ z5zAEYw76Ix;(R5GX)*E4h-nmz%n>o|{+EgnWS!s=5$KXdypcmT^>-zX$LA6UV)oS@ z8`og*=`IF~7t5e}YHsDXjpK-O<`~nX?@jbqx58?BrT;+O5bf2YhikzJr&V;imHq?x z?^?t<{pZTsE4nKoLg&?Hh(n!G9*(ef9iGd{F&BSpDIf-7DfXx2*60KRkHGRdLw0^A zSNbO_?ln%QWg{z@EJL!Z$yl^Si@e5tF`}K~m)Q9raDc9FdGxJ1k&~WDsG( z8i*6n!L3Ni5F&G7hFYq2cWg&U34CcTECA5x8={A_dfi#hvY^7k>BJotzeyIPD1@-2f>(&r1mbo*b#a$i4@6)szaY9a;aCWYahnXX0TYSDl3WhcpKz`7cxjZh4&Us{Yz)gT*&i>xlju zhWwJC_@;<{&rKBYw-6$j4WGM`4D>gNAT_g{C4}f^QAj&0w-F+KSLaJD_{>#|hlWpf zPpvj>AD>o53L(9Kl1piIVJldRs=c||S0IDfP*YTXyqn6m(8PeP37rcn|D{vO(DfN^ zYCkurWhxcVm^l~>9mqrDZJQ{tfn_2;l zawdk-=<#VwTB|}Wg=2-%oWa4$wrq%VbgjAt=p!D?>ci&w4`m(>izU`*s(wCr;(AR2ugOb)tamRs3CbY}1;;tDK`z)pM0|ikpf{Rf3AYs?KuLDxfOP!ceL@ zmid(m2Ts1vVpAAtG~Th1T1!4us(YNfqpneQiNETe?55&UouHCXT?Q(a-P8&wk25ip z@=k#}k$ca~rpuEYwWMmDWt66Gc1y*j>1BUSzran!rD;JWkEZW*Q!Aip&cslfK3v=S zwCQw1{JYek_C)FHFWh}|>Fe$O`ub}(6_>sQm4v^GO^e6b z%S&~p{jBu*J8mhs^m@6!UT57@TzVB${Pnuzrd2?%oQ0wEdVi&-#Oa$&r^gPKmHM>( zq;z?UyXP)lKHFcHD{d+-T?#7xx_qshRsmgd7Dk~Tw$1Am;;dxnk9f3kyexMlR$FCd0KJ7liC90d9$_(9E6AG)2D+Akq|_V^ZLgk(SPlj)K?>7JM* z*RI;l)Ppl(w$YiJ=n2l|*dZHt5um&>NI0OKuSpLN<=D0PYUXqm?4o2K0VVRFGf`># zDZeW7->}ZLveG>Qz%{u%`)x~pFgN5)jcC| zdd;#GA$jjI+-)dN$5rsi*@l$9h|k0lMotFXwjmK1CH_-s3=wm*5nQ#5L|l#Foaysf zI49wpK>;i~9b{`_*(@l7R(E0B1p(XTMAlKdIY-VYN7a$+0m(FGQLWin)H-CIi;KH< z#+kbk?!~!;yORrd2mXOjH}($=CbV}mdaNH*lh+Iq+)>)V*?sWW*4Pwcy|}+o_5|4i zk!h;h(F$SwciYl7*k{G}^#(1s6Zca%-`6s}(~BaPbhJ=zE+OIaO8?N-@=E`3ax>pY zX(Fp#BzawjugvMX_A5XJD~@E)i&1x__H?w(ipvBaE4TJHw3aUv5XCSC*@c%cg zkiG?#Tuv3b%xgEIa1NQj0L5!P{JFKZhdweK--}OK(p^nsRrZsAQQf=?4U9{|8%=Yg5R=#>8kQolwRC6kb78Zb*NNdb9>Y=VkA8*CVbf-Xpo9P9V)SsSf6bTG{3L8ZO z%X@mPL&9(v+A&)50+<%#EWPM37}`VInTr}O8cz&;L6I&B3M0YLR~BL5&N0gP)&4Rz zG1Rm^8-`lSbS)S<{^6_!pvh7;>|L87e{a}(o5eLXC*sLu?Z}af49o!w-=2sB!54^x zWLOg}^8(^3q6}0mSC>;IB&!V@NEh2`wVSOfAd!V)TcD)MRs^*A&kFFf{-(tKxm=bn zaPQMh@&mX>k4J}l|IcVG9nAEF72_ruEry&r;^O>9}_Q2elfICX3lP_=yag_r}4`YM#IHMq?HZ zl2bI^gTvj}*5%7KzGfo`8@xJ6d53t7%NE#&DIlRtQLOH0BOfxu(Q-)uCNigU-YBiI zxbHYU;_+tJd}P5FYg$@ZI4&f{{87lD?Su<m^yPhU8`mJ->uidt?(+gGg1W4r^zlR z0XYX$vFAzWJNzYnp+p;@Y*9=v`IO0HW8C~MQjw>eY859YxqB3`NAo$m|PZtrkog%gXlUcr20(UHk;T{n-N>z#&vJHMl zI3ldh)gyKk#TLHC;gh-=CO}p_Py#)tltjUFFe2O%h&qi*7JmqOoC{GM{tk~d+H&(H zj+`!Ge5Ds122U?T+nIRE1>=dQvqicnD2xP8TSXXH8l#Nc{xUZ4)U-Vto?6Q6zt;z@ z8j2=++1PewhAzCZZNIpw7)($+8RKL=4Co=y3tnA`({Df$JBp7pT9T{SbZ{l&G6CY6 z06Jd06EA72ORZ)bFaOiQ#UXy~M2$|B)|RK(@GHJ9Dc~#qu0-~xTox?Q>vc?OFp#7- z7d_5}UaMK`9l;#`qBwiM(ONnvY3srFGS1SA4ufAGMBAD8#YN+ZU!O11ML}UC`1SQ7 z4BRtD8GplH#wLE5)@Q>nOPTTk8JxNOei_Qj}~NxXvV_j9f9+}gf|2)M?4 ze(;hzPk=-9$<2tZyo`J<6sWr#)qzF`^aig~tg9Mq8AoT~d>xmpQQBLDa}gG0q88Pu zc6hK-cptHQ8$qjzcXE1Lt~U7lG6KEDa7YeD+$SjxY8OlhBD1Wo`~+&UBvya4+`~s~ zk4A00?RN#tigPN^7nQB=;mM240=JS6m7*VTcoGfMK}lN|9*;_vbs;^@hpaAVq_d6I z+?}HLcHvtb=7{ z)&p)1q6vEqo!0zWO-W@>0Gl(+!g~U^8DWeam-?;q0d_fQe_M+H$-%eLgllLQFXb&@ zD2|#~5Y8_5c;eAS=_VE~Cm@(G|AbO4euaVGbm%Y-)WkBEPYCUZ{OQ>Q(p#ECXirQc z4ftOpfT&K2Vh_V}06R~e%Ikn;g?H?d)v6@f9Ib7dmy9#lZY`MEE zc4-5aXtF#o+lY9+;8)f(a&=FaE@9CZXg7kqx=0v8Toki3!0vEV?gYISdlg{Y*mw!x zeO764u|FNvTWk}9cBZj;fyIBd+hf6g@p?dEpJ{Vh1b>!Y~-8by9VPkPvgMvy7T@Uz`hc#mmeK+2{hMC0}Of@#v=9HyW*_ z&!gJQ%BgGIV1D2!yv{d5rqJ~2iaf5uK7RXghPp;ezp;an3E$ML}UC zGtMPN7}z;R8DHuzV{^taZO=C2Sjt>HiqWU6)})XPGQS=b$lRtPF4<6~gKN9pc!|ys zCR||e9uZ;ZO?{BmNL5!t7nbpFTjCMO*rqC1eiih0F$DVqx4Yv%o=~9X}U4VOyc#{Z@a@euKW(7Ii zAt@gn7hqojw}+Vn-*oUK=DR`6(28v#g!4z6Xc2lg@drCTNMy&z(<7AuhV2BEs4afa z1hvCG&1yMijc0^s6ToUbRa*XDuJI+X_1jF*1K3KB^I>axXp1#RCfiB}ObuHPMWu1w zURZ~=GqIHm#uHl~Sfq=B!bq@nx(EYjj#0+j{bg)ot7&^SY#l5!vk4pe0!Z%Je+P$> zd-mU{g9$xna6-=kDELmJ7~dGEsIR|Gz@h-c6k7H)@XZlT1N~4%xzj_SaeoxTe!z#} zmcr4Ny(!}i7Llzw{Mgpq6c*d{wwL6zfQSM~(|%SGi*gMs0jVJyRs)bqk8?q))Bofq zqcty3-OD&jFFMSE^>@*BCa7}JBtaG7Y8Ld^HTa?w@JB_uDX3%ttHV3-bw$X&W{lE( zLs99b2E=$@kuG{lR>i*%BTYR}s{KR}20k`M8Gp)O#^#h|j&0kNWhrx3UW`-HGh55X z@~3Br&UZ=QzfNJfjBYw4j*CD&JZ_%h1U<&nN=7|B`W*UUZl>_j}NGCT?@l#baFhTo29lDw+5BQwel#TZBGj}aoZf* zHr%$9$-?aft|{C$Tgt}mmuHw}a=quCJTE(ZTKuB@ga7Q9Dh0)?aru+c}RzTgTs(h%V1%Tq3UZQ^euBYl|d5 z7DXG$i3g)+AC;smy)oDs1ec_?+0w|Rz&e%QT&vj&xM#GCMGA7h_suiGRLZ@ zpu7EDTcwF^r7-Nmx0fAz$sY>ZuCk}slAy?*YR|$a2?_m@A}zJEUeeS=^d_q99n4!O z<@LOu8~cxEIvGv36f9BmI#1qeI}d7m4dcyQZB&J;EuBhj5;+!XTk(fxfZLNgf4X4S zHQ!RTXM)gEvw4#f0-S~+nPI|SX@ZALM|O(_ zf|4{FW`Yb6%$}E82UFqE>%Wcu_19BQc>Q~$xvknLNBbzyeWNKq9wi@d1FE-|@#7KV zNBR92ln_}jI&q<+8%_C4mZO%~NpIBc!ZU_vX5R&ULx%=yg0^(w=&^YX(V*h+{7M!K~x3ks8?0luy*xdn!!QT+mQMrd}W6F_z zT78^c=})R}+7Hu~_K;TOitb8C3Z5a(MF+IuTw5OK#6<1)v}gSnS=yc8&xA&&SZWYt zD(P0H5I>AMQoSkKaW>rd$$_7{D(%20=KV+?SdJEiSe!@D1fJUyA;Wu1v*JN6! zKyFVvC_2MbuyyP1y+~xxnPg}+QG2e=_M*0uMA_H?bxmn>X#Lk^Xuq&8b4neN9m+76`WGx6p$NJd% zo9fodF-Lqno85XHb?fzM-Fm6nt=a>rJP@p_2`9A@(cvL_JYGDHrd_4P3Zi(JkSS9g-S8DJpF@6<200K_!t{Yb{4ZNlJcI z^!B^y709l|*+`%EJq&NX#BQ6q*76_YE{U(IOLw}vE@tsb`&-P;J^-!+w*>5#N+Zan-ouHD?-67}6e&Lhq%QbE)1$4%V z52Z6E`S^Xorm^*;F)ATDr5>ohExG&V(o@x6PtR~uap_4=N$AO$C;2uvtpeKOEDWWs z_40L2C@QfeJ9O(-sUrHQl=E75S6pIyHCIkz!MT>dQA%3!tD^U3Zh9_b;Pi6J$X&el zePr~zt@Z=_)w7kVw@&T#Otn;73+NANLt>)#6Urj`Q~XK1#nyg-Cus>vSsKC0+S;$F zYJjF{tFY@+`v*vdeZ6I+b|@b7H(Op(lQ~J{yCYtd*NYh&sI~@`lba|LS}MyO;*25) zks7Rle3D&kuCoXO%>5s!!f>exuKh$DW#~PLLICjB2C<93u|H%h${xPpvUUWoLwUSH5swhX0vE^Nv)i2OB2ostcH;nYa?5y%MH-GX?y~J1 z!dmS0;O-f!QacnjLtdMWZtR71a@odZkVU#+fxz?GtkCUR9OGzbHH-k_Lnz)51BRGq zS3%|?$Ri5cy+(ufVp#lSxf3bv+|c`hBz%@K4-B;p=J>{NEJr0Pv#wes znCBJpKoi24yi8Az^|mrCcO3<(L`Nlu z@pq+>zcJc$^CxWgLyW)lqQltkN6>br?Q#Jn{UuX9`o3JGi-JOyucVhp-+vZi;Qx(L z#^3RmF^n*Q52g*;@WE2%M91J##%NZ|hKDz1NXZ)>eup1+q+&xNb_XE@do$(nJLaP{ zy+q0PAV5gGCuLle$vj~>byISPr;jlWE>1=z%c6}Qj~Xt{H`;XbC*a~d#$S5TVc_Cn zXgd=wxPUz2;>sdj6ck1R7dI4P;Avx&@tnVmO}H>^&;}QlGUp~^aQKZkg(GH***J1i zhWNa3q{2?=(qW{jf^>TIYKjNP#1a~jJb5rp?UdGlmy9FAm*p}nv5I~PlMM8hT#L}- zQG?6dj5gB|gTPOK%Uc+K=|zVCm)qB@!p0o_S9?2%WTFh0lqbr3q)1-{g^{4l|5t>8 z&yG*nwJ-Y1*hCrA7;PwHDf0vb^?ROn+;%0{0TWr)=qeIBQ89$SMkQ|My75Zgl) z+wD<^z`g9X=25mcp5!66cwJ9ER6;o7eo1^tAE4SoW<4rd7BciW7uKwH#jZcaXwA); zK$(*nXX!JxM)1VL9 zkJ4#{dmC0hcO!DakiY4N2-o9UpT ztzurn_)9N348GifwlndC3&;~+-d?1Og2G7ffq>{9%6?oA_edpbcLvWiA@Q zU{pqH63B+0n=+*73q3R6!5Ulo@uUHd^Dvvm1+$)=Q$Ah5Q**9fT_i_?Wpa8l<8eNMw*>rvlDcF^3D&i zc|KnpbIWtU_}!3hj!|L>9dg-0A&UUZh%bwPh7>CnNgsBK4wcMf_;4P{9_nUyncD>+ zHuYw2RIg75$Tl$_B3A}dRq)+#L;REiLqDD$a2+5g0Foh7O37fIAJQ9duF7#s0IPbS zjP%F3M!i7(?=w3cKz@2WYUDqBbF$5JIMP9y?YJS zoU_Pazepyf<{HHEMLN>1b%v0>oML{EUzO-~=RyWCJ1jC}7?>UCajw~6H3>}~v+^&B zv;9VEUh~4ujI;Ej!^{iMM%$V50vC7XQO1AbFJp6FFs;uv zFIdVn5A-Ni7H)Er4O`_5(I;OY-0e~1m37$%!SbR#dHZEugcp%le!z-myC<%_t{TgAp8a@l`a;eK<7jy-}6ISxVG~b^|{hvuW8cLb9wwCCgSfJ=WVwM)){f1!9TsQ*4L>uxNW^4=|c>vm|1C z#4J5%Fz`ykcr-#LzwUub@m7RW@W~jnhcOvAd1LWbv?{B(*j^E9$|v4RsZgw-*hsu$ zx)h>OEP%^JMU?wUE;wfZm)w0&_(sj^cI#~i4}u+B$awR%1FAA$2N#VBc4D>H=BQ7D z*szvUl8e1Vt6gn8EE;lfc1mJFne~5Q5lWABnVMLj@Ky4%A%3K>v}`ovW=UW{%+hv_ z1v$W58HL#aZ=*N`8oq%E#mTG=4pfC3MLLzis6HC9{33fnA{P)eFMBN@5@<(j2~uZP zO%b?9UKEnSY0|qzvx*4ZBd=lED@|}e;*`KWweMjDWF>0sm2TqPJfN+^i>*OZ8(1bNqV4NR2CE^T8@O@NuZDkwrNxsX9Cwrsa z{uu0u@gpWo?TOOqQTI>Io5?xE*@F_Q4%vfa2M4cETjHj2&O`4riudVM)~8zHK6Xlo zob%jNT(_|W75_`@7rAK_xWvv`NS`M?%x^>?2cGKgo9mYOwf@?wx~aIdC8+poYphSFBCkOMDrcf}>PK37g+Aj^$tf-4}B{HoyS)oyw&W8n01%E(}yIm=?r|M#fQSJm#o12a#>soB+R$4NyM zpv&#`dQ`XHyq_*zigWCPH}7-Zygw-B4#lgWqcGZ-LyUyc1~^c-@)0Ml826-E=!)T2 z;TUiq7G$v-J>HxAU&_-zd6WMOROz?vCjSp}NkW`#eh-x_8_e`Lv8j}G`ewbYFD5(d zZ^}Y99G|3>T!E}Iaxyo1@qzy>Kj&SlG)H~F7zwCI$s zwAfvYyY!;E#nw(n;T$*lXHY!TVq@_nEY_5c&0;NOJa6)wHM8yY!VEFV6W>gGT~54V zXS<9Jx}i@6aJ3ZqtJze&gem(x=B`N-_fohI38CSO5;XZtKHpqw^^ibXyvQe`vLv{X zn@`5;y~4y7LJGRgrkf4zqYC@Kjfrl+{^_ya)+piuyw+&b&7Zg(^T&+8^rFLzfY+n# z%n`r^{q5btTVJyvSabs4mzw4?XYh3I8-j^V!5jxC__8+gd_&1 zgP?}zzhbsFfammh)OddXT>J?pqm19}FJlv=P3yCPw57}iMIFR7ATgWG29j2W43i6McYEaN{f+E> zFX^a7yTMuRR>IT!bF65#r+1uFQ@~98T`dX!CzquOU+yqoA#MT zGwEPXFAu^sGiE7=o3_cXdz6uz_Gd93;K;NI1MXNR11E3H6H}{lG#6XE=j`P|o%gN* z-)oD9MePYBO=cuT(qdj!L>HIyemcFXb9YN22{o^qnYY^R2enbI2sOf`NMxmy zmzSE2`m#(o3Dk``vtb8C8fE-L-zinN{5@>7>dUh%*1{~32rPx&I9H|kN|onPYZ0*` zc3ji$Axow93+}x}?Wn9uTpHFpD1w*{^UbILMSL8HsPj zQtC`~DVDw=)&q_j1bf2QH`>>2hpIivI?tl1evJF1|3Lju{4kzun{O9`Uk;5V?07m1 zzcp^8f2Oa)Ff%oafAD%~IPyeBJy7`iftcVB-oJ|L+WV=!LGRz0$H9;f+OHUm32U4R z^4hO>^?!$+@$txna9Ih%2YRpo-kFSQ$}T?Vvs2^v=lRnVL4q}_= zbi(oQ2)&rJ^5jF+qyH@4qi=8)ef)=i=BDCutrS!e9;q3L=GL8*TpcAbr&hoxl{1mP zfbdY>$?i$WrpV*dsz{}#7f=cg+`@2qnLYqjJ+skGyQ#PoEU4sB@FU#R3MiN}F_eN& zNL@wPbi2t?TB_Cho6_i$+`V^c^mqIN##Rsskrp~K7T!b(oMysXF(;Q=Zv}bpWM_6Xqq!Il%|i+U%YHe zT_*}i1;*c%vVQ39m`hpT^HA_mm%g6judlkBic4RDNLspfBTQz@V)PJAdm9ii_#*%Vb$1*E3*M@m&M zad*$9sz3Bs)m?5XE>#ICKB{_$n@RyyapFU%>e#_eL7T#kOcawkGoC87ebn7mm)bt! zueL9^skqc8s3g?pocX@yrd2?BoQ0v3caqxR8rX}qY4JFFd8y8{pOs#J>6U^^uRrtG z>){V9yrL0Q{PlW*n^pn6au$Zt>;09U5<8kUogO<_R_fFClhWlm?w-4JIgP5GtCmN* zskp|dpyIE~E8MgS=#sNA3SD}QPoXfqtf9-qPfC}I?w-4JIq$E_o|}qGmx7AFE}!G3 zRX~@Vg`B!{7f-qHZauY8E!EzDt?Ut9c>fTZ;uqdu4}sO_tGw`DlBZP3`|a`^2`A-m z5?ksR%4-G_XR93Y{qSmBZbvfqU03be#iG*Fk;im!DGPQVB4av&^de$!StR6r(lwWE zyC8@f^G(EgpJJY=>e(&l+((BbWkCf} z9`B{*59R5Oywv=Ds^s(yOOKT~aNF}4iK8%ZM#=Mwx#C`~<@`*JP;3Mbw# zppwOliyrIlHJSJ44nr>`hwQVm)BiHsN*+cTb}Da%()lJw8{wraC}g?tu3;7^Wh=fZ>7G!8^l_-?i-Cx_NeyZhA_1qdBxC6N5h}hAt|?(4$akTynp}U+$*Uv^m;sPSch$ zmzkN(i=&^Ct4T*KJkoCae=Y+m$g}R{n92Tum8-;_mnQx*rz+iZz?vmcyB^JaoY3b> zMV7BdlLa=3(~{B(CYVEp8uG*nWXnj9)5N?Gc7x?+j}{aN{)~J$^?DH1qb0=nmr+tm zvWA#&c$OTTh$Bi*8}42)9a@US9?iI&-Nx*MTiW&B5)vybQtV?5!%kgUM?EX zneB~5x+o}Q&1_yb!rxtlfp?Bk#_#o)v5B*$_1SQCu*}Ta@R2(RJ9%M80f;Hm>?x(4 zVL!f8O8>4j2PWUS1zE=6WkB-^a9AQVd|n$JI+f?|tlX!Um7xumhn@!@?sRGLX)ds* za3x$=z@$(GezUm`*I>4@>4Rno3Dh8#VBA`6XeR6EwlL=n2-!h(q&#CsE2b= zJuW5}&{HL3Yor^VV5{A1RRN~R(iPzXL$6V`BB0d)QGlQIHzoG@T$V3zZoLyKiw?6~y$Nk+;vN@`C+@wdNEZc#k>K84MHqPX7-jrAe;J#&XIh^P z_bg?en~r-2a8RoOX|kA&gV$&1!+ZJnS!SsJ6P8BWwn7chJyEMWM40C zvUF4Kp;>=Z%K67!<3*t5=b3&6(2^dH4lTc9w3ZHm+A8r|jI;Ej!=UAVq3ukxVPF#~jcX--Jlgh@v5A(Z_1VzUQs%81THe=(z8bb>N3t>X zGZ`bp7gJ|WryGO(iYnbnHT~GF@G1gYvQ(^c*OtR2+s{;pi7if+LY%js4v2!P28?G# z*h`%*VTP+v?sM#kMr9lu`*tx2$T^^j zZQV{wzQiw-Xdjm6M#oFOCJ))Xby@3l(-+HIXBlMym**O~0=O?@Lw5kU>G9}*d(LRh z3)N;BXX!XF3yLss>lkJHLVp>Xz-?Ne4Y)03e)zu< zR1^T1BFUZtF3r%t?-bDAFD|bH6ZL9mAR%`^5Bb_RaR`QWEIW}~Xg8M_?9(~bbZ{jd z&cR`$6Nxi3wa;2z!X0`nkf(!-k***>0`5+gHc?Mui`$7>!doN0K_hT9{;ov!H@QZQ zz|0RasSRKzJ| zMuM5EPDyGkU2vL=e>p}O9}0#%Wo%-mX?-@#w3I1_2V!t4vo=}C#;EsY$lDjAW^O)o z)hfpwE$cEB3qg7X2vqzSz7A|O;ULiMMoXuwz`v{kA4Z%2v2|{X zd!cb>HSPkCK)DiIVz#5D5XbgdvT|2|4)ft)%UhikR+~%MTt%RFdJ3NfZ6`HBi2F+d zpWDo}0UrozOVtKnq9W2u5YFK?1_R(`ySi9yg!OpKLM&v1P8TueV}Am1WIi6@^*4Er;y+1<5_ZF@gC5OA%T3Y+*68)>QWY*8 zSfmR%$>PDp-b!`8LaTmOhM(mvM`1fSd;8S(?TC0oMLVUqF*MF~R)tidgDb(@LcO^+ zh}vyzgF`IJa3<~Re}_fNsloHs;Q6`GOw48HqLRhikRIoo%jTNRx@4HUXsAK|M58q? zoV|>3mR@w2x$FwGor$wtG@f%=xkwiUg^|o>$0*~y{xUY_GSm8ObJ<{-nact2 z2LYSI`a!@R1z;-(GtDh~-LgGnZ27KR`ZvUvkXiZ|gk5XVv=`QyzdQ23RF`^7rU#&S zwGtkR(L&g(cWGkV9`AAW8e)>O&P&=oXYux=JyBwLTQ1ZQbIzNYWH6|co`Cc?*PL@0 zPD13A!#*p%K5Vp=K8H@tDWjfuk-Hn&%%sDw+VDBCk zfJ$>=f#r_8NF}PmT3K$U^SZG+^g^|b%^)A+djr6@Y zN`j}Hn#7Rw!A#>`;L!t7$+8Bf$D_idhZ=3U`4ZPr&SiY17aazVE7t-85@g8aLR=C| ztdZ#Y1YY;Ia0lBhh(pg8M3Yl^)~tu^&KA1qw542~?{2}?1B$YbxS>k_(qgN<%=fRc zC)0x0TDu)C)9pd&%fWU5a8silb$jiGxTIQ&H(jvp(1c&HujX;yI& z#EPm$v<(5Q##5!`m*yH@0$cxxDH`URT2t0#?Tb{L6}vy>yJyeL_*`9y%4vmOd)UhDEyQDOs;;itQo{G{-38uD^`UDa#z& zwkgX}=B&IJr_^V*mW}1BGeqZ&<<}`Jm%*xr#Bp&<*|A}`EvA*gMB7hFLT|}sUt&4@ z1|}q^FS#71$D_mU4;rnd1G2Utejnp3z34F5{nuza6T7)+a$xrtigZ&@83Mb%QH1Q* z#wguy7L{%)cK^Ca7d<8Gh20xZPmYIlv(zm3NK_h^7y7Yi+tY$g>^8@?4ZAI6&h)_U z7}pdknJs1G_G>dtGcRtBX#LF`MI3AI!lCURo6EKYZePr7YXGLmar;$8y67ocFWi265eEKb zj57W+e;J#&ZH{dlZd=M^;dTPo6mFX>W#jgvGsKp}ZFhT=s`iuFL7QZnLyGa|ndb1l ztmsHm)&3xtafwv5-=j*-aD;JA&i>12=X{oLovT!}w2?=xs=5_n?R@*ex zb`j&vTWwT@t1X?%V3u1==c@&?uD2qZCMe78A=$i1_$N%w1^?;n(`XV|Ze>_onU&LB zNo2W|5r^%SCU~SwXO>%vrOC70{sAPwv)r;z_kk?8XS0aQov?HM94?XirMf*$d7Mvc z9}_K&Am45OQHd5O5`l3M-HKv0;}lyYg-x8$vuESU?D{5Q@X{QTL(Ma@>+9l1`rCao zyGk9ch>WT)J8ade$!D$HyfRT)(?2pHDmfn+Pt{WJ?wI}%iC$GFYVV@<1{1yZx98QF z*gkznqHl>tSc##snSR3Ad1p4$kD{sz>5PP!A7RCl*-Vd2*sbVqB9ZBOSwgB&Jy06_ zTJcW&E9c55f$8_%R9w;X1r`73`K!)IPJ79LRU~~WXCWQrJ+w8RR5K^IyXs1Puo+c7 z(^zbAQ*kLzQ1MsZL)^3qq(0y*zdO!3kQz9_9dZi9Cz-8~hW?KWpofZp9(i1DAOPeLX~54tni zUPPLSMz@4Em5QmeNz5pbkZl#+5`k8lWFb z?4Bia2Bd(WbeSDOqevlDR0*g(5#9+t(&4g{54osNV7-!@VGwMpJI~Y%H$mLKq-&5= z9xXHdEm8cuLC)xED)of|PH|zwuNq84j#ZR~Gb48ftZY1Jh6l}%F5%v5W~f$7*E^>u zBO?XNoKkFQ4v@Z1kQ#gXlpFK(Nv2O}P$lPnWsdYIONqsK!SpFK8v&YVIv^NHB<2}) z!jyh4k%_apTT#ifQ%H~Xotj}1rrc$;m0bQB<|(s@yqfWqUQ|Ds%bPIeb!b~ZnPV#! zGhqrBO!8zd_3Y@cigZy>$U2qFNSN~RBBVc>L%OxQQ8-7!lux2~A?flQDbl5qRv+4q z@4px6rl*7l^P&hQ27geX`@6FGGy-^zPZLTzZO>{ww8j(RT6W5`NDG>)$3zBEsCzu}tQx_RcbH zmMrlI79uQ2fSWN@++T?|@UV1^1J^J1q7Hj4sCLm1537fUu^tT@r7B%R*@nm*kZ6^b zo|NZA?4Tr~GN}y{VWR4R66l#*lIl!HQQAQk6Tuc#vP=Z@ST~JfCW1#BZMpdpZqYj! zU+G1M88R24?M$fRg7KUPW{PxCP{^7HyqpNCMHpBZql|a^%h-e^)AnqzWGS=%ULUw> zD4OhLW83K&y70xenJKz*)9bc+UEv69!?*)~xi6Wp39sgOAE%3Yy#~80$Tk}g8WfuY zv}oo&Y;5gZ-%Ga!+4c<~FzVp{W$FMm0s!qGARO>q+%@EP{baKUJA@!j6v`BNqYwu# z#PvYLMrtAA5ZxO@VAD}t@_S9L!6$(Cl}zEV?W9*TJsuVCzRPGU9ZhLM5WxEvjIZ>f z!vOEQ(RL>Aa=~~4?`vcT5z{V4r|ZMUP4Qc1=>~d^jO%i?4bjr<+f;t(8EEtrtW5!sGDCZc&nRAs3UMOG9C?`&tDZCJDEafxk#tEh!y7dw4B ztluu;7B`%b_^EKLq1q18=8*1l7v(ae`q7}cx%Mbjvb+n?7qfWPp!?jAT2L@$cGwLoh6NLD1CPZgvn46teO}27sJ%fy&6#=Fec~XOLhE(m;L!~aT6#N-hqTq8A*IOr z!+@oWvx>2LxBk*;GEVQ-pP{O2RyF)3f5eI>y<3kRG#k$^ClNj_AAVDn^h zb&?#(&K@0us-E7Gr@5)Pyd?#dgtz1xHaW;;r1+-#bhevX0e?x(MEd%|LwP5YC3jM1 zGMggPb3zNHrWa7cc)VK}E_c{V{S`dprs7htppr+y3vOx!6wH|zO2NkrEJbWOJwh)f zEjam5>F$~Ce!6t`41e9d&`rgqJ3%F(yVX}G|vadj5%-uO()5U~ z`<(3Vn@e9OqN?W_Xv$5+r7uAxp)V)QUg)M(KwF%Jp|o{`{xWSFf^mK~G2G(sYH00p zcg&@#EB#d!x~aHSC8+qTs_CXxKvkTDp;UD&RAuaR*c3(@jf=@SBKc6M?pAk4U8;Mo zzv^DGAnP1%&{%vL2QLPyKm4$BAJ;&G|`z5XiyxSNVg<$_8cm4C@i zt$@lo6GM&H!?i6&n@+XdFG7Rb6E#G?@9vvRU*GlD*Qzs}O9_|01eJuo4%se|2cJ}5 zj&f5epeIgzC_Npa@BZ2prDw$un$jPs?rm{*&!wu)l;-scptzZ8bL)m)ZoCgxZ`-&3$fK1(e5G7)p63InGdQ!!9k-w-|zH zKda&RVz(4rdVQh4UjNul#idt4#b2*~>ZVmdubhRU^m>1#*TkWKO{cc#ze1n3pOh~D zue;|iUH*-~ER}c zXap61UEbeKtAH*!3psV^E}jw$!g^S$TB>~-hh8HJ2JuZa#e+dy0D;x$t0fo&&Sa9o zAmkY?-l#rmOx~pqWrHOVMc;Lt2`1!374$G`T3}Ybj9Q;DKD#q zal{CDmA^k+BMQ78=`;`h1(Lh*oKf)X9Rhl|AO!)PFespG58TpKVH|SX1%uCeH5*Uc^RJ43V4UoaytKJ$PNqw%-a#FeG1q zj!ZsP5^Us>ptu!MLnVs~Dm~Wy*@n4}_Z*|G=1BG+k%YFxn7m}{?UiRM>>87WI z2d`g?CFI}_YP5Z!2t%JkC6|AQZq<3^{*V50H}Bz)ob=IdyN6>b^LRPcu?qt5&BKM` zqVT5#YZ6jR2Xl8+`lv2uNR`UH9CKNjm2+IvzDM`H2`1*6&AO3~YEC6jW$r2H@ufkR z`5nre8uDTWc|itr8;}JTk}b2l8|-?;aN#>-(pJ(T z8e*51zBizfWtO4Gy4_{YGOI}?aw6nk6lbRzt+_c9w+|o0I7=@&%!oW4ZD%4O7mepU zb77G#3JO{CjMugAClq1eabuM6<^D1@QO~qK8|qogeE2sX1Jsx?`BJUvtf)kGBBg#{pHbr0Qq zLlijF6}7BbneL4za5KGtlKQiAjUus9|2-yn7-{nUHa#94hQ7>bEgcvM-35lOFwWA8 z4uhe0qU}r!<)ZP#(03H+qM$Gm4E^gO418dWGX5KX8JietTAvL=EoHhE3?2V)Rs+yv zDI4~lks*Iy*qix%9Qo_+p|)rla$T*qkVMeYi`4QHw{^(}lLZT+Xp;10io+mFlgjoU z1R+)%@qfyQIoYa*^K`*C5?QfJP=$8ESFApO zOD{UiV*WX3J98S~qVb#t?kv(pL184*z*~zj@TM`!_-+0&Hm3p8`fSsHrOd1D+oN5L zRFn5?XNd50EH0?rY+eW~@JK6ezQU&Vty>`s z0|iwAV1jO7;aO3mw}hZR2wG1u>sr`5jUrU}jQ7J~m1 zPk2+HeP{#stJsbvc<1{o3#ItIgTnA@0+G#I*W}I{IRd1eWt0j0Tdv_M!1`a96%2qi zJsurc|JZ0P9f7qq`wtjr=|zVD>z|_SOt9vn@dWFm&Poa_oo}s+g2G6^`awk)cmOJm z>%Hg{wCyQl6Rb_^vw^jx%#Z$eqKZNQQzqGyz?U-yneQaF0(nUdGB!Ie7gn<{2QN}Ozm$3<` zrtR4P)l%lZ6b0I3FB{vg%+Q55w(S@9K7)xm!Xq1A6JbCPu{!KllAa0JlVxraEZr2_ zg=StPSJFXTm%a3JM+UX1MNH*pyGvUI7b6lT_JI+OnHHC)2=DMj6#MvYsaPb&-_>;R z@mv-x(ChD*)CSOt9_K=@)g+eKoq>H(oc*iOS~@7{t0l%+deLF<>mIb7iC|MuJ}(wkI`~E;vobYf))j3&O+Ewx^6u{4%Z2hF_L4fOU0LR}s7|#r#ZKyw_>SF!30hUWl+){SRfW}!-|@-$i~Ebk;l_dqL1dQo zmG7EPQt~{?0YXVX@Dcj~Q5&!ObZDpTt%AO&Y<&?=-ujk@W4cJS!?8!_8e0NcAHl}f z0J75Ke8}o@6nm1Co&at}Mps8r1M7T%Lo2rBs?xM` z@Fj;_19g`Z*5i7Q7kzNq7-OB^Bjm(@v4Dy<@vgT}exrOt#(k0an<{jEImSUmU z@*=$|o&H7TPS9(yR{^$>O$l6CpTlw)t9v9+p$+P&-eP;0gf=h8@aA9GSc)JRzLbz9gxrKUjZxFTH@PfhItPE$;I;oB@6vw-Afv%Wx z|D27kfhm_Bk8aBSd!x1Vc~o0y{~hBjz34Dg?kCW8=9J4t<2mKtQ>2T6!bqmv9~5EW zdt;RGkNjn9PPwM_*{0mVGBcM0;12?}aCtij*dqXJ_2O!pTlTu;?HOasciqyzA&&eL zOyJGU*j-x+_f?mAOJcD=vl@!CnUeO_#JwSYmP`}d_V@(1*ASDObzahf2Z=X5?THf0 z*0YoIL^@m(vWq$A3{7t-85^TM?2m@D+ zQO4K!%h<$L)AnrGI#_0A6Cn);l6&^w!J*`y{dekMLeCkT&~pF^zSAhiHwG%|>u(dV zsDWq-EqfX`GQ&cAr-6Q`q6X^G=D0r!VL#x*cySi~$8;VF;AXcb*|Dv;DJ-_@Z2+1U zG*T>4(|%SGyDitS63f-+F`>a~lgm|loC{K&{wJ?CT1!VtZNd5q##wsNVLB zxoDE0ioik(ft)({7o~u^i*!>^$pTh~cjDg_A^VXrO7~+$rF-a9EL-}hB>UAOUG$W! zSFn=r6=C2zW0djt{bg)US?1WbO<9&QXXV8>r9QK@Y%G6vhUmPp{5pl@G6L+7I4*)H z@fd^?wS5v{+enYe!h$adV;smVp2EtIs9(BI~= zEwSeQFcT6~mt1qxIdJ>?MY<`d41wE+ zotM;Ay2v!?u0o}8d3&!x+l8c?irXg@>7u7(y>NS~2m_O2l<~B`j7{7&$F>c(EoHKB zJArEomCTm1ar=WA13!t|?)Gj+eAF;Ij%w{31OZ1;3cTGztf#cZRWyJe$ctXiie^U& zUw1XzIgi7H$KRERZp>v|r*irYs^p9juA;pEH|?Cy@~!g;wTq68Jle&Z47P2feY<#f zT|DO(n`m#Iewr?+(5)yh{3F@nrwr-JeKM9J=G+-OT6W+#S?@)&^>8k#s~b<`VY(c^ zS0n0RGoOwds%05Ng$MSkc1oQdLSI#}%U^mT;%&h(l^qq7oAW)2Da)KB>2M)ff)6L0 z68XvkryBfJppqUXz5n>FTa{3@ZVe{bS1uya|E->a;j?or?b-`SGi+X8I$Fiv?;n+< zDCcx`s=;-mZ8E$lmr2w?2iE&SRI2Hw8!-lAyZlY$exjDJ)sm9GG|}}^BbuFjw1{PXge!Yv|Mko;@9Vl%vj;J* z4{z^LaXv=HU$b6&j|!^7M@2f7+T>wa{%yq{ny7D24yk7gW?f59s`g9}dS*6na^9xN zFxR}D&OS}?$MY#xCJCvWaYbd~imdim^GY)HioMbV4}ZUYq1Rx??<D5CZ~pd>3% z`)~Sm`#d>mwSNU@Y%$~TkhfNow^J#tv*h!^iNjbv>&Er zBP*4)S9DiGVt0mk6s#g~P0a4{0J{^l-_xGW^l*A9+nY$_5FtmcZb(xYML_1+v&BV+ z*|0Oq4?1V@JG;^%e`moq#gawrRLGyiSE?)n`|RK`g0x@E7)Y`*!Vfjc$7~0WXbKMs z+yU>XZ*eYKS;29mM;0O1HsuAN8iac174 zF*CCpwtmpW$tClEn7FX;cW5f;8)=GYonK3&d$SaP)fi8e={&({IyG04x5uKYYaW%O zLS$LKm=&)jdUNa`LW)i&`jkwXAr6s}4^@xmi}z@jv-lNV;D_vx=z&j)%8hO+t`vlV zN+NAtMy~8~Slm79RAy6TdK7=5)bs*M^mn+0;WF73e+9qM zO~s{PK_!oZ-|41SK*5}ep%i>V>RQC6+fA0za_CrpQyTrGyZ0`Qe#~E^|Kz6P(x{-4 zN2A|#Q!AiR&csj}JziTVCYF#^g<1;73bp;F6nf}GUCSuvtnw>=g>H0HaVb<#NhowR zt)*oL`4`orlijomsFSlWlsZq*v|wNN+w|&;=_zp7Sw>0ae796w1NU51^~|LH7&jG{ zo&}YJo-^j!U2bXxG|ib9O4COsUf*n5T`x;W3sw)5zUuD2x%5@>*Vj#MDlUBqDhYi# zQ>fqSrd2>&oQ0vZMFD-{w`-fS;)rQtxW(Uem}zUHRlQk|fZP+bNpe&0>4fbuvK zLn-f+%sncbE=L#{c2iE1+r4#88?(T-$22=~TNz zFCbNWqCoZ0?!LK3<|F*|b%mRXOJ9OYLSKh$XFVo2itXAC#Px0}1@y#;52dFg^j%<^ zqV(IvLR0!9rK+C0doESo=&!2hxT&~QC8+qQ>cws<1ysd}52dPO2e;^L3Nvmk3Y{5G zmD=9w?y5^|Z}eB&d)!o9Y71j&caZ7y}#0H;uy@PQ`;>Hp->cH?0D?(|) zmo5bre_cjyS_O2;S;(nNck$Zy*OD*95AgR^avylJ;|x``RC^#cH^a(_qK}KbPaEa@H z#tF1sM<%$`-frHXOMv1s$$L=A;($tzb*GNn5SJZ3W3-iYwJ_{dX7c_N<14+WewCzu zXlr?;e>ep&*$3a_`D%CNw*ESNrO+fC0$6dxjarPlE49y|ZT+$XLxa6A?ki~MKM5aT z_gpZ^t0bwH9llkhi-JOyWY;hYlw(JHQ^V%xMM(cNhjeTIfxNWV&UL4#hoEPYG`{hqe^<;17zS(~B^43M#q$KXj|kEB7uPun?ck8_m>7;mQ$h89z&&Yt^c#w1`??N2UZoY{KP6*Y+bJZa01I7I&CIolZ z&`U|LATi4%A1d`cHJ90oN#|vZfiYJ9T#!Vc?}>l<_P4Wo&|;X?-@(vy}PpZ$1X7(QNiF8*H!1 zP^LH7-j(JG=L@_@`U>DB&;`axH0-v+Mu%KH_$r%w*|9RTPw>$5fUbyO2V{n8G1Z(B zX~B^xhXXb0BK}gN9NM#Ur#ssT+)OW^r2Y@NMv=hKPcXp`U?@Ev9fp40Xe}KWwN=(V zjI;Ej!(iw)&~_$$t!>qub9`kY=M24Qt=J=8?%U)%yG0_5`bB4i{Qt|?Hb6`P`33YGCnjZ{6Vyc zd{amhW!u8tWa*~dU9$eBl=D})#*0A9yP19l(2^dH4lO@zw3ZHm+6v|qjI;Ej!=UA7 z&~_$Ta?yCAM13wz0jQ_`9#wJ>t)@MUYOPRN7Xn9{B`fAvk9m&Sj zzs%5@FQ&5i^BUfm*Bh+xDx%M`Bt4gg^$wk2akyk>S2BTKC#ZybC^d#?-}=JM08voY zfbpydf$FDAnBgi29FG&w`KXLjFT8LAU1fv%4Q-XK1IUg<9F&SyAh?_+yO;#z98krc zCsOy}az4GpFHr71vF61~z9tVj%~*ljd3!@FZ=Ge71)TNpB-o~79>Jpk?lV!zat=q2 zM+e-O7_GTE6Ne}}8E5H5hXL+O(RLb2ofHWEwe8cz9$Z=2Gh|!3jDtImUmrF~RZ0Z1jT~MO@ryEj(@~Ud zfvm1v36NC}lt5pfYfK45eGQW-Og4GwM2~YJsv~szdyTfzK~h@?-_7_+FFFjKz7K6@ z;wcx5C!T($NEZc#k>Ke)MHu+%7-jr5e;J#2YTBL+Pc3Ek-|GWc4Mmf^Y;1c~hAzCZ zZNIo8$OEt&88kwqNk%F+b`qXA{RSklqxgk(bBSRZchkC(PURCBuj3_cb*a^C)Ij=Tr)-)U*|7l6TeLBv*DMeO!d;L-hl>@)Fl<fOb6MuKs7|#rg)<*iZv^b_M9`|@ot%!uwRo&C9Fl{P zacUGy2qLpMZeNT#lO?h6qm>>$Vk01G<3*ohzc$e$vC#_BqMr2?JlBQcKgcz##FFs& zOwF*`urWHM`u;iO0euS0-F00D|*RKwOb1j{Ayo zm(RrFmQMriXek7g)3niJ5x+5YG~jhz#)N}LBq?m5F2P@brBp@|PgH2N+RauKPm+ZA zgu~`5a%IH_T49&;StOjpomsZ-#v$2awGr0iQ#i3Vi*$Gh1zsMQV?;P#@GEQLe6L*% zF~`iZoTJmFOR61wr9BApZ~Kx2upUgnK2JTc{&bHIlT# zvjbvLH=ZV~^XUkKHXODiIYXvTRN5=dui5Atm~H9t=w{pFb8#kKVK$@ExV))OMBACO zEfR+nr+KW3o|1&&9o;|Ml$2vU4((Z9HWfi<1b@# z#xZTrHse^zTs(@=r>xebkPR|7W{A`G<*0v~3UFjYnGUYycH<>FLzr-Zy?c=7M{|K< zhffC=Ez_1**sFH~td%9u@VfE!w}omOX8>pd_uaZdXLq&LA~=G7GrUL|i&iw!Ln#S3 z(jO@aekYer3OxEI6XF0K(c@9!(V>q_wv`St+J4ioGn6|F9<2sLnRvtnm!AmuW%H?k z8wD+lw(vV+TY?FJQj=47)~tu^&KA1XzJ;>3ZDBk0{38N{&?9U?gzaU#>31u%%xd8x zM!Ov@Q>X~JYc4nNv7O#)!x@8Zx|HHg7i>E;;+-4pW?)+Zn-%0{w}71j?5kj30e6OR zB`ySvK8bm35M^4iErf9SXcH~kylB!cN5HmL|>tG|&%Kd^y@-mNDkI7YboNAj5cZ zmQK>ZOvL$VVG`hnwPKe(-V_$w^|qJfwD5ugNz;B-68mDVVI?5-b4+LhkV=npL8{a1 z=^3d=`?<02Rwk8L+mOT=%pg%lO|ZTm?{sF%yW1a{xZ>}vqK z>G9~W`}sy|UZD2-jI;Ej!(ewGZD*nj7flZAer=I%3MxZj_g@wv`)6a6?z@UgHx;`- zUZjhjlJ&ywe=fqnm&PdLulUQ@#BOtJ+pybG=1dRlj&V()lG#!=ZZ|T-mKV22wEkv} zB967UEqrhiw{=FeCEun;C$Tmi@@UB?aQkRfvUqya89d#wMZ8|CF_OTHx*%E?-*tLyZ$mZ zaoZf*Hr%$9$-?aft|{C$Tgt}mBQnI6#BFzbw5pKHCWv+~L1c2P{@K@B_ zGx>>VB|S!V|M6S5D%Q7d4JO#v1ovA#+2?!gu}o@TBKaX1^F(dwXcbVse^ip9+?i)* z4_t!UjQf>bimQVT%<-R4$ui^8B$gRO>Emc|1 z#+}l75^5?b(o#F?B{Q0cHvj+aeG9x?Rdx4GLS8pd@{*?>(;wtsxVb4WiFow>}J$%B@M8h(-M*08YUvB~Hlz-Iu>pA%ANcqR)^FPVwPsry_$>-0==kxf9 zeK-gPAj4v1`C|N&jo9*=;ft7sqPXhX_E7Nzh>|Tu%5KdCFMu(s+K9FdXxJLXBYe4o zc+(Xi1`hv$Zy0aF^{x0+`Dpy-aJ!}cAwi~HoU^sj&ZEe?QBEdqVv>~)b%{JwzAjO= zd%=u>frMZ}rUN|n)5s&zV$d&|caoi&$KWyatyvC!Cl>+u?>rvDdJK3lf>#teSw^8T zxjztg8s*~m-Ml@XT_T4W*Tb=+_#hL06V3)O`tkl^@)5D?N51(e{Ls~6m>}3t`EWu- ztyQsA5(Z+9e5v;57-k{~W<<;wD&GR!%I|>>VMO!f_V0inz_hgvk=9yRX0Q|&@HRv( zU2M}fxS1J{OXU5@KGEzeWH55jP8P+ozrDj&1=~aAJ5lz#bh5usmc9Hoq(=q%L{gw% z{+f?GHt;@~)QKV+N%_;33h-bfHH&Te0i!LA3D4Wm)Z}>hVEqef@LNdrve27l-C)8x zE%ZqYgU>dB#KO2opYrd~pHUINoz&-y^?WkGUon>l&0I{0r5G0>v6Ll=?Zakn9;v0M z5PBEvV7!+j%12t%R~b?tmzxHCJvTug>zTm-`zQ*6G<%*(@C zRD?{{>O~UwZRU=dOtr<`R9Bg~m`ugExSML9nU{yDs0f)%^`hqiKWx^D$<8;p+xb>A z7n7YC7s1XJXZbNRHxElwAu?IIM|r^SH}}nCuTQ(%>&s>?CVMe1g1t0(z#lhr@vswR zp2<$V%LD$bxqBv4J>zbwUzoX=OvSjkm}>AMX?Y@gZVyvY=9x^@pFH5dVeYEQY_EW( zj*FDD%v?-nV_XEY85b$9HS_W?9u*;z@s4^P@ZDxDnC!aC-L4a6E+)G&F79@1n0a~F zm5Pwbu16&g_`A$KH`(%tyDdLt=3=rXN1p9IiPN_^KV4X$~@hZ`c`-&25?@n(ylAevbE> zW^Xhtex$dQB*VAIW<2z0CgTG=>TizklhSmE=lFgZHZq>G(4SxE%JJH(9N+9J&(Y5D zeO@XBvJ-}9K_kU^2P{tR{8`hl8g89zmS~ADm86l%(=%U8E%>%RHxPZN8R-)yc`o(&c`NVEs zKDoe;kc?WCiuEwZ_nD;LbdGO0<{?}~5?@(b-eW!{4HZ2?<6#fxWFDoOmt*T*4DXEj>sj7feJh zebp>@_BhbC;u%$pBc6TVr;Ch3Pw?y)J_0=7M;*W5u45U`am24ZK3!xSdV*h9`v_3&qmCnY9n1J7k3JQCDe8?+`*+(6J*Imc5FOx@~%9nN5na;+7NwB8VXZ0|BR{U;K z9&Yw^%N>@v<+^TpNoQj@^Y z`vwsY^}v)^>&=2jinSgVr^8l#HkMN)T4uS}TJJ<6m%eHiY<)S(fQX zp(oh7$wz<-`>5lK-E}Nut338p*xFrZIvWcKwb-5JDSk$lm1cJX1C|lu>IQyQv$6bM zs%gcRs|ShFVAP7sRV+>gsm9lj?~$nKkutGheK(OzUo{J;z87d)L6xdT1XW`;mQVO} zlX0;DtKo3U13ql;>!Wr*>#JSuy_m20bkR|>P6w8s^bz1+`>5lm+;uFwEO~CLT$Z9v zhHNY{H9M9!Evj?I@?Vi`EGJze;;kO`63gLL&`7Zy#^T;#_d1E1Su(aD9wCzHt7gIO zvw*f0yQykYVE4s7-DF%cVE1kxwwLu$yKnK;t`@tee7fkUStsm%n~wn3^-;&~aM!Vn z-SXU4VYi}=Evi4pI#gt1ktx}6d$~nzX>mIlogqUuL?qMcAKpxpuC956_;WVf>0q{dh-}Vg!zR>hdM@4BSQ0jGGGR^L72O18W2xI^yV_AEkUTQ!d zl1APw8OtlwX*N1kdXS5yb!&&((D(%8N{JefW2I3XAwkS?mHb#(S-)n@NC5d%nv+#p z5V3?N`@?!vs#VvYb>2v@KVL85dDYzhe5DzR^(ISERI2XHL0XnN{k=nhx1za93ElqW zLpfoKIMKyf>zEH^MTbah#33I_N43gyDDx9P1E#`yG*J?-B-eC!W=Mt-3tm1Q=_!(- zyz?bueir=kle6NyN3EIT6Qo$oM8Zq)F&-+!DqC+`{^{KbD$cJWCjm(Ijz))2C#3}V_GT7&!y-AES29hvm+NQo-eB~!}p znz@)lZ!#`I=*^jH*6?28pK))FnE7~w-K6aGj?rPTE$hZ*mB|(f)p-A;(zvUCVD73Z zX6o(khWnJ6i^*_|i(oiojOqu?ygZCYMaX2l!PtSSj5e43%+1yL9vkYL=5Cn`^>uec zJ!R%%G8E$?7;5HO=kYG#pK))VGxPB<5@nysNGIu6HY%g7R95Hx)%+T(VBs50%M_#Q zng>lCqr;zM=3+7^<02T;IP-?gygZCbMaX2-6Ld>bl}VQ?DszJ>e~Znz!Q6S%{9NyD z&TVEcCUY__?&iG8%*(@^RD?|CT+x|yiRTEFDVInUxf#34V-xN-ci3dYy1NMvo4J@w z$hf$h@K!S~4---mQku|QT@ycC`5+ThDlY*S(xdp{!$6A055ET#R>rS9e)xjUqnj8$ zoIhK^{>$;qms!JypMC{y3Pcb<99{vlgyDGZJJ`8v!>$bhY!;A5aXwOAtH%TQextdi zpv@$_c=~5s=swebwa4?X;o52QGz4+MGKua8r3de3r?il|zAd zlr&>FvF?<01P`>cN$ziRomX}=g~nD|J=T}ZBgQOUFytpJ%Hl5s|Ao{u1Vg@%Z%70~ zaO(m`B<}E4N@Jtj;a@U-Cz_QCDaD>(P>p&RH7gAfeWVi`@zwy@yG5d9mW!RKdjpY6Uo|;=%gdp1idgHHLUrr#rHbh~ zn^6z=RHcE}WAzt&y2-fM&Sor3jv_9ASQrb^@Db!{Xk^-q%cAf7?)nBe5a2={hbp*G z)CsJUELNA?+>RFOEV^<=i?ie1J%SgI0ez|gyZreIK?;a3h3^C~ECm4ytgUix$sIw4 z56PmqtACnmWH5yIBhp(?ym)>Ki+hC-e=X6{PkTfzh7g}4a_OsP8L?jk+E#?1iV+b) zd%ox&eY(gv*wDf0e9`xO1bDiSI{v=9j%8Gk$DRrm6m?c8CsaH=fS~%$Va58+MFBfscuSHfx|91q401zT&? za5T7Nf=CH3CgFW#)M3j-3aY>xp1P{zyhi62N_}+jl4=k&3&o(2kBGSSFepX9KB$Jk z2o_4EYN65`4}&}`o_Oo%w<$nUO;l^uAUp`&2H^%fRiGcx0(4N?TdmcB7VB4VAYZS- zi&9*oh4p%^PLJn>^6o`I`W8V{ggtB8qua7wJePJu>>6&Mz$!dK&+wDTltX2}@B zo=qgvSIvU3zXi0d2uoEXBCIjr&80rwWL#`0dmK(gzV@PDV#~kPhw+tt)bAc&{c1hf zexEKn>ek7Fz0*g4!+q585qBNS9!#FyDi79OXZK~`CZ@rk9DeCB_{UROR=a%_aH3_5 zxvm0QJJ?&uV5n4;eLmlu3|O5JaF|n5wK_WDiF$1^I3L|49uFE1C-S(V01lMB{gb>} z=jA5zXPxh{5*|!7*VvQ714Iunl*K0nEKcRg48h61F459Er^J)OqeL!!)hvGOaiDGW zV^lGsAJgLO_kFs^IM{rc6VCp^M}X)1sN)yhbu8noJoZ#LtElr^zOyZ!K{8c4jNE5Y zp(~8+J_Ec2UjPed1Ys+^`(c7C+Sx*S1YeCn72JcUAEImJec_?bikqzDCw+1_<^#dh%I$#U>LAIdBXBOZQ zG!9MiM-NI7w^p$bpKtJQ`lJL85+Y^gx?gj4fZ?U)*Vy*wY!eYr4?T(JfOXJF@f?7~ zsnFB7PJM$!%`6#v4%kE_(^t)cpPPZU6+fwJ9Px9HPZt@7p5W)zJ_1zxsN=|8$1;A( zqfdpO-F0>k5Cp<$NoW4AC9cGHAZy6(3q~x%!POVEeyli9qjUp!U>ui@r7A2aStCGY z0^hg+4Vy(_y;SG`HEb4L%C?u3J|lun7u;Xrz&_Zu2}FNqNfZF2MW#TW9%bi3@Exdp zfCtB`eX4A7Oo#pe6tR1=ylhVLR4g!v*a zhOxMJaQ-=onjWJQ%i#xzWcsRE;QaGI+Y0AYHI8upxK9@uhn~Rs(>?+`*+(6J*Imal zoXew61?P%74cM^i#d9XPKn7;*q}T0tPX%=z5}R^_=`(l z&MV%C=L>U+!EjUoAT^@!kD!f>D9_PgXBY-MHf`8==_c562pf$gsIy8D{6HQWMh4MU zOu|Mxtg|Trc$84$an~_GhQ(dwvAIs&E@G!1!V=5s6QPk}S&hZL!{M_fYG%pUvU(kn zOkXt%4xbCOtvF0o(fAQFnxfZt{|ra+kCwm(`Rk=~eHZq(dvJXhsPy9c?sj?-8D&a;fAgqazWox|GU?bv z|KfQ0_6r>%DK6gpQOd5`lAndkw^$Mb!DAhs87|+(f|tLJ^c0tGH}%AL z>>So7lO5%Uj2*AeK4a{#@&3`%(A0EVPrA+c1gYNRtFtrTWEyBj@n6U;eh;tCp5)(= zRnXM&9@vnXi|N)0<09NT(O#W>m6?ynjT6dV??)X5TYs+3ZZmh)bX{nRyWy@fb1@l? zaS;q>yui25%*(@gRD?{%>*tNH!{!c~On8I432!xXF`1BYaW~<|%)C5INJU6#LUVP^ zjW4D5j472r3%K2*8(-f5QuM~x7eHZU{3_k}!gbbg8=vH_1t$wZoVY`WCHsR=9Tzzn zZhURuxii?lZ3nsVMK>tmAxwYcOROHRTE1*Fx3qRodE<*OsG!4t!`Sru#@9cm=?=f~ z^-tKSS2w;!)HlB1j0+xMg(EJV%RhWUDV=WNt1vL97^>u_srtsY@t=c6itQsTPOh@8 z_hS+lyVyooq9h(p3wMZg#nrnsocKxj`OwI;8cc2^rM>F47-%OqlE`e8uX=TqB;4JQ zb)?$lP}DgIU;1mz9V<$17^9T#j@J)~C5;M&z;7$dKcE)xM0+dFAqMNj^=oCg;{`)D zzF{hj+xSWs8z6B(-0h92#s?e2uOs6F=R+`*c;Ld~RAbn1$Lq}!Eu)(GxV@anrLUSC zx8+wtj&LoS~B{#RD#d?db_$H$jEspjbulrMt42BS&CcW)K2rTXu zLVQ)CrJwe=;kq8^+O#~8kz0gV(-5m=lG zUyXOXE|RF3C1VKtIwG0AY8Hgu1hlOPOI0HxtZ@x?rB62*7aPhN&(2nS7?=8}->R>E zwI1xSPZu3^>*T?1^AX_IKI-`W?mCt|m^`~x9<000^c}ChUGR;c2V}L|R{?7*W6X6G z(3(E@#ZRNLlW+V=t>NI;!>Le#`P_$y#bDBjyB=7a&gYu${eDNHrgx-?rl2>$=_2D`^S4euVQ`mdF}>mvI-U!S`nA`w5NJE=u`Ow zMV({u;FsJ@I|hHrGH*l-Hq*m{U(eWgg!#cQe8u5-@ar26RN28V{#HkQhD+YyP@BYnDbf1Z=POY-64Yx4a&lR<)(Cl; z2YybB+`LhzcBtp8d&91*4&$Y0s**pHJ5U;L6lH3YVLocsyO_`u+I`Ff(J(@{<6*R^ z4v`dx(TM5whtbH-!eKNli5H0P=XWHsJHu`upv(cDp!@y6Yax8KagWIVGi!&b{2Yd@$K> z7BqGAdMnLbO!i}3-0k-pW?mllqatLo-^rbA_wJnnl^s{9>vMbReva*WfmsVCyPofE z*Ue@wCc82&?sna6=H+2mDncf^#=)qPn>;FuF6~&9)#SG9{vo#F)#g5%tT^dz#p}&n zOjcxE+^zU7GcOM-QV}v)v7dKrK5p)?$%KF4Zo+%bTudfpT-;6gMKdoC6H*aUn$TQb zbH_%xDHu~K?}G>L9^J9I5lGQHHcx`W%J@~fV}o1T!W|pFPYL_vlTaP^$*p&6Mz7Fi zRl-X%z=9{{5%1chZ5CtF_l)M3UYn%6b3-jdyr0EX7bMs%=s8@Gx z`krO!#4Ai|Jjr7G(A-LBq&PH(#lrg=+e_xeMH|!An^B3bxQ!*t$d1pQNo3SlO}@%c zd-diwfp+pWGnvHl)tiozgd_E`j#RIi6?IZ&S(4kw7^b^{v&^C_{{D6esb|QtwAnw) zk_<;|p(G>=i!a_7ZsJUUkjY`F9|QRAk)25yqdk+)q+oH9mi0E7;U>=SO0>*!v0;3W z$fd8E9LD8~pmK_vIM+gT>oBH@5l^HTPl3MIr<;t64KTz@HI~_!Ep<({*oVtx?C6oR=*$^Cj`oe5|D9@tFr@e<=`9#QJiUg+ zy+Vo~O0@LT9}$cp#Se&F`l?w*?vH@B6)C7Czc8%j8xT|3c7 zfK||_U+8c$(00_Zj1KbHQ=x;R&I(J`CAoVOPd6DC8_F7QP>j`lH{?+7rrC`H6*Nn+!E4qDi3*`p<<#AeuqRCwIDxEl0B33 z6PjfA#si-Jm}&qr5PFO#pbLbsI28yPUdsGHqNPWa#4_m_BA32u7V!DMK-&sFR52p> z7&iiDzeQA;UiL&c85bJ>88=#1`7mA%jrz3=JppL@>USdG3vN(0e2FLbs82T?^=lZt zuk~SjK_9id!B@N5MgA2&U3Ao}(;~mlZ1{>PJ&e8s_dlL?%s_yT{_>ptYXCFz!s>D^YXugm)9k z^i{Js{LcVwt3#ry5goo3G9UKoBI96l_D+!be|!Y^Rv&fzFIFAjwkJ10{)6L%opC6f z+>(c(3Ol>&Oeb8O3`Y|SC0Rpur|<#GxNvp~*UTIk5U;=}Q~Mb*Dq0i!ZR>H}!+MsE&^9}kK2OCI1SOTE0!zR)o z`wO$aMumC^k8(UWEIiWDRDv{TYcMpKKNy@7OhG$-_h1;G`!oq-*Az=@$nMpeN^K21 z4i1*85PK;P4A93kr;rXNc&*e9z+dEk5hft)uxHt73D>jO@1!g^GdL@jmKFgqNP<`| z<;N=F@MushG19?g{!jq1I%>FIhJ48u8EpgVJWwowmI`@DL=I2*EEhRw3)0X+oR0?N z&IRklsu>iL+Kvvs9>i@F;l%(v>;nC8VgeH$_NRyX)`k#XpWTixL!z_vc>c$d455+ zZorF%eEkrB9K1Bx7aod&CvNyavGl|ZA0&_iUn({HG7Z!uHAzaKj^S1wfcC}8BFk)Z zU97Y|!aZP4xD={fu|V!o;tyF(7#0v{iuhknq$?%7JbuKC@Vaco=uG#9^+@T=boWk~ zQ`7w%Yx_tlcw^4(MxyYpXGSdUopZZgqNev)=ysWN`w)>#Up0$!`xwx+Iyb5sN9Xn# zpDr>EJ#lVd_7UK3`l#ctxa(MUZu00;IX6X}`in4;R~Rv+hoMumJOT#b)S ztDDt*)!KpTY7jh}$TusEVI@X(-{)rN*!@Fnm={vb42Fw8C${OrMJ(PD33lBE-LDLzLQ-2 zsL%W-Zul^p`%m2Pkr7yCf0)gG{*_<=d_fd|Ul|TyK>`Wlxh(h24zfS(706D9H|MDD z9^O1kHTf9y*2v`Rf?h1{9rWHLQFDUc8;NB4s#%t#{}X6ip_i)05qdx7(?!OiC(wJh zj{twsM;+heu45T`<!<+w% zRMpRJT!XRj<~)D~kF;$Rxy-_w^ROf8Mnm-WxiP#s-cP6D&1YT(f06L!rIC^)L?s5Au!C#GeT|?PB&2=hr0Yr4Mr6z?UewDkSJ-fyXD{@E-Gj zx&5$}13QW9&&PKh^nDBasgHrjPX@~;-Jm#L9RrWQtV5(VI$kTVS6lF;mas$O&x8uw zEY|n?XAKMtzpZ_3d#E_OwLqvqgO3Yk@dECQ4(ANv$7Au!!$?mNeta@@`0*^JX18EI znN$kT)?60CQo-i%KqUhKZks2F2N@C%@+>4{K^(tJLt-s6zqyZy!Am0kQEh6JDT z??{Cz)+HqPb!IN6m|~2J5K~MW61-*R;}K7cve!F2hr!mLkl=r4?y4ym+#T+QyT{DM zWH`n}Fq|<2?ib9wJd8(0$Yi`F5>7Jc6F_b-uEP)fCW~Tk@GWx>O*Z?6yUo69=3=rL zofh~Zhj?r#UHFGi9l5r7i zIpciZJNPT^%b8{_9#*8xGg+~pku*1&J8YVWuX8uv4l@^%@fa7uct-HtW9H>yLMlQ^ z6Pl}QB55kuw=t#iG60z#MbaDrQZ$n0+dyGu{K_L~E=sKG#aNnr(G8E{D;VBcV`+Zt z3SBJC4LgI~_|zB-9h_g&mrTIPuORj#c;!5r3Jax)5}XdhBV*(F2AoxE1VuPD zmbj;mKjHIQuyMn#4LdjO3Wgf_edI_RynTmzScO8ZiKhT32Jzt&PZnYeguP&*UYiVd zZrC|GJa{>Mw2OlC$cd2igFGBZi{PLhIh{7rxfKsmoloCX!Giu+?qZCM?=(&$3AvSB;`jTFNei<7jh!`N_v@I;B0SuS?6 zX%&%6Uo|;&%ijURq=-p+GSIdTU8)%IHIniA>sdbCWL#{ol2XMaz0gOH*Y;808{PE{ zP#{2sJPuV*p{TQ37n3wG&0@rm3D^`tnp;TjoVMLRR4N$!pjTDP}g%R(T zXz3?DVi&`Rn~7Zds#!4N7NBj#2&xznBeXZ>KJL>+#=(XUPB-T6^AX_QKI-^>cOA>P zAdfv2E-32QqLIo?>_||z=*M;KFddEbn21LDY^piN@bwuohPv<-i&NpNF-XR&Jt8$d zY$gzP02-Oznq@)Q*+AQhuv9f7!Wvg$C;N1haj~JS@y_>%598rJ>UY#vzgiEr(Wi@! zx^?nkm-z^=qmMei!d=I*2a{*F%7b;+nT|$!6rz#JYPYWf{=G-5fYzqOZthTb@GP=v z3rA2Ad%Hp~K(?Q&+CoUaTx1sll11^;P%G6WV=n9_GReAJ7#62;VTNslJ0x084(xU! zm%eHi2X-gWwmLAX7}0@g0rq~ME;0@_=j8;jf9oT_m!VO=76}i#>sSU@dF-hGR#9h- z>l}+`j7-Ij7dKi|=K9pox?J%tIv9etI8xNT-P^bA*hSyquoHPBJf_3>c&*?(@pX*~ zK$Nex8ImY}ixo5@FT#L+KH}PwLCSv<9d$tp7N>(0&<5!bkeY>m$8xPoB^TRuSPqT) zHQY}C+Ez%RigARLQJ*d{4n2XC*ZK%>K_7Lz!Cl8Pq{w4W1u2R;>(b7?c!bK-?9lS_ zUO~(BT^{McG6#_*a(Qg7{iy~!1G+jH>|H>I#i@YK_;`A=M9mDr4C-zolIg2vSv|cA zXj`FTuO?)2#*b)zBr*4B8J z2jA<`yF9bU;4gBQhy2xxyF9Vlhst~5QbOxx6U{1wp%S)4_oySN4}UR(q(*w5e>L5g#5%{)|G#|v7^F2O)&5CR)R zd6DP;h`SoqPqDXI0ZK`F2t81vRHHCDj_ zh0nG4J(Ne@vtUQ)<_J(TF45;eYcOEDxJ__juYq>0x$qlCeE@ER=K}Z)4?-e_LaEU{ zLViAwuUFeQk*1A&eQ(%kCpv|b@iLr@^yJf4kZ0H;51QxtME%no>i>SC{%WX?0|Ct0 zWxdH79N<$~?@DacWxYd)+;dne5Q*7aj5)i_}$fZd!Vk5?Iw|jv+c@T zuzK7V$!OcaXjfSTNg567zuBQaHyYMg8f_7sa#5JC7m8gI?p?s5+hmb1S~FpBV+VrzDz*2q`dTLxN#yiPa{Uz^yU8Lh>IX1xw> zF~?|aZ7t*_l~OfqZ*9$k)5Z-rFdVg8$D@aAlq%6EoEe6oUR6NuIhW@#_-OmRZR$i? zb85}TRI}0ES{&Wlnh%a4tmhlGI#9xMks;iBot%O%3+lC614IocN(bAm8SC1u1yqC_ z@ZAR$2HDqUy#n7BHEM<2SiZ0ie+5xygUt0qpwbB-gXty`Ki2C~5&5))K1u1eMu@O1pKc^ovBI z{GT{+7gM^i47~Lz;tx{e)>7;PjJ>D`Dyl%A+O0*Ee06U#zc&PpkHhzwkTI>bydD-H z3`%Z1oPv=9Y#56ScgzcNN@=$A%h*Q9~VtUVRO8eJ2;60YAGxLYEhU=wj`sZ(8%pCMI}09mtY({ zav8cK-<0>^A`U|7Ue7%vox`|0-KvB!dcltF~sbTaiqS{jn z#XQIZhNtrlOi5G-t@kyjfW=~vu2E{h&2K!k zQX@AdP%wlf7&4P%;W*6TLm)vhgf-%k*2)6Z+LsF_^QB4-vfUu=5~+_z%4qQ@tV~c$ zJJOmJR`<8JHpg1?Sj1n1#ii&oU~V*Wbmd7pcRUCMBdY;$3p5})7@~P=nNW(aHApc~ zo9KK&-&`6e<#Vx+{ykLOS1gt{qBGloAB$nemlxp2L-_F}_-MA~V|`pG6W3APcZ4)J zLMk626^}HFC*bAxV)0Bur&y&#E=HR8$W2pYN6}CJ99xkwA$18GA z+nQa9U?JMR30DHYT>w(2w^oC_5Z&Oqitd&^xtR~n93`L&=JI~{vwS^%%vlN_3-IHi zRq*i$e*ED{@bM@3arrta8OK?__QkW@|W3@_W zGLga+Qemg|e1YP8&XqJ;CeR08Rd2Kbc~;7_*e|eT0Qe;rhtSU~DAXzyI;g<`&%FpQ z6hZlWVPM|a-T_cDm4{G-5Q{I0VD?ak9TXOd7j%lDJuC%E)k38?juUP#V&>pDItqrV I)TX2VA254LQUCw| diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo index 21da5c2..f8edd7e 100644 --- a/docs/_build/html/.buildinfo +++ b/docs/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: a00fbade8350e617c6a624dde88d788b +config: 52108008ddbffab0993edd96bc05016e tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/.buildinfo.bak b/docs/_build/html/.buildinfo.bak index d373e36..21da5c2 100644 --- a/docs/_build/html/.buildinfo.bak +++ b/docs/_build/html/.buildinfo.bak @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file records the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 75a9de938a44ab293aeee5172fdca7b5 +config: a00fbade8350e617c6a624dde88d788b tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/_static/documentation_options.js b/docs/_build/html/_static/documentation_options.js index b1151d0..14a4c29 100644 --- a/docs/_build/html/_static/documentation_options.js +++ b/docs/_build/html/_static/documentation_options.js @@ -1,5 +1,5 @@ const DOCUMENTATION_OPTIONS = { - VERSION: '1.3.3', + VERSION: '1.3.4', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 08c4d60..8c6027c 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -5,12 +5,12 @@ - Index — pyreadstat 1.3.3 documentation + Index — pyreadstat 1.3.4 documentation - + @@ -66,12 +66,22 @@

Index

- M + F + | M | P | R + | S | W
+

F

+ + +
+

M