From 31a21e8fd2f88ab607b60cf7b5755acb9b3f9dac Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Sat, 28 Nov 2020 10:13:58 +0100 Subject: [PATCH 1/7] updated readstat source to 1.1.5_rc0 --- src/readstat.h | 8 +- src/readstat_io_unistd.c | 42 ++- src/readstat_strings.h | 6 + src/readstat_writer.c | 8 +- src/sas/readstat_sas.c | 18 +- src/sas/readstat_sas.h | 6 +- src/sas/readstat_sas7bcat_read.c | 18 +- src/sas/readstat_sas7bdat_read.c | 42 ++- src/sas/readstat_sas7bdat_write.c | 11 +- src/sas/readstat_sas_rle.c | 5 + src/sas/readstat_xport_read.c | 37 ++- src/sas/readstat_xport_write.c | 4 + src/spss/readstat_sav_parse.c | 491 +++++++++++++++--------------- src/spss/readstat_sav_parse.rl | 40 +-- src/spss/readstat_sav_write.c | 1 - src/stata/readstat_dta_read.c | 8 +- src/stata/readstat_dta_write.c | 8 +- 17 files changed, 435 insertions(+), 318 deletions(-) create mode 100644 src/readstat_strings.h diff --git a/src/readstat.h b/src/readstat.h index 46066f6..ece0d37 100644 --- a/src/readstat.h +++ b/src/readstat.h @@ -295,7 +295,11 @@ typedef int (*readstat_value_label_handler)(const char *val_labels, typedef void (*readstat_error_handler)(const char *error_message, void *ctx); typedef int (*readstat_progress_handler)(double progress, void *ctx); -#if defined _WIN32 || defined __CYGWIN__ +#if defined(_MSC_VER) +#include +typedef SSIZE_T ssize_t; +typedef _off_t readstat_off_t; +#elif defined _WIN32 || defined __CYGWIN__ typedef _off64_t readstat_off_t; #elif defined _AIX typedef off64_t readstat_off_t; @@ -479,7 +483,7 @@ typedef struct readstat_writer_s { int row_count; int current_row; - char file_label[100]; + char file_label[257]; char table_name[33]; const readstat_variable_t *fweight_variable; diff --git a/src/readstat_io_unistd.c b/src/readstat_io_unistd.c index 915f205..3560291 100644 --- a/src/readstat_io_unistd.c +++ b/src/readstat_io_unistd.c @@ -1,7 +1,13 @@ #include #include -#include +#include +#if !defined(_MSC_VER) +# include +#endif +#if defined _WIN32 +# include +#endif #include "readstat.h" #include "readstat_io_unistd.h" @@ -14,13 +20,43 @@ #define UNISTD_OPEN_OPTIONS O_RDONLY #endif -#if defined _WIN32 || defined _AIX +#if defined _MSC_VER && defined WIN64 +#define lseek _lseeki64 +#elif defined _MSC_VER +#elif defined _WIN32 || defined _AIX #define lseek lseek64 #endif +int open_with_unicode(const char *path, int options) +{ +#if defined _WIN32 + const int buffer_size = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0); + + if(buffer_size <= 0) + return -1; + + wchar_t* wpath = malloc((buffer_size + 1) * sizeof(wchar_t)); + const int res = MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, buffer_size); + wpath[buffer_size] = 0; + + if(res <= 0) + { + free(wpath); + return -1; + } + + int fd = _wopen(wpath, options); + + free(wpath); + return fd; +#else + return open(path, options); +#endif +} + int unistd_open_handler(const char *path, void *io_ctx) { - int fd = open(path, UNISTD_OPEN_OPTIONS); + int fd = open_with_unicode(path, UNISTD_OPEN_OPTIONS); ((unistd_io_ctx_t*) io_ctx)->fd = fd; return fd; } diff --git a/src/readstat_strings.h b/src/readstat_strings.h new file mode 100644 index 0000000..3a5eb47 --- /dev/null +++ b/src/readstat_strings.h @@ -0,0 +1,6 @@ +#if defined(_MSC_VER) +# define strncasecmp _strnicmp +# define strcasecmp _stricmp +#else +# include +#endif diff --git a/src/readstat_writer.c b/src/readstat_writer.c index 962a36d..6ab17a2 100644 --- a/src/readstat_writer.c +++ b/src/readstat_writer.c @@ -258,9 +258,13 @@ static readstat_error_t readstat_write_repeated_byte(readstat_writer_t *writer, if (len == 0) return READSTAT_OK; - char zeros[len]; + char *zeros = malloc(len); + memset(zeros, byte, len); - return readstat_write_bytes(writer, zeros, len); + readstat_error_t error = readstat_write_bytes(writer, zeros, len); + + free(zeros); + return error; } readstat_error_t readstat_write_zeros(readstat_writer_t *writer, size_t len) { diff --git a/src/sas/readstat_sas.c b/src/sas/readstat_sas.c index 7e3ffc7..3c43e0b 100644 --- a/src/sas/readstat_sas.c +++ b/src/sas/readstat_sas.c @@ -189,7 +189,7 @@ readstat_error_t sas_read_header(readstat_io_t *io, sas_header_info_t *hinfo, retval = READSTAT_ERROR_UNSUPPORTED_CHARSET; goto cleanup; } - memcpy(hinfo->file_label, header_start.file_label, sizeof(header_start.file_label)); + memcpy(hinfo->table_name, header_start.table_name, sizeof(header_start.table_name)); if (io->seek(hinfo->pad1, READSTAT_SEEK_CUR, io->io_ctx) == -1) { retval = READSTAT_ERROR_SEEK; goto cleanup; @@ -317,16 +317,16 @@ readstat_error_t sas_write_header(readstat_writer_t *writer, sas_header_info_t * struct tm epoch_tm = { .tm_year = 60, .tm_mday = 1 }; time_t epoch = mktime(&epoch_tm); - memset(header_start.file_label, ' ', sizeof(header_start.file_label)); + memset(header_start.table_name, ' ', sizeof(header_start.table_name)); - size_t file_label_len = strlen(writer->file_label); - if (file_label_len > sizeof(header_start.file_label)) - file_label_len = sizeof(header_start.file_label); + size_t table_name_len = strlen(writer->table_name); + if (table_name_len > sizeof(header_start.table_name)) + table_name_len = sizeof(header_start.table_name); - if (file_label_len) { - memcpy(header_start.file_label, writer->file_label, file_label_len); + if (table_name_len) { + memcpy(header_start.table_name, writer->table_name, table_name_len); } else { - memcpy(header_start.file_label, "DATASET", sizeof("DATASET")-1); + memcpy(header_start.table_name, "DATASET", sizeof("DATASET")-1); } retval = readstat_write_bytes(writer, &header_start, sizeof(sas_header_start_t)); @@ -379,7 +379,7 @@ readstat_error_t sas_write_header(readstat_writer_t *writer, sas_header_info_t * goto cleanup; sas_header_end_t header_end = { - .host = "W32_VSPRO" + .host = "9.0401M6Linux" }; char release[sizeof(header_end.release)+1] = { 0 }; diff --git a/src/sas/readstat_sas.h b/src/sas/readstat_sas.h index 4d70768..5fce15c 100644 --- a/src/sas/readstat_sas.h +++ b/src/sas/readstat_sas.h @@ -17,7 +17,8 @@ typedef struct sas_header_start_s { unsigned char encoding; unsigned char mystery5[13]; char file_type[8]; - char file_label[64]; + char table_name[32]; + unsigned char mystery6[32]; char file_info[8]; } sas_header_start_t; @@ -47,7 +48,8 @@ typedef struct sas_header_info_s { int64_t header_size; time_t creation_time; time_t modification_time; - char file_label[64]; + char table_name[32]; + char file_label[256]; char *encoding; } sas_header_info_t; diff --git a/src/sas/readstat_sas7bcat_read.c b/src/sas/readstat_sas7bcat_read.c index 77f16bd..968d968 100644 --- a/src/sas/readstat_sas7bcat_read.c +++ b/src/sas/readstat_sas7bcat_read.c @@ -51,6 +51,7 @@ static readstat_error_t sas7bcat_parse_value_labels(const char *value_start, siz /* Doubles appear to be stored as big-endian, always */ int bswap_doubles = machine_is_little_endian(); int is_string = (name[0] == '$'); + char *label = NULL; if (value_offset == NULL) { retval = READSTAT_ERROR_MALLOC; @@ -117,8 +118,8 @@ static readstat_error_t sas7bcat_parse_value_labels(const char *value_start, siz goto cleanup; } if (ctx->value_label_handler) { - char label[4*label_len+1]; - retval = readstat_convert(label, sizeof(label), + label = realloc(label, 4 * label_len + 1); + retval = readstat_convert(label, 4 * label_len + 1, &lbp2[10], label_len, ctx->converter); if (retval != READSTAT_OK) goto cleanup; @@ -133,9 +134,8 @@ static readstat_error_t sas7bcat_parse_value_labels(const char *value_start, siz } cleanup: - if (value_offset) - free(value_offset); - + free(label); + free(value_offset); return retval; } @@ -415,7 +415,7 @@ readstat_error_t readstat_parse_sas7bcat(readstat_parser_t *parser, const char * } if (ctx->metadata_handler) { - char file_label[4*64+1]; + char table_name[4*32+1]; readstat_metadata_t metadata = { .file_encoding = ctx->input_encoding, /* orig encoding? */ .modified_time = hinfo->modification_time, @@ -424,12 +424,12 @@ readstat_error_t readstat_parse_sas7bcat(readstat_parser_t *parser, const char * .endianness = hinfo->little_endian ? READSTAT_ENDIAN_LITTLE : READSTAT_ENDIAN_BIG, .is64bit = ctx->u64 }; - retval = readstat_convert(file_label, sizeof(file_label), - hinfo->file_label, sizeof(hinfo->file_label), ctx->converter); + retval = readstat_convert(table_name, sizeof(table_name), + hinfo->table_name, sizeof(hinfo->table_name), ctx->converter); if (retval != READSTAT_OK) goto cleanup; - metadata.file_label = file_label; + metadata.table_name = table_name; if (ctx->metadata_handler(&metadata, ctx->user_ctx) != READSTAT_HANDLER_OK) { retval = READSTAT_ERROR_USER_ABORT; diff --git a/src/sas/readstat_sas7bdat_read.c b/src/sas/readstat_sas7bdat_read.c index bf88bfa..44e1313 100644 --- a/src/sas/readstat_sas7bdat_read.c +++ b/src/sas/readstat_sas7bdat_read.c @@ -85,7 +85,8 @@ typedef struct sas7bdat_ctx_s { time_t ctime; time_t mtime; int version; - char file_label[4*64+1]; + char table_name[4*32+1]; + char file_label[4*256+1]; char error_buf[2048]; unsigned int rdc_compression:1; @@ -285,6 +286,7 @@ static readstat_error_t sas7bdat_parse_column_name_subheader(const char *subhead int i; const char *cnp = &subheader[signature_len+8]; uint16_t remainder = sas_read2(&subheader[signature_len], ctx->bswap); + int off; if (remainder != sas_subheader_remainder(len, signature_len)) { retval = READSTAT_ERROR_PARSE; @@ -298,6 +300,39 @@ static readstat_error_t sas7bdat_parse_column_name_subheader(const char *subhead for (i=ctx->col_names_count-cmax; icol_names_count; i++) { ctx->col_info[i].name_ref = sas7bdat_parse_text_ref(cnp, ctx); + if (i == 0) { + if (ctx->text_blobs == NULL || ctx->text_blob_lengths == NULL) { + retval = READSTAT_ERROR_PARSE; + goto cleanup; + } + if (ctx->version < 9) { + off = 36; + } else { + if (ctx->text_blob_lengths[0] < 19) { + retval = READSTAT_ERROR_PARSE; + goto cleanup; + } + if (!memcmp(&ctx->text_blobs[0][12], "SASYZCR", 7)) { + off = 44; + } else { + off = ctx->u64 ? 36 : 12; + } + } + if (ctx->col_info[0].name_ref.offset >= + ctx->text_blob_lengths[0] || + ctx->col_info[0].name_ref.offset < off) { + retval = READSTAT_ERROR_PARSE; + goto cleanup; + } + retval = readstat_convert(ctx->file_label, + sizeof(ctx->file_label), + &ctx->text_blobs[0][off], + ctx->col_info[0].name_ref.offset - off, + ctx->converter + ); + if (retval != READSTAT_OK) + goto cleanup; + } cnp += 8; } @@ -712,6 +747,7 @@ static readstat_error_t sas7bdat_submit_columns(sas7bdat_ctx_t *ctx, int compres readstat_metadata_t metadata = { .row_count = ctx->row_limit, .var_count = ctx->column_count, + .table_name = ctx->table_name, .file_label = ctx->file_label, .file_encoding = ctx->input_encoding, /* orig encoding? */ .creation_time = ctx->ctime, @@ -1219,8 +1255,8 @@ readstat_error_t readstat_parse_sas7bdat(readstat_parser_t *parser, const char * ctx->converter = converter; } - if ((retval = readstat_convert(ctx->file_label, sizeof(ctx->file_label), - hinfo->file_label, sizeof(hinfo->file_label), ctx->converter)) != READSTAT_OK) { + if ((retval = readstat_convert(ctx->table_name, sizeof(ctx->table_name), + hinfo->table_name, sizeof(hinfo->table_name), ctx->converter)) != READSTAT_OK) { goto cleanup; } diff --git a/src/sas/readstat_sas7bdat_write.c b/src/sas/readstat_sas7bdat_write.c index 19467ab..acb8a9e 100644 --- a/src/sas/readstat_sas7bdat_write.c +++ b/src/sas/readstat_sas7bdat_write.c @@ -140,7 +140,7 @@ static readstat_error_t sas7bdat_emit_header(readstat_writer_t *writer, sas_head .file_format = SAS_FILE_FORMAT_UNIX, .encoding = 20, /* UTF-8 */ .file_type = "SAS FILE", - .file_info = "DATA ~ ~" + .file_info = "DATA " }; memcpy(&header_start.magic, sas7bdat_magic_number, sizeof(header_start.magic)); @@ -218,13 +218,16 @@ static sas7bdat_subheader_t *sas7bdat_col_name_subheader_init(readstat_writer_t sas7bdat_subheader_t *subheader = sas7bdat_subheader_init( SAS_SUBHEADER_SIGNATURE_COLUMN_NAME, len); memcpy(&subheader->data[signature_len], &remainder, sizeof(uint16_t)); + + sas_text_ref_t text_ref = sas7bdat_make_text_ref(column_text_array, "READSTAT"); + text_ref = sas7bdat_make_text_ref(column_text_array, writer->file_label); int i; char *ptrs = &subheader->data[signature_len+8]; for (i=0; ivariables_count; i++) { readstat_variable_t *variable = readstat_get_variable(writer, i); const char *name = readstat_variable_get_name(variable); - sas_text_ref_t text_ref = sas7bdat_make_text_ref(column_text_array, name); + text_ref = sas7bdat_make_text_ref(column_text_array, name); memcpy(&ptrs[0], &text_ref.index, sizeof(uint16_t)); memcpy(&ptrs[2], &text_ref.offset, sizeof(uint16_t)); memcpy(&ptrs[4], &text_ref.length, sizeof(uint16_t)); @@ -699,11 +702,11 @@ static readstat_error_t sas7bdat_write_row_uncompressed(readstat_writer_t *write int16_t page_row_count = (writer->row_count - writer->current_row < rows_per_page ? writer->row_count - writer->current_row : rows_per_page); - char header[hinfo->page_header_size]; - memset(header, 0, sizeof(header)); + char *header = calloc(hinfo->page_header_size, 1); memcpy(&header[hinfo->page_header_size-6], &page_row_count, sizeof(int16_t)); memcpy(&header[hinfo->page_header_size-8], &page_type, sizeof(int16_t)); retval = readstat_write_bytes(writer, header, hinfo->page_header_size); + free(header); if (retval != READSTAT_OK) goto cleanup; } diff --git a/src/sas/readstat_sas_rle.c b/src/sas/readstat_sas_rle.c index 354da34..adb0289 100644 --- a/src/sas/readstat_sas_rle.c +++ b/src/sas/readstat_sas_rle.c @@ -3,6 +3,11 @@ #include #include +#if defined(_MSC_VER) +#include +typedef SSIZE_T ssize_t; +#endif + #include "readstat_sas_rle.h" #define SAS_RLE_COMMAND_COPY64 0 diff --git a/src/sas/readstat_xport_read.c b/src/sas/readstat_xport_read.c index eebcd0d..f9349f2 100644 --- a/src/sas/readstat_xport_read.c +++ b/src/sas/readstat_xport_read.c @@ -32,7 +32,7 @@ typedef struct xport_ctx_s { int row_offset; size_t row_length; int parsed_row_count; - char file_label[40*4+1]; + char file_label[256*4+1]; char table_name[32*4+1]; readstat_variable_t **variables; @@ -280,10 +280,13 @@ static readstat_error_t xport_read_obs_header_record(xport_ctx_t *ctx) { static readstat_error_t xport_construct_format(char *dst, size_t dst_len, const char *src, size_t src_len, int width, int decimals) { - char format[4*src_len+1]; - readstat_error_t retval = readstat_convert(format, sizeof(format), src, src_len, NULL); - if (retval != READSTAT_OK) + char *format = malloc(4 * src_len + 1); + readstat_error_t retval = readstat_convert(format, 4 * src_len + 1, src, src_len, NULL); + + if (retval != READSTAT_OK) { + free(format); return retval; + } if (!format[0]) { *dst = '\0'; @@ -297,12 +300,15 @@ static readstat_error_t xport_construct_format(char *dst, size_t dst_len, snprintf(dst, dst_len, "%s", format); } + free(format); return retval; } static readstat_error_t xport_read_labels_v8(xport_ctx_t *ctx, int label_count) { readstat_error_t retval = READSTAT_OK; uint16_t labeldef[3]; + char *name = NULL; + char *label = NULL; int i; for (i=0; ivariables[index-1]; if (read_bytes(ctx, name, name_len) != name_len || @@ -356,6 +362,8 @@ static readstat_error_t xport_read_labels_v8(xport_ctx_t *ctx, int label_count) goto cleanup; cleanup: + free(name); + free(label); return retval; } @@ -363,6 +371,11 @@ static readstat_error_t xport_read_labels_v9(xport_ctx_t *ctx, int label_count) readstat_error_t retval = READSTAT_OK; uint16_t labeldef[5]; int i; + char *name = NULL; + char *format = NULL; + char *informat = NULL; + char *label = NULL; + for (i=0; ivariables[index-1]; @@ -429,6 +442,10 @@ static readstat_error_t xport_read_labels_v9(xport_ctx_t *ctx, int label_count) goto cleanup; cleanup: + free(name); + free(format); + free(informat); + free(label); return retval; } diff --git a/src/sas/readstat_xport_write.c b/src/sas/readstat_xport_write.c index 2ba6b86..0d6360a 100644 --- a/src/sas/readstat_xport_write.c +++ b/src/sas/readstat_xport_write.c @@ -12,6 +12,10 @@ #define XPORT_DEFAULT_VERISON 8 #define RECORD_LEN 80 +#if defined _MSC_VER +#define restrict __restrict +#endif + static void copypad(char * restrict dst, size_t dst_len, const char * restrict src) { char *dst_end = dst + dst_len; while (dst < dst_end && *src) diff --git a/src/spss/readstat_sav_parse.c b/src/spss/readstat_sav_parse.c index 565af8e..be17eb0 100644 --- a/src/spss/readstat_sav_parse.c +++ b/src/spss/readstat_sav_parse.c @@ -4,10 +4,15 @@ #include #include "../readstat.h" #include "../readstat_malloc.h" +#include "../readstat_strings.h" #include "readstat_sav.h" #include "readstat_sav_parse.h" + +#line 21 "src/spss/readstat_sav_parse.rl" + + typedef struct varlookup { char name[8*4+1]; int index; @@ -16,13 +21,13 @@ typedef struct varlookup { static int compare_key_varlookup(const void *elem1, const void *elem2) { const char *key = (const char *)elem1; const varlookup_t *v = (const varlookup_t *)elem2; - return strcmp(key, v->name); + return strcasecmp(key, v->name); } static int compare_varlookups(const void *elem1, const void *elem2) { const varlookup_t *v1 = (const varlookup_t *)elem1; const varlookup_t *v2 = (const varlookup_t *)elem2; - return strcmp(v1->name, v2->name); + return strcasecmp(v1->name, v2->name); } static int count_vars(sav_ctx_t *ctx) { @@ -60,180 +65,173 @@ static varlookup_t *build_lookup_table(int var_count, sav_ctx_t *ctx) { } -#line 64 "src/spss/readstat_sav_parse.c" +#line 69 "src/spss/readstat_sav_parse.c" static const char _sav_long_variable_parse_actions[] = { - 0, 1, 3, 1, 5, 2, 4, 1, - 3, 6, 2, 0 + 0, 1, 1, 1, 5, 2, 2, 0, + 3, 6, 4, 3 }; static const short _sav_long_variable_parse_key_offsets[] = { - 0, 0, 6, 20, 34, 48, 62, 76, - 90, 104, 105, 110, 116, 122, 128, 134, - 140, 146, 152, 158, 164, 170, 176, 182, - 188, 194, 200, 206, 212, 218, 224, 230, - 236, 242, 248, 254, 260, 266, 272, 278, - 284, 290, 296, 302, 308, 314, 320, 326, - 332, 338, 344, 350, 356, 362, 368, 374, - 380, 386, 392, 398, 404, 410, 416, 422, - 428, 434, 440, 446, 452, 458, 464, 470, - 476, 482, 488, 494 + 0, 0, 5, 19, 33, 47, 61, 75, + 89, 103, 104, 108, 113, 118, 123, 128, + 133, 138, 143, 148, 153, 158, 163, 168, + 173, 178, 183, 188, 193, 198, 203, 208, + 213, 218, 223, 228, 233, 238, 243, 248, + 253, 258, 263, 268, 273, 278, 283, 288, + 293, 298, 303, 308, 313, 318, 323, 328, + 333, 338, 343, 348, 353, 358, 363, 368, + 373, 378, 383, 388, 393, 398, 403, 408, + 413, 418, 423, 428 }; static const unsigned char _sav_long_variable_parse_trans_keys[] = { - 0u, 63u, 91u, 127u, 248u, 255u, 47u, 61u, - 0u, 34u, 37u, 45u, 58u, 63u, 91u, 94u, - 96u, 127u, 248u, 255u, 47u, 61u, 0u, 34u, - 37u, 45u, 58u, 63u, 91u, 94u, 96u, 127u, - 248u, 255u, 47u, 61u, 0u, 34u, 37u, 45u, - 58u, 63u, 91u, 94u, 96u, 127u, 248u, 255u, - 47u, 61u, 0u, 34u, 37u, 45u, 58u, 63u, - 91u, 94u, 96u, 127u, 248u, 255u, 47u, 61u, - 0u, 34u, 37u, 45u, 58u, 63u, 91u, 94u, - 96u, 127u, 248u, 255u, 47u, 61u, 0u, 34u, - 37u, 45u, 58u, 63u, 91u, 94u, 96u, 127u, - 248u, 255u, 47u, 61u, 0u, 34u, 37u, 45u, - 58u, 63u, 91u, 94u, 96u, 127u, 248u, 255u, - 61u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 0u, 63u, 91u, 127u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 127u, - 0u, 31u, 248u, 255u, 9u, 127u, 0u, 31u, - 248u, 255u, 9u, 127u, 0u, 31u, 248u, 255u, - 9u, 127u, 0u, 31u, 248u, 255u, 9u, 0 + 255u, 0u, 63u, 91u, 127u, 47u, 61u, 96u, + 255u, 0u, 34u, 37u, 45u, 58u, 63u, 91u, + 94u, 123u, 127u, 47u, 61u, 96u, 255u, 0u, + 34u, 37u, 45u, 58u, 63u, 91u, 94u, 123u, + 127u, 47u, 61u, 96u, 255u, 0u, 34u, 37u, + 45u, 58u, 63u, 91u, 94u, 123u, 127u, 47u, + 61u, 96u, 255u, 0u, 34u, 37u, 45u, 58u, + 63u, 91u, 94u, 123u, 127u, 47u, 61u, 96u, + 255u, 0u, 34u, 37u, 45u, 58u, 63u, 91u, + 94u, 123u, 127u, 47u, 61u, 96u, 255u, 0u, + 34u, 37u, 45u, 58u, 63u, 91u, 94u, 123u, + 127u, 47u, 61u, 96u, 255u, 0u, 34u, 37u, + 45u, 58u, 63u, 91u, 94u, 123u, 127u, 61u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 255u, 0u, 63u, 91u, 127u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 9u, 127u, 255u, 0u, 31u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 9u, 127u, 255u, 0u, 31u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 9u, 127u, 255u, 0u, 31u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 9u, 127u, 255u, 0u, 31u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 9u, 127u, 255u, 0u, 31u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 9u, 127u, 255u, 0u, 31u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 127u, 255u, 0u, + 31u, 9u, 127u, 255u, 0u, 31u, 9u, 127u, + 255u, 0u, 31u, 9u, 127u, 255u, 0u, 31u, + 9u, 127u, 255u, 0u, 31u, 9u, 127u, 255u, + 0u, 31u, 9u, 127u, 255u, 0u, 31u, 9u, + 127u, 255u, 0u, 31u, 9u, 0 }; static const char _sav_long_variable_parse_single_lengths[] = { - 0, 0, 2, 2, 2, 2, 2, 2, - 2, 1, 1, 2, 0, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 1 + 0, 1, 4, 4, 4, 4, 4, 4, + 4, 1, 2, 3, 1, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 1 }; static const char _sav_long_variable_parse_range_lengths[] = { - 0, 3, 6, 6, 6, 6, 6, 6, - 6, 0, 2, 2, 3, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 0 + 0, 2, 5, 5, 5, 5, 5, 5, + 5, 0, 1, 1, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0 }; static const short _sav_long_variable_parse_index_offsets[] = { - 0, 0, 4, 13, 22, 31, 40, 49, - 58, 67, 69, 73, 78, 82, 87, 92, - 97, 102, 107, 112, 117, 122, 127, 132, - 137, 142, 147, 152, 157, 162, 167, 172, - 177, 182, 187, 192, 197, 202, 207, 212, - 217, 222, 227, 232, 237, 242, 247, 252, - 257, 262, 267, 272, 277, 282, 287, 292, - 297, 302, 307, 312, 317, 322, 327, 332, - 337, 342, 347, 352, 357, 362, 367, 372, - 377, 382, 387, 392 + 0, 0, 4, 14, 24, 34, 44, 54, + 64, 74, 76, 80, 85, 89, 94, 99, + 104, 109, 114, 119, 124, 129, 134, 139, + 144, 149, 154, 159, 164, 169, 174, 179, + 184, 189, 194, 199, 204, 209, 214, 219, + 224, 229, 234, 239, 244, 249, 254, 259, + 264, 269, 274, 279, 284, 289, 294, 299, + 304, 309, 314, 319, 324, 329, 334, 339, + 344, 349, 354, 359, 364, 369, 374, 379, + 384, 389, 394, 399 }; static const char _sav_long_variable_parse_indicies[] = { 1, 1, 1, 0, 1, 3, 1, 1, - 1, 1, 1, 1, 2, 1, 3, 1, - 1, 1, 1, 1, 1, 4, 1, 3, - 1, 1, 1, 1, 1, 1, 5, 1, - 3, 1, 1, 1, 1, 1, 1, 6, + 1, 1, 1, 1, 1, 2, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 4, + 1, 3, 1, 1, 1, 1, 1, 1, + 1, 5, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 6, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 7, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 8, 1, 3, 1, 1, 1, 1, 1, 1, - 7, 1, 3, 1, 1, 1, 1, 1, - 1, 8, 1, 3, 1, 1, 1, 1, - 1, 1, 9, 3, 1, 1, 1, 1, - 10, 11, 1, 1, 1, 12, 1, 1, - 1, 0, 11, 1, 1, 1, 13, 11, - 1, 1, 1, 14, 11, 1, 1, 1, - 15, 11, 1, 1, 1, 16, 11, 1, - 1, 1, 17, 11, 1, 1, 1, 18, - 11, 1, 1, 1, 19, 11, 1, 1, - 1, 20, 11, 1, 1, 1, 21, 11, - 1, 1, 1, 22, 11, 1, 1, 1, - 23, 11, 1, 1, 1, 24, 11, 1, - 1, 1, 25, 11, 1, 1, 1, 26, - 11, 1, 1, 1, 27, 11, 1, 1, - 1, 28, 11, 1, 1, 1, 29, 11, - 1, 1, 1, 30, 11, 1, 1, 1, - 31, 11, 1, 1, 1, 32, 11, 1, - 1, 1, 33, 11, 1, 1, 1, 34, - 11, 1, 1, 1, 35, 11, 1, 1, - 1, 36, 11, 1, 1, 1, 37, 11, - 1, 1, 1, 38, 11, 1, 1, 1, - 39, 11, 1, 1, 1, 40, 11, 1, - 1, 1, 41, 11, 1, 1, 1, 42, - 11, 1, 1, 1, 43, 11, 1, 1, - 1, 44, 11, 1, 1, 1, 45, 11, - 1, 1, 1, 46, 11, 1, 1, 1, - 47, 11, 1, 1, 1, 48, 11, 1, - 1, 1, 49, 11, 1, 1, 1, 50, - 11, 1, 1, 1, 51, 11, 1, 1, - 1, 52, 11, 1, 1, 1, 53, 11, - 1, 1, 1, 54, 11, 1, 1, 1, - 55, 11, 1, 1, 1, 56, 11, 1, - 1, 1, 57, 11, 1, 1, 1, 58, - 11, 1, 1, 1, 59, 11, 1, 1, - 1, 60, 11, 1, 1, 1, 61, 11, - 1, 1, 1, 62, 11, 1, 1, 1, - 63, 11, 1, 1, 1, 64, 11, 1, - 1, 1, 65, 11, 1, 1, 1, 66, - 11, 1, 1, 1, 67, 11, 1, 1, - 1, 68, 11, 1, 1, 1, 69, 11, - 1, 1, 1, 70, 11, 1, 1, 1, - 71, 11, 1, 1, 1, 72, 11, 1, - 1, 1, 73, 11, 1, 1, 1, 74, - 11, 1, 0 + 1, 9, 3, 1, 1, 1, 1, 10, + 11, 1, 1, 1, 12, 1, 1, 1, + 0, 11, 1, 1, 1, 13, 11, 1, + 1, 1, 14, 11, 1, 1, 1, 15, + 11, 1, 1, 1, 16, 11, 1, 1, + 1, 17, 11, 1, 1, 1, 18, 11, + 1, 1, 1, 19, 11, 1, 1, 1, + 20, 11, 1, 1, 1, 21, 11, 1, + 1, 1, 22, 11, 1, 1, 1, 23, + 11, 1, 1, 1, 24, 11, 1, 1, + 1, 25, 11, 1, 1, 1, 26, 11, + 1, 1, 1, 27, 11, 1, 1, 1, + 28, 11, 1, 1, 1, 29, 11, 1, + 1, 1, 30, 11, 1, 1, 1, 31, + 11, 1, 1, 1, 32, 11, 1, 1, + 1, 33, 11, 1, 1, 1, 34, 11, + 1, 1, 1, 35, 11, 1, 1, 1, + 36, 11, 1, 1, 1, 37, 11, 1, + 1, 1, 38, 11, 1, 1, 1, 39, + 11, 1, 1, 1, 40, 11, 1, 1, + 1, 41, 11, 1, 1, 1, 42, 11, + 1, 1, 1, 43, 11, 1, 1, 1, + 44, 11, 1, 1, 1, 45, 11, 1, + 1, 1, 46, 11, 1, 1, 1, 47, + 11, 1, 1, 1, 48, 11, 1, 1, + 1, 49, 11, 1, 1, 1, 50, 11, + 1, 1, 1, 51, 11, 1, 1, 1, + 52, 11, 1, 1, 1, 53, 11, 1, + 1, 1, 54, 11, 1, 1, 1, 55, + 11, 1, 1, 1, 56, 11, 1, 1, + 1, 57, 11, 1, 1, 1, 58, 11, + 1, 1, 1, 59, 11, 1, 1, 1, + 60, 11, 1, 1, 1, 61, 11, 1, + 1, 1, 62, 11, 1, 1, 1, 63, + 11, 1, 1, 1, 64, 11, 1, 1, + 1, 65, 11, 1, 1, 1, 66, 11, + 1, 1, 1, 67, 11, 1, 1, 1, + 68, 11, 1, 1, 1, 69, 11, 1, + 1, 1, 70, 11, 1, 1, 1, 71, + 11, 1, 1, 1, 72, 11, 1, 1, + 1, 73, 11, 1, 1, 1, 74, 11, + 1, 0 }; static const char _sav_long_variable_parse_trans_targs[] = { @@ -280,7 +278,7 @@ static const int sav_long_variable_parse_start = 1; static const int sav_long_variable_parse_en_main = 1; -#line 64 "src/spss/readstat_sav_parse.rl" +#line 79 "src/spss/readstat_sav_parse.rl" readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav_ctx_t *ctx) { @@ -304,12 +302,12 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav int cs; -#line 308 "src/spss/readstat_sav_parse.c" +#line 306 "src/spss/readstat_sav_parse.c" { cs = sav_long_variable_parse_start; } -#line 313 "src/spss/readstat_sav_parse.c" +#line 311 "src/spss/readstat_sav_parse.c" { int _klen; unsigned int _trans; @@ -384,7 +382,22 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav switch ( *_acts++ ) { case 0: -#line 87 "src/spss/readstat_sav_parse.rl" +#line 13 "src/spss/readstat_sav_parse.rl" + { + memcpy(temp_key, str_start, str_len); + temp_key[str_len] = '\0'; + } + break; + case 1: +#line 20 "src/spss/readstat_sav_parse.rl" + { str_start = p; } + break; + case 2: +#line 20 "src/spss/readstat_sav_parse.rl" + { str_len = p - str_start; } + break; + case 3: +#line 102 "src/spss/readstat_sav_parse.rl" { varlookup_t *found = bsearch(temp_key, table, var_count, sizeof(varlookup_t), &compare_key_varlookup); if (found) { @@ -397,37 +410,22 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav } } break; - case 1: -#line 99 "src/spss/readstat_sav_parse.rl" - { - memcpy(temp_key, str_start, str_len); - temp_key[str_len] = '\0'; - } - break; - case 2: -#line 104 "src/spss/readstat_sav_parse.rl" + case 4: +#line 114 "src/spss/readstat_sav_parse.rl" { memcpy(temp_val, str_start, str_len); temp_val[str_len] = '\0'; } break; - case 3: -#line 111 "src/spss/readstat_sav_parse.rl" - { str_start = p; } - break; - case 4: -#line 111 "src/spss/readstat_sav_parse.rl" - { str_len = p - str_start; } - break; case 5: -#line 113 "src/spss/readstat_sav_parse.rl" +#line 119 "src/spss/readstat_sav_parse.rl" { str_start = p; } break; case 6: -#line 113 "src/spss/readstat_sav_parse.rl" +#line 119 "src/spss/readstat_sav_parse.rl" { str_len = p - str_start; } break; -#line 431 "src/spss/readstat_sav_parse.c" +#line 429 "src/spss/readstat_sav_parse.c" } } @@ -443,8 +441,8 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav unsigned int __nacts = (unsigned int) *__acts++; while ( __nacts-- > 0 ) { switch ( *__acts++ ) { - case 0: -#line 87 "src/spss/readstat_sav_parse.rl" + case 3: +#line 102 "src/spss/readstat_sav_parse.rl" { varlookup_t *found = bsearch(temp_key, table, var_count, sizeof(varlookup_t), &compare_key_varlookup); if (found) { @@ -457,18 +455,18 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav } } break; - case 2: -#line 104 "src/spss/readstat_sav_parse.rl" + case 4: +#line 114 "src/spss/readstat_sav_parse.rl" { memcpy(temp_val, str_start, str_len); temp_val[str_len] = '\0'; } break; case 6: -#line 113 "src/spss/readstat_sav_parse.rl" +#line 119 "src/spss/readstat_sav_parse.rl" { str_len = p - str_start; } break; -#line 472 "src/spss/readstat_sav_parse.c" +#line 470 "src/spss/readstat_sav_parse.c" } } } @@ -476,7 +474,7 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav _out: {} } -#line 121 "src/spss/readstat_sav_parse.rl" +#line 127 "src/spss/readstat_sav_parse.rl" if (cs < 11|| p != pe) { @@ -499,62 +497,63 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav } -#line 503 "src/spss/readstat_sav_parse.c" +#line 501 "src/spss/readstat_sav_parse.c" static const char _sav_very_long_string_parse_actions[] = { - 0, 1, 0, 1, 2, 1, 3, 2, - 4, 1, 2, 5, 2 + 0, 1, 1, 1, 3, 1, 4, 2, + 2, 0, 2, 5, 4 }; static const char _sav_very_long_string_parse_key_offsets[] = { - 0, 0, 6, 20, 34, 48, 62, 76, - 90, 104, 105, 107, 110, 112 + 0, 0, 5, 19, 33, 47, 61, 75, + 89, 103, 104, 106, 109, 111 }; static const unsigned char _sav_very_long_string_parse_trans_keys[] = { - 0u, 63u, 91u, 127u, 248u, 255u, 47u, 61u, - 0u, 34u, 37u, 45u, 58u, 63u, 91u, 94u, - 96u, 127u, 248u, 255u, 47u, 61u, 0u, 34u, - 37u, 45u, 58u, 63u, 91u, 94u, 96u, 127u, - 248u, 255u, 47u, 61u, 0u, 34u, 37u, 45u, - 58u, 63u, 91u, 94u, 96u, 127u, 248u, 255u, - 47u, 61u, 0u, 34u, 37u, 45u, 58u, 63u, - 91u, 94u, 96u, 127u, 248u, 255u, 47u, 61u, - 0u, 34u, 37u, 45u, 58u, 63u, 91u, 94u, - 96u, 127u, 248u, 255u, 47u, 61u, 0u, 34u, - 37u, 45u, 58u, 63u, 91u, 94u, 96u, 127u, - 248u, 255u, 47u, 61u, 0u, 34u, 37u, 45u, - 58u, 63u, 91u, 94u, 96u, 127u, 248u, 255u, - 61u, 48u, 57u, 0u, 48u, 57u, 0u, 9u, - 0u, 63u, 91u, 127u, 248u, 255u, 0 + 255u, 0u, 63u, 91u, 127u, 47u, 61u, 96u, + 255u, 0u, 34u, 37u, 45u, 58u, 63u, 91u, + 94u, 123u, 127u, 47u, 61u, 96u, 255u, 0u, + 34u, 37u, 45u, 58u, 63u, 91u, 94u, 123u, + 127u, 47u, 61u, 96u, 255u, 0u, 34u, 37u, + 45u, 58u, 63u, 91u, 94u, 123u, 127u, 47u, + 61u, 96u, 255u, 0u, 34u, 37u, 45u, 58u, + 63u, 91u, 94u, 123u, 127u, 47u, 61u, 96u, + 255u, 0u, 34u, 37u, 45u, 58u, 63u, 91u, + 94u, 123u, 127u, 47u, 61u, 96u, 255u, 0u, + 34u, 37u, 45u, 58u, 63u, 91u, 94u, 123u, + 127u, 47u, 61u, 96u, 255u, 0u, 34u, 37u, + 45u, 58u, 63u, 91u, 94u, 123u, 127u, 61u, + 48u, 57u, 0u, 48u, 57u, 0u, 9u, 255u, + 0u, 63u, 91u, 127u, 0 }; static const char _sav_very_long_string_parse_single_lengths[] = { - 0, 0, 2, 2, 2, 2, 2, 2, - 2, 1, 0, 1, 2, 0 + 0, 1, 4, 4, 4, 4, 4, 4, + 4, 1, 0, 1, 2, 1 }; static const char _sav_very_long_string_parse_range_lengths[] = { - 0, 3, 6, 6, 6, 6, 6, 6, - 6, 0, 1, 1, 0, 3 + 0, 2, 5, 5, 5, 5, 5, 5, + 5, 0, 1, 1, 0, 2 }; static const char _sav_very_long_string_parse_index_offsets[] = { - 0, 0, 4, 13, 22, 31, 40, 49, - 58, 67, 69, 71, 74, 77 + 0, 0, 4, 14, 24, 34, 44, 54, + 64, 74, 76, 78, 81, 84 }; static const char _sav_very_long_string_parse_indicies[] = { 1, 1, 1, 0, 1, 3, 1, 1, - 1, 1, 1, 1, 2, 1, 3, 1, - 1, 1, 1, 1, 1, 4, 1, 3, - 1, 1, 1, 1, 1, 1, 5, 1, - 3, 1, 1, 1, 1, 1, 1, 6, + 1, 1, 1, 1, 1, 2, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 4, 1, 3, 1, 1, 1, 1, 1, 1, - 7, 1, 3, 1, 1, 1, 1, 1, - 1, 8, 1, 3, 1, 1, 1, 1, - 1, 1, 9, 3, 1, 10, 1, 11, - 12, 1, 13, 14, 1, 1, 1, 1, - 0, 0 + 1, 5, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 6, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 7, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 8, + 1, 3, 1, 1, 1, 1, 1, 1, + 1, 9, 3, 1, 10, 1, 11, 12, + 1, 13, 14, 1, 1, 1, 1, 0, + 0 }; static const char _sav_very_long_string_parse_trans_targs[] = { @@ -563,8 +562,8 @@ static const char _sav_very_long_string_parse_trans_targs[] = { }; static const char _sav_very_long_string_parse_trans_actions[] = { - 5, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 10, 1, 3, 0, 0 + 1, 0, 0, 7, 0, 0, 0, 0, + 0, 0, 10, 3, 5, 0, 0 }; static const int sav_very_long_string_parse_start = 1; @@ -572,7 +571,7 @@ static const int sav_very_long_string_parse_start = 1; static const int sav_very_long_string_parse_en_main = 1; -#line 146 "src/spss/readstat_sav_parse.rl" +#line 153 "src/spss/readstat_sav_parse.rl" readstat_error_t sav_parse_very_long_string_record(void *data, int count, sav_ctx_t *ctx) { @@ -597,12 +596,12 @@ readstat_error_t sav_parse_very_long_string_record(void *data, int count, sav_ct table = build_lookup_table(var_count, ctx); -#line 601 "src/spss/readstat_sav_parse.c" +#line 600 "src/spss/readstat_sav_parse.c" { cs = sav_very_long_string_parse_start; } -#line 606 "src/spss/readstat_sav_parse.c" +#line 605 "src/spss/readstat_sav_parse.c" { int _klen; unsigned int _trans; @@ -677,23 +676,33 @@ readstat_error_t sav_parse_very_long_string_record(void *data, int count, sav_ct switch ( *_acts++ ) { case 0: -#line 170 "src/spss/readstat_sav_parse.rl" +#line 13 "src/spss/readstat_sav_parse.rl" { - varlookup_t *found = bsearch(temp_key, table, var_count, sizeof(varlookup_t), &compare_key_varlookup); - if (found) { - ctx->varinfo[found->index]->string_length = temp_val; - } - } + memcpy(temp_key, str_start, str_len); + temp_key[str_len] = '\0'; + } break; case 1: +#line 20 "src/spss/readstat_sav_parse.rl" + { str_start = p; } + break; + case 2: +#line 20 "src/spss/readstat_sav_parse.rl" + { str_len = p - str_start; } + break; + case 3: #line 177 "src/spss/readstat_sav_parse.rl" { - memcpy(temp_key, str_start, str_len); - temp_key[str_len] = '\0'; + varlookup_t *found = bsearch(temp_key, table, var_count, sizeof(varlookup_t), &compare_key_varlookup); + if (found) { + ctx->varinfo[found->index]->string_length = temp_val; + ctx->varinfo[found->index]->write_format.width = temp_val; + ctx->varinfo[found->index]->print_format.width = temp_val; + } } break; - case 2: -#line 182 "src/spss/readstat_sav_parse.rl" + case 4: +#line 186 "src/spss/readstat_sav_parse.rl" { if ((*p) != '\0') { unsigned char digit = (*p) - '0'; @@ -705,19 +714,11 @@ readstat_error_t sav_parse_very_long_string_record(void *data, int count, sav_ct } } break; - case 3: -#line 195 "src/spss/readstat_sav_parse.rl" - { str_start = p; } - break; - case 4: -#line 195 "src/spss/readstat_sav_parse.rl" - { str_len = p - str_start; } - break; case 5: #line 197 "src/spss/readstat_sav_parse.rl" { temp_val = 0; } break; -#line 721 "src/spss/readstat_sav_parse.c" +#line 722 "src/spss/readstat_sav_parse.c" } } diff --git a/src/spss/readstat_sav_parse.rl b/src/spss/readstat_sav_parse.rl index c77e8fe..5926ce4 100644 --- a/src/spss/readstat_sav_parse.rl +++ b/src/spss/readstat_sav_parse.rl @@ -2,10 +2,24 @@ #include #include "../readstat.h" #include "../readstat_malloc.h" +#include "../readstat_strings.h" #include "readstat_sav.h" #include "readstat_sav_parse.h" +%%{ + machine key_defs; + + action copy_key { + memcpy(temp_key, str_start, str_len); + temp_key[str_len] = '\0'; + } + + non_ascii_byte = (0x80 .. 0xFE); # multi-byte sequence might be incomplete + + key = ( ( non_ascii_byte | [A-Z@] ) ( non_ascii_byte | [A-Za-z0-9@#$_\.] ){0,7} ) >{ str_start = fpc; } %{ str_len = fpc - str_start; }; +}%% + typedef struct varlookup { char name[8*4+1]; int index; @@ -14,13 +28,13 @@ typedef struct varlookup { static int compare_key_varlookup(const void *elem1, const void *elem2) { const char *key = (const char *)elem1; const varlookup_t *v = (const varlookup_t *)elem2; - return strcmp(key, v->name); + return strcasecmp(key, v->name); } static int compare_varlookups(const void *elem1, const void *elem2) { const varlookup_t *v1 = (const varlookup_t *)elem1; const varlookup_t *v2 = (const varlookup_t *)elem2; - return strcmp(v1->name, v2->name); + return strcasecmp(v1->name, v2->name); } static int count_vars(sav_ctx_t *ctx) { @@ -59,6 +73,7 @@ static varlookup_t *build_lookup_table(int var_count, sav_ctx_t *ctx) { %%{ machine sav_long_variable_parse; + include key_defs; write data nofinal noerror; alphtype unsigned char; }%% @@ -96,20 +111,11 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav } } - action copy_key { - memcpy(temp_key, str_start, str_len); - temp_key[str_len] = '\0'; - } - action copy_value { memcpy(temp_val, str_start, str_len); temp_val[str_len] = '\0'; } - non_ascii_byte = (0xC0..0xDF | 0x80..0xBF | 0xE0..0xEF | 0xF0..0xF7); # UTF-8 byte sequences (might be incomplete) - - key = ( ( non_ascii_byte | [A-Z@] ) ( non_ascii_byte | [A-Z0-9@#$_\.] ){0,7} ) >{ str_start = fpc; } %{ str_len = fpc - str_start; }; - value = ( non_ascii_byte | print ){1,64} >{ str_start = fpc; } %{ str_len = fpc - str_start; }; keyval = ( key %copy_key "=" value %copy_value ) %set_long_name; @@ -141,6 +147,7 @@ readstat_error_t sav_parse_long_variable_names_record(void *data, int count, sav %%{ machine sav_very_long_string_parse; + include key_defs; write data nofinal noerror; alphtype unsigned char; }%% @@ -171,14 +178,11 @@ readstat_error_t sav_parse_very_long_string_record(void *data, int count, sav_ct varlookup_t *found = bsearch(temp_key, table, var_count, sizeof(varlookup_t), &compare_key_varlookup); if (found) { ctx->varinfo[found->index]->string_length = temp_val; + ctx->varinfo[found->index]->write_format.width = temp_val; + ctx->varinfo[found->index]->print_format.width = temp_val; } } - action copy_key { - memcpy(temp_key, str_start, str_len); - temp_key[str_len] = '\0'; - } - action incr_val { if (fc != '\0') { unsigned char digit = fc - '0'; @@ -190,10 +194,6 @@ readstat_error_t sav_parse_very_long_string_record(void *data, int count, sav_ct } } - non_ascii_byte = (0xC0..0xDF | 0x80..0xBF | 0xE0..0xEF | 0xF0..0xF7); # UTF-8 byte sequences (might be incomplete) - - key = ( ( non_ascii_byte | [A-Z@] ) ( non_ascii_byte | [A-Z0-9@#$_\.] ){0,7} ) >{ str_start = fpc; } %{ str_len = fpc - str_start; }; - value = [0-9]+ >{ temp_val = 0; } $incr_val; keyval = ( key %copy_key "=" value ) %set_width; diff --git a/src/spss/readstat_sav_write.c b/src/spss/readstat_sav_write.c index ec909b9..1888da0 100644 --- a/src/spss/readstat_sav_write.c +++ b/src/spss/readstat_sav_write.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/src/stata/readstat_dta_read.c b/src/stata/readstat_dta_read.c index 041e17f..faec36e 100644 --- a/src/stata/readstat_dta_read.c +++ b/src/stata/readstat_dta_read.c @@ -904,12 +904,10 @@ static readstat_error_t dta_read_label_and_timestamp(dta_ctx_t *ctx) { memmove(timestamp_buffer+1, timestamp_buffer, timestamp_len-1); timestamp_buffer[0] = last_data_label_char; } - if ((retval = dta_parse_timestamp(timestamp_buffer, timestamp_len, - ×tamp, ctx->handle.error, ctx->user_ctx)) != READSTAT_OK) { - goto cleanup; + if (dta_parse_timestamp(timestamp_buffer, timestamp_len, + ×tamp, ctx->handle.error, ctx->user_ctx) == READSTAT_OK) { + ctx->timestamp = mktime(×tamp); } - - ctx->timestamp = mktime(×tamp); } } diff --git a/src/stata/readstat_dta_write.c b/src/stata/readstat_dta_write.c index 77cc20a..08a8364 100644 --- a/src/stata/readstat_dta_write.c +++ b/src/stata/readstat_dta_write.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include "../readstat.h" @@ -523,13 +522,15 @@ static readstat_error_t dta_emit_variable_labels(readstat_writer_t *writer, dta_ static readstat_error_t dta_emit_characteristics(readstat_writer_t *writer, dta_ctx_t *ctx) { readstat_error_t error = READSTAT_OK; int i; - char buffer[ctx->ch_metadata_len]; + char *buffer = NULL; if (ctx->expansion_len_len == 0) return READSTAT_OK; if ((error = dta_write_tag(writer, ctx, "")) != READSTAT_OK) - goto cleanup; + return error; + + buffer = malloc(ctx->ch_metadata_len); for (i=0; inotes_count; i++) { if (ctx->file_is_xmlish) { @@ -581,6 +582,7 @@ static readstat_error_t dta_emit_characteristics(readstat_writer_t *writer, dta_ goto cleanup; cleanup: + free(buffer); return error; } From 392f383c52e6fadf631ca6ba1a3c174beccb1e2e Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Sat, 28 Nov 2020 10:49:21 +0100 Subject: [PATCH 2/7] added tests for original_variable_type for sav and file_label for sas7bdat linux --- test_data/basic/test_file_label_linux.sas7bdat | Bin 0 -> 131072 bytes test_data/basic/test_file_label_win.sas7bdat | Bin 0 -> 131072 bytes test_data/basic/test_width.sav | Bin 0 -> 6154 bytes tests/test_basic.py | 16 +++++++++++++++- 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test_data/basic/test_file_label_linux.sas7bdat create mode 100644 test_data/basic/test_file_label_win.sas7bdat create mode 100644 test_data/basic/test_width.sav diff --git a/test_data/basic/test_file_label_linux.sas7bdat b/test_data/basic/test_file_label_linux.sas7bdat new file mode 100644 index 0000000000000000000000000000000000000000..5d88454d227a7b9186b32587a1059d0377f27d70 GIT binary patch literal 131072 zcmeI!%WEA~901@mH&Lrr`!H&Ri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F5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5cppSTsYq?kIgN*-MS-o_-FlxTemdo|9y6AqyArHI~w(WKfA3_|97*S8uee!wl(Vi zY<6>_{&QKg`@g5*{JXLn8m)i0;r(9;&F23uG`s(wg=Y8fgNFUjHthd;*xBg*9S^rR z>OUJAKEL6{G=H^yc8`QFUMo_EWB%4~XUIa@rHb;}HM4DDIGpdc!gb-d?l0Yy?#?ij zw~ypM-R>=6YuJ+4c9c(8dP?#{eypasvMRo-Dnh#`hg)HPjLYUco~^~57++hIdHePl z7qf@qETla-#c7XAaWYGB>|U<7=>JGew94^XRX(p5*Hg657iE5=_3f&{^6HEBM`N7Y zAFIU+wfInsOQrmJo~*S$Rg0gFakZXSc(xYDP;r$6Hv4Tb8_FkVZT8LfpKjQHZQ@wD z5Z|}m@!jq{uS5AWT)qYQncePCxX|tIo8Hsu{$yTH&s|ye#pyjv?fu>261wfRi^ z_ugH$jK=nQ|CqjL-1Hu&Z@Au*RQ2e@hV-1IGL5Iaw7{`5=PrH16}G1LEd5nTak_6Q z-WtbCar!n+aoTUMaN13rwx!&Acjw=1#rIopp6VNJS6}8*gAV6AS$5GbzK|~SqUSds JD_vSS?BA&yB`N>_ literal 0 HcmV?d00001 diff --git a/test_data/basic/test_file_label_win.sas7bdat b/test_data/basic/test_file_label_win.sas7bdat new file mode 100644 index 0000000000000000000000000000000000000000..4ec19266071447a03a85f3d556cdaa6699c8d23a GIT binary patch literal 131072 zcmeHwdz>6qm48nXBqCyffanipfb0sA8S2$t-Qkg$WI_^1CLtLhJcQ0nf@BTg5+D!o z=X6icOwcIEO9dCQg03$9T%QZFA_L+ZS$v?&!YV92c3tIR8eK4w-???}y;XJU)-$ai z|G2G8ot&wuzTb21_uSXHw@M}d^Wd)<_0P{f@L%t{erD;_-!OL^cEqd$k2TVU|s-FJ&3 z+Ao1L?SRs2;L`m{sq|DA{$@7F`}3QAw!2g^xc)|vS28{P`y!C%a@hd6%HCR;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zAWr-zD>yd+E3&ZY!saHFQ(n{+ zjPJq&;tF#U5oV+&4(4$La9%OJ!rmMk$`=e!L(Z)T>*L%?WL_v-aIYT&OGI-!X8p8i z#b&wKfj(lE3l_!$DCB%_zzc!4p6B}bqjZswpmq{FS4ew=w9LWv?#_oii&JnY0D!`EB|5D<~ zo_X-5@N~_@9i`8!M&Ftcp+~8=I-IAPN9*f(wT)S-I`Bf;g zbL`@qxGN?hx17IPgQb~+y91M4^5xvX=kUq0X-P<4SW1~&i3MR;R@pMW;~luD3QHq< z)-G1fdqMgXwCgTEpoeErElW=;@`^lK(C&&NXAUniE35%YVPfSoG}onsG$$B8(q@V} z?GI(}$mkww&UGtiaaKXVIw&*5GBd94Eamsl zL#6z-{#1d#`A~ts87&=@+t&5c>vR82U#URdDZNH~&z?PdhDuMqoBeYc{C7y{O{FgQ zi63@-mBjwK(u~p{_Dn17Tl)Q;7xz5B=b+Mb`2B47Z_l2COZ%5*f^?wgdEv=YX*WE7 zMi=}7K1aZR-AtGfNM&bie{x+QB}oLGs(O{7tpM z-^efE0`w~PbaPG~2D<6+zb;t=_UxHndPTPTj9+sD4-j?Fuk*+wp%=HZde|-gQ8IX` z9bh>7oXD?u!yn<^0TjKT-Q+XSKh(c^Xwk}xw_d(})8*Y8*AB1WxD@_i^`bTXbAZrr zT`*@s-~mu*_B{4oSpNgROAzv*_O%dQQ`{S zC}~end!LsTx|b9>asQw4`aAe|aSFcV_wacy1U3<24>XRNfpx?$fw-6Hu^nbeOQrSj z4}jo(JjGwwkHLF)-<`Ec3=xa(?8-2*>;C-8`ULFXUY&<)w$Dtj?#%I?GCT0M*sdKO d&?G%?27Gf@h&}A?ccL3W621vM14BPo{C{IeXy^a{ literal 0 HcmV?d00001 diff --git a/test_data/basic/test_width.sav b/test_data/basic/test_width.sav new file mode 100644 index 0000000000000000000000000000000000000000..2bd0ecb569f5cd10154821afe4951b64323b9106 GIT binary patch literal 6154 zcmeHLUr*Ce6z>qC!>C9!`eJeuNf-~)d)rP*lf_NDN)!IfwS(ZxGFgElX>l82;YHtk zFnk7m@B{fR)F=D`E1q-Piw=b7Fc~pD%jvzl_uPAaJ-z*<`AwK}av^hnidawPiCwmB zVmn30vK{NGO&+P)mtLF9+hp1E8^Lai$jSqXKO$^MlB9RwDR8ursDbNBfiYsc+eD^J z)fG*rnpo6t3%g>zad44O8iyWurDT^E7wpnin5($0?Z9uj#4-rRAA&){Ep;y?p$iCq zG!H9}@*P4C9I8}tjG{9Nb9TGlY!jp2cFDiVcV4{7`tv>Sq<%^LBD&yQae^;S;{%|@ zgb(`Q*W`Um-nX;fw~Ky0PU8cX@IhbSTNnL#C-@S+I*YGP;{!S2gM<%~@1qmn)Bic2 zj{V99W1t^^bNxW+j}MS~gdQ=J8IjP9Y6WDQ#f952XY4fVZ7=Xi#`8(bT@Cz3YYGGp z)H=|_S}6r;4Y+A7SoUnm7=}5gx#M1fR>Vru_s1hfy9VGM%(Fdp|p{pT_` zuEVh_;CH}$y=Dok~ zV@|{=aEU(VyB3cxLo0NpybzVFMp|e;c`p2*?vobf&x_jEYMx(^$#Sfm~jijiol3$}~%-vrGXM zQD-xHF2`rWL0WeW&LY^`{Q}2r8bN#;;YztPzqk2XeQ^xGLJ>ceb#;2+_yK-||Kod( zpB2qlIc4tImbN>C_kpE#j^St1glf8))740i9bowpeuTgCA;P~B7{+>Id2e&Wj!p+5 z@oj|B`O&gW14UVjWDDNVL6>q ST~P;%zq`hdKEHh3FZ=*+j52co literal 0 HcmV?d00001 diff --git a/tests/test_basic.py b/tests/test_basic.py index 022b539..9a6bd48 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -918,6 +918,14 @@ def test_sav_international_varname(self): df, meta = pyreadstat.read_sav(os.path.join(self.basic_data_folder, "hebrews.sav")) self.assertTrue(df.columns[0] == "ותק_ב") + def test_sav_original_var_types(self): + # a file with a varname with international characters + df, meta = pyreadstat.read_sav(os.path.join(self.basic_data_folder, "test_width.sav")) + self.assertEqual(meta.original_variable_types['StartDate'],'A1024') + self.assertEqual(meta.original_variable_types['ResponseId'],'A18') + self.assertEqual(meta.original_variable_types['Duration__in_seconds_'],'F40.2') + self.assertEqual(meta.original_variable_types['Finished'],'F1.0') + def test_sav_write_longstr(self): path = os.path.join(self.write_folder, "longstr.sav") pyreadstat.write_sav(self.df_longstr, path, variable_display_width={"v1": 1000}) @@ -925,7 +933,13 @@ def test_sav_write_longstr(self): self.assertTrue(meta.variable_display_width['v1']==1000) self.assertTrue(len(df.iloc[0,0])==781) - + def test_sas7bdat_file_label_linux(self): + "testing file label for file produced on linux" + path = os.path.join(self.basic_data_folder, "test_file_label_linux.sas7bdat") + df, meta = pyreadstat.read_sas7bdat(path) + self.assertEqual(meta.file_label, "mytest label") + self.assertEqual(meta.table_name, "TEST_DATA") + if __name__ == '__main__': From c3204dff20f2304a71ab15488b5bb3f5ab1dc1d1 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Mon, 30 Nov 2020 12:15:07 +0100 Subject: [PATCH 3/7] updated Readstat to commit 6b2bcc5a40688cc1d50cfa00168ff5bb6f3dff96 makes windows labels to work --- src/sas/readstat_sas.h | 3 + src/sas/readstat_sas7bdat_read.c | 120 ++++++++++++------------------ src/sas/readstat_sas7bdat_write.c | 26 ++++--- src/stata/readstat_dta_read.c | 2 +- tests/test_basic.py | 7 ++ 5 files changed, 74 insertions(+), 84 deletions(-) diff --git a/src/sas/readstat_sas.h b/src/sas/readstat_sas.h index 5fce15c..6b80c2f 100644 --- a/src/sas/readstat_sas.h +++ b/src/sas/readstat_sas.h @@ -108,6 +108,9 @@ typedef struct sas_text_ref_s { #define SAS_COMPRESSION_TRUNC 0x01 #define SAS_COMPRESSION_ROW 0x04 +#define SAS_COMPRESSION_SIGNATURE_RLE "SASYZCRL" +#define SAS_COMPRESSION_SIGNATURE_RDC "SASYZCR2" + #define SAS_DEFAULT_FILE_VERSION 9 extern unsigned char sas7bdat_magic_number[32]; diff --git a/src/sas/readstat_sas7bdat_read.c b/src/sas/readstat_sas7bdat_read.c index 44e1313..259edd1 100644 --- a/src/sas/readstat_sas7bdat_read.c +++ b/src/sas/readstat_sas7bdat_read.c @@ -11,9 +11,6 @@ #include "../readstat_convert.h" #include "../readstat_malloc.h" -#define SAS_COMPRESSION_SIGNATURE_RLE "SASYZCRL" -#define SAS_COMPRESSION_SIGNATURE_RDC "SASYZCR2" - typedef struct col_info_s { sas_text_ref_t name_ref; sas_text_ref_t format_ref; @@ -131,6 +128,34 @@ static readstat_error_t sas7bdat_update_progress(sas7bdat_ctx_t *ctx) { return io->update(ctx->file_size, ctx->handle.progress, ctx->user_ctx, io->io_ctx); } +static sas_text_ref_t sas7bdat_parse_text_ref(const char *data, sas7bdat_ctx_t *ctx) { + sas_text_ref_t ref; + + ref.index = sas_read2(&data[0], ctx->bswap); + ref.offset = sas_read2(&data[2], ctx->bswap); + ref.length = sas_read2(&data[4], ctx->bswap); + + return ref; +} + +static readstat_error_t sas7bdat_copy_text_ref(char *out_buffer, size_t out_buffer_len, sas_text_ref_t text_ref, sas7bdat_ctx_t *ctx) { + if (text_ref.index >= ctx->text_blob_count) + return READSTAT_ERROR_PARSE; + + if (text_ref.length == 0) { + out_buffer[0] = '\0'; + return READSTAT_OK; + } + + char *blob = ctx->text_blobs[text_ref.index]; + + if (text_ref.offset + text_ref.length > ctx->text_blob_lengths[text_ref.index]) + return READSTAT_ERROR_PARSE; + + return readstat_convert(out_buffer, out_buffer_len, &blob[text_ref.offset], text_ref.length, + ctx->converter); +} + static readstat_error_t sas7bdat_parse_column_text_subheader(const char *subheader, size_t len, sas7bdat_ctx_t *ctx) { readstat_error_t retval = READSTAT_OK; size_t signature_len = ctx->subheader_signature_size; @@ -157,12 +182,6 @@ static readstat_error_t sas7bdat_parse_column_text_subheader(const char *subhead ctx->text_blob_lengths[ctx->text_blob_count-1] = len-signature_len; ctx->text_blobs[ctx->text_blob_count-1] = blob; - /* another bit of a hack */ - if (len-signature_len > 12 + sizeof(SAS_COMPRESSION_SIGNATURE_RDC)-1 && - strncmp(blob + 12, SAS_COMPRESSION_SIGNATURE_RDC, sizeof(SAS_COMPRESSION_SIGNATURE_RDC)-1) == 0) { - ctx->rdc_compression = 1; - } - cleanup: return retval; } @@ -180,7 +199,6 @@ static readstat_error_t sas7bdat_realloc_col_info(sas7bdat_ctx_t *ctx, size_t co return READSTAT_OK; } - static readstat_error_t sas7bdat_parse_column_size_subheader(const char *subheader, size_t len, sas7bdat_ctx_t *ctx) { uint64_t col_count; readstat_error_t retval = READSTAT_OK; @@ -214,7 +232,7 @@ static readstat_error_t sas7bdat_parse_row_size_subheader(const char *subheader, uint64_t total_row_count; uint64_t row_length, page_row_count; - if (len < (ctx->u64 ? 128 : 64)) { + if (len < (ctx->u64 ? 250: 190)) { retval = READSTAT_ERROR_PARSE; goto cleanup; } @@ -229,6 +247,24 @@ static readstat_error_t sas7bdat_parse_row_size_subheader(const char *subheader, page_row_count = sas_read4(&subheader[60], ctx->bswap); } + sas_text_ref_t file_label_ref = sas7bdat_parse_text_ref(&subheader[len-130], ctx); + if (file_label_ref.length) { + if ((retval = sas7bdat_copy_text_ref(ctx->file_label, sizeof(ctx->file_label), + file_label_ref, ctx)) != READSTAT_OK) { + goto cleanup; + } + } + + sas_text_ref_t compression_ref = sas7bdat_parse_text_ref(&subheader[len-118], ctx); + if (compression_ref.length) { + char compression[9]; + if ((retval = sas7bdat_copy_text_ref(compression, sizeof(compression), + compression_ref, ctx)) != READSTAT_OK) { + goto cleanup; + } + ctx->rdc_compression = (memcmp(compression, SAS_COMPRESSION_SIGNATURE_RDC, 8) == 0); + } + ctx->row_length = row_length; ctx->row = readstat_realloc(ctx->row, ctx->row_length); if (ctx->row == NULL) { @@ -251,34 +287,6 @@ static readstat_error_t sas7bdat_parse_row_size_subheader(const char *subheader, return retval; } -static sas_text_ref_t sas7bdat_parse_text_ref(const char *data, sas7bdat_ctx_t *ctx) { - sas_text_ref_t ref; - - ref.index = sas_read2(&data[0], ctx->bswap); - ref.offset = sas_read2(&data[2], ctx->bswap); - ref.length = sas_read2(&data[4], ctx->bswap); - - return ref; -} - -static readstat_error_t sas7bdat_copy_text_ref(char *out_buffer, size_t out_buffer_len, sas_text_ref_t text_ref, sas7bdat_ctx_t *ctx) { - if (text_ref.index >= ctx->text_blob_count) - return READSTAT_ERROR_PARSE; - - if (text_ref.length == 0) { - out_buffer[0] = '\0'; - return READSTAT_OK; - } - - char *blob = ctx->text_blobs[text_ref.index]; - - if (text_ref.offset + text_ref.length > ctx->text_blob_lengths[text_ref.index]) - return READSTAT_ERROR_PARSE; - - return readstat_convert(out_buffer, out_buffer_len, &blob[text_ref.offset], text_ref.length, - ctx->converter); -} - static readstat_error_t sas7bdat_parse_column_name_subheader(const char *subheader, size_t len, sas7bdat_ctx_t *ctx) { readstat_error_t retval = READSTAT_OK; size_t signature_len = ctx->subheader_signature_size; @@ -286,7 +294,6 @@ static readstat_error_t sas7bdat_parse_column_name_subheader(const char *subhead int i; const char *cnp = &subheader[signature_len+8]; uint16_t remainder = sas_read2(&subheader[signature_len], ctx->bswap); - int off; if (remainder != sas_subheader_remainder(len, signature_len)) { retval = READSTAT_ERROR_PARSE; @@ -300,39 +307,6 @@ static readstat_error_t sas7bdat_parse_column_name_subheader(const char *subhead for (i=ctx->col_names_count-cmax; icol_names_count; i++) { ctx->col_info[i].name_ref = sas7bdat_parse_text_ref(cnp, ctx); - if (i == 0) { - if (ctx->text_blobs == NULL || ctx->text_blob_lengths == NULL) { - retval = READSTAT_ERROR_PARSE; - goto cleanup; - } - if (ctx->version < 9) { - off = 36; - } else { - if (ctx->text_blob_lengths[0] < 19) { - retval = READSTAT_ERROR_PARSE; - goto cleanup; - } - if (!memcmp(&ctx->text_blobs[0][12], "SASYZCR", 7)) { - off = 44; - } else { - off = ctx->u64 ? 36 : 12; - } - } - if (ctx->col_info[0].name_ref.offset >= - ctx->text_blob_lengths[0] || - ctx->col_info[0].name_ref.offset < off) { - retval = READSTAT_ERROR_PARSE; - goto cleanup; - } - retval = readstat_convert(ctx->file_label, - sizeof(ctx->file_label), - &ctx->text_blobs[0][off], - ctx->col_info[0].name_ref.offset - off, - ctx->converter - ); - if (retval != READSTAT_OK) - goto cleanup; - } cnp += 8; } diff --git a/src/sas/readstat_sas7bdat_write.c b/src/sas/readstat_sas7bdat_write.c index acb8a9e..a277b9c 100644 --- a/src/sas/readstat_sas7bdat_write.c +++ b/src/sas/readstat_sas7bdat_write.c @@ -158,7 +158,7 @@ static sas7bdat_subheader_t *sas7bdat_subheader_init(uint32_t signature, size_t } static sas7bdat_subheader_t *sas7bdat_row_size_subheader_init(readstat_writer_t *writer, - sas_header_info_t *hinfo) { + sas_header_info_t *hinfo, sas7bdat_column_text_array_t *column_text_array) { sas7bdat_subheader_t *subheader = sas7bdat_subheader_init( SAS_SUBHEADER_SIGNATURE_ROW_SIZE, hinfo->u64 ? 808 : 480); @@ -187,6 +187,18 @@ static sas7bdat_subheader_t *sas7bdat_row_size_subheader_init(readstat_writer_t memset(&subheader->data[64], 0xFF, 8); } + sas_text_ref_t text_ref = { 0 }; + + if (writer->file_label[0]) { + text_ref = sas7bdat_make_text_ref(column_text_array, writer->file_label); + memcpy(&subheader->data[subheader->len-130], &text_ref, sizeof(sas_text_ref_t)); + } + + if (writer->compression == READSTAT_COMPRESS_ROWS) { + text_ref = sas7bdat_make_text_ref(column_text_array, SAS_COMPRESSION_SIGNATURE_RLE); + memcpy(&subheader->data[subheader->len-118], &text_ref, sizeof(sas_text_ref_t)); + } + return subheader; } @@ -219,19 +231,13 @@ static sas7bdat_subheader_t *sas7bdat_col_name_subheader_init(readstat_writer_t SAS_SUBHEADER_SIGNATURE_COLUMN_NAME, len); memcpy(&subheader->data[signature_len], &remainder, sizeof(uint16_t)); - sas_text_ref_t text_ref = sas7bdat_make_text_ref(column_text_array, "READSTAT"); - text_ref = sas7bdat_make_text_ref(column_text_array, writer->file_label); - int i; char *ptrs = &subheader->data[signature_len+8]; for (i=0; ivariables_count; i++) { readstat_variable_t *variable = readstat_get_variable(writer, i); const char *name = readstat_variable_get_name(variable); - text_ref = sas7bdat_make_text_ref(column_text_array, name); - memcpy(&ptrs[0], &text_ref.index, sizeof(uint16_t)); - memcpy(&ptrs[2], &text_ref.offset, sizeof(uint16_t)); - memcpy(&ptrs[4], &text_ref.length, sizeof(uint16_t)); - + sas_text_ref_t text_ref = sas7bdat_make_text_ref(column_text_array, name); + memcpy(ptrs, &text_ref, sizeof(sas_text_ref_t)); ptrs += 8; } return subheader; @@ -350,7 +356,7 @@ static sas7bdat_subheader_array_t *sas7bdat_subheader_array_init(readstat_writer col_name_subheader = sas7bdat_col_name_subheader_init(writer, hinfo, column_text_array); col_attrs_subheader = sas7bdat_col_attrs_subheader_init(writer, hinfo); - sarray->subheaders[idx++] = sas7bdat_row_size_subheader_init(writer, hinfo); + sarray->subheaders[idx++] = sas7bdat_row_size_subheader_init(writer, hinfo, column_text_array); sarray->subheaders[idx++] = sas7bdat_col_size_subheader_init(writer, hinfo); col_format_subheaders = calloc(writer->variables_count, sizeof(sas7bdat_subheader_t *)); diff --git a/src/stata/readstat_dta_read.c b/src/stata/readstat_dta_read.c index faec36e..6ba975d 100644 --- a/src/stata/readstat_dta_read.c +++ b/src/stata/readstat_dta_read.c @@ -1053,7 +1053,7 @@ static readstat_error_t dta_handle_value_labels(dta_ctx_t *ctx) { goto cleanup; } } - } else if (len > 8) { + } else if (len >= 8) { if ((retval = dta_read_tag(ctx, "")) != READSTAT_OK) { goto cleanup; } diff --git a/tests/test_basic.py b/tests/test_basic.py index 9a6bd48..b1341c0 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -940,6 +940,13 @@ def test_sas7bdat_file_label_linux(self): self.assertEqual(meta.file_label, "mytest label") self.assertEqual(meta.table_name, "TEST_DATA") + def test_sas7bdat_file_label_windows(self): + "testing file label for file produced on windows" + path = os.path.join(self.basic_data_folder, "test_file_label_win.sas7bdat") + df, meta = pyreadstat.read_sas7bdat(path) + self.assertEqual(meta.file_label, "mytest label") + self.assertEqual(meta.table_name, "TEST_DATA") + if __name__ == '__main__': From 336ddcceaea0d24412248d3677d87db330f4ec04 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Wed, 2 Dec 2020 09:16:55 +0100 Subject: [PATCH 4/7] added np.float32 and float type, solves #92 --- pyreadstat/_readstat_writer.c | 3153 ++++++++++++++++--------------- pyreadstat/_readstat_writer.pyx | 3 +- 2 files changed, 1591 insertions(+), 1565 deletions(-) diff --git a/pyreadstat/_readstat_writer.c b/pyreadstat/_readstat_writer.c index 5d481a6..076f524 100644 --- a/pyreadstat/_readstat_writer.c +++ b/pyreadstat/_readstat_writer.c @@ -1660,7 +1660,7 @@ static const char __pyx_k_np[] = "np"; static const char __pyx_k_nt[] = "nt"; static const char __pyx_k_os[] = "os"; static const char __pyx_k_pd[] = "pd"; -static const char __pyx_k__13[] = "_"; +static const char __pyx_k__14[] = "_"; static const char __pyx_k_any[] = "any"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_get[] = "get"; @@ -1719,6 +1719,7 @@ static const char __pyx_k_values[] = "values"; static const char __pyx_k_asarray[] = "asarray"; static const char __pyx_k_columns[] = "columns"; static const char __pyx_k_combine[] = "combine"; +static const char __pyx_k_float32[] = "float32"; static const char __pyx_k_isalpha[] = "isalpha"; static const char __pyx_k_nominal[] = "nominal"; static const char __pyx_k_ordinal[] = "ordinal"; @@ -1800,7 +1801,7 @@ static PyObject *__pyx_n_s_UInt64Dtype; static PyObject *__pyx_n_s_UInt8Dtype; static PyObject *__pyx_kp_s_Unknown_data_format_to_insert; static PyObject *__pyx_kp_s_Unknown_pywriter_variable_format; -static PyObject *__pyx_n_s__13; +static PyObject *__pyx_n_s__14; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_s_alignment_for_variable_s_must_be; static PyObject *__pyx_n_s_any; @@ -1832,6 +1833,7 @@ static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_expanduser; static PyObject *__pyx_kp_s_first_argument_must_be_a_pandas; static PyObject *__pyx_n_s_float; +static PyObject *__pyx_n_s_float32; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_hi; static PyObject *__pyx_n_s_iloc; @@ -1934,6 +1936,7 @@ static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; /* Late includes */ /* "pyreadstat/_readstat_writer.pyx":60 @@ -3643,7 +3646,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types * # 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: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -3668,8 +3671,8 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types * # 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)) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -3702,35 +3705,35 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types * # 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: */ } - /* "pyreadstat/_readstat_writer.pyx":201 + /* "pyreadstat/_readstat_writer.pyx":200 + * 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 (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_int_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 201, __pyx_L1_error) + __PYX_ERR(0, 200, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_t_10 = (__pyx_t_11 != 0); if (__pyx_t_10) { - /* "pyreadstat/_readstat_writer.pyx":202 - * + /* "pyreadstat/_readstat_writer.pyx":201 + * 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)): */ - __pyx_t_3 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); @@ -3741,12 +3744,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_0); __pyx_t_3 = 0; - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "pyreadstat/_readstat_writer.pyx":201 + /* "pyreadstat/_readstat_writer.pyx":200 + * 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: @@ -3754,7 +3757,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":203 + /* "pyreadstat/_readstat_writer.pyx":202 * if col_type in int_types: * result.append((PYWRITER_INTEGER, 0,0)) * elif col_type in float_types: # <<<<<<<<<<<<<< @@ -3763,27 +3766,27 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_float_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 203, __pyx_L1_error) + __PYX_ERR(0, 202, __pyx_L1_error) } - __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_float_types, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_v_col_type, __pyx_v_10pyreadstat_16_readstat_writer_float_types, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { - /* "pyreadstat/_readstat_writer.pyx":204 + /* "pyreadstat/_readstat_writer.pyx":203 * 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: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pd); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pd); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isna); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isna); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -3798,7 +3801,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types } __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_8, __pyx_v_curseries) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_curseries); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; @@ -3814,23 +3817,23 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types __pyx_t_6 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_13, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_11) { - /* "pyreadstat/_readstat_writer.pyx":205 + /* "pyreadstat/_readstat_writer.pyx":204 * 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)) */ - __pyx_t_6 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); @@ -3841,10 +3844,10 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_1); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "pyreadstat/_readstat_writer.pyx":204 + /* "pyreadstat/_readstat_writer.pyx":203 * result.append((PYWRITER_INTEGER, 0,0)) * elif col_type in float_types: * if np.any(pd.isna(curseries)): # <<<<<<<<<<<<<< @@ -3854,7 +3857,7 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types goto __pyx_L10; } - /* "pyreadstat/_readstat_writer.pyx":207 + /* "pyreadstat/_readstat_writer.pyx":206 * result.append((PYWRITER_DOUBLE, 0, 1)) * else: * result.append((PYWRITER_DOUBLE, 0, 0)) # <<<<<<<<<<<<<< @@ -3862,9 +3865,9 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types * result.append((PYWRITER_LOGICAL, 0,0)) */ /*else*/ { - __pyx_t_7 = __Pyx_PyInt_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, 207, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_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, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); @@ -3875,12 +3878,12 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_0); __pyx_t_7 = 0; - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L10:; - /* "pyreadstat/_readstat_writer.pyx":203 + /* "pyreadstat/_readstat_writer.pyx":202 * if col_type in int_types: * result.append((PYWRITER_INTEGER, 0,0)) * elif col_type in float_types: # <<<<<<<<<<<<<< @@ -3890,34 +3893,34 @@ static PyObject *__pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":208 + /* "pyreadstat/_readstat_writer.pyx":207 * else: * result.append((PYWRITER_DOUBLE, 0, 0)) * elif col_type == np.bool: # <<<<<<<<<<<<<< * result.append((PYWRITER_LOGICAL, 0,0)) * # np.datetime64[ns] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_col_type, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_11) { - /* "pyreadstat/_readstat_writer.pyx":209 + /* "pyreadstat/_readstat_writer.pyx":208 * result.append((PYWRITER_DOUBLE, 0, 0)) * elif col_type == np.bool: * result.append((PYWRITER_LOGICAL, 0,0)) # <<<<<<<<<<<<<< * # np.datetime64[ns] * elif col_type == np.dtype('tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -5611,17 +5614,17 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 301, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 301, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -5631,7 +5634,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 302, __pyx_L1_error) + else __PYX_ERR(0, 301, __pyx_L1_error) } break; } @@ -5643,7 +5646,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 301, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5656,15 +5659,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __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, 302, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -5672,7 +5675,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; @@ -5680,7 +5683,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 302, __pyx_L1_error) + __PYX_ERR(0, 301, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); @@ -5688,28 +5691,28 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":304 + /* "pyreadstat/_readstat_writer.pyx":303 * for value, label in value_labels.items(): * * if type(label) != str: # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_label)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_label)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":305 + /* "pyreadstat/_readstat_writer.pyx":304 * * if type(label) != str: * msg = "variable_value_labels: type of Label %s in variable %s must be string" % (str(label), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_label); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); @@ -5717,20 +5720,20 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GIVEREF(__pyx_v_variable_name); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variable_name); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_La, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_La, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":306 + /* "pyreadstat/_readstat_writer.pyx":305 * 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: */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -5744,14 +5747,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 306, __pyx_L1_error) + __PYX_ERR(0, 305, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":304 + /* "pyreadstat/_readstat_writer.pyx":303 * for value, label in value_labels.items(): * * if type(label) != str: # <<<<<<<<<<<<<< @@ -5760,7 +5763,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":308 + /* "pyreadstat/_readstat_writer.pyx":307 * raise PyreadstatError(msg) * * if user_missing_tags and value in user_missing_tags: # <<<<<<<<<<<<<< @@ -5773,13 +5776,13 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_t_11 = __pyx_t_12; goto __pyx_L9_bool_binop_done; } - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_user_missing_tags, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_user_missing_tags, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_t_13 = (__pyx_t_12 != 0); __pyx_t_11 = __pyx_t_13; __pyx_L9_bool_binop_done:; if (__pyx_t_11) { - /* "pyreadstat/_readstat_writer.pyx":309 + /* "pyreadstat/_readstat_writer.pyx":308 * * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< @@ -5790,26 +5793,26 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT: - /* "pyreadstat/_readstat_writer.pyx":310 + /* "pyreadstat/_readstat_writer.pyx":309 * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: * msg = "missing_user_values not allowed for character variable %s" % variable_name # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_missing_user_values_not_allowed, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_missing_user_values_not_allowed, __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":311 + /* "pyreadstat/_readstat_writer.pyx":310 * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: * 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")) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -5823,14 +5826,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 311, __pyx_L1_error) + __PYX_ERR(0, 310, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":309 + /* "pyreadstat/_readstat_writer.pyx":308 * * if user_missing_tags and value in user_missing_tags: * if curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< @@ -5841,15 +5844,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l default: break; } - /* "pyreadstat/_readstat_writer.pyx":313 + /* "pyreadstat/_readstat_writer.pyx":312 * raise PyreadstatError(msg) * * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_14 = __Pyx_PyObject_Ord(__pyx_v_value); if (unlikely(__pyx_t_14 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 313, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_Ord(__pyx_v_value); if (unlikely(__pyx_t_14 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -5863,14 +5866,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_15 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error) readstat_label_tagged_value(__pyx_v_label_set, __pyx_t_14, __pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":314 + /* "pyreadstat/_readstat_writer.pyx":313 * * readstat_label_tagged_value(label_set, ord(value), label.encode("utf-8")) * continue # <<<<<<<<<<<<<< @@ -5879,7 +5882,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ goto __pyx_L3_continue; - /* "pyreadstat/_readstat_writer.pyx":308 + /* "pyreadstat/_readstat_writer.pyx":307 * raise PyreadstatError(msg) * * if user_missing_tags and value in user_missing_tags: # <<<<<<<<<<<<<< @@ -5888,7 +5891,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":317 + /* "pyreadstat/_readstat_writer.pyx":316 * * * if curpytype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -5898,7 +5901,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l switch (__pyx_v_curpytype) { case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE: - /* "pyreadstat/_readstat_writer.pyx":318 + /* "pyreadstat/_readstat_writer.pyx":317 * * if curpytype == PYWRITER_DOUBLE: * if type(value) not in numeric_types: # <<<<<<<<<<<<<< @@ -5907,22 +5910,22 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 318, __pyx_L1_error) + __PYX_ERR(0, 317, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_t_13 = (__pyx_t_11 != 0); if (unlikely(__pyx_t_13)) { - /* "pyreadstat/_readstat_writer.pyx":319 + /* "pyreadstat/_readstat_writer.pyx":318 * 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")) */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); @@ -5930,20 +5933,20 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GIVEREF(__pyx_v_variable_name); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variable_name); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":320 + /* "pyreadstat/_readstat_writer.pyx":319 * 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")) * */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -5957,14 +5960,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 320, __pyx_L1_error) + __PYX_ERR(0, 319, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":318 + /* "pyreadstat/_readstat_writer.pyx":317 * * if curpytype == PYWRITER_DOUBLE: * if type(value) not in numeric_types: # <<<<<<<<<<<<<< @@ -5973,15 +5976,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":321 + /* "pyreadstat/_readstat_writer.pyx":320 * msg = "variable_value_labels: type of Value %s in variable %s must be numeric" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_double_value(label_set, value, label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_INTEGER: */ - __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -5995,14 +5998,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_17 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L1_error) readstat_label_double_value(__pyx_v_label_set, __pyx_t_16, __pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":317 + /* "pyreadstat/_readstat_writer.pyx":316 * * * if curpytype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -6012,7 +6015,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER: - /* "pyreadstat/_readstat_writer.pyx":324 + /* "pyreadstat/_readstat_writer.pyx":323 * * elif curpytype == PYWRITER_INTEGER: * if type(value) not in int_types: # <<<<<<<<<<<<<< @@ -6021,22 +6024,22 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_int_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 324, __pyx_L1_error) + __PYX_ERR(0, 323, __pyx_L1_error) } - __pyx_t_13 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_NE)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_13 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_int_types, Py_NE)); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) __pyx_t_11 = (__pyx_t_13 != 0); if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":325 + /* "pyreadstat/_readstat_writer.pyx":324 * 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")) */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); @@ -6044,20 +6047,20 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GIVEREF(__pyx_v_variable_name); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variable_name); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va_2, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va_2, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":326 + /* "pyreadstat/_readstat_writer.pyx":325 * if type(value) not in int_types: * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< * readstat_label_int32_value(label_set, value, label.encode("utf-8")) * */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -6071,14 +6074,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 326, __pyx_L1_error) + __PYX_ERR(0, 325, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":324 + /* "pyreadstat/_readstat_writer.pyx":323 * * elif curpytype == PYWRITER_INTEGER: * if type(value) not in int_types: # <<<<<<<<<<<<<< @@ -6087,15 +6090,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":327 + /* "pyreadstat/_readstat_writer.pyx":326 * msg = "variable_value_labels: type of Value %s in variable %s must be int" % (str(value), variable_name) * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, value, label.encode("utf-8")) # <<<<<<<<<<<<<< * * elif curpytype == PYWRITER_LOGICAL: */ - __pyx_t_18 = __Pyx_PyInt_As_int32_t(__pyx_v_value); if (unlikely((__pyx_t_18 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyInt_As_int32_t(__pyx_v_value); if (unlikely((__pyx_t_18 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -6109,14 +6112,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error) readstat_label_int32_value(__pyx_v_label_set, __pyx_t_18, __pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":323 + /* "pyreadstat/_readstat_writer.pyx":322 * readstat_label_double_value(label_set, value, label.encode("utf-8")) * * elif curpytype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< @@ -6126,48 +6129,48 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL: - /* "pyreadstat/_readstat_writer.pyx":330 + /* "pyreadstat/_readstat_writer.pyx":329 * * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): # <<<<<<<<<<<<<< * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject*)&PyBool_Type), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_value)), ((PyObject*)&PyBool_Type), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_13) { } else { __pyx_t_11 = __pyx_t_13; goto __pyx_L14_bool_binop_done; } - __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_value, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_value, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_13) { } else { __pyx_t_11 = __pyx_t_13; goto __pyx_L14_bool_binop_done; } - __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_value, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_value, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __pyx_t_13; __pyx_L14_bool_binop_done:; if (unlikely(__pyx_t_11)) { - /* "pyreadstat/_readstat_writer.pyx":331 + /* "pyreadstat/_readstat_writer.pyx":330 * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); @@ -6175,20 +6178,20 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GIVEREF(__pyx_v_variable_name); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variable_name); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":332 + /* "pyreadstat/_readstat_writer.pyx":331 * if type(value) != bool and (value != 0 and value != 1): * msg = "variable_value_labels: type of Value %s in variable %s must be boolean or be 1 or 0" % (str(value), variable_name) * raise PyreadstatError(msg) # <<<<<<<<<<<<<< * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) * */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -6202,14 +6205,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 332, __pyx_L1_error) + __PYX_ERR(0, 331, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":330 + /* "pyreadstat/_readstat_writer.pyx":329 * * elif curpytype == PYWRITER_LOGICAL: * if type(value) != bool and (value != 0 and value != 1): # <<<<<<<<<<<<<< @@ -6218,18 +6221,18 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":333 + /* "pyreadstat/_readstat_writer.pyx":332 * 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: */ - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_18 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_18 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_18 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -6243,14 +6246,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error) readstat_label_int32_value(__pyx_v_label_set, __pyx_t_18, __pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":329 + /* "pyreadstat/_readstat_writer.pyx":328 * readstat_label_int32_value(label_set, value, label.encode("utf-8")) * * elif curpytype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< @@ -6260,7 +6263,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER: - /* "pyreadstat/_readstat_writer.pyx":335 + /* "pyreadstat/_readstat_writer.pyx":334 * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< @@ -6269,26 +6272,26 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT: - /* "pyreadstat/_readstat_writer.pyx":336 + /* "pyreadstat/_readstat_writer.pyx":335 * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: * value = str(value) # <<<<<<<<<<<<<< * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":337 + /* "pyreadstat/_readstat_writer.pyx":336 * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: * 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): */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -6302,11 +6305,11 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { @@ -6320,15 +6323,15 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_21 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L1_error) readstat_label_string_value(__pyx_v_label_set, __pyx_t_20, __pyx_t_21); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":335 + /* "pyreadstat/_readstat_writer.pyx":334 * readstat_label_int32_value(label_set, int(value), label.encode("utf-8")) * * elif curpytype == PYWRITER_CHARACTER or curpytype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< @@ -6338,7 +6341,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l break; case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE: - /* "pyreadstat/_readstat_writer.pyx":339 + /* "pyreadstat/_readstat_writer.pyx":338 * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME): # <<<<<<<<<<<<<< @@ -6348,7 +6351,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME: case __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME: - /* "pyreadstat/_readstat_writer.pyx":340 + /* "pyreadstat/_readstat_writer.pyx":339 * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME): * if type(value) not in nat_types: # <<<<<<<<<<<<<< @@ -6357,22 +6360,22 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_nat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 340, __pyx_L1_error) + __PYX_ERR(0, 339, __pyx_L1_error) } - __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_nat_types, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_v_10pyreadstat_16_readstat_writer_nat_types, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 339, __pyx_L1_error) __pyx_t_13 = (__pyx_t_11 != 0); if (unlikely(__pyx_t_13)) { - /* "pyreadstat/_readstat_writer.pyx":341 + /* "pyreadstat/_readstat_writer.pyx":340 * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME): * 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) */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); @@ -6380,20 +6383,20 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __Pyx_GIVEREF(__pyx_v_variable_name); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_variable_name); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_type_of_Va_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_msg = __pyx_t_8; __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":342 + /* "pyreadstat/_readstat_writer.pyx":341 * 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")) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -6407,14 +6410,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 342, __pyx_L1_error) + __PYX_ERR(0, 341, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":340 + /* "pyreadstat/_readstat_writer.pyx":339 * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME): * if type(value) not in nat_types: # <<<<<<<<<<<<<< @@ -6423,24 +6426,24 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l */ } - /* "pyreadstat/_readstat_writer.pyx":343 + /* "pyreadstat/_readstat_writer.pyx":342 * 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")) * */ - __pyx_t_16 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curpytype, __pyx_v_value); if (unlikely(__pyx_t_16 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_16 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curpytype, __pyx_v_value); if (unlikely(__pyx_t_16 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error) __pyx_v_double_val = __pyx_t_16; - /* "pyreadstat/_readstat_writer.pyx":344 + /* "pyreadstat/_readstat_writer.pyx":343 * 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 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -6454,14 +6457,14 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_17 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_AsString(__pyx_t_8); if (unlikely((!__pyx_t_17) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L1_error) readstat_label_double_value(__pyx_v_label_set, __pyx_v_double_val, __pyx_t_17); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":339 + /* "pyreadstat/_readstat_writer.pyx":338 * readstat_label_string_value(label_set, value.encode("utf-8"), label.encode("utf-8")) * * elif curpytype in (PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME): # <<<<<<<<<<<<<< @@ -6472,7 +6475,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l default: break; } - /* "pyreadstat/_readstat_writer.pyx":302 + /* "pyreadstat/_readstat_writer.pyx":301 * label_set = readstat_add_label_set(writer, curtype, labelset_name.encode("utf-8")) * * for value, label in value_labels.items(): # <<<<<<<<<<<<<< @@ -6483,7 +6486,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":346 + /* "pyreadstat/_readstat_writer.pyx":345 * readstat_label_double_value(label_set, double_val, label.encode("utf-8")) * * return label_set # <<<<<<<<<<<<<< @@ -6493,7 +6496,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l __pyx_r = __pyx_v_label_set; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":288 + /* "pyreadstat/_readstat_writer.pyx":287 * return result * * cdef readstat_label_set_t *set_value_label(readstat_writer_t *writer, dict value_labels, str labelset_name, # <<<<<<<<<<<<<< @@ -6518,7 +6521,7 @@ static readstat_label_set_t *__pyx_f_10pyreadstat_16_readstat_writer_set_value_l return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":348 +/* "pyreadstat/_readstat_writer.pyx":347 * return label_set * * cdef void add_missing_ranges(list cur_ranges, readstat_variable_t *variable) except *: # <<<<<<<<<<<<<< @@ -6552,7 +6555,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_missing_ranges", 0); - /* "pyreadstat/_readstat_writer.pyx":354 + /* "pyreadstat/_readstat_writer.pyx":353 * """ * * cdef int range_values = 0 # <<<<<<<<<<<<<< @@ -6561,7 +6564,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_range_values = 0; - /* "pyreadstat/_readstat_writer.pyx":355 + /* "pyreadstat/_readstat_writer.pyx":354 * * cdef int range_values = 0 * cdef int discrete_values = 0 # <<<<<<<<<<<<<< @@ -6570,7 +6573,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = 0; - /* "pyreadstat/_readstat_writer.pyx":356 + /* "pyreadstat/_readstat_writer.pyx":355 * cdef int range_values = 0 * cdef int discrete_values = 0 * cdef int discrete_strings = 0 # <<<<<<<<<<<<<< @@ -6579,7 +6582,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = 0; - /* "pyreadstat/_readstat_writer.pyx":358 + /* "pyreadstat/_readstat_writer.pyx":357 * cdef int discrete_strings = 0 * * for cur_range in cur_ranges: # <<<<<<<<<<<<<< @@ -6588,21 +6591,21 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ if (unlikely(__pyx_v_cur_ranges == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 358, __pyx_L1_error) + __PYX_ERR(0, 357, __pyx_L1_error) } __pyx_t_1 = __pyx_v_cur_ranges; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_cur_range, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":359 + /* "pyreadstat/_readstat_writer.pyx":358 * * for cur_range in cur_ranges: * if isinstance(cur_range, dict): # <<<<<<<<<<<<<< @@ -6613,14 +6616,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { - /* "pyreadstat/_readstat_writer.pyx":360 + /* "pyreadstat/_readstat_writer.pyx":359 * 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: */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur_range, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur_range, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6634,20 +6637,20 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_n_s_hi) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_hi); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_hi, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":361 + /* "pyreadstat/_readstat_writer.pyx":360 * 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" */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur_range, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur_range, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6661,13 +6664,13 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_n_s_lo) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_lo); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_lo, __pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":362 + /* "pyreadstat/_readstat_writer.pyx":361 * hi = cur_range.get("hi") * lo = cur_range.get("lo") * if hi is None or lo is None: # <<<<<<<<<<<<<< @@ -6687,7 +6690,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_5)) { - /* "pyreadstat/_readstat_writer.pyx":363 + /* "pyreadstat/_readstat_writer.pyx":362 * 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" # <<<<<<<<<<<<<< @@ -6697,14 +6700,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_dictionaries_in_missing_ranges_m); __pyx_v_msg = __pyx_kp_s_dictionaries_in_missing_ranges_m; - /* "pyreadstat/_readstat_writer.pyx":364 + /* "pyreadstat/_readstat_writer.pyx":363 * 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 hi == lo: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -6718,14 +6721,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 364, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":362 + /* "pyreadstat/_readstat_writer.pyx":361 * hi = cur_range.get("hi") * lo = cur_range.get("lo") * if hi is None or lo is None: # <<<<<<<<<<<<<< @@ -6734,7 +6737,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":365 + /* "pyreadstat/_readstat_writer.pyx":364 * 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: # <<<<<<<<<<<<<< @@ -6743,9 +6746,9 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 365, __pyx_L1_error) + __PYX_ERR(0, 364, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_hi)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_hi)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 364, __pyx_L1_error) __pyx_t_8 = (__pyx_t_4 != 0); if (__pyx_t_8) { } else { @@ -6754,37 +6757,37 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 365, __pyx_L1_error) + __PYX_ERR(0, 364, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_lo)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_lo)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 364, __pyx_L1_error) __pyx_t_4 = (__pyx_t_8 != 0); __pyx_t_5 = __pyx_t_4; __pyx_L10_bool_binop_done:; if (__pyx_t_5) { - /* "pyreadstat/_readstat_writer.pyx":366 + /* "pyreadstat/_readstat_writer.pyx":365 * raise PyreadstatError(msg) * if type(hi) in numeric_types and type(lo) in numeric_types: * if hi == lo: # <<<<<<<<<<<<<< * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) * discrete_values += 1 */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "pyreadstat/_readstat_writer.pyx":367 + /* "pyreadstat/_readstat_writer.pyx":366 * if type(hi) in numeric_types and type(lo) in numeric_types: * if hi == lo: * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) # <<<<<<<<<<<<<< * discrete_values += 1 * else: */ - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_9)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_9)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":368 + /* "pyreadstat/_readstat_writer.pyx":367 * if hi == lo: * check_exit_status(readstat_variable_add_missing_double_value(variable, hi)) * discrete_values += 1 # <<<<<<<<<<<<<< @@ -6793,7 +6796,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = (__pyx_v_discrete_values + 1); - /* "pyreadstat/_readstat_writer.pyx":366 + /* "pyreadstat/_readstat_writer.pyx":365 * raise PyreadstatError(msg) * if type(hi) in numeric_types and type(lo) in numeric_types: * if hi == lo: # <<<<<<<<<<<<<< @@ -6803,7 +6806,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L12; } - /* "pyreadstat/_readstat_writer.pyx":370 + /* "pyreadstat/_readstat_writer.pyx":369 * discrete_values += 1 * else: * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) # <<<<<<<<<<<<<< @@ -6811,11 +6814,11 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject * elif type(hi) == str and type(lo) == str: */ /*else*/ { - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_lo); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L1_error) - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_range(__pyx_v_variable, __pyx_t_9, __pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_lo); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_hi); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_range(__pyx_v_variable, __pyx_t_9, __pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":371 + /* "pyreadstat/_readstat_writer.pyx":370 * else: * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 # <<<<<<<<<<<<<< @@ -6826,7 +6829,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_L12:; - /* "pyreadstat/_readstat_writer.pyx":365 + /* "pyreadstat/_readstat_writer.pyx":364 * 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: # <<<<<<<<<<<<<< @@ -6836,52 +6839,52 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":372 + /* "pyreadstat/_readstat_writer.pyx":371 * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 * elif type(hi) == str and type(lo) == str: # <<<<<<<<<<<<<< * if hi == lo: * if len(hi) > 8: */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_hi)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_hi)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L13_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_lo)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_lo)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_4; __pyx_L13_bool_binop_done:; if (likely(__pyx_t_5)) { - /* "pyreadstat/_readstat_writer.pyx":373 + /* "pyreadstat/_readstat_writer.pyx":372 * range_values += 1 * elif type(hi) == str and type(lo) == str: * if hi == lo: # <<<<<<<<<<<<<< * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_hi, __pyx_v_lo, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_5)) { - /* "pyreadstat/_readstat_writer.pyx":374 + /* "pyreadstat/_readstat_writer.pyx":373 * elif type(hi) == str and type(lo) == str: * if hi == lo: * if len(hi) > 8: # <<<<<<<<<<<<<< * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) */ - __pyx_t_11 = PyObject_Length(__pyx_v_hi); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_11 = PyObject_Length(__pyx_v_hi); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 373, __pyx_L1_error) __pyx_t_5 = ((__pyx_t_11 > 8) != 0); if (unlikely(__pyx_t_5)) { - /* "pyreadstat/_readstat_writer.pyx":375 + /* "pyreadstat/_readstat_writer.pyx":374 * if hi == lo: * if len(hi) > 8: * msg = "missing_ranges: string values length must not be larger than 8" # <<<<<<<<<<<<<< @@ -6891,14 +6894,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_string_values_len); __pyx_v_msg = __pyx_kp_s_missing_ranges_string_values_len; - /* "pyreadstat/_readstat_writer.pyx":376 + /* "pyreadstat/_readstat_writer.pyx":375 * 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 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -6912,14 +6915,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 376, __pyx_L1_error) + __PYX_ERR(0, 375, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":374 + /* "pyreadstat/_readstat_writer.pyx":373 * elif type(hi) == str and type(lo) == str: * if hi == lo: * if len(hi) > 8: # <<<<<<<<<<<<<< @@ -6928,14 +6931,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":377 + /* "pyreadstat/_readstat_writer.pyx":376 * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, hi.encode("utf-8"))) # <<<<<<<<<<<<<< * discrete_strings += 1 * else: */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_hi, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_hi, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -6949,14 +6952,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_12)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_12)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":378 + /* "pyreadstat/_readstat_writer.pyx":377 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, hi.encode("utf-8"))) * discrete_strings += 1 # <<<<<<<<<<<<<< @@ -6965,7 +6968,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = (__pyx_v_discrete_strings + 1); - /* "pyreadstat/_readstat_writer.pyx":373 + /* "pyreadstat/_readstat_writer.pyx":372 * range_values += 1 * elif type(hi) == str and type(lo) == str: * if hi == lo: # <<<<<<<<<<<<<< @@ -6975,7 +6978,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L15; } - /* "pyreadstat/_readstat_writer.pyx":381 + /* "pyreadstat/_readstat_writer.pyx":380 * 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" # <<<<<<<<<<<<<< @@ -6986,14 +6989,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_hi_and_lo_values); __pyx_v_msg = __pyx_kp_s_missing_ranges_hi_and_lo_values; - /* "pyreadstat/_readstat_writer.pyx":382 + /* "pyreadstat/_readstat_writer.pyx":381 * #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" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7007,16 +7010,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 382, __pyx_L1_error) + __PYX_ERR(0, 381, __pyx_L1_error) } __pyx_L15:; - /* "pyreadstat/_readstat_writer.pyx":372 + /* "pyreadstat/_readstat_writer.pyx":371 * check_exit_status(readstat_variable_add_missing_double_range(variable, lo, hi)) * range_values += 1 * elif type(hi) == str and type(lo) == str: # <<<<<<<<<<<<<< @@ -7026,7 +7029,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L9; } - /* "pyreadstat/_readstat_writer.pyx":384 + /* "pyreadstat/_readstat_writer.pyx":383 * raise PyreadstatError(msg) * else: * msg = "missing_ranges: hi and lo values must be both either of numeric or string type" # <<<<<<<<<<<<<< @@ -7037,14 +7040,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_hi_and_lo_values_2); __pyx_v_msg = __pyx_kp_s_missing_ranges_hi_and_lo_values_2; - /* "pyreadstat/_readstat_writer.pyx":385 + /* "pyreadstat/_readstat_writer.pyx":384 * 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: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7058,16 +7061,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 385, __pyx_L1_error) + __PYX_ERR(0, 384, __pyx_L1_error) } __pyx_L9:; - /* "pyreadstat/_readstat_writer.pyx":359 + /* "pyreadstat/_readstat_writer.pyx":358 * * for cur_range in cur_ranges: * if isinstance(cur_range, dict): # <<<<<<<<<<<<<< @@ -7077,7 +7080,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L5; } - /* "pyreadstat/_readstat_writer.pyx":387 + /* "pyreadstat/_readstat_writer.pyx":386 * raise PyreadstatError(msg) * else: * if type(cur_range) in numeric_types: # <<<<<<<<<<<<<< @@ -7087,23 +7090,23 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject /*else*/ { if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 386, __pyx_L1_error) } - __pyx_t_5 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_cur_range)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySet_ContainsTF(((PyObject *)Py_TYPE(__pyx_v_cur_range)), __pyx_v_10pyreadstat_16_readstat_writer_numeric_types, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 386, __pyx_L1_error) __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":388 + /* "pyreadstat/_readstat_writer.pyx":387 * else: * if type(cur_range) in numeric_types: * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) # <<<<<<<<<<<<<< * discrete_values += 1 * elif type(cur_range) == str: */ - __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_cur_range); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_cur_range); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_double_value(__pyx_v_variable, __pyx_t_10)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":389 + /* "pyreadstat/_readstat_writer.pyx":388 * if type(cur_range) in numeric_types: * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 # <<<<<<<<<<<<<< @@ -7112,7 +7115,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_values = (__pyx_v_discrete_values + 1); - /* "pyreadstat/_readstat_writer.pyx":387 + /* "pyreadstat/_readstat_writer.pyx":386 * raise PyreadstatError(msg) * else: * if type(cur_range) in numeric_types: # <<<<<<<<<<<<<< @@ -7122,30 +7125,30 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L17; } - /* "pyreadstat/_readstat_writer.pyx":390 + /* "pyreadstat/_readstat_writer.pyx":389 * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 * elif type(cur_range) == str: # <<<<<<<<<<<<<< * if len(cur_range) > 8: * msg = "missing_ranges: string values length must not be larger than 8" */ - __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_cur_range)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_cur_range)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":391 + /* "pyreadstat/_readstat_writer.pyx":390 * discrete_values += 1 * elif type(cur_range) == str: * if len(cur_range) > 8: # <<<<<<<<<<<<<< * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) */ - __pyx_t_11 = PyObject_Length(__pyx_v_cur_range); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_11 = PyObject_Length(__pyx_v_cur_range); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_t_4 = ((__pyx_t_11 > 8) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":392 + /* "pyreadstat/_readstat_writer.pyx":391 * elif type(cur_range) == str: * if len(cur_range) > 8: * msg = "missing_ranges: string values length must not be larger than 8" # <<<<<<<<<<<<<< @@ -7155,14 +7158,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_string_values_len); __pyx_v_msg = __pyx_kp_s_missing_ranges_string_values_len; - /* "pyreadstat/_readstat_writer.pyx":393 + /* "pyreadstat/_readstat_writer.pyx":392 * 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 */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7176,14 +7179,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 393, __pyx_L1_error) + __PYX_ERR(0, 392, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":391 + /* "pyreadstat/_readstat_writer.pyx":390 * discrete_values += 1 * elif type(cur_range) == str: * if len(cur_range) > 8: # <<<<<<<<<<<<<< @@ -7192,14 +7195,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":394 + /* "pyreadstat/_readstat_writer.pyx":393 * msg = "missing_ranges: string values length must not be larger than 8" * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, cur_range.encode("utf-8"))) # <<<<<<<<<<<<<< * discrete_strings += 1 * else: */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur_range, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur_range, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -7213,14 +7216,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_12)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_variable_add_missing_string_value(__pyx_v_variable, __pyx_t_12)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":395 + /* "pyreadstat/_readstat_writer.pyx":394 * raise PyreadstatError(msg) * check_exit_status(readstat_variable_add_missing_string_value(variable, cur_range.encode("utf-8"))) * discrete_strings += 1 # <<<<<<<<<<<<<< @@ -7229,7 +7232,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ __pyx_v_discrete_strings = (__pyx_v_discrete_strings + 1); - /* "pyreadstat/_readstat_writer.pyx":390 + /* "pyreadstat/_readstat_writer.pyx":389 * check_exit_status(readstat_variable_add_missing_double_value(variable, cur_range)) * discrete_values += 1 * elif type(cur_range) == str: # <<<<<<<<<<<<<< @@ -7239,7 +7242,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject goto __pyx_L17; } - /* "pyreadstat/_readstat_writer.pyx":397 + /* "pyreadstat/_readstat_writer.pyx":396 * discrete_strings += 1 * else: * msg = "missing_ranges: values must be both either of numeric or string type" # <<<<<<<<<<<<<< @@ -7250,14 +7253,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_values_must_be_bo); __pyx_v_msg = __pyx_kp_s_missing_ranges_values_must_be_bo; - /* "pyreadstat/_readstat_writer.pyx":398 + /* "pyreadstat/_readstat_writer.pyx":397 * else: * msg = "missing_ranges: values must be both either of numeric or string type" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< * * if discrete_strings > 3: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7271,18 +7274,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 398, __pyx_L1_error) + __PYX_ERR(0, 397, __pyx_L1_error) } __pyx_L17:; } __pyx_L5:; - /* "pyreadstat/_readstat_writer.pyx":400 + /* "pyreadstat/_readstat_writer.pyx":399 * raise PyreadstatError(msg) * * if discrete_strings > 3: # <<<<<<<<<<<<<< @@ -7292,7 +7295,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_4 = ((__pyx_v_discrete_strings > 3) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":401 + /* "pyreadstat/_readstat_writer.pyx":400 * * if discrete_strings > 3: * msg = "missing_ranges: max 3 string values per variable allowed" # <<<<<<<<<<<<<< @@ -7302,14 +7305,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_max_3_string_valu); __pyx_v_msg = __pyx_kp_s_missing_ranges_max_3_string_valu; - /* "pyreadstat/_readstat_writer.pyx":402 + /* "pyreadstat/_readstat_writer.pyx":401 * if discrete_strings > 3: * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< * if range_values: * if range_values > 1: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7323,14 +7326,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 402, __pyx_L1_error) + __PYX_ERR(0, 401, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":400 + /* "pyreadstat/_readstat_writer.pyx":399 * raise PyreadstatError(msg) * * if discrete_strings > 3: # <<<<<<<<<<<<<< @@ -7339,7 +7342,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":403 + /* "pyreadstat/_readstat_writer.pyx":402 * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) * if range_values: # <<<<<<<<<<<<<< @@ -7349,7 +7352,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_4 = (__pyx_v_range_values != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":404 + /* "pyreadstat/_readstat_writer.pyx":403 * raise PyreadstatError(msg) * if range_values: * if range_values > 1: # <<<<<<<<<<<<<< @@ -7359,7 +7362,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_4 = ((__pyx_v_range_values > 1) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":405 + /* "pyreadstat/_readstat_writer.pyx":404 * if range_values: * if range_values > 1: * msg = "missing_ranges: max 1 range value per variable allowed" # <<<<<<<<<<<<<< @@ -7369,14 +7372,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_max_1_range_value); __pyx_v_msg = __pyx_kp_s_missing_ranges_max_1_range_value; - /* "pyreadstat/_readstat_writer.pyx":406 + /* "pyreadstat/_readstat_writer.pyx":405 * 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" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7390,14 +7393,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 406, __pyx_L1_error) + __PYX_ERR(0, 405, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":404 + /* "pyreadstat/_readstat_writer.pyx":403 * raise PyreadstatError(msg) * if range_values: * if range_values > 1: # <<<<<<<<<<<<<< @@ -7406,7 +7409,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":407 + /* "pyreadstat/_readstat_writer.pyx":406 * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values > 1: # <<<<<<<<<<<<<< @@ -7416,7 +7419,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_4 = ((__pyx_v_discrete_values > 1) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":408 + /* "pyreadstat/_readstat_writer.pyx":407 * raise PyreadstatError(msg) * if discrete_values > 1: * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" # <<<<<<<<<<<<<< @@ -7426,14 +7429,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_max_1_discrete_nu); __pyx_v_msg = __pyx_kp_s_missing_ranges_max_1_discrete_nu; - /* "pyreadstat/_readstat_writer.pyx":409 + /* "pyreadstat/_readstat_writer.pyx":408 * 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" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7447,14 +7450,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 408, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":407 + /* "pyreadstat/_readstat_writer.pyx":406 * msg = "missing_ranges: max 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values > 1: # <<<<<<<<<<<<<< @@ -7463,7 +7466,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":403 + /* "pyreadstat/_readstat_writer.pyx":402 * msg = "missing_ranges: max 3 string values per variable allowed" * raise PyreadstatError(msg) * if range_values: # <<<<<<<<<<<<<< @@ -7472,7 +7475,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":410 + /* "pyreadstat/_readstat_writer.pyx":409 * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values >3: # <<<<<<<<<<<<<< @@ -7482,7 +7485,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __pyx_t_4 = ((__pyx_v_discrete_values > 3) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":411 + /* "pyreadstat/_readstat_writer.pyx":410 * raise PyreadstatError(msg) * if discrete_values >3: * msg = "missing_ranges: max 3 discrete numeric values per variable allowed" # <<<<<<<<<<<<<< @@ -7492,14 +7495,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_INCREF(__pyx_kp_s_missing_ranges_max_3_discrete_nu); __pyx_v_msg = __pyx_kp_s_missing_ranges_max_3_discrete_nu; - /* "pyreadstat/_readstat_writer.pyx":412 + /* "pyreadstat/_readstat_writer.pyx":411 * 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 *: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { @@ -7513,14 +7516,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 412, __pyx_L1_error) + __PYX_ERR(0, 411, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":410 + /* "pyreadstat/_readstat_writer.pyx":409 * msg = "missing_ranges: max 1 discrete numeric value if combined with 1 range value per variable allowed" * raise PyreadstatError(msg) * if discrete_values >3: # <<<<<<<<<<<<<< @@ -7529,7 +7532,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject */ } - /* "pyreadstat/_readstat_writer.pyx":358 + /* "pyreadstat/_readstat_writer.pyx":357 * cdef int discrete_strings = 0 * * for cur_range in cur_ranges: # <<<<<<<<<<<<<< @@ -7539,7 +7542,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":348 + /* "pyreadstat/_readstat_writer.pyx":347 * return label_set * * cdef void add_missing_ranges(list cur_ranges, readstat_variable_t *variable) except *: # <<<<<<<<<<<<<< @@ -7563,7 +7566,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(PyObject __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":414 +/* "pyreadstat/_readstat_writer.pyx":413 * raise PyreadstatError(msg) * * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -7585,18 +7588,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_variable_alignment", 0); - /* "pyreadstat/_readstat_writer.pyx":421 + /* "pyreadstat/_readstat_writer.pyx":420 * cdef readstat_alignment_t alignment * * if alignment_str == "right": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 420, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":422 + /* "pyreadstat/_readstat_writer.pyx":421 * * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT # <<<<<<<<<<<<<< @@ -7605,7 +7608,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_RIGHT; - /* "pyreadstat/_readstat_writer.pyx":421 + /* "pyreadstat/_readstat_writer.pyx":420 * cdef readstat_alignment_t alignment * * if alignment_str == "right": # <<<<<<<<<<<<<< @@ -7615,18 +7618,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":423 + /* "pyreadstat/_readstat_writer.pyx":422 * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 422, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":424 + /* "pyreadstat/_readstat_writer.pyx":423 * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT # <<<<<<<<<<<<<< @@ -7635,7 +7638,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_LEFT; - /* "pyreadstat/_readstat_writer.pyx":423 + /* "pyreadstat/_readstat_writer.pyx":422 * if alignment_str == "right": * alignment = READSTAT_ALIGNMENT_RIGHT * elif alignment_str == "left": # <<<<<<<<<<<<<< @@ -7645,18 +7648,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":425 + /* "pyreadstat/_readstat_writer.pyx":424 * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_center, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_center, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 424, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":426 + /* "pyreadstat/_readstat_writer.pyx":425 * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER # <<<<<<<<<<<<<< @@ -7665,7 +7668,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_CENTER; - /* "pyreadstat/_readstat_writer.pyx":425 + /* "pyreadstat/_readstat_writer.pyx":424 * elif alignment_str == "left": * alignment = READSTAT_ALIGNMENT_LEFT * elif alignment_str == "center": # <<<<<<<<<<<<<< @@ -7675,18 +7678,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":427 + /* "pyreadstat/_readstat_writer.pyx":426 * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": # <<<<<<<<<<<<<< * alignment = READSTAT_ALIGNMENT_UNKNOWN * else: */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_unknown, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alignment_str, __pyx_n_s_unknown, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 426, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":428 + /* "pyreadstat/_readstat_writer.pyx":427 * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": * alignment = READSTAT_ALIGNMENT_UNKNOWN # <<<<<<<<<<<<<< @@ -7695,7 +7698,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ __pyx_v_alignment = READSTAT_ALIGNMENT_UNKNOWN; - /* "pyreadstat/_readstat_writer.pyx":427 + /* "pyreadstat/_readstat_writer.pyx":426 * elif alignment_str == "center": * alignment = READSTAT_ALIGNMENT_CENTER * elif alignment_str == "unknown": # <<<<<<<<<<<<<< @@ -7705,7 +7708,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":430 + /* "pyreadstat/_readstat_writer.pyx":429 * 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) # <<<<<<<<<<<<<< @@ -7713,7 +7716,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads * */ /*else*/ { - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_var_name); __Pyx_GIVEREF(__pyx_v_var_name); @@ -7721,20 +7724,20 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __Pyx_INCREF(__pyx_v_alignment_str); __Pyx_GIVEREF(__pyx_v_alignment_str); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_alignment_str); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_alignment_for_variable_s_must_be, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_alignment_for_variable_s_must_be, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":431 + /* "pyreadstat/_readstat_writer.pyx":430 * 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) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -7748,16 +7751,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads } __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 431, __pyx_L1_error) + __PYX_ERR(0, 430, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":433 + /* "pyreadstat/_readstat_writer.pyx":432 * raise PyreadstatError(msg) * * readstat_variable_set_alignment(variable, alignment) # <<<<<<<<<<<<<< @@ -7766,7 +7769,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads */ readstat_variable_set_alignment(__pyx_v_variable, __pyx_v_alignment); - /* "pyreadstat/_readstat_writer.pyx":414 + /* "pyreadstat/_readstat_writer.pyx":413 * raise PyreadstatError(msg) * * cdef void set_variable_alignment(readstat_variable_t *variable, str alignment_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -7786,7 +7789,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(reads __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":435 +/* "pyreadstat/_readstat_writer.pyx":434 * readstat_variable_set_alignment(variable, alignment) * * cdef void set_variable_display_width(readstat_variable_t *variable, int display_width, str var_name) except *: # <<<<<<<<<<<<<< @@ -7798,7 +7801,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(r __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_variable_display_width", 0); - /* "pyreadstat/_readstat_writer.pyx":440 + /* "pyreadstat/_readstat_writer.pyx":439 * """ * * readstat_variable_set_display_width(variable, display_width) # <<<<<<<<<<<<<< @@ -7807,7 +7810,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(r */ readstat_variable_set_display_width(__pyx_v_variable, __pyx_v_display_width); - /* "pyreadstat/_readstat_writer.pyx":435 + /* "pyreadstat/_readstat_writer.pyx":434 * readstat_variable_set_alignment(variable, alignment) * * cdef void set_variable_display_width(readstat_variable_t *variable, int display_width, str var_name) except *: # <<<<<<<<<<<<<< @@ -7819,7 +7822,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(r __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":442 +/* "pyreadstat/_readstat_writer.pyx":441 * readstat_variable_set_display_width(variable, display_width) * * cdef void set_variable_measure(readstat_variable_t *variable, str measure_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -7841,18 +7844,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_variable_measure", 0); - /* "pyreadstat/_readstat_writer.pyx":449 + /* "pyreadstat/_readstat_writer.pyx":448 * cdef readstat_measure_t measure * * if measure_str == "nominal": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_nominal, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_nominal, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 448, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":450 + /* "pyreadstat/_readstat_writer.pyx":449 * * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL # <<<<<<<<<<<<<< @@ -7861,7 +7864,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_NOMINAL; - /* "pyreadstat/_readstat_writer.pyx":449 + /* "pyreadstat/_readstat_writer.pyx":448 * cdef readstat_measure_t measure * * if measure_str == "nominal": # <<<<<<<<<<<<<< @@ -7871,18 +7874,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":451 + /* "pyreadstat/_readstat_writer.pyx":450 * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_ordinal, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_ordinal, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 450, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "pyreadstat/_readstat_writer.pyx":452 + /* "pyreadstat/_readstat_writer.pyx":451 * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL # <<<<<<<<<<<<<< @@ -7891,7 +7894,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_ORDINAL; - /* "pyreadstat/_readstat_writer.pyx":451 + /* "pyreadstat/_readstat_writer.pyx":450 * if measure_str == "nominal": * measure = READSTAT_MEASURE_NOMINAL * elif measure_str == "ordinal": # <<<<<<<<<<<<<< @@ -7901,18 +7904,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":453 + /* "pyreadstat/_readstat_writer.pyx":452 * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_scale, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_scale, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "pyreadstat/_readstat_writer.pyx":454 + /* "pyreadstat/_readstat_writer.pyx":453 * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE # <<<<<<<<<<<<<< @@ -7921,7 +7924,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_SCALE; - /* "pyreadstat/_readstat_writer.pyx":453 + /* "pyreadstat/_readstat_writer.pyx":452 * elif measure_str == "ordinal": * measure = READSTAT_MEASURE_ORDINAL * elif measure_str == "scale": # <<<<<<<<<<<<<< @@ -7931,18 +7934,18 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":455 + /* "pyreadstat/_readstat_writer.pyx":454 * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": # <<<<<<<<<<<<<< * measure = READSTAT_MEASURE_UNKNOWN * else: */ - __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_unknown, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_measure_str, __pyx_n_s_unknown, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 454, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (likely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":456 + /* "pyreadstat/_readstat_writer.pyx":455 * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": * measure = READSTAT_MEASURE_UNKNOWN # <<<<<<<<<<<<<< @@ -7951,7 +7954,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ __pyx_v_measure = READSTAT_MEASURE_UNKNOWN; - /* "pyreadstat/_readstat_writer.pyx":455 + /* "pyreadstat/_readstat_writer.pyx":454 * elif measure_str == "scale": * measure = READSTAT_MEASURE_SCALE * elif measure_str == "unknown": # <<<<<<<<<<<<<< @@ -7961,7 +7964,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":458 + /* "pyreadstat/_readstat_writer.pyx":457 * 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) # <<<<<<<<<<<<<< @@ -7969,7 +7972,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta * */ /*else*/ { - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_var_name); __Pyx_GIVEREF(__pyx_v_var_name); @@ -7977,20 +7980,20 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __Pyx_INCREF(__pyx_v_measure_str); __Pyx_GIVEREF(__pyx_v_measure_str); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_measure_str); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_measure_for_variable_s_must_be_e, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_measure_for_variable_s_must_be_e, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "pyreadstat/_readstat_writer.pyx":459 + /* "pyreadstat/_readstat_writer.pyx":458 * 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); */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -8004,16 +8007,16 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta } __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 459, __pyx_L1_error) + __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":461 + /* "pyreadstat/_readstat_writer.pyx":460 * raise PyreadstatError(msg) * * readstat_variable_set_measure(variable, measure); # <<<<<<<<<<<<<< @@ -8022,7 +8025,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta */ readstat_variable_set_measure(__pyx_v_variable, __pyx_v_measure); - /* "pyreadstat/_readstat_writer.pyx":442 + /* "pyreadstat/_readstat_writer.pyx":441 * readstat_variable_set_display_width(variable, display_width) * * cdef void set_variable_measure(readstat_variable_t *variable, str measure_str, str var_name) except *: # <<<<<<<<<<<<<< @@ -8042,7 +8045,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(readsta __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":464 +/* "pyreadstat/_readstat_writer.pyx":463 * * * cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx): # <<<<<<<<<<<<<< @@ -8056,7 +8059,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("write_bytes", 0); - /* "pyreadstat/_readstat_writer.pyx":469 + /* "pyreadstat/_readstat_writer.pyx":468 * """ * cdef int fd * fd = (ctx)[0] # <<<<<<<<<<<<<< @@ -8065,7 +8068,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const */ __pyx_v_fd = (((int *)__pyx_v_ctx)[0]); - /* "pyreadstat/_readstat_writer.pyx":470 + /* "pyreadstat/_readstat_writer.pyx":469 * cdef int fd * fd = (ctx)[0] * return write(fd, data, _len) # <<<<<<<<<<<<<< @@ -8075,7 +8078,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const __pyx_r = write(__pyx_v_fd, __pyx_v_data, __pyx_v__len); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":464 + /* "pyreadstat/_readstat_writer.pyx":463 * * * cdef ssize_t write_bytes(const void *data, size_t _len, void *ctx): # <<<<<<<<<<<<<< @@ -8089,7 +8092,7 @@ static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_writer_write_bytes(void const return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":472 +/* "pyreadstat/_readstat_writer.pyx":471 * return write(fd, data, _len) * * cdef void _check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -8110,7 +8113,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_check_exit_status", 0); - /* "pyreadstat/_readstat_writer.pyx":479 + /* "pyreadstat/_readstat_writer.pyx":478 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -8120,7 +8123,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_ __pyx_t_1 = ((__pyx_v_retcode != READSTAT_OK) != 0); if (unlikely(__pyx_t_1)) { - /* "pyreadstat/_readstat_writer.pyx":480 + /* "pyreadstat/_readstat_writer.pyx":479 * cdef str err_message * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) # <<<<<<<<<<<<<< @@ -8129,14 +8132,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_ */ __pyx_v_err_readstat = readstat_error_message(__pyx_v_retcode); - /* "pyreadstat/_readstat_writer.pyx":481 + /* "pyreadstat/_readstat_writer.pyx":480 * if retcode != READSTAT_OK: * err_readstat = readstat_error_message(retcode) * err_message = err_readstat # <<<<<<<<<<<<<< * raise ReadstatError(err_message) * */ - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_err_readstat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); @@ -8144,14 +8147,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_ __pyx_v_err_message = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "pyreadstat/_readstat_writer.pyx":482 + /* "pyreadstat/_readstat_writer.pyx":481 * err_readstat = readstat_error_message(retcode) * err_message = err_readstat * raise ReadstatError(err_message) # <<<<<<<<<<<<<< * * cdef int open_file(str filename_path): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ReadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ReadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -8165,14 +8168,14 @@ static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_ } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_err_message) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_err_message); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 482, __pyx_L1_error) + __PYX_ERR(0, 481, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":479 + /* "pyreadstat/_readstat_writer.pyx":478 * cdef char * err_readstat * cdef str err_message * if retcode != READSTAT_OK: # <<<<<<<<<<<<<< @@ -8181,7 +8184,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_ */ } - /* "pyreadstat/_readstat_writer.pyx":472 + /* "pyreadstat/_readstat_writer.pyx":471 * return write(fd, data, _len) * * cdef void _check_exit_status(readstat_error_t retcode) except *: # <<<<<<<<<<<<<< @@ -8201,7 +8204,7 @@ static void __pyx_f_10pyreadstat_16_readstat_writer__check_exit_status(readstat_ __Pyx_RefNannyFinishContext(); } -/* "pyreadstat/_readstat_writer.pyx":484 +/* "pyreadstat/_readstat_writer.pyx":483 * raise ReadstatError(err_message) * * cdef int open_file(str filename_path): # <<<<<<<<<<<<<< @@ -8227,23 +8230,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open_file", 0); - /* "pyreadstat/_readstat_writer.pyx":495 + /* "pyreadstat/_readstat_writer.pyx":494 * IF PY_MAJOR_VERSION >2: * * if os.name == "nt": # <<<<<<<<<<<<<< * u16_path = PyUnicode_AsWideCharString(filename_path, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":496 + /* "pyreadstat/_readstat_writer.pyx":495 * * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(filename_path, &length) # <<<<<<<<<<<<<< @@ -8252,7 +8255,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_u16_path = PyUnicode_AsWideCharString(__pyx_v_filename_path, (&__pyx_v_length)); - /* "pyreadstat/_readstat_writer.pyx":497 + /* "pyreadstat/_readstat_writer.pyx":496 * if os.name == "nt": * u16_path = PyUnicode_AsWideCharString(filename_path, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY # <<<<<<<<<<<<<< @@ -8261,7 +8264,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_flags = ((_O_WRONLY | _O_CREAT) | _O_BINARY); - /* "pyreadstat/_readstat_writer.pyx":498 + /* "pyreadstat/_readstat_writer.pyx":497 * u16_path = PyUnicode_AsWideCharString(filename_path, &length) * flags = _O_WRONLY | _O_CREAT | _O_BINARY * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) # <<<<<<<<<<<<<< @@ -8270,7 +8273,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_fd = _wsopen(__pyx_v_u16_path, __pyx_v_flags, _SH_DENYRW, (_S_IREAD | _S_IWRITE)); - /* "pyreadstat/_readstat_writer.pyx":495 + /* "pyreadstat/_readstat_writer.pyx":494 * IF PY_MAJOR_VERSION >2: * * if os.name == "nt": # <<<<<<<<<<<<<< @@ -8280,7 +8283,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f goto __pyx_L3; } - /* "pyreadstat/_readstat_writer.pyx":500 + /* "pyreadstat/_readstat_writer.pyx":499 * fd = _wsopen(u16_path, flags, _SH_DENYRW, _S_IREAD | _S_IWRITE) * else: * filename_bytes = filename_path.encode("utf-8") # <<<<<<<<<<<<<< @@ -8288,13 +8291,13 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f * flags = O_WRONLY | O_CREAT | O_TRUNC */ /*else*/ { - __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_filename_path, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_filename_path, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 500, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 499, __pyx_L1_error) __pyx_v_filename_bytes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":501 + /* "pyreadstat/_readstat_writer.pyx":500 * else: * filename_bytes = filename_path.encode("utf-8") * path = filename_bytes # <<<<<<<<<<<<<< @@ -8303,12 +8306,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ if (unlikely(__pyx_v_filename_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 501, __pyx_L1_error) + __PYX_ERR(0, 500, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_filename_bytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) __pyx_v_path = ((char *)__pyx_t_4); - /* "pyreadstat/_readstat_writer.pyx":502 + /* "pyreadstat/_readstat_writer.pyx":501 * filename_bytes = filename_path.encode("utf-8") * path = filename_bytes * flags = O_WRONLY | O_CREAT | O_TRUNC # <<<<<<<<<<<<<< @@ -8317,7 +8320,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f */ __pyx_v_flags = ((O_WRONLY | O_CREAT) | O_TRUNC); - /* "pyreadstat/_readstat_writer.pyx":503 + /* "pyreadstat/_readstat_writer.pyx":502 * path = filename_bytes * flags = O_WRONLY | O_CREAT | O_TRUNC * fd = open(path, flags, 0644) # <<<<<<<<<<<<<< @@ -8328,7 +8331,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f } __pyx_L3:; - /* "pyreadstat/_readstat_writer.pyx":514 + /* "pyreadstat/_readstat_writer.pyx":513 * fd = open(path, flags, 0644) * * return fd # <<<<<<<<<<<<<< @@ -8338,7 +8341,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f __pyx_r = __pyx_v_fd; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":484 + /* "pyreadstat/_readstat_writer.pyx":483 * raise ReadstatError(err_message) * * cdef int open_file(str filename_path): # <<<<<<<<<<<<<< @@ -8358,7 +8361,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_open_file(PyObject *__pyx_v_f return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":516 +/* "pyreadstat/_readstat_writer.pyx":515 * return fd * * cdef int close_file(int fd): # <<<<<<<<<<<<<< @@ -8377,23 +8380,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close_file", 0); - /* "pyreadstat/_readstat_writer.pyx":517 + /* "pyreadstat/_readstat_writer.pyx":516 * * cdef int close_file(int fd): * if os.name == "nt": # <<<<<<<<<<<<<< * return _close(fd) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_nt, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":518 + /* "pyreadstat/_readstat_writer.pyx":517 * cdef int close_file(int fd): * if os.name == "nt": * return _close(fd) # <<<<<<<<<<<<<< @@ -8403,7 +8406,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { __pyx_r = _close(__pyx_v_fd); goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":517 + /* "pyreadstat/_readstat_writer.pyx":516 * * cdef int close_file(int fd): * if os.name == "nt": # <<<<<<<<<<<<<< @@ -8412,7 +8415,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { */ } - /* "pyreadstat/_readstat_writer.pyx":520 + /* "pyreadstat/_readstat_writer.pyx":519 * return _close(fd) * else: * return close(fd) # <<<<<<<<<<<<<< @@ -8424,7 +8427,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { goto __pyx_L0; } - /* "pyreadstat/_readstat_writer.pyx":516 + /* "pyreadstat/_readstat_writer.pyx":515 * return fd * * cdef int close_file(int fd): # <<<<<<<<<<<<<< @@ -8443,7 +8446,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_close_file(int __pyx_v_fd) { return __pyx_r; } -/* "pyreadstat/_readstat_writer.pyx":522 +/* "pyreadstat/_readstat_writer.pyx":521 * return close(fd) * * cdef int run_write(df, str filename_path, dst_file_format file_format, str file_label, list column_labels, # <<<<<<<<<<<<<< @@ -8542,31 +8545,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_RefNannySetupContext("run_write", 0); __Pyx_INCREF(__pyx_v_filename_path); - /* "pyreadstat/_readstat_writer.pyx":536 + /* "pyreadstat/_readstat_writer.pyx":535 * raise PyreadstatError("Writing API not supported on python 2 on windows") * * if not isinstance(df, pd.DataFrame): # <<<<<<<<<<<<<< * raise PyreadstatError("first argument must be a pandas data frame") * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_IsInstance(__pyx_v_df, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_3 = PyObject_IsInstance(__pyx_v_df, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":537 + /* "pyreadstat/_readstat_writer.pyx":536 * * if not isinstance(df, pd.DataFrame): * raise PyreadstatError("first argument must be a pandas data frame") # <<<<<<<<<<<<<< * * if variable_value_labels: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -8580,14 +8583,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_s_first_argument_must_be_a_pandas) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_first_argument_must_be_a_pandas); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 537, __pyx_L1_error) + __PYX_ERR(0, 536, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":536 + /* "pyreadstat/_readstat_writer.pyx":535 * raise PyreadstatError("Writing API not supported on python 2 on windows") * * if not isinstance(df, pd.DataFrame): # <<<<<<<<<<<<<< @@ -8596,17 +8599,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":539 + /* "pyreadstat/_readstat_writer.pyx":538 * 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: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 538, __pyx_L1_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":540 + /* "pyreadstat/_readstat_writer.pyx":539 * * if variable_value_labels: * for k,v in variable_value_labels.items(): # <<<<<<<<<<<<<< @@ -8615,17 +8618,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 540, __pyx_L1_error) + __PYX_ERR(0, 539, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_variable_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_variable_value_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -8633,17 +8636,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 539, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 539, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -8653,7 +8656,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 540, __pyx_L1_error) + else __PYX_ERR(0, 539, __pyx_L1_error) } break; } @@ -8665,7 +8668,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 540, __pyx_L1_error) + __PYX_ERR(0, 539, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8678,15 +8681,15 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __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, 540, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -8694,7 +8697,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -8702,7 +8705,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 540, __pyx_L1_error) + __PYX_ERR(0, 539, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); @@ -8710,28 +8713,28 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":541 + /* "pyreadstat/_readstat_writer.pyx":540 * if variable_value_labels: * for k,v in variable_value_labels.items(): * if type(v) != dict: # <<<<<<<<<<<<<< * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) * raise PyreadstatError(msg) */ - __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_v)), ((PyObject *)(&PyDict_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":542 + /* "pyreadstat/_readstat_writer.pyx":541 * for k,v in variable_value_labels.items(): * if type(v) != dict: * msg = "variable_value_labels: value for key %s must be dict, got %s" % (k, str(type(v))) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_v))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_v))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); @@ -8739,20 +8742,20 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_value_for, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_variable_value_labels_value_for, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_msg = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":543 + /* "pyreadstat/_readstat_writer.pyx":542 * 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: */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { @@ -8766,14 +8769,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 543, __pyx_L1_error) + __PYX_ERR(0, 542, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":541 + /* "pyreadstat/_readstat_writer.pyx":540 * if variable_value_labels: * for k,v in variable_value_labels.items(): * if type(v) != dict: # <<<<<<<<<<<<<< @@ -8782,7 +8785,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":540 + /* "pyreadstat/_readstat_writer.pyx":539 * * if variable_value_labels: * for k,v in variable_value_labels.items(): # <<<<<<<<<<<<<< @@ -8792,7 +8795,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":539 + /* "pyreadstat/_readstat_writer.pyx":538 * raise PyreadstatError("first argument must be a pandas data frame") * * if variable_value_labels: # <<<<<<<<<<<<<< @@ -8801,17 +8804,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":545 + /* "pyreadstat/_readstat_writer.pyx":544 * raise PyreadstatError(msg) * * if missing_user_values: # <<<<<<<<<<<<<< * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 544, __pyx_L1_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":546 + /* "pyreadstat/_readstat_writer.pyx":545 * * if missing_user_values: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -8821,7 +8824,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA: - /* "pyreadstat/_readstat_writer.pyx":547 + /* "pyreadstat/_readstat_writer.pyx":546 * if missing_user_values: * if file_format == FILE_FORMAT_DTA: * valid_user_missing = valid_user_missing_stata # <<<<<<<<<<<<<< @@ -8831,7 +8834,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata); __pyx_v_valid_user_missing = __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata; - /* "pyreadstat/_readstat_writer.pyx":546 + /* "pyreadstat/_readstat_writer.pyx":545 * * if missing_user_values: * if file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -8841,7 +8844,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BDAT: - /* "pyreadstat/_readstat_writer.pyx":548 + /* "pyreadstat/_readstat_writer.pyx":547 * 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: # <<<<<<<<<<<<<< @@ -8850,7 +8853,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BCAT: - /* "pyreadstat/_readstat_writer.pyx":549 + /* "pyreadstat/_readstat_writer.pyx":548 * 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 # <<<<<<<<<<<<<< @@ -8860,7 +8863,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas); __pyx_v_valid_user_missing = __pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas; - /* "pyreadstat/_readstat_writer.pyx":548 + /* "pyreadstat/_readstat_writer.pyx":547 * 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: # <<<<<<<<<<<<<< @@ -8871,7 +8874,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d default: break; } - /* "pyreadstat/_readstat_writer.pyx":550 + /* "pyreadstat/_readstat_writer.pyx":549 * 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(): # <<<<<<<<<<<<<< @@ -8880,17 +8883,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); - __PYX_ERR(0, 550, __pyx_L1_error) + __PYX_ERR(0, 549, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_missing_user_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_missing_user_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 549, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -8898,17 +8901,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 549, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 549, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -8918,7 +8921,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 550, __pyx_L1_error) + else __PYX_ERR(0, 549, __pyx_L1_error) } break; } @@ -8930,7 +8933,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 550, __pyx_L1_error) + __PYX_ERR(0, 549, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8943,15 +8946,15 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -8959,7 +8962,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 549, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L14_unpacking_done; @@ -8967,7 +8970,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 550, __pyx_L1_error) + __PYX_ERR(0, 549, __pyx_L1_error) __pyx_L14_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_8); @@ -8975,7 +8978,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_missing_values, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":551 + /* "pyreadstat/_readstat_writer.pyx":550 * valid_user_missing = valid_user_missing_sas * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): # <<<<<<<<<<<<<< @@ -8986,7 +8989,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); if (unlikely(__pyx_t_3)) { - /* "pyreadstat/_readstat_writer.pyx":552 + /* "pyreadstat/_readstat_writer.pyx":551 * 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" # <<<<<<<<<<<<<< @@ -8996,14 +8999,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_kp_s_missing_user_values_values_in_di); __pyx_v_msg = __pyx_kp_s_missing_user_values_values_in_di; - /* "pyreadstat/_readstat_writer.pyx":553 + /* "pyreadstat/_readstat_writer.pyx":552 * 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: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -9017,14 +9020,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 553, __pyx_L1_error) + __PYX_ERR(0, 552, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":551 + /* "pyreadstat/_readstat_writer.pyx":550 * valid_user_missing = valid_user_missing_sas * for key, missing_values in missing_user_values.items(): * if not isinstance(missing_values, list): # <<<<<<<<<<<<<< @@ -9033,7 +9036,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":554 + /* "pyreadstat/_readstat_writer.pyx":553 * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) * for val in missing_values: # <<<<<<<<<<<<<< @@ -9044,26 +9047,26 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = __pyx_v_missing_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_missing_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_missing_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_12 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 553, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -9073,7 +9076,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 554, __pyx_L1_error) + else __PYX_ERR(0, 553, __pyx_L1_error) } break; } @@ -9082,41 +9085,41 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":555 + /* "pyreadstat/_readstat_writer.pyx":554 * raise PyreadstatError(msg) * for val in missing_values: * if val not in valid_user_missing: # <<<<<<<<<<<<<< * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) * raise PyreadstatError(msg) */ - if (unlikely(!__pyx_v_valid_user_missing)) { __Pyx_RaiseUnboundLocalError("valid_user_missing"); __PYX_ERR(0, 555, __pyx_L1_error) } - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_val, __pyx_v_valid_user_missing, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(!__pyx_v_valid_user_missing)) { __Pyx_RaiseUnboundLocalError("valid_user_missing"); __PYX_ERR(0, 554, __pyx_L1_error) } + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_val, __pyx_v_valid_user_missing, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 554, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":556 + /* "pyreadstat/_readstat_writer.pyx":555 * for val in missing_values: * if val not in valid_user_missing: * msg = "missing_user_values supports values a to z for Stata and A to Z and _ for SAS, got %s instead" % str(val) # <<<<<<<<<<<<<< * raise PyreadstatError(msg) * */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyString_FormatSafe(__pyx_kp_s_missing_user_values_supports_val, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyString_FormatSafe(__pyx_kp_s_missing_user_values_supports_val, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_msg = __pyx_t_8; __pyx_t_8 = 0; - /* "pyreadstat/_readstat_writer.pyx":557 + /* "pyreadstat/_readstat_writer.pyx":556 * 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 */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -9130,14 +9133,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 557, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 557, __pyx_L1_error) + __PYX_ERR(0, 556, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":555 + /* "pyreadstat/_readstat_writer.pyx":554 * raise PyreadstatError(msg) * for val in missing_values: * if val not in valid_user_missing: # <<<<<<<<<<<<<< @@ -9146,7 +9149,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":554 + /* "pyreadstat/_readstat_writer.pyx":553 * msg = "missing_user_values: values in dictionary must be list" * raise PyreadstatError(msg) * for val in missing_values: # <<<<<<<<<<<<<< @@ -9156,7 +9159,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":550 + /* "pyreadstat/_readstat_writer.pyx":549 * 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(): # <<<<<<<<<<<<<< @@ -9166,7 +9169,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":545 + /* "pyreadstat/_readstat_writer.pyx":544 * raise PyreadstatError(msg) * * if missing_user_values: # <<<<<<<<<<<<<< @@ -9175,19 +9178,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":568 + /* "pyreadstat/_readstat_writer.pyx":567 * cdef char *file_labl * * cdef list col_names = df.columns.values.tolist() # <<<<<<<<<<<<<< * * for variable_name in col_names: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_tolist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_tolist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -9202,14 +9205,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 568, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 567, __pyx_L1_error) __pyx_v_col_names = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":570 + /* "pyreadstat/_readstat_writer.pyx":569 * cdef list col_names = df.columns.values.tolist() * * for variable_name in col_names: # <<<<<<<<<<<<<< @@ -9218,44 +9221,44 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 570, __pyx_L1_error) + __PYX_ERR(0, 569, __pyx_L1_error) } __pyx_t_2 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_1); __pyx_t_1 = 0; - /* "pyreadstat/_readstat_writer.pyx":571 + /* "pyreadstat/_readstat_writer.pyx":570 * * for variable_name in col_names: * if type(variable_name) != str: # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_variable_name)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":572 + /* "pyreadstat/_readstat_writer.pyx":571 * for variable_name in col_names: * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) # <<<<<<<<<<<<<< * if not variable_name[0].isalpha(): * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_v_variable_name))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_variable_name); __Pyx_GIVEREF(__pyx_v_variable_name); @@ -9263,7 +9266,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_is_of_type_s_and, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_is_of_type_s_and, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -9279,14 +9282,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 572, __pyx_L1_error) + __PYX_ERR(0, 571, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":571 + /* "pyreadstat/_readstat_writer.pyx":570 * * for variable_name in col_names: * if type(variable_name) != str: # <<<<<<<<<<<<<< @@ -9295,16 +9298,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":573 + /* "pyreadstat/_readstat_writer.pyx":572 * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isalpha); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_isalpha); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -9319,32 +9322,32 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_4) != 0); if (unlikely(__pyx_t_3)) { - /* "pyreadstat/_readstat_writer.pyx":574 + /* "pyreadstat/_readstat_writer.pyx":573 * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) # <<<<<<<<<<<<<< * if " " in variable_name: * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_variable_name, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_t_9); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_t_9); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_variable_name); __Pyx_GIVEREF(__pyx_v_variable_name); @@ -9355,7 +9358,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_starts_with_an_i, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_variable_name_s_starts_with_an_i, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; @@ -9371,14 +9374,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 574, __pyx_L1_error) + __PYX_ERR(0, 573, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":573 + /* "pyreadstat/_readstat_writer.pyx":572 * if type(variable_name) != str: * raise PyreadstatError("variable name '%s' is of type %s and it must be str (not starting with numbers!)" % (variable_name, str(type(variable_name)))) * if not variable_name[0].isalpha(): # <<<<<<<<<<<<<< @@ -9387,27 +9390,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":575 + /* "pyreadstat/_readstat_writer.pyx":574 * if not variable_name[0].isalpha(): * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: # <<<<<<<<<<<<<< * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * */ - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__2, __pyx_v_variable_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__2, __pyx_v_variable_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 574, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":576 + /* "pyreadstat/_readstat_writer.pyx":575 * raise PyreadstatError("variable name '%s' starts with an illegal (non-alphabetic) character: '%s' (ordinal %s)" % (variable_name, variable_name[0], ord(variable_name[0]))) * if " " in variable_name: * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) # <<<<<<<<<<<<<< * * if file_format == FILE_FORMAT_POR: */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyString_FormatSafe(__pyx_kp_s_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyString_FormatSafe(__pyx_kp_s_variable_name_s_contains_a_space, __pyx_v_variable_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { @@ -9422,14 +9425,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 576, __pyx_L1_error) + __PYX_ERR(0, 575, __pyx_L1_error) - /* "pyreadstat/_readstat_writer.pyx":575 + /* "pyreadstat/_readstat_writer.pyx":574 * 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: # <<<<<<<<<<<<<< @@ -9438,7 +9441,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":570 + /* "pyreadstat/_readstat_writer.pyx":569 * cdef list col_names = df.columns.values.tolist() * * for variable_name in col_names: # <<<<<<<<<<<<<< @@ -9448,7 +9451,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":578 + /* "pyreadstat/_readstat_writer.pyx":577 * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -9458,31 +9461,31 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = ((__pyx_v_file_format == __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR) != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":579 + /* "pyreadstat/_readstat_writer.pyx":578 * * if file_format == FILE_FORMAT_POR: * col_names = [x.upper() for x in col_names] # <<<<<<<<<<<<<< * * cdef list col_types = get_pandas_column_types(df, missing_user_values) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 579, __pyx_L1_error) + __PYX_ERR(0, 578, __pyx_L1_error) } __pyx_t_1 = __pyx_v_col_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 578, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { @@ -9496,17 +9499,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 579, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_col_names, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":578 + /* "pyreadstat/_readstat_writer.pyx":577 * raise PyreadstatError("variable name '%s' contains a space, which is not allowed" % variable_name) * * if file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -9515,29 +9518,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":581 + /* "pyreadstat/_readstat_writer.pyx":580 * col_names = [x.upper() for x in col_names] * * cdef list col_types = get_pandas_column_types(df, missing_user_values) # <<<<<<<<<<<<<< * cdef int row_count = len(df) * cdef int col_count = len(col_names) */ - __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types(__pyx_v_df, __pyx_v_missing_user_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __pyx_f_10pyreadstat_16_readstat_writer_get_pandas_column_types(__pyx_v_df, __pyx_v_missing_user_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_col_types = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":582 + /* "pyreadstat/_readstat_writer.pyx":581 * * cdef list col_types = get_pandas_column_types(df, missing_user_values) * cdef int row_count = len(df) # <<<<<<<<<<<<<< * cdef int col_count = len(col_names) * cdef dict col_names_to_types = {k:v[0] for k,v in zip(col_names, col_types)} */ - __pyx_t_6 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 581, __pyx_L1_error) __pyx_v_row_count = __pyx_t_6; - /* "pyreadstat/_readstat_writer.pyx":583 + /* "pyreadstat/_readstat_writer.pyx":582 * cdef list col_types = get_pandas_column_types(df, missing_user_values) * cdef int row_count = len(df) * cdef int col_count = len(col_names) # <<<<<<<<<<<<<< @@ -9546,12 +9549,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 583, __pyx_L1_error) + __PYX_ERR(0, 582, __pyx_L1_error) } - __pyx_t_6 = PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_6 = PyList_GET_SIZE(__pyx_v_col_names); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) __pyx_v_col_count = __pyx_t_6; - /* "pyreadstat/_readstat_writer.pyx":584 + /* "pyreadstat/_readstat_writer.pyx":583 * 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)} # <<<<<<<<<<<<<< @@ -9559,9 +9562,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * cdef readstat_variable_t *variable */ { /* enter inner scope */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_col_names); __Pyx_GIVEREF(__pyx_v_col_names); @@ -9569,16 +9572,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_v_col_types); __Pyx_GIVEREF(__pyx_v_col_types); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_col_types); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 583, __pyx_L29_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -9586,17 +9589,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 583, __pyx_L29_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 583, __pyx_L29_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -9606,7 +9609,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 584, __pyx_L29_error) + else __PYX_ERR(0, 583, __pyx_L29_error) } break; } @@ -9618,7 +9621,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 584, __pyx_L29_error) + __PYX_ERR(0, 583, __pyx_L29_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -9631,15 +9634,15 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_14); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_14); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -9647,7 +9650,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_14 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_14)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 584, __pyx_L29_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 583, __pyx_L29_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L33_unpacking_done; @@ -9655,16 +9658,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 584, __pyx_L29_error) + __PYX_ERR(0, 583, __pyx_L29_error) __pyx_L33_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_k, __pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_14); __pyx_t_14 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L29_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_7genexpr__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 584, __pyx_L29_error) + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_k, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 583, __pyx_L29_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9680,7 +9683,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_v_col_names_to_types = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":592 + /* "pyreadstat/_readstat_writer.pyx":591 * cdef int col_indx * cdef bytes cur_col_label * cdef int col_label_count = 0 # <<<<<<<<<<<<<< @@ -9689,7 +9692,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_col_label_count = 0; - /* "pyreadstat/_readstat_writer.pyx":601 + /* "pyreadstat/_readstat_writer.pyx":600 * cdef object values * cdef dict value_labels * cdef int lblset_cnt = 0 # <<<<<<<<<<<<<< @@ -9698,19 +9701,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_lblset_cnt = 0; - /* "pyreadstat/_readstat_writer.pyx":604 + /* "pyreadstat/_readstat_writer.pyx":603 * cdef readstat_label_set_t *label_set * * filename_path = os.path.expanduser(filename_path) # <<<<<<<<<<<<<< * cdef int fd = open_file(filename_path) * writer = readstat_writer_init() */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -9725,14 +9728,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_filename_path) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_filename_path); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 604, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_filename_path, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":605 + /* "pyreadstat/_readstat_writer.pyx":604 * * filename_path = os.path.expanduser(filename_path) * cdef int fd = open_file(filename_path) # <<<<<<<<<<<<<< @@ -9741,7 +9744,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_fd = __pyx_f_10pyreadstat_16_readstat_writer_open_file(__pyx_v_filename_path); - /* "pyreadstat/_readstat_writer.pyx":606 + /* "pyreadstat/_readstat_writer.pyx":605 * filename_path = os.path.expanduser(filename_path) * cdef int fd = open_file(filename_path) * writer = readstat_writer_init() # <<<<<<<<<<<<<< @@ -9750,7 +9753,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_writer = readstat_writer_init(); - /* "pyreadstat/_readstat_writer.pyx":608 + /* "pyreadstat/_readstat_writer.pyx":607 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -9767,39 +9770,39 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { - /* "pyreadstat/_readstat_writer.pyx":610 + /* "pyreadstat/_readstat_writer.pyx":609 * try: * * check_exit_status(readstat_set_data_writer(writer, write_bytes)) # <<<<<<<<<<<<<< * * if file_label: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_data_writer(__pyx_v_writer, __pyx_f_10pyreadstat_16_readstat_writer_write_bytes)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_set_data_writer(__pyx_v_writer, __pyx_f_10pyreadstat_16_readstat_writer_write_bytes)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":612 + /* "pyreadstat/_readstat_writer.pyx":611 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) * * if file_label: # <<<<<<<<<<<<<< * file_label_bytes = file_label.encode("utf-8") * file_labl = file_label_bytes */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_file_label); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 612, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_file_label); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 611, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":613 + /* "pyreadstat/_readstat_writer.pyx":612 * * if file_label: * file_label_bytes = file_label.encode("utf-8") # <<<<<<<<<<<<<< * file_labl = file_label_bytes * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) */ - __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_file_label, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L38_error) + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_file_label, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 613, __pyx_L38_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 612, __pyx_L38_error) __pyx_v_file_label_bytes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":614 + /* "pyreadstat/_readstat_writer.pyx":613 * if file_label: * file_label_bytes = file_label.encode("utf-8") * file_labl = file_label_bytes # <<<<<<<<<<<<<< @@ -9808,21 +9811,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_file_label_bytes == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 614, __pyx_L38_error) + __PYX_ERR(0, 613, __pyx_L38_error) } - __pyx_t_18 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L38_error) + __pyx_t_18 = __Pyx_PyBytes_AsWritableString(__pyx_v_file_label_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L38_error) __pyx_v_file_labl = ((char *)__pyx_t_18); - /* "pyreadstat/_readstat_writer.pyx":615 + /* "pyreadstat/_readstat_writer.pyx":614 * file_label_bytes = file_label.encode("utf-8") * file_labl = file_label_bytes * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) # <<<<<<<<<<<<<< * * if note: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_label(__pyx_v_writer, __pyx_v_file_labl)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_label(__pyx_v_writer, __pyx_v_file_labl)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":612 + /* "pyreadstat/_readstat_writer.pyx":611 * check_exit_status(readstat_set_data_writer(writer, write_bytes)) * * if file_label: # <<<<<<<<<<<<<< @@ -9831,30 +9834,30 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":617 + /* "pyreadstat/_readstat_writer.pyx":616 * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) * * if note: # <<<<<<<<<<<<<< * readstat_add_note(writer, note.encode("utf-8")) * */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 617, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_note); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 616, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":618 + /* "pyreadstat/_readstat_writer.pyx":617 * * if note: * readstat_add_note(writer, note.encode("utf-8")) # <<<<<<<<<<<<<< * * if file_format_version > -1: */ - __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_note, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L38_error) + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_note, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L38_error) + __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L38_error) readstat_add_note(__pyx_v_writer, __pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":617 + /* "pyreadstat/_readstat_writer.pyx":616 * check_exit_status(readstat_writer_set_file_label(writer, file_labl)) * * if note: # <<<<<<<<<<<<<< @@ -9863,7 +9866,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":620 + /* "pyreadstat/_readstat_writer.pyx":619 * readstat_add_note(writer, note.encode("utf-8")) * * if file_format_version > -1: # <<<<<<<<<<<<<< @@ -9873,16 +9876,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = ((__pyx_v_file_format_version > -1L) != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":621 + /* "pyreadstat/_readstat_writer.pyx":620 * * if file_format_version > -1: * check_exit_status(readstat_writer_set_file_format_version(writer, file_format_version)) # <<<<<<<<<<<<<< * * # table name is used only for xpt files */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_format_version(__pyx_v_writer, __pyx_v_file_format_version)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_file_format_version(__pyx_v_writer, __pyx_v_file_format_version)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":620 + /* "pyreadstat/_readstat_writer.pyx":619 * readstat_add_note(writer, note.encode("utf-8")) * * if file_format_version > -1: # <<<<<<<<<<<<<< @@ -9891,48 +9894,48 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":624 + /* "pyreadstat/_readstat_writer.pyx":623 * * # table name is used only for xpt files * if table_name: # <<<<<<<<<<<<<< * table_name_bytes = table_name.encode("utf-8") * tab_name = table_name_bytes */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_table_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 624, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_table_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 623, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":625 + /* "pyreadstat/_readstat_writer.pyx":624 * # table name is used only for xpt files * if table_name: * table_name_bytes = table_name.encode("utf-8") # <<<<<<<<<<<<<< * tab_name = table_name_bytes * check_exit_status(readstat_writer_set_table_name(writer, tab_name)) */ - __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_table_name, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L38_error) + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_table_name, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_table_name_bytes = __pyx_t_2; __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":626 + /* "pyreadstat/_readstat_writer.pyx":625 * if table_name: * table_name_bytes = table_name.encode("utf-8") * tab_name = table_name_bytes # <<<<<<<<<<<<<< * check_exit_status(readstat_writer_set_table_name(writer, tab_name)) * */ - __pyx_t_18 = __Pyx_PyObject_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L38_error) + __pyx_t_18 = __Pyx_PyObject_AsWritableString(__pyx_v_table_name_bytes); if (unlikely((!__pyx_t_18) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L38_error) __pyx_v_tab_name = ((char *)__pyx_t_18); - /* "pyreadstat/_readstat_writer.pyx":627 + /* "pyreadstat/_readstat_writer.pyx":626 * table_name_bytes = table_name.encode("utf-8") * tab_name = table_name_bytes * check_exit_status(readstat_writer_set_table_name(writer, tab_name)) # <<<<<<<<<<<<<< * * # add variables */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_table_name(__pyx_v_writer, __pyx_v_tab_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 627, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_writer_set_table_name(__pyx_v_writer, __pyx_v_tab_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":624 + /* "pyreadstat/_readstat_writer.pyx":623 * * # table name is used only for xpt files * if table_name: # <<<<<<<<<<<<<< @@ -9941,7 +9944,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":630 + /* "pyreadstat/_readstat_writer.pyx":629 * * # add variables * if column_labels: # <<<<<<<<<<<<<< @@ -9951,7 +9954,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = (__pyx_v_column_labels != Py_None)&&(PyList_GET_SIZE(__pyx_v_column_labels) != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":631 + /* "pyreadstat/_readstat_writer.pyx":630 * # add variables * if column_labels: * col_label_count = len(column_labels) # <<<<<<<<<<<<<< @@ -9960,12 +9963,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_column_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 631, __pyx_L38_error) + __PYX_ERR(0, 630, __pyx_L38_error) } - __pyx_t_6 = PyList_GET_SIZE(__pyx_v_column_labels); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 631, __pyx_L38_error) + __pyx_t_6 = PyList_GET_SIZE(__pyx_v_column_labels); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 630, __pyx_L38_error) __pyx_v_col_label_count = __pyx_t_6; - /* "pyreadstat/_readstat_writer.pyx":632 + /* "pyreadstat/_readstat_writer.pyx":631 * if column_labels: * col_label_count = len(column_labels) * if col_label_count != col_count: # <<<<<<<<<<<<<< @@ -9975,14 +9978,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_4 = ((__pyx_v_col_label_count != __pyx_v_col_count) != 0); if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":633 + /* "pyreadstat/_readstat_writer.pyx":632 * col_label_count = len(column_labels) * if col_label_count != col_count: * raise PyreadstatError("length of column labels must be the same as number of columns") # <<<<<<<<<<<<<< * * for col_indx in range(col_count): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L38_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -9996,14 +9999,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_kp_s_length_of_column_labels_must_be) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_length_of_column_labels_must_be); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L38_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 633, __pyx_L38_error) + __PYX_ERR(0, 632, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":632 + /* "pyreadstat/_readstat_writer.pyx":631 * if column_labels: * col_label_count = len(column_labels) * if col_label_count != col_count: # <<<<<<<<<<<<<< @@ -10012,7 +10015,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":630 + /* "pyreadstat/_readstat_writer.pyx":629 * * # add variables * if column_labels: # <<<<<<<<<<<<<< @@ -10021,7 +10024,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":635 + /* "pyreadstat/_readstat_writer.pyx":634 * raise PyreadstatError("length of column labels must be the same as number of columns") * * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -10033,7 +10036,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":636 + /* "pyreadstat/_readstat_writer.pyx":635 * * for col_indx in range(col_count): * curtype, max_length, _ = col_types[col_indx] # <<<<<<<<<<<<<< @@ -10042,9 +10045,9 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 636, __pyx_L38_error) + __PYX_ERR(0, 635, __pyx_L38_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L38_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; @@ -10052,7 +10055,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 636, __pyx_L38_error) + __PYX_ERR(0, 635, __pyx_L38_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -10068,17 +10071,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_14); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L38_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 636, __pyx_L38_error) + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 636, __pyx_L38_error) + __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 635, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); #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, 636, __pyx_L38_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 635, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -10088,7 +10091,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_14 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_14)) goto __pyx_L52_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 636, __pyx_L38_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 635, __pyx_L38_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L53_unpacking_done; @@ -10096,19 +10099,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 636, __pyx_L38_error) + __PYX_ERR(0, 635, __pyx_L38_error) __pyx_L53_unpacking_done:; } - __pyx_t_23 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L38_error) + __pyx_t_23 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 635, __pyx_L38_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L38_error) + __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 635, __pyx_L38_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_curtype = __pyx_t_23; __pyx_v_max_length = __pyx_t_24; __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":639 + /* "pyreadstat/_readstat_writer.pyx":638 * #if file_format == FILE_FORMAT_XPORT and curtype == PYWRITER_DOUBLE: * # max_length = 8 * variable_name = col_names[col_indx] # <<<<<<<<<<<<<< @@ -10117,21 +10120,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 639, __pyx_L38_error) + __PYX_ERR(0, 638, __pyx_L38_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L38_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_variable_name, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":640 + /* "pyreadstat/_readstat_writer.pyx":639 * # max_length = 8 * variable_name = col_names[col_indx] * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) # <<<<<<<<<<<<<< * if curtype in pyrwriter_datetimelike_types: * curformat = get_datetimelike_format_for_readstat(file_format, curtype) */ - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_variable_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 640, __pyx_L38_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_variable_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 639, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { @@ -10145,43 +10148,43 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_5, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L38_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_25 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_25) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L38_error) + __pyx_t_25 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_25) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L38_error) if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 640, __pyx_L38_error) + __PYX_ERR(0, 639, __pyx_L38_error) } - __pyx_t_14 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 640, __pyx_L38_error) + __pyx_t_14 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 639, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 640, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_26 = ((readstat_type_t)__Pyx_PyInt_As_readstat_type_t(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L38_error) + __pyx_t_26 = ((readstat_type_t)__Pyx_PyInt_As_readstat_type_t(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L38_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_variable = readstat_add_variable(__pyx_v_writer, __pyx_t_25, __pyx_t_26, __pyx_v_max_length); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":641 + /* "pyreadstat/_readstat_writer.pyx":640 * variable_name = col_names[col_indx] * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) * if curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) */ - __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L38_error) + __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 641, __pyx_L38_error) + __PYX_ERR(0, 640, __pyx_L38_error) } - __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 641, __pyx_L38_error) + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 640, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":642 + /* "pyreadstat/_readstat_writer.pyx":641 * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) * if curtype in pyrwriter_datetimelike_types: * curformat = get_datetimelike_format_for_readstat(file_format, curtype) # <<<<<<<<<<<<<< @@ -10190,7 +10193,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_curformat = __pyx_f_10pyreadstat_16_readstat_writer_get_datetimelike_format_for_readstat(__pyx_v_file_format, __pyx_v_curtype); - /* "pyreadstat/_readstat_writer.pyx":643 + /* "pyreadstat/_readstat_writer.pyx":642 * if curtype in pyrwriter_datetimelike_types: * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) # <<<<<<<<<<<<<< @@ -10199,7 +10202,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_variable_set_format(__pyx_v_variable, __pyx_v_curformat); - /* "pyreadstat/_readstat_writer.pyx":641 + /* "pyreadstat/_readstat_writer.pyx":640 * variable_name = col_names[col_indx] * variable = readstat_add_variable(writer, variable_name.encode("utf-8"), pandas_to_readstat_types[curtype], max_length) * if curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< @@ -10208,7 +10211,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":644 + /* "pyreadstat/_readstat_writer.pyx":643 * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) * if col_label_count: # <<<<<<<<<<<<<< @@ -10218,7 +10221,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = (__pyx_v_col_label_count != 0); if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":645 + /* "pyreadstat/_readstat_writer.pyx":644 * readstat_variable_set_format(variable, curformat) * if col_label_count: * if column_labels[col_indx] is not None: # <<<<<<<<<<<<<< @@ -10227,16 +10230,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_column_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 645, __pyx_L38_error) + __PYX_ERR(0, 644, __pyx_L38_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L38_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":646 + /* "pyreadstat/_readstat_writer.pyx":645 * if col_label_count: * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: # <<<<<<<<<<<<<< @@ -10245,24 +10248,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_column_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 646, __pyx_L38_error) + __PYX_ERR(0, 645, __pyx_L38_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L38_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_2)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 646, __pyx_L38_error) + __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_2)), ((PyObject *)(&PyString_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 646, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 645, __pyx_L38_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_t_4)) { - /* "pyreadstat/_readstat_writer.pyx":647 + /* "pyreadstat/_readstat_writer.pyx":646 * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") # <<<<<<<<<<<<<< * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L38_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -10276,14 +10279,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_14, __pyx_kp_s_Column_labels_must_be_strings) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Column_labels_must_be_strings); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 647, __pyx_L38_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 646, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 647, __pyx_L38_error) + __PYX_ERR(0, 646, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":646 + /* "pyreadstat/_readstat_writer.pyx":645 * if col_label_count: * if column_labels[col_indx] is not None: * if type(column_labels[col_indx]) != str: # <<<<<<<<<<<<<< @@ -10292,7 +10295,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":648 + /* "pyreadstat/_readstat_writer.pyx":647 * if type(column_labels[col_indx]) != str: * raise PyreadstatError("Column labels must be strings") * cur_col_label = column_labels[col_indx].encode("utf-8") # <<<<<<<<<<<<<< @@ -10301,11 +10304,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_column_labels == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 648, __pyx_L38_error) + __PYX_ERR(0, 647, __pyx_L38_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L38_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_column_labels, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 648, __pyx_L38_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 647, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10320,14 +10323,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_2, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __pyx_L38_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 647, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 648, __pyx_L38_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 647, __pyx_L38_error) __Pyx_XDECREF_SET(__pyx_v_cur_col_label, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":649 + /* "pyreadstat/_readstat_writer.pyx":648 * 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) # <<<<<<<<<<<<<< @@ -10336,12 +10339,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_cur_col_label == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 649, __pyx_L38_error) + __PYX_ERR(0, 648, __pyx_L38_error) } - __pyx_t_27 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_27) && PyErr_Occurred())) __PYX_ERR(0, 649, __pyx_L38_error) + __pyx_t_27 = __Pyx_PyBytes_AsString(__pyx_v_cur_col_label); if (unlikely((!__pyx_t_27) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L38_error) readstat_variable_set_label(__pyx_v_variable, __pyx_t_27); - /* "pyreadstat/_readstat_writer.pyx":645 + /* "pyreadstat/_readstat_writer.pyx":644 * readstat_variable_set_format(variable, curformat) * if col_label_count: * if column_labels[col_indx] is not None: # <<<<<<<<<<<<<< @@ -10350,7 +10353,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":644 + /* "pyreadstat/_readstat_writer.pyx":643 * curformat = get_datetimelike_format_for_readstat(file_format, curtype) * readstat_variable_set_format(variable, curformat) * if col_label_count: # <<<<<<<<<<<<<< @@ -10359,17 +10362,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":650 + /* "pyreadstat/_readstat_writer.pyx":649 * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: # <<<<<<<<<<<<<< * value_labels = variable_value_labels.get(variable_name) * if value_labels: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 650, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variable_value_labels); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 649, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":651 + /* "pyreadstat/_readstat_writer.pyx":650 * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) # <<<<<<<<<<<<<< @@ -10378,43 +10381,43 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_value_labels == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 651, __pyx_L38_error) + __PYX_ERR(0, 650, __pyx_L38_error) } - __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_value_labels, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 650, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(PyDict_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 651, __pyx_L38_error) + if (!(likely(PyDict_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 650, __pyx_L38_error) __Pyx_XDECREF_SET(__pyx_v_value_labels, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":652 + /* "pyreadstat/_readstat_writer.pyx":651 * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) * if value_labels: # <<<<<<<<<<<<<< * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 652, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_value_labels); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 651, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":653 + /* "pyreadstat/_readstat_writer.pyx":652 * value_labels = variable_value_labels.get(variable_name) * if value_labels: * labelset_name = variable_name + str(lblset_cnt) # <<<<<<<<<<<<<< * lblset_cnt += 1 * curuser_missing = None */ - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_lblset_cnt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 653, __pyx_L38_error) + __pyx_t_14 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 652, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L38_error) + __pyx_t_5 = PyNumber_Add(__pyx_v_variable_name, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF_SET(__pyx_v_labelset_name, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":654 + /* "pyreadstat/_readstat_writer.pyx":653 * if value_labels: * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 # <<<<<<<<<<<<<< @@ -10423,7 +10426,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_lblset_cnt = (__pyx_v_lblset_cnt + 1); - /* "pyreadstat/_readstat_writer.pyx":655 + /* "pyreadstat/_readstat_writer.pyx":654 * labelset_name = variable_name + str(lblset_cnt) * lblset_cnt += 1 * curuser_missing = None # <<<<<<<<<<<<<< @@ -10433,17 +10436,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":656 + /* "pyreadstat/_readstat_writer.pyx":655 * lblset_cnt += 1 * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 656, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 655, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":657 + /* "pyreadstat/_readstat_writer.pyx":656 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) # <<<<<<<<<<<<<< @@ -10452,14 +10455,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 657, __pyx_L38_error) + __PYX_ERR(0, 656, __pyx_L38_error) } - __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":656 + /* "pyreadstat/_readstat_writer.pyx":655 * lblset_cnt += 1 * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -10468,40 +10471,40 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":658 + /* "pyreadstat/_readstat_writer.pyx":657 * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, # <<<<<<<<<<<<<< * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) */ - if (!(likely(PyString_CheckExact(__pyx_v_labelset_name))||((__pyx_v_labelset_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_labelset_name)->tp_name), 0))) __PYX_ERR(0, 658, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_v_labelset_name))||((__pyx_v_labelset_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_labelset_name)->tp_name), 0))) __PYX_ERR(0, 657, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":659 + /* "pyreadstat/_readstat_writer.pyx":658 * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) # <<<<<<<<<<<<<< * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: */ - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_col_names_to_types, __pyx_v_variable_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_23 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L38_error) + __pyx_t_23 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L38_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 659, __pyx_L38_error) - if (!(likely(PyList_CheckExact(__pyx_v_curuser_missing))||((__pyx_v_curuser_missing) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_curuser_missing)->tp_name), 0))) __PYX_ERR(0, 659, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 658, __pyx_L38_error) + if (!(likely(PyList_CheckExact(__pyx_v_curuser_missing))||((__pyx_v_curuser_missing) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_curuser_missing)->tp_name), 0))) __PYX_ERR(0, 658, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":658 + /* "pyreadstat/_readstat_writer.pyx":657 * if missing_user_values: * curuser_missing = missing_user_values.get(variable_name) * label_set = set_value_label(writer, value_labels, labelset_name, # <<<<<<<<<<<<<< * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) */ - __pyx_t_28 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_v_labelset_name), __pyx_t_23, __pyx_v_file_format, ((PyObject*)__pyx_v_variable_name), ((PyObject*)__pyx_v_curuser_missing)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L38_error) + __pyx_t_28 = __pyx_f_10pyreadstat_16_readstat_writer_set_value_label(__pyx_v_writer, __pyx_v_value_labels, ((PyObject*)__pyx_v_labelset_name), __pyx_t_23, __pyx_v_file_format, ((PyObject*)__pyx_v_variable_name), ((PyObject*)__pyx_v_curuser_missing)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L38_error) __pyx_v_label_set = __pyx_t_28; - /* "pyreadstat/_readstat_writer.pyx":660 + /* "pyreadstat/_readstat_writer.pyx":659 * 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) # <<<<<<<<<<<<<< @@ -10510,7 +10513,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_variable_set_label_set(__pyx_v_variable, __pyx_v_label_set); - /* "pyreadstat/_readstat_writer.pyx":652 + /* "pyreadstat/_readstat_writer.pyx":651 * if variable_value_labels: * value_labels = variable_value_labels.get(variable_name) * if value_labels: # <<<<<<<<<<<<<< @@ -10519,7 +10522,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":650 + /* "pyreadstat/_readstat_writer.pyx":649 * cur_col_label = column_labels[col_indx].encode("utf-8") * readstat_variable_set_label(variable, cur_col_label) * if variable_value_labels: # <<<<<<<<<<<<<< @@ -10528,17 +10531,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":661 + /* "pyreadstat/_readstat_writer.pyx":660 * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: # <<<<<<<<<<<<<< * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 661, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_missing_ranges); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 660, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":662 + /* "pyreadstat/_readstat_writer.pyx":661 * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) # <<<<<<<<<<<<<< @@ -10547,24 +10550,24 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_ranges == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 662, __pyx_L38_error) + __PYX_ERR(0, 661, __pyx_L38_error) } - __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 662, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_ranges, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_cur_ranges, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":663 + /* "pyreadstat/_readstat_writer.pyx":662 * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: # <<<<<<<<<<<<<< * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 663, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_cur_ranges); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 662, __pyx_L38_error) if (__pyx_t_4) { - /* "pyreadstat/_readstat_writer.pyx":664 + /* "pyreadstat/_readstat_writer.pyx":663 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -10575,7 +10578,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); if (unlikely(__pyx_t_3)) { - /* "pyreadstat/_readstat_writer.pyx":665 + /* "pyreadstat/_readstat_writer.pyx":664 * if cur_ranges: * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" # <<<<<<<<<<<<<< @@ -10585,14 +10588,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(__pyx_kp_s_missing_ranges_values_in_diction); __pyx_v_msg = __pyx_kp_s_missing_ranges_values_in_diction; - /* "pyreadstat/_readstat_writer.pyx":666 + /* "pyreadstat/_readstat_writer.pyx":665 * if not isinstance(cur_ranges, list): * msg = "missing_ranges: values in dictionary must be list" * raise PyreadstatError(msg) # <<<<<<<<<<<<<< * add_missing_ranges(cur_ranges, variable) * if variable_alignment: */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 666, __pyx_L38_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 665, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { @@ -10606,14 +10609,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_2, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_msg); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 666, __pyx_L38_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 666, __pyx_L38_error) + __PYX_ERR(0, 665, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":664 + /* "pyreadstat/_readstat_writer.pyx":663 * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: * if not isinstance(cur_ranges, list): # <<<<<<<<<<<<<< @@ -10622,17 +10625,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":667 + /* "pyreadstat/_readstat_writer.pyx":666 * msg = "missing_ranges: values in dictionary must be list" * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable) # <<<<<<<<<<<<<< * if variable_alignment: * # At the moment this is ineffective for sav and dta (the function runs but in */ - if (!(likely(PyList_CheckExact(__pyx_v_cur_ranges))||((__pyx_v_cur_ranges) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_cur_ranges)->tp_name), 0))) __PYX_ERR(0, 667, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_v_cur_ranges), __pyx_v_variable); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L38_error) + if (!(likely(PyList_CheckExact(__pyx_v_cur_ranges))||((__pyx_v_cur_ranges) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_cur_ranges)->tp_name), 0))) __PYX_ERR(0, 666, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_writer_add_missing_ranges(((PyObject*)__pyx_v_cur_ranges), __pyx_v_variable); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":663 + /* "pyreadstat/_readstat_writer.pyx":662 * if missing_ranges: * cur_ranges = missing_ranges.get(variable_name) * if cur_ranges: # <<<<<<<<<<<<<< @@ -10641,7 +10644,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":661 + /* "pyreadstat/_readstat_writer.pyx":660 * col_names_to_types[variable_name], file_format, variable_name, curuser_missing) * readstat_variable_set_label_set(variable, label_set) * if missing_ranges: # <<<<<<<<<<<<<< @@ -10650,17 +10653,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":668 + /* "pyreadstat/_readstat_writer.pyx":667 * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable) * if variable_alignment: # <<<<<<<<<<<<<< * # At the moment this is ineffective for sav and dta (the function runs but in * # the resulting file all alignments are still unknown) */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 668, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_variable_alignment); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 667, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":671 + /* "pyreadstat/_readstat_writer.pyx":670 * # 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) # <<<<<<<<<<<<<< @@ -10669,35 +10672,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_alignment == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 671, __pyx_L38_error) + __PYX_ERR(0, 670, __pyx_L38_error) } - __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_alignment, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_cur_alignment, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":672 + /* "pyreadstat/_readstat_writer.pyx":671 * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: # <<<<<<<<<<<<<< * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 672, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_cur_alignment); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 671, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":673 + /* "pyreadstat/_readstat_writer.pyx":672 * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) # <<<<<<<<<<<<<< * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) */ - if (!(likely(PyString_CheckExact(__pyx_v_cur_alignment))||((__pyx_v_cur_alignment) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_alignment)->tp_name), 0))) __PYX_ERR(0, 673, __pyx_L38_error) - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 673, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_v_cur_alignment), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_v_cur_alignment))||((__pyx_v_cur_alignment) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_alignment)->tp_name), 0))) __PYX_ERR(0, 672, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 672, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_alignment(__pyx_v_variable, ((PyObject*)__pyx_v_cur_alignment), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":672 + /* "pyreadstat/_readstat_writer.pyx":671 * # the resulting file all alignments are still unknown) * cur_alignment = variable_alignment.get(variable_name) * if cur_alignment: # <<<<<<<<<<<<<< @@ -10706,7 +10709,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":668 + /* "pyreadstat/_readstat_writer.pyx":667 * raise PyreadstatError(msg) * add_missing_ranges(cur_ranges, variable) * if variable_alignment: # <<<<<<<<<<<<<< @@ -10715,17 +10718,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":674 + /* "pyreadstat/_readstat_writer.pyx":673 * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: # <<<<<<<<<<<<<< * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 674, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_variable_display_width); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 673, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":675 + /* "pyreadstat/_readstat_writer.pyx":674 * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) # <<<<<<<<<<<<<< @@ -10734,35 +10737,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_display_width == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 675, __pyx_L38_error) + __PYX_ERR(0, 674, __pyx_L38_error) } - __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_display_width, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 674, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_cur_display_width, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":675 * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: # <<<<<<<<<<<<<< * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 676, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_cur_display_width); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 675, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":677 + /* "pyreadstat/_readstat_writer.pyx":676 * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) # <<<<<<<<<<<<<< * if variable_measure: * cur_measure = variable_measure.get(variable_name) */ - __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L38_error) - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 677, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_24, ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L38_error) + __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_v_cur_display_width); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 676, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_display_width(__pyx_v_variable, __pyx_t_24, ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":676 + /* "pyreadstat/_readstat_writer.pyx":675 * if variable_display_width: * cur_display_width = variable_display_width.get(variable_name) * if cur_display_width: # <<<<<<<<<<<<<< @@ -10771,7 +10774,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":674 + /* "pyreadstat/_readstat_writer.pyx":673 * if cur_alignment: * set_variable_alignment(variable, cur_alignment, variable_name) * if variable_display_width: # <<<<<<<<<<<<<< @@ -10780,17 +10783,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":678 + /* "pyreadstat/_readstat_writer.pyx":677 * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: # <<<<<<<<<<<<<< * cur_measure = variable_measure.get(variable_name) * if cur_measure: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 678, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_variable_measure); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 677, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":679 + /* "pyreadstat/_readstat_writer.pyx":678 * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: * cur_measure = variable_measure.get(variable_name) # <<<<<<<<<<<<<< @@ -10799,35 +10802,35 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_variable_measure == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 679, __pyx_L38_error) + __PYX_ERR(0, 678, __pyx_L38_error) } - __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_variable_measure, __pyx_v_variable_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_cur_measure, __pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":680 + /* "pyreadstat/_readstat_writer.pyx":679 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< * set_variable_measure(variable, cur_measure, variable_name) * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 680, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_cur_measure); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 679, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":681 + /* "pyreadstat/_readstat_writer.pyx":680 * cur_measure = variable_measure.get(variable_name) * if cur_measure: * set_variable_measure(variable, cur_measure, variable_name) # <<<<<<<<<<<<<< * * # start writing */ - if (!(likely(PyString_CheckExact(__pyx_v_cur_measure))||((__pyx_v_cur_measure) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_measure)->tp_name), 0))) __PYX_ERR(0, 681, __pyx_L38_error) - if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 681, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_v_cur_measure), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_v_cur_measure))||((__pyx_v_cur_measure) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_cur_measure)->tp_name), 0))) __PYX_ERR(0, 680, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_v_variable_name))||((__pyx_v_variable_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_variable_name)->tp_name), 0))) __PYX_ERR(0, 680, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_writer_set_variable_measure(__pyx_v_variable, ((PyObject*)__pyx_v_cur_measure), ((PyObject*)__pyx_v_variable_name)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":680 + /* "pyreadstat/_readstat_writer.pyx":679 * if variable_measure: * cur_measure = variable_measure.get(variable_name) * if cur_measure: # <<<<<<<<<<<<<< @@ -10836,7 +10839,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":678 + /* "pyreadstat/_readstat_writer.pyx":677 * if cur_display_width: * set_variable_display_width(variable, cur_display_width, variable_name) * if variable_measure: # <<<<<<<<<<<<<< @@ -10846,7 +10849,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } } - /* "pyreadstat/_readstat_writer.pyx":684 + /* "pyreadstat/_readstat_writer.pyx":683 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -10856,16 +10859,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d switch (__pyx_v_file_format) { case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BCAT: - /* "pyreadstat/_readstat_writer.pyx":685 + /* "pyreadstat/_readstat_writer.pyx":684 * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bcat(__pyx_v_writer, (&__pyx_v_fd))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 685, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bcat(__pyx_v_writer, (&__pyx_v_fd))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":684 + /* "pyreadstat/_readstat_writer.pyx":683 * * # start writing * if file_format == FILE_FORMAT_SAS7BCAT: # <<<<<<<<<<<<<< @@ -10875,16 +10878,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_DTA: - /* "pyreadstat/_readstat_writer.pyx":687 + /* "pyreadstat/_readstat_writer.pyx":686 * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_dta(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_dta(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":686 + /* "pyreadstat/_readstat_writer.pyx":685 * if file_format == FILE_FORMAT_SAS7BCAT: * check_exit_status(readstat_begin_writing_sas7bcat(writer, &fd)) * elif file_format == FILE_FORMAT_DTA: # <<<<<<<<<<<<<< @@ -10894,16 +10897,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAV: - /* "pyreadstat/_readstat_writer.pyx":689 + /* "pyreadstat/_readstat_writer.pyx":688 * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sav(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 689, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sav(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":688 + /* "pyreadstat/_readstat_writer.pyx":687 * elif file_format == FILE_FORMAT_DTA: * check_exit_status(readstat_begin_writing_dta(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAV: # <<<<<<<<<<<<<< @@ -10913,16 +10916,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_POR: - /* "pyreadstat/_readstat_writer.pyx":691 + /* "pyreadstat/_readstat_writer.pyx":690 * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_por(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_por(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":690 + /* "pyreadstat/_readstat_writer.pyx":689 * elif file_format == FILE_FORMAT_SAV: * check_exit_status(readstat_begin_writing_sav(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_POR: # <<<<<<<<<<<<<< @@ -10932,16 +10935,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_SAS7BDAT: - /* "pyreadstat/_readstat_writer.pyx":693 + /* "pyreadstat/_readstat_writer.pyx":692 * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) # <<<<<<<<<<<<<< * elif file_format == FILE_FORMAT_XPORT: * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bdat(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_sas7bdat(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":692 + /* "pyreadstat/_readstat_writer.pyx":691 * elif file_format == FILE_FORMAT_POR: * check_exit_status(readstat_begin_writing_por(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_SAS7BDAT: # <<<<<<<<<<<<<< @@ -10951,16 +10954,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; case __pyx_e_10pyreadstat_16_readstat_writer_FILE_FORMAT_XPORT: - /* "pyreadstat/_readstat_writer.pyx":695 + /* "pyreadstat/_readstat_writer.pyx":694 * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_XPORT: * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) # <<<<<<<<<<<<<< * else: * raise PyreadstatError("unknown file format") */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_xport(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_writing_xport(__pyx_v_writer, (&__pyx_v_fd), __pyx_v_row_count)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":694 + /* "pyreadstat/_readstat_writer.pyx":693 * elif file_format == FILE_FORMAT_SAS7BDAT: * check_exit_status(readstat_begin_writing_sas7bdat(writer, &fd, row_count)) * elif file_format == FILE_FORMAT_XPORT: # <<<<<<<<<<<<<< @@ -10970,14 +10973,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d break; default: - /* "pyreadstat/_readstat_writer.pyx":697 + /* "pyreadstat/_readstat_writer.pyx":696 * check_exit_status(readstat_begin_writing_xport(writer, &fd, row_count)) * else: * raise PyreadstatError("unknown file format") # <<<<<<<<<<<<<< * * # validation */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 697, __pyx_L38_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 696, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { @@ -10991,25 +10994,25 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_2, __pyx_kp_s_unknown_file_format) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_unknown_file_format); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L38_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 697, __pyx_L38_error) + __PYX_ERR(0, 696, __pyx_L38_error) break; } - /* "pyreadstat/_readstat_writer.pyx":700 + /* "pyreadstat/_readstat_writer.pyx":699 * * # validation * check_exit_status(readstat_validate_metadata(writer)) # <<<<<<<<<<<<<< * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_metadata(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_metadata(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":701 + /* "pyreadstat/_readstat_writer.pyx":700 * # validation * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -11021,7 +11024,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":702 + /* "pyreadstat/_readstat_writer.pyx":701 * check_exit_status(readstat_validate_metadata(writer)) * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -11030,29 +11033,29 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_tempvar = readstat_get_variable(__pyx_v_writer, __pyx_v_col_indx); - /* "pyreadstat/_readstat_writer.pyx":703 + /* "pyreadstat/_readstat_writer.pyx":702 * for col_indx in range(col_count): * tempvar = readstat_get_variable(writer, col_indx) * check_exit_status(readstat_validate_variable(writer, tempvar)) # <<<<<<<<<<<<<< * * # inserting */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_variable(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_validate_variable(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L38_error) } - /* "pyreadstat/_readstat_writer.pyx":706 + /* "pyreadstat/_readstat_writer.pyx":705 * * # inserting * values = df.values # <<<<<<<<<<<<<< * * for row in values: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L38_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_values = __pyx_t_5; __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":708 + /* "pyreadstat/_readstat_writer.pyx":707 * values = df.values * * for row in values: # <<<<<<<<<<<<<< @@ -11063,26 +11066,26 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_5 = __pyx_v_values; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L38_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 707, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 708, __pyx_L38_error) + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L38_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_14 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 708, __pyx_L38_error) + __pyx_t_14 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 707, __pyx_L38_error) #else - __pyx_t_14 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 708, __pyx_L38_error) + __pyx_t_14 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 707, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 708, __pyx_L38_error) + __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 707, __pyx_L38_error) #else - __pyx_t_14 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 708, __pyx_L38_error) + __pyx_t_14 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 707, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); #endif } @@ -11092,7 +11095,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 708, __pyx_L38_error) + else __PYX_ERR(0, 707, __pyx_L38_error) } break; } @@ -11101,16 +11104,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":709 + /* "pyreadstat/_readstat_writer.pyx":708 * * for row in values: * check_exit_status(readstat_begin_row(writer)) # <<<<<<<<<<<<<< * * for col_indx in range(col_count): */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_begin_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":711 + /* "pyreadstat/_readstat_writer.pyx":710 * check_exit_status(readstat_begin_row(writer)) * * for col_indx in range(col_count): # <<<<<<<<<<<<<< @@ -11122,7 +11125,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { __pyx_v_col_indx = __pyx_t_22; - /* "pyreadstat/_readstat_writer.pyx":713 + /* "pyreadstat/_readstat_writer.pyx":712 * for col_indx in range(col_count): * * tempvar = readstat_get_variable(writer, col_indx) # <<<<<<<<<<<<<< @@ -11131,19 +11134,19 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ __pyx_v_tempvar = readstat_get_variable(__pyx_v_writer, __pyx_v_col_indx); - /* "pyreadstat/_readstat_writer.pyx":714 + /* "pyreadstat/_readstat_writer.pyx":713 * * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] # <<<<<<<<<<<<<< * curtype = col_types[col_indx][0] * is_missing = col_types[col_indx][2] */ - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 714, __pyx_L38_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_row, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 713, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_XDECREF_SET(__pyx_v_curval, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":715 + /* "pyreadstat/_readstat_writer.pyx":714 * tempvar = readstat_get_variable(writer, col_indx) * curval = row[col_indx] * curtype = col_types[col_indx][0] # <<<<<<<<<<<<<< @@ -11152,18 +11155,18 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 715, __pyx_L38_error) + __PYX_ERR(0, 714, __pyx_L38_error) } - __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 715, __pyx_L38_error) + __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 714, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L38_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_23 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L38_error) + __pyx_t_23 = ((__pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type)__Pyx_PyInt_As___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_t_2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_curtype = __pyx_t_23; - /* "pyreadstat/_readstat_writer.pyx":716 + /* "pyreadstat/_readstat_writer.pyx":715 * curval = row[col_indx] * curtype = col_types[col_indx][0] * is_missing = col_types[col_indx][2] # <<<<<<<<<<<<<< @@ -11172,17 +11175,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_col_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 716, __pyx_L38_error) + __PYX_ERR(0, 715, __pyx_L38_error) } - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L38_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_col_types, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 716, __pyx_L38_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 715, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_is_missing, __pyx_t_14); __pyx_t_14 = 0; - /* "pyreadstat/_readstat_writer.pyx":717 + /* "pyreadstat/_readstat_writer.pyx":716 * curtype = col_types[col_indx][0] * is_missing = col_types[col_indx][2] * curuser_missing = None # <<<<<<<<<<<<<< @@ -11192,17 +11195,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_curuser_missing, Py_None); - /* "pyreadstat/_readstat_writer.pyx":718 + /* "pyreadstat/_readstat_writer.pyx":717 * is_missing = col_types[col_indx][2] * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< * curuser_missing = missing_user_values.get(col_names[col_indx]) * */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 718, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_missing_user_values); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 717, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":719 + /* "pyreadstat/_readstat_writer.pyx":718 * curuser_missing = None * if missing_user_values: * curuser_missing = missing_user_values.get(col_names[col_indx]) # <<<<<<<<<<<<<< @@ -11211,21 +11214,21 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ if (unlikely(__pyx_v_missing_user_values == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 719, __pyx_L38_error) + __PYX_ERR(0, 718, __pyx_L38_error) } if (unlikely(__pyx_v_col_names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 719, __pyx_L38_error) + __PYX_ERR(0, 718, __pyx_L38_error) } - __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 719, __pyx_L38_error) + __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_col_names, __pyx_v_col_indx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 718, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_14, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L38_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_missing_user_values, __pyx_t_14, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF_SET(__pyx_v_curuser_missing, __pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":718 + /* "pyreadstat/_readstat_writer.pyx":717 * is_missing = col_types[col_indx][2] * curuser_missing = None * if missing_user_values: # <<<<<<<<<<<<<< @@ -11234,26 +11237,26 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":721 + /* "pyreadstat/_readstat_writer.pyx":720 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 721, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_missing); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 720, __pyx_L38_error) if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":723 + /* "pyreadstat/_readstat_writer.pyx":722 * if is_missing: * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_pd); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 723, __pyx_L38_error) + __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_pd); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 722, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_isna); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L38_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_isna); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; @@ -11268,23 +11271,23 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_14, __pyx_v_curval) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_curval); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L38_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __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, 723, __pyx_L38_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 722, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":724 + /* "pyreadstat/_readstat_writer.pyx":723 * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): * check_exit_status(readstat_insert_missing_value(writer, tempvar)) # <<<<<<<<<<<<<< * continue * */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_missing_value(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_missing_value(__pyx_v_writer, __pyx_v_tempvar)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":725 + /* "pyreadstat/_readstat_writer.pyx":724 * if pd.isna(curval): * check_exit_status(readstat_insert_missing_value(writer, tempvar)) * continue # <<<<<<<<<<<<<< @@ -11293,7 +11296,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ goto __pyx_L74_continue; - /* "pyreadstat/_readstat_writer.pyx":723 + /* "pyreadstat/_readstat_writer.pyx":722 * if is_missing: * #if curval is None or (type(curval) in numeric_types and np.isnan(curval)): * if pd.isna(curval): # <<<<<<<<<<<<<< @@ -11302,7 +11305,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":721 + /* "pyreadstat/_readstat_writer.pyx":720 * curuser_missing = missing_user_values.get(col_names[col_indx]) * * if is_missing: # <<<<<<<<<<<<<< @@ -11311,54 +11314,54 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":727 + /* "pyreadstat/_readstat_writer.pyx":726 * continue * * if curuser_missing and curtype in pywriter_numeric_types: # <<<<<<<<<<<<<< * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 727, __pyx_L38_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_curuser_missing); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 726, __pyx_L38_error) if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L80_bool_binop_done; } - __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L38_error) + __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 727, __pyx_L38_error) + __PYX_ERR(0, 726, __pyx_L38_error) } - __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 727, __pyx_L38_error) + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 726, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_29 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_29; __pyx_L80_bool_binop_done:; if (__pyx_t_3) { - /* "pyreadstat/_readstat_writer.pyx":728 + /* "pyreadstat/_readstat_writer.pyx":727 * * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) * continue */ - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 728, __pyx_L38_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_curval, __pyx_v_curuser_missing, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 727, __pyx_L38_error) __pyx_t_29 = (__pyx_t_3 != 0); if (__pyx_t_29) { - /* "pyreadstat/_readstat_writer.pyx":729 + /* "pyreadstat/_readstat_writer.pyx":728 * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) # <<<<<<<<<<<<<< * continue * */ - __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 729, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L38_error) + __pyx_t_13 = __Pyx_PyObject_Ord(__pyx_v_curval); if (unlikely(__pyx_t_13 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 728, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_tagged_missing_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_13)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":730 + /* "pyreadstat/_readstat_writer.pyx":729 * if curval in curuser_missing: * check_exit_status(readstat_insert_tagged_missing_value(writer, tempvar, ord(curval))) * continue # <<<<<<<<<<<<<< @@ -11367,7 +11370,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ goto __pyx_L74_continue; - /* "pyreadstat/_readstat_writer.pyx":728 + /* "pyreadstat/_readstat_writer.pyx":727 * * if curuser_missing and curtype in pywriter_numeric_types: * if curval in curuser_missing: # <<<<<<<<<<<<<< @@ -11376,7 +11379,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":727 + /* "pyreadstat/_readstat_writer.pyx":726 * continue * * if curuser_missing and curtype in pywriter_numeric_types: # <<<<<<<<<<<<<< @@ -11385,7 +11388,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ } - /* "pyreadstat/_readstat_writer.pyx":732 + /* "pyreadstat/_readstat_writer.pyx":731 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -11395,17 +11398,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_29 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE) != 0); if (__pyx_t_29) { - /* "pyreadstat/_readstat_writer.pyx":733 + /* "pyreadstat/_readstat_writer.pyx":732 * * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) */ - __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_30 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_30))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L38_error) + __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_curval); if (unlikely((__pyx_t_30 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 732, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, ((double)__pyx_t_30))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 732, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":732 + /* "pyreadstat/_readstat_writer.pyx":731 * continue * * if curtype == PYWRITER_DOUBLE: # <<<<<<<<<<<<<< @@ -11415,7 +11418,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L83; } - /* "pyreadstat/_readstat_writer.pyx":734 + /* "pyreadstat/_readstat_writer.pyx":733 * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< @@ -11425,17 +11428,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_29 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER) != 0); if (__pyx_t_29) { - /* "pyreadstat/_readstat_writer.pyx":735 + /* "pyreadstat/_readstat_writer.pyx":734 * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) */ - __pyx_t_31 = __Pyx_PyInt_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_31 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_31)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L38_error) + __pyx_t_31 = __Pyx_PyInt_As_int32_t(__pyx_v_curval); if (unlikely((__pyx_t_31 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_31)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":734 + /* "pyreadstat/_readstat_writer.pyx":733 * if curtype == PYWRITER_DOUBLE: * check_exit_status(readstat_insert_double_value(writer, tempvar, curval)) * elif curtype == PYWRITER_INTEGER: # <<<<<<<<<<<<<< @@ -11445,7 +11448,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L83; } - /* "pyreadstat/_readstat_writer.pyx":736 + /* "pyreadstat/_readstat_writer.pyx":735 * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< @@ -11455,17 +11458,17 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_29 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL) != 0); if (__pyx_t_29) { - /* "pyreadstat/_readstat_writer.pyx":737 + /* "pyreadstat/_readstat_writer.pyx":736 * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) */ - __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_v_curval); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_24))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L38_error) + __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_v_curval); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_int32_value(__pyx_v_writer, __pyx_v_tempvar, ((int)__pyx_t_24))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":736 + /* "pyreadstat/_readstat_writer.pyx":735 * elif curtype == PYWRITER_INTEGER: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_LOGICAL: # <<<<<<<<<<<<<< @@ -11475,7 +11478,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L83; } - /* "pyreadstat/_readstat_writer.pyx":738 + /* "pyreadstat/_readstat_writer.pyx":737 * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: # <<<<<<<<<<<<<< @@ -11485,14 +11488,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_29 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER) != 0); if (__pyx_t_29) { - /* "pyreadstat/_readstat_writer.pyx":739 + /* "pyreadstat/_readstat_writer.pyx":738 * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) # <<<<<<<<<<<<<< * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curval, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L38_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_curval, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -11506,14 +11509,14 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_14, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_utf_8); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L38_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_32 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_32) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_32)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L38_error) + __pyx_t_32 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_32) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_32)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":738 + /* "pyreadstat/_readstat_writer.pyx":737 * elif curtype == PYWRITER_LOGICAL: * check_exit_status(readstat_insert_int32_value(writer, tempvar, curval)) * elif curtype == PYWRITER_CHARACTER: # <<<<<<<<<<<<<< @@ -11523,7 +11526,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L83; } - /* "pyreadstat/_readstat_writer.pyx":740 + /* "pyreadstat/_readstat_writer.pyx":739 * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< @@ -11533,33 +11536,33 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_29 = ((__pyx_v_curtype == __pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT) != 0); if (__pyx_t_29) { - /* "pyreadstat/_readstat_writer.pyx":741 + /* "pyreadstat/_readstat_writer.pyx":740 * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_curval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L38_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_curval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 741, __pyx_L38_error) + if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 740, __pyx_L38_error) __Pyx_XDECREF_SET(__pyx_v_curvalstr, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":742 + /* "pyreadstat/_readstat_writer.pyx":741 * elif curtype == PYWRITER_OBJECT: * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) # <<<<<<<<<<<<<< * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) */ - __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_curvalstr, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L38_error) + __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_curvalstr, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_32 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_32) && PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L38_error) - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_32)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 742, __pyx_L38_error) + __pyx_t_32 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_32) && PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_string_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_t_32)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pyreadstat/_readstat_writer.pyx":740 + /* "pyreadstat/_readstat_writer.pyx":739 * elif curtype == PYWRITER_CHARACTER: * check_exit_status(readstat_insert_string_value(writer, tempvar, curval.encode("utf-8"))) * elif curtype == PYWRITER_OBJECT: # <<<<<<<<<<<<<< @@ -11569,44 +11572,44 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L83; } - /* "pyreadstat/_readstat_writer.pyx":743 + /* "pyreadstat/_readstat_writer.pyx":742 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) */ - __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L38_error) + __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_v_curtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 743, __pyx_L38_error) + __PYX_ERR(0, 742, __pyx_L38_error) } - __pyx_t_29 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 743, __pyx_L38_error) + __pyx_t_29 = (__Pyx_PySet_ContainsTF(__pyx_t_2, __pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, Py_EQ)); if (unlikely(__pyx_t_29 < 0)) __PYX_ERR(0, 742, __pyx_L38_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_29 != 0); if (likely(__pyx_t_3)) { - /* "pyreadstat/_readstat_writer.pyx":744 + /* "pyreadstat/_readstat_writer.pyx":743 * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) # <<<<<<<<<<<<<< * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) * else: */ - __pyx_t_30 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_30 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 744, __pyx_L38_error) + __pyx_t_30 = __pyx_f_10pyreadstat_16_readstat_writer_convert_datetimelike_to_number(__pyx_v_file_format, __pyx_v_curtype, __pyx_v_curval); if (unlikely(__pyx_t_30 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 743, __pyx_L38_error) __pyx_v_dtimelikeval = __pyx_t_30; - /* "pyreadstat/_readstat_writer.pyx":745 + /* "pyreadstat/_readstat_writer.pyx":744 * elif curtype in pyrwriter_datetimelike_types: * dtimelikeval = convert_datetimelike_to_number(file_format, curtype, curval) * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) # <<<<<<<<<<<<<< * else: * raise PyreadstatError("Unknown data format to insert") */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_dtimelikeval)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 745, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_insert_double_value(__pyx_v_writer, __pyx_v_tempvar, __pyx_v_dtimelikeval)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 744, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":743 + /* "pyreadstat/_readstat_writer.pyx":742 * curvalstr = str(curval) * check_exit_status(readstat_insert_string_value(writer, tempvar, curvalstr.encode("utf-8"))) * elif curtype in pyrwriter_datetimelike_types: # <<<<<<<<<<<<<< @@ -11616,7 +11619,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d goto __pyx_L83; } - /* "pyreadstat/_readstat_writer.pyx":747 + /* "pyreadstat/_readstat_writer.pyx":746 * check_exit_status(readstat_insert_double_value(writer, tempvar, dtimelikeval)) * else: * raise PyreadstatError("Unknown data format to insert") # <<<<<<<<<<<<<< @@ -11624,7 +11627,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d * check_exit_status(readstat_end_row(writer)) */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L38_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PyreadstatError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -11638,27 +11641,27 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_14, __pyx_kp_s_Unknown_data_format_to_insert) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_Unknown_data_format_to_insert); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L38_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L38_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 747, __pyx_L38_error) + __PYX_ERR(0, 746, __pyx_L38_error) } __pyx_L83:; __pyx_L74_continue:; } - /* "pyreadstat/_readstat_writer.pyx":749 + /* "pyreadstat/_readstat_writer.pyx":748 * raise PyreadstatError("Unknown data format to insert") * * check_exit_status(readstat_end_row(writer)) # <<<<<<<<<<<<<< * * check_exit_status(readstat_end_writing(writer)) */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 749, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_row(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":708 + /* "pyreadstat/_readstat_writer.pyx":707 * values = df.values * * for row in values: # <<<<<<<<<<<<<< @@ -11668,16 +11671,16 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "pyreadstat/_readstat_writer.pyx":751 + /* "pyreadstat/_readstat_writer.pyx":750 * check_exit_status(readstat_end_row(writer)) * * check_exit_status(readstat_end_writing(writer)) # <<<<<<<<<<<<<< * * except: */ - __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_writing(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L38_error) + __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_end_writing(__pyx_v_writer)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L38_error) - /* "pyreadstat/_readstat_writer.pyx":608 + /* "pyreadstat/_readstat_writer.pyx":607 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -11697,7 +11700,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "pyreadstat/_readstat_writer.pyx":753 + /* "pyreadstat/_readstat_writer.pyx":752 * check_exit_status(readstat_end_writing(writer)) * * except: # <<<<<<<<<<<<<< @@ -11706,12 +11709,12 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ /*except:*/ { __Pyx_AddTraceback("pyreadstat._readstat_writer.run_write", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L40_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 752, __pyx_L40_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); - /* "pyreadstat/_readstat_writer.pyx":754 + /* "pyreadstat/_readstat_writer.pyx":753 * * except: * raise # <<<<<<<<<<<<<< @@ -11723,11 +11726,11 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_2, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; - __PYX_ERR(0, 754, __pyx_L40_except_error) + __PYX_ERR(0, 753, __pyx_L40_except_error) } __pyx_L40_except_error:; - /* "pyreadstat/_readstat_writer.pyx":608 + /* "pyreadstat/_readstat_writer.pyx":607 * writer = readstat_writer_init() * * try: # <<<<<<<<<<<<<< @@ -11743,7 +11746,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d } } - /* "pyreadstat/_readstat_writer.pyx":756 + /* "pyreadstat/_readstat_writer.pyx":755 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -11754,7 +11757,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d /*normal exit:*/{ readstat_writer_free(__pyx_v_writer); - /* "pyreadstat/_readstat_writer.pyx":757 + /* "pyreadstat/_readstat_writer.pyx":756 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< @@ -11786,7 +11789,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_t_20 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_33 = __pyx_filename; { - /* "pyreadstat/_readstat_writer.pyx":756 + /* "pyreadstat/_readstat_writer.pyx":755 * raise * finally: * readstat_writer_free(writer) # <<<<<<<<<<<<<< @@ -11795,7 +11798,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d */ readstat_writer_free(__pyx_v_writer); - /* "pyreadstat/_readstat_writer.pyx":757 + /* "pyreadstat/_readstat_writer.pyx":756 * finally: * readstat_writer_free(writer) * close_file(fd) # <<<<<<<<<<<<<< @@ -11821,7 +11824,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_L37:; } - /* "pyreadstat/_readstat_writer.pyx":759 + /* "pyreadstat/_readstat_writer.pyx":758 * close_file(fd) * * return 0 # <<<<<<<<<<<<<< @@ -11829,7 +11832,7 @@ static int __pyx_f_10pyreadstat_16_readstat_writer_run_write(PyObject *__pyx_v_d __pyx_r = 0; goto __pyx_L0; - /* "pyreadstat/_readstat_writer.pyx":522 + /* "pyreadstat/_readstat_writer.pyx":521 * return close(fd) * * cdef int run_write(df, str filename_path, dst_file_format file_format, str file_label, list column_labels, # <<<<<<<<<<<<<< @@ -11946,7 +11949,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_UInt8Dtype, __pyx_k_UInt8Dtype, sizeof(__pyx_k_UInt8Dtype), 0, 0, 1, 1}, {&__pyx_kp_s_Unknown_data_format_to_insert, __pyx_k_Unknown_data_format_to_insert, sizeof(__pyx_k_Unknown_data_format_to_insert), 0, 0, 1, 0}, {&__pyx_kp_s_Unknown_pywriter_variable_format, __pyx_k_Unknown_pywriter_variable_format, sizeof(__pyx_k_Unknown_pywriter_variable_format), 0, 0, 1, 0}, - {&__pyx_n_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 1}, + {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s_alignment_for_variable_s_must_be, __pyx_k_alignment_for_variable_s_must_be, sizeof(__pyx_k_alignment_for_variable_s_must_be), 0, 0, 1, 0}, {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1}, @@ -11978,6 +11981,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_expanduser, __pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 0, 1, 1}, {&__pyx_kp_s_first_argument_must_be_a_pandas, __pyx_k_first_argument_must_be_a_pandas, sizeof(__pyx_k_first_argument_must_be_a_pandas), 0, 0, 1, 0}, {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_hi, __pyx_k_hi, sizeof(__pyx_k_hi), 0, 0, 1, 1}, {&__pyx_n_s_iloc, __pyx_k_iloc, sizeof(__pyx_k_iloc), 0, 0, 1, 1}, @@ -12114,7 +12118,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * 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.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} + * np.dtype('float32'), np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} * cdef set numeric_types = int_types.union(float_types).union(int_mixed_types) */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_int64); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 38, __pyx_L1_error) @@ -12130,6 +12134,17 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); + /* "pyreadstat/_readstat_writer.pyx":39 + * 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, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} # <<<<<<<<<<<<<< + * 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} + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + /* "pyreadstat/_readstat_writer.pyx":54 * cdef double spss_offset_days = 141428 * cdef double sas_offset_days = 3653 @@ -12137,9 +12152,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] */ - __pyx_tuple__12 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__13 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -12412,8 +12427,9 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__readstat_writer(PyObject *__pyx_p PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; + PyObject *(*__pyx_t_15)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -12743,7 +12759,7 @@ if (!__Pyx_RefNanny) { * 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.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} + * np.dtype('float32'), np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -12806,7 +12822,7 @@ if (!__Pyx_RefNanny) { * 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.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} + * np.dtype('float32'), np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} * cdef set numeric_types = int_types.union(float_types).union(int_mixed_types) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 38, __pyx_L1_error) @@ -12845,148 +12861,158 @@ if (!__Pyx_RefNanny) { /* "pyreadstat/_readstat_writer.pyx":39 * 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.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} # <<<<<<<<<<<<<< + * np.dtype('float32'), np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} # <<<<<<<<<<<<<< * 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} */ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_pd); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_Int64Dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UInt32Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Int64Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UInt64Dtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UInt32Dtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PySet_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_pd); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PySet_Add(__pyx_t_12, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - if (PySet_Add(__pyx_t_12, __pyx_t_7) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_UInt64Dtype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PySet_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PySet_Add(__pyx_t_13, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_7) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PySet_Add(__pyx_t_12, __pyx_t_8) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __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_12, __pyx_t_9) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __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_12, __pyx_t_10) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __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_12, __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_12, __pyx_t_5) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __pyx_t_11) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PySet_Add(__pyx_t_13, __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_12, __pyx_t_4) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __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_12, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __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_12, __pyx_t_11) < 0) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_12, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __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_12, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + if (PySet_Add(__pyx_t_13, __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_13, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PySet_Add(__pyx_t_13, __pyx_t_12) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_float_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_float_types, ((PyObject*)__pyx_t_12)); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_float_types, ((PyObject*)__pyx_t_13)); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; /* "pyreadstat/_readstat_writer.pyx":40 * cdef set float_types = {float, np.dtype('int64'), np.dtype('uint64'), np.dtype('uint32'), np.dtype('float'), - * np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} + * np.dtype('float32'), np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} * 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} * cdef set nat_types = {datetime.datetime, np.datetime64, pd._libs.tslibs.timestamps.Timestamp, datetime.time, datetime.date} */ - __pyx_t_12 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_union, __pyx_v_10pyreadstat_16_readstat_writer_int_types, __pyx_v_10pyreadstat_16_readstat_writer_float_types); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_13 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_union, __pyx_v_10pyreadstat_16_readstat_writer_int_types, __pyx_v_10pyreadstat_16_readstat_writer_float_types); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_union); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_union); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_10pyreadstat_16_readstat_writer_int_mixed_types); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_10pyreadstat_16_readstat_writer_int_mixed_types); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(PySet_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_12)->tp_name), 0))) __PYX_ERR(0, 40, __pyx_L1_error) + if (!(likely(PySet_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_13)->tp_name), 0))) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_numeric_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_numeric_types, ((PyObject*)__pyx_t_12)); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_numeric_types, ((PyObject*)__pyx_t_13)); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; /* "pyreadstat/_readstat_writer.pyx":41 - * np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} + * np.dtype('float32'), np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} * 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} # <<<<<<<<<<<<<< * 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} */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_pd); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_libs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_tslibs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_timestamps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PySet_Add(__pyx_t_6, __pyx_t_12) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_pd); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_libs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_tslibs); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_timestamps); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PySet_Add(__pyx_t_11, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + if (PySet_Add(__pyx_t_6, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PySet_Add(__pyx_t_11, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_11, __pyx_t_12) < 0) __PYX_ERR(0, 41, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PySet_Add(__pyx_t_6, __pyx_t_13) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_datetime_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_datetime_types, ((PyObject*)__pyx_t_11)); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_datetime_types, ((PyObject*)__pyx_t_6)); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; /* "pyreadstat/_readstat_writer.pyx":42 * cdef set numeric_types = int_types.union(float_types).union(int_mixed_types) @@ -12995,56 +13021,56 @@ if (!__Pyx_RefNanny) { * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME} * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME} */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_datetime); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_libs); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_tslibs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timestamps); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_pd); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_libs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tslibs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_timestamps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PySet_Add(__pyx_t_1, __pyx_t_12) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_1, __pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_12 = PySet_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PySet_Add(__pyx_t_12, __pyx_t_13) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (PySet_Add(__pyx_t_12, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PySet_Add(__pyx_t_12, __pyx_t_6) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PySet_Add(__pyx_t_12, __pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_1, __pyx_t_11) < 0) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_1, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + if (PySet_Add(__pyx_t_12, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PySet_Add(__pyx_t_1, __pyx_t_4) < 0) __PYX_ERR(0, 42, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_nat_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_nat_types, ((PyObject*)__pyx_t_1)); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_nat_types, ((PyObject*)__pyx_t_12)); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; /* "pyreadstat/_readstat_writer.pyx":43 * cdef set datetime_types = {datetime.datetime, np.datetime64, pd._libs.tslibs.timestamps.Timestamp} @@ -13053,24 +13079,24 @@ if (!__Pyx_RefNanny) { * 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, */ - __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_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, 43, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = __Pyx_PyInt_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, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PySet_Add(__pyx_t_11, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PySet_Add(__pyx_t_11, __pyx_t_4) < 0) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_11, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PySet_Add(__pyx_t_6, __pyx_t_12) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PySet_Add(__pyx_t_6, __pyx_t_3) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PySet_Add(__pyx_t_6, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_11)); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pyrwriter_datetimelike_types, ((PyObject*)__pyx_t_6)); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; /* "pyreadstat/_readstat_writer.pyx":44 * cdef set nat_types = {datetime.datetime, np.datetime64, pd._libs.tslibs.timestamps.Timestamp, datetime.time, datetime.date} @@ -13079,36 +13105,36 @@ if (!__Pyx_RefNanny) { * 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, */ - __pyx_t_11 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PySet_Add(__pyx_t_5, __pyx_t_11) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PySet_Add(__pyx_t_4, __pyx_t_6) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PySet_Add(__pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PySet_Add(__pyx_t_5, __pyx_t_12) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PySet_Add(__pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PySet_Add(__pyx_t_4, __pyx_t_12) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PySet_Add(__pyx_t_4, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PySet_Add(__pyx_t_4, __pyx_t_13) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 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_5)); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pywriter_numeric_types, ((PyObject*)__pyx_t_4)); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "pyreadstat/_readstat_writer.pyx":45 * cdef set pyrwriter_datetimelike_types = {PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME} @@ -13117,22 +13143,22 @@ if (!__Pyx_RefNanny) { * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_12, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_2, __pyx_t_12) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DOUBLE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_13, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_INTEGER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_13) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "pyreadstat/_readstat_writer.pyx":46 * cdef set pywriter_numeric_types = {PYWRITER_DOUBLE, PYWRITER_INTEGER, PYWRITER_LOGICAL, PYWRITER_DATE, PYWRITER_DATETIME, PYWRITER_TIME} @@ -13141,20 +13167,20 @@ if (!__Pyx_RefNanny) { * PYWRITER_OBJECT: READSTAT_TYPE_STRING, PYWRITER_DATE: READSTAT_TYPE_DOUBLE, * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE} */ - __pyx_t_12 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_12, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_2, __pyx_t_12) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_CHARACTER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_13, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_LOGICAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_INT32); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_13) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "pyreadstat/_readstat_writer.pyx":47 * cdef dict pandas_to_readstat_types = {PYWRITER_DOUBLE: READSTAT_TYPE_DOUBLE, PYWRITER_INTEGER: READSTAT_TYPE_INT32, @@ -13163,20 +13189,20 @@ if (!__Pyx_RefNanny) { * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE} * */ - __pyx_t_12 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_12, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_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, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_2, __pyx_t_12) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_OBJECT); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_13, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_13) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "pyreadstat/_readstat_writer.pyx":48 * PYWRITER_CHARACTER: READSTAT_TYPE_STRING, PYWRITER_LOGICAL: READSTAT_TYPE_INT32, @@ -13185,24 +13211,24 @@ if (!__Pyx_RefNanny) { * * cdef double spss_offset_secs = 12219379200 */ - __pyx_t_12 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_12, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_5, __pyx_t_2, __pyx_t_12) < 0) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_DATETIME); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_13, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From___pyx_t_10pyreadstat_16_readstat_writer_pywriter_variable_type(__pyx_e_10pyreadstat_16_readstat_writer_PYWRITER_TIME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyInt_From_readstat_type_t(READSTAT_TYPE_DOUBLE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + if (PyDict_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_13) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types, ((PyObject*)__pyx_t_5)); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_pandas_to_readstat_types, ((PyObject*)__pyx_t_4)); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "pyreadstat/_readstat_writer.pyx":50 * PYWRITER_DATETIME: READSTAT_TYPE_DOUBLE, PYWRITER_TIME: READSTAT_TYPE_DOUBLE} @@ -13247,24 +13273,24 @@ if (!__Pyx_RefNanny) { * * cdef valid_user_missing_sas = [chr(x) for x in range(ord("A"), ord("Z")+1)] + ["_"] */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_date); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_date); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XGOTREF(__pyx_v_10pyreadstat_16_readstat_writer_date_0); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_date_0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_date_0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; /* "pyreadstat/_readstat_writer.pyx":56 * cdef object date_0 = datetime.datetime(1970,1,1).date() @@ -13273,52 +13299,52 @@ if (!__Pyx_RefNanny) { * cdef valid_user_missing_stata = [chr(x) for x in range(ord("a"), ord("z")+1)] * */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyInt_From_long((90 + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyInt_From_long((90 + 1)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_65); __Pyx_GIVEREF(__pyx_int_65); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_65); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { - __pyx_t_2 = __pyx_t_12; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0; - __pyx_t_14 = NULL; + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_65); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) { + __pyx_t_1 = __pyx_t_13; __Pyx_INCREF(__pyx_t_1); __pyx_t_14 = 0; + __pyx_t_15 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_14 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 56, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break; + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_13 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_14); __Pyx_INCREF(__pyx_t_13); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); #endif } else { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_14); __Pyx_INCREF(__pyx_t_13); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) #else - __pyx_t_12 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PySequence_ITEM(__pyx_t_1, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); #endif } } else { - __pyx_t_12 = __pyx_t_14(__pyx_t_2); - if (unlikely(!__pyx_t_12)) { + __pyx_t_13 = __pyx_t_15(__pyx_t_1); + if (unlikely(!__pyx_t_13)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -13326,32 +13352,32 @@ if (!__Pyx_RefNanny) { } break; } - __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_13); } - if (PyDict_SetItem(__pyx_d, __pyx_n_s_x, __pyx_t_12) < 0) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_x); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_x, __pyx_t_13) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s__13); - __Pyx_GIVEREF(__pyx_n_s__13); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__13); - __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_n_s__14); + __Pyx_GIVEREF(__pyx_n_s__14); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__14); + __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_sas, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; /* "pyreadstat/_readstat_writer.pyx":57 * @@ -13360,52 +13386,52 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyInt_From_long((0x7A + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_long((0x7A + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_97); __Pyx_GIVEREF(__pyx_int_97); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_97); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0; - __pyx_t_14 = NULL; + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_97); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0; + __pyx_t_15 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 57, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break; + if (likely(!__pyx_t_15)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 57, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } else { - if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 57, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_5); - if (unlikely(!__pyx_t_2)) { + __pyx_t_1 = __pyx_t_15(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -13413,33 +13439,33 @@ if (!__Pyx_RefNanny) { } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); } - if (PyDict_SetItem(__pyx_d, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - __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_writer_valid_user_missing_stata); - __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_10pyreadstat_16_readstat_writer_valid_user_missing_stata, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; /* "pyreadstat/_readstat_writer.pyx":1 * # cython: c_string_type=unicode, c_string_encoding=utf8, language_level=2 # <<<<<<<<<<<<<< * # ###cython: profile=True * # ############################################################################# */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_12 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_12) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /*--- Wrapped vars code ---*/ @@ -13457,6 +13483,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pyreadstat._readstat_writer", __pyx_clineno, __pyx_lineno, __pyx_filename); diff --git a/pyreadstat/_readstat_writer.pyx b/pyreadstat/_readstat_writer.pyx index 56b3261..451fb39 100644 --- a/pyreadstat/_readstat_writer.pyx +++ b/pyreadstat/_readstat_writer.pyx @@ -36,7 +36,7 @@ cdef set int_types = {int, np.dtype('int32'), np.dtype('int16'), np.dtype('int8' 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.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} + np.dtype('float32'), np.int64, np.uint64, np.uint32, np.float, pd.Int64Dtype(), pd.UInt32Dtype(), pd.UInt64Dtype()} 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} cdef set nat_types = {datetime.datetime, np.datetime64, pd._libs.tslibs.timestamps.Timestamp, datetime.time, datetime.date} @@ -197,7 +197,6 @@ cdef list get_pandas_column_types(object df, dict missing_user_values): # 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: From dfce04e39d26925bed2da8f1facd83349722b2e4 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Fri, 4 Dec 2020 18:03:22 +0100 Subject: [PATCH 5/7] updated to Readstat commit 8aec75529193bc125fc66f68f23d97be5b61cae6 fixes reading por date-like columns. Version bumped --- README.md | 10 ++++------ change_log.md | 5 +++++ docs/_build/doctrees/environment.pickle | Bin 15276 -> 15276 bytes docs/_build/html/.buildinfo | 2 +- .../html/_static/documentation_options.js | 2 +- docs/_build/html/genindex.html | 2 +- docs/_build/html/index.html | 2 +- docs/_build/html/py-modindex.html | 2 +- docs/_build/html/search.html | 2 +- docs/conf.py | 2 +- pyreadstat/__init__.py | 2 +- setup.py | 2 +- src/spss/readstat_por_read.c | 12 ++++++++++-- tests/test_basic.py | 15 ++++----------- 14 files changed, 32 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 58687b6..145b252 100644 --- a/README.md +++ b/README.md @@ -747,10 +747,6 @@ user defined missing values in stata/sas where characters (a to z, A to Z, \_) w pyreadstat builds on top of Readstat and therefore inherits its limitations. Currently those include: -* XPT files v8 with labels are not read correctly (see [here](/~https://github.com/WizardMac/ReadStat/issues/208)) -* Cannot read sas7bdat dataset labels (see [here](/~https://github.com/WizardMac/ReadStat/issues/180)) -* Dates, datetimes and times in SPSS POR files are not translated to python dates, datetimes and times, but stay as - timestamps. (see [here](/~https://github.com/WizardMac/ReadStat/issues/160)) * Cannot write SAS sas7bdat. Those files can be written but not read in SAS and therefore are not supported in pyreadstat. (see [here](/~https://github.com/WizardMac/ReadStat/issues/98)) @@ -765,7 +761,7 @@ Converting data types from foreign applications into python some times also brin OverflowError: date value out of range ``` - The workarounds to deal with this include using the keyword argument disable_datetime_conversion so that you will + The workaround is to deal with this include using the keyword argument disable_datetime_conversion so that you will get numbers instead of datetime objects or skipping reading such columns with the argument usecols. ## Python 2.7 support. @@ -777,8 +773,10 @@ At the moment of writing this document Python 2.7 does not work for windows. It does work for Mac and Linux. In Mac and Linux, files cannot be opened if the path contains international (non-ascii) characters. As mentioned before this bug is not going to be repaired (There is not such issue on -Python 3). +Python 3). +Starting on version 1.0.6 wheels are not produced for Python 2.7 anymore, +but you can still compile on linux and mac. ## Change log diff --git a/change_log.md b/change_log.md index 8392029..aff5792 100644 --- a/change_log.md +++ b/change_log.md @@ -1,3 +1,8 @@ +# 1.0.5 (github, pypi and conda xxx) +* Updated Readstat to version 1.1.5, this fixes: reading sas7bdat file labels, + reading newer por files date-like columns, and few others. +* Corrected writing columns with numpy.float32 format. + # 1.0.5 (github, pypi and conda 2020.11.13) * fixed sharing permissions when reading files on windows, fixes #87 diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 0c77f84335999e0b31b45fa8512fce8ca6ed17f0..3897ec46a2a1e5a1a07aa6fe8723c15826934e50 100644 GIT binary patch delta 69 zcmZ2ezNUP`c1A|C%{v%%xEReQKjpRna^!gYxPerzcs3{7r&;TKw!N5qPr->%ZSqDY Yd5+}#f=a!D$|;lO6{R;PD|$)+0A%GDNB{r; delta 80 zcmZ2ezNUP`c1A|i%{v%%xEM_*KjpRna^!gYxPerzcs3{7>&dGhUoV_|Pr*r2Tu)EG ipt2}6F{QX9u|&T-zbHGkNUxxB%4B&(tBmuFdX>+ diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo index e09ce27..43a9f32 100644 --- a/docs/_build/html/.buildinfo +++ b/docs/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 0e6aa8dad2e26ffbb7cd3a5536c8b463 +config: 91713509866076208214b3c819ac7b2d tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_build/html/_static/documentation_options.js b/docs/_build/html/_static/documentation_options.js index 8314691..42185a7 100644 --- a/docs/_build/html/_static/documentation_options.js +++ b/docs/_build/html/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '1.0.5', + VERSION: '1.0.6', LANGUAGE: 'None', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 3e3988a..0f00dce 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -7,7 +7,7 @@ - Index — pyreadstat 1.0.5 documentation + Index — pyreadstat 1.0.6 documentation diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html index d834c3e..76d5e5b 100644 --- a/docs/_build/html/index.html +++ b/docs/_build/html/index.html @@ -7,7 +7,7 @@ - Welcome to pyreadstat’s documentation! — pyreadstat 1.0.5 documentation + Welcome to pyreadstat’s documentation! — pyreadstat 1.0.6 documentation diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html index a6567f7..6669f5d 100644 --- a/docs/_build/html/py-modindex.html +++ b/docs/_build/html/py-modindex.html @@ -7,7 +7,7 @@ - Python Module Index — pyreadstat 1.0.5 documentation + Python Module Index — pyreadstat 1.0.6 documentation diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html index 842cff5..1f026d2 100644 --- a/docs/_build/html/search.html +++ b/docs/_build/html/search.html @@ -7,7 +7,7 @@ - Search — pyreadstat 1.0.5 documentation + Search — pyreadstat 1.0.6 documentation diff --git a/docs/conf.py b/docs/conf.py index cdffda8..df35cbe 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.0.5' +release = '1.0.6' # -- General configuration --------------------------------------------------- diff --git a/pyreadstat/__init__.py b/pyreadstat/__init__.py index 15b6c87..ccf4da8 100644 --- a/pyreadstat/__init__.py +++ b/pyreadstat/__init__.py @@ -20,4 +20,4 @@ from .pyreadstat import read_file_in_chunks, read_file_multiprocessing from ._readstat_parser import ReadstatError, metadata_container -__version__ = "1.0.5" +__version__ = "1.0.6" diff --git a/setup.py b/setup.py index 91b85a4..cf31231 100644 --- a/setup.py +++ b/setup.py @@ -136,7 +136,7 @@ setup( name='pyreadstat', - version='1.0.5', + version='1.0.6', description=short_description, author="Otto Fajardo", author_email="pleasecontactviagithub@notvalid.com", diff --git a/src/spss/readstat_por_read.c b/src/spss/readstat_por_read.c index 72a7e6a..44dc0f4 100644 --- a/src/spss/readstat_por_read.c +++ b/src/spss/readstat_por_read.c @@ -24,7 +24,8 @@ #define POR_LINE_LENGTH 80 #define POR_LABEL_NAME_PREFIX "labels" -#define MAX_FORMAT_TYPE 120 +#define POR_FORMAT_SHIFT 82 +#define MAX_FORMAT_TYPE (POR_FORMAT_SHIFT+SPSS_FORMAT_TYPE_YMDHMS) #define MAX_FORMAT_WIDTH 20000 #define MAX_FORMAT_DECIMALS 100 #define MAX_STRING_LENGTH 20000 @@ -337,7 +338,14 @@ static readstat_error_t read_variable_record(por_ctx_t *ctx) { if ((retval = read_integer_in_range(ctx, 0, MAX_FORMAT_TYPE, &value)) != READSTAT_OK) { goto cleanup; } - format->type = value; + if (value > POR_FORMAT_SHIFT) { + // Some files in the wild have their format types shifted by 82 for date/time values + // I have no idea why, but see test files linked from: + // /~https://github.com/WizardMac/ReadStat/issues/158 + format->type = value - POR_FORMAT_SHIFT; + } else { + format->type = value; + } if ((retval = read_integer_in_range(ctx, 0, MAX_FORMAT_WIDTH, &value)) != READSTAT_OK) { goto cleanup; diff --git a/tests/test_basic.py b/tests/test_basic.py index b1341c0..3bb91ba 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -440,10 +440,8 @@ def test_zsav_chunks(self): def test_por(self): df, meta = pyreadstat.read_por(os.path.join(self.basic_data_folder, "sample.por")) - # dates, datetimes and timestamps are not translated but stay as integers, let's just drop them - df_pandas_por = self.df_pandas.drop(labels=["dtime", "mydate", "mytime"], axis=1) + df_pandas_por = self.df_pandas.copy() df.columns = [x.lower() for x in df.columns] - df = df.drop(labels=["dtime", "mydate", "mytime"], axis=1) self.assertTrue(df.equals(df_pandas_por)) self.assertTrue(meta.number_columns == len(self.df_pandas.columns)) self.assertTrue(meta.number_rows == len(df_pandas_por)) @@ -451,10 +449,8 @@ def test_por(self): def test_por_formatted(self): df, meta = pyreadstat.read_por(os.path.join(self.basic_data_folder, "sample.por"), apply_value_formats=True, formats_as_category=True) - # dates, datetimes and timestamps are not translated but stay as integers, let's just drop them - df_pandas_por = self.df_pandas_formatted.drop(labels=["dtime", "mydate", "mytime"], axis=1) + df_pandas_por = self.df_pandas_formatted.copy() df.columns = [x.lower() for x in df.columns] - df = df.drop(labels=["dtime", "mydate", "mytime"], axis=1) self.assertTrue(df.equals(df_pandas_por)) self.assertTrue(meta.number_columns == len(self.df_pandas_formatted.columns)) self.assertTrue(meta.number_rows == len(df_pandas_por)) @@ -485,11 +481,9 @@ def test_por_nodates(self): def test_por_chunks(self): df, meta = pyreadstat.read_por(os.path.join(self.basic_data_folder, "sample.por"), row_limit = 2, row_offset =1) - df_pandas = self.df_pandas.iloc[1:3,:].reset_index(drop=True) - # dates, datetimes and timestamps are not translated but stay as integers, let's just drop them - df_pandas_por = df_pandas.drop(labels=["dtime", "mydate", "mytime"], axis=1) + df_pandas_por = self.df_pandas.iloc[1:3,:].reset_index(drop=True) + df_pandas_por.loc[:, 'dtime'] = pd.to_datetime(df_pandas_por.dtime) df.columns = [x.lower() for x in df.columns] - df = df.drop(labels=["dtime", "mydate", "mytime"], axis=1) self.assertTrue(df.equals(df_pandas_por)) self.assertTrue(meta.number_columns == len(self.df_pandas.columns)) self.assertTrue(meta.number_rows == len(df_pandas_por)) @@ -778,7 +772,6 @@ def test_por_write_basic(self): pyreadstat.write_por(self.df_pandas, path, file_label=file_label, column_labels=col_labels) #, note=file_note) df, meta = pyreadstat.read_por(path) df.columns = [x.lower() for x in df.columns] - self.assertTrue(df.equals(self.df_pandas)) self.assertEqual(meta.file_label, file_label) self.assertListEqual(meta.column_labels, col_labels) From b6dc8bd5b00a3e55cf1f889463e27c42deea2787 Mon Sep 17 00:00:00 2001 From: Otto Fajardo Date: Thu, 10 Dec 2020 18:07:52 +0100 Subject: [PATCH 6/7] updated readstat source to 1.1.5 release candidate 1 --- src/sas/readstat_sas.c | 28 +++++++++++++++++++++------- src/sas/readstat_sas7bdat_read.c | 2 +- src/spss/readstat_sav_read.c | 6 +++--- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/sas/readstat_sas.c b/src/sas/readstat_sas.c index 3c43e0b..e894a8e 100644 --- a/src/sas/readstat_sas.c +++ b/src/sas/readstat_sas.c @@ -35,6 +35,7 @@ unsigned char sas7bcat_magic_number[32] = { /* This table is cobbled together from extant files and: * https://support.sas.com/documentation/cdl/en/nlsref/61893/HTML/default/viewer.htm#a002607278.htm + * https://support.sas.com/documentation/onlinedoc/dfdmstudio/2.6/dmpdmsug/Content/dfU_Encodings_SAS.html * * Discrepancies form the official documentation are noted with a comment. It * appears that in some instances that SAS software uses a newer encoding than @@ -56,13 +57,25 @@ static readstat_charset_entry_t _charset_table[] = { { .code = 37, .name = "ISO-8859-9" }, { .code = 39, .name = "ISO-8859-11" }, { .code = 40, .name = "ISO-8859-15" }, - { .code = 43, .name = "CP437" }, - { .code = 44, .name = "CP850" }, - { .code = 45, .name = "CP852" }, - { .code = 46, .name = "CP858" }, - { .code = 47, .name = "CP862" }, - { .code = 51, .name = "CP866" }, - { .code = 58, .name = "CP857" }, + { .code = 41, .name = "CP437" }, + { .code = 42, .name = "CP850" }, + { .code = 43, .name = "CP852" }, + { .code = 44, .name = "CP857" }, + { .code = 45, .name = "CP858" }, + { .code = 46, .name = "CP862" }, + { .code = 47, .name = "CP864" }, + { .code = 48, .name = "CP865" }, + { .code = 49, .name = "CP866" }, + { .code = 50, .name = "CP869" }, + { .code = 51, .name = "CP874" }, + { .code = 52, .name = "CP921" }, + { .code = 53, .name = "CP922" }, + { .code = 54, .name = "CP1129" }, + { .code = 55, .name = "CP720" }, + { .code = 56, .name = "CP737" }, + { .code = 57, .name = "CP775" }, + { .code = 58, .name = "CP860" }, + { .code = 59, .name = "CP863" }, { .code = 60, .name = "WINDOWS-1250" }, { .code = 61, .name = "WINDOWS-1251" }, { .code = 62, .name = "WINDOWS-1252" }, @@ -99,6 +112,7 @@ static readstat_charset_entry_t _charset_table[] = { { .code = 172, .name = "ISO-2022-CN-EXT" }, { .code = 204, .name = SAS_DEFAULT_STRING_ENCODING }, // "any" in SAS { .code = 205, .name = "GB18030" }, + { .code = 227, .name = "ISO-8859-14" }, { .code = 242, .name = "ISO-8859-13" }, { .code = 245, .name = "MACCROATIAN" }, { .code = 246, .name = "MACCYRILLIC" }, diff --git a/src/sas/readstat_sas7bdat_read.c b/src/sas/readstat_sas7bdat_read.c index 259edd1..b7ff18c 100644 --- a/src/sas/readstat_sas7bdat_read.c +++ b/src/sas/readstat_sas7bdat_read.c @@ -973,7 +973,7 @@ static readstat_error_t sas7bdat_parse_page_pass2(const char *page, size_t page_ * some files created by Stat/Transfer don't. So verify that the * padding is { 0, 0, 0, 0 } or { ' ', ' ', ' ', ' ' } (or that * the file is not from Stat/Transfer) before skipping it */ - if ((shp-page)%8 == 4 && + if ((shp-page)%8 == 4 && shp + 4 <= page + page_size && (*(uint32_t *)shp == 0x00000000 || *(uint32_t *)shp == 0x20202020 || ctx->vendor != READSTAT_VENDOR_STAT_TRANSFER)) { diff --git a/src/spss/readstat_sav_read.c b/src/spss/readstat_sav_read.c index a9e1545..9504156 100644 --- a/src/spss/readstat_sav_read.c +++ b/src/spss/readstat_sav_read.c @@ -790,7 +790,7 @@ static readstat_error_t sav_read_data(sav_ctx_t *ctx) { if (retval != READSTAT_OK) goto done; - if (ctx->record_count != -1 && ctx->current_row != ctx->row_limit) { + if (ctx->record_count >= 0 && ctx->current_row != ctx->row_limit) { retval = READSTAT_ERROR_ROW_COUNT_MISMATCH; } @@ -1593,7 +1593,7 @@ readstat_error_t readstat_parse_sav(readstat_parser_t *parser, const char *path, ctx->file_size = file_size; if (parser->row_offset > 0) ctx->row_offset = parser->row_offset; - if (ctx->record_count != -1) { + if (ctx->record_count >= 0) { int record_count_after_skipping = ctx->record_count - ctx->row_offset; if (record_count_after_skipping < 0) { record_count_after_skipping = 0; @@ -1632,7 +1632,7 @@ readstat_error_t readstat_parse_sav(readstat_parser_t *parser, const char *path, if (ctx->handle.metadata) { readstat_metadata_t metadata = { - .row_count = ctx->record_count == -1 ? -1 : ctx->row_limit, + .row_count = ctx->record_count < 0 ? -1 : ctx->row_limit, .var_count = ctx->var_count, .file_encoding = ctx->input_encoding, .file_format_version = ctx->format_version, From cc05f7832a45851e8671ca74a068f8f12d09aaa0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 17:17:31 +0100 Subject: [PATCH 7/7] updated Readstat src to release 1.15, commit 69f55186ae615a14a3367ad5cd08b7829aa8f308 --- change_log.md | 2 +- docs/_build/doctrees/environment.pickle | Bin 15276 -> 15263 bytes docs/_build/doctrees/index.doctree | Bin 184296 -> 184521 bytes docs/_build/html/_sources/index.rst.txt | 1 + docs/_build/html/index.html | 1 + docs/index.rst | 1 + src/CKHashTable.c | 276 +++++++++++++++++------- src/CKHashTable.h | 22 +- src/spss/readstat_por.c | 2 +- src/spss/readstat_sav_write.c | 2 +- 10 files changed, 216 insertions(+), 91 deletions(-) diff --git a/change_log.md b/change_log.md index aff5792..2ce822b 100644 --- a/change_log.md +++ b/change_log.md @@ -1,4 +1,4 @@ -# 1.0.5 (github, pypi and conda xxx) +# 1.0.6 (github, pypi and conda 2020.12.17) * Updated Readstat to version 1.1.5, this fixes: reading sas7bdat file labels, reading newer por files date-like columns, and few others. * Corrected writing columns with numpy.float32 format. diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 3897ec46a2a1e5a1a07aa6fe8723c15826934e50..192573536aef741e7ec9340423d9bf94a13af872 100644 GIT binary patch delta 2775 zcmcImZA@EL7;d3ZpiGuXLQz;LIA}+qA3(b@;-;c=8VQjsG24*z<8JLqKk$BR>(*I^ z5mLR;E$`*8#ve2OFq&qG#z2t8@xv{~7-RMamrNHnqmnE!nrSq?=iFO*K}hJ2{dvwg z?|IL2-uJoZocDfo>b+B@*G#iY!8Fxc5wl&MZ5^uIakj!>IQYbkKWUhMnh%+%8xq{8O z;vjR_%C(8OAWpp32%oKV!gv*peF{7#P zTPKl5G~&^`-Y9PaBSb`f7*;uWdHyG delta 2799 zcmcImeN0x%aj7(QOI+WB;6U z&pG%0?m54E-#zcGk>exggXY(cO`8wZR;V_IyD`B>cuwLQo3s;0Yx{~ejTIIY?7rjM zb8o!&;QMFbOGi&B^}MXP)drX@v|EF*_~_2~s0LNeM{amUQmuj*j3^;Kq>;CAB6%04 zob?tqd8JMlBu3GO~ z#1Qyh?S0fuKBeL$6{{$e07pJUO<_MrJ*1H@boG_4zSh+@u)5=>6wOsFEqv zLuIk4swK`Pcv035LoLB!Lf|EBNKi_qWbEIq8HZys7M zFRQpapNi@2!EfWE#b?L|l29vzPb@Ao{As8{PEpZpzwFcrYxVP)X4d#<>nmD1! zn@ikd`M?;9&VFb6@_|ShF|H|bxRF|QpBNH?yyW1-kVEDI5q_Vft=+;a&yY0zLpqpG zS!sgHZ*k`moXiKtNKTgEXYzrF7%_4Q&ih#?AoOKX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x(US|6o4Nq(b10XtK^h&|Lu;bVkmZ_)C_tX&5Qx_dXPiY={`so_T{al6&x1T8gSpoUI{bYv>JtAn# zNv^{Pl3b4;)YyHF32Ur%huicdal18cZ3pCUSCDUxte8}HKo~l}0Kf;6hTd;lb%rOG@BUQCe`F21d7MaVjJ&W;t!ltiCgXB>>U0$UN$p{y7%DEg8H-5tl_T>?M7*Gs#w}X zsc3E$=xWX{q$f=`8f}Vf;w0X9OuC_kE3>$9Jh`7HP7C;Q0v&yxn?!Ih8n0WZ@^tw{ zU1o0K>PovZS*jIVEs%^BRRQy1y}VI7S&R3^wS^mxO$(J`t*!rDm2QgnS0O9-0-cuq zx~d#cb!JfC2{Z;kR>*;T&F!5*Gq)IGYjduPJ4R$<=b0T z{C-Av;$+-xHky+aC`B!9Le4~L31iBMjZV9}mQ|vbh4jpxl%6V*=a8kHAnUa>=+b9& zC-f9fHxdsm2&w`R)xgt2x}k<^?VaLG42hTV_pxz(A>G`JOE{`JS&rwRA84j3B)z)S zs854UNTgbx#0}}`>VBNfOHU|v+Koy3DLu9drP@&L%+5_3#e-nQ2XVU^N7es`YmkPoZ_O5)?a60$ zV7@Js+${cs12HE6d)n1DmPw?!-wP#a zl&bYTW$j*hWHV=yiKiI(CBMO=t*O(FPzwHn=&_!V${!q^_^DU?o1IwrTSR z`I*(S_`Zfd%HKyTNo6K^1`Qo|(vR1{fk<9WKb{V|O?J~bm9C@w!R17xaw?TP4cfQ^<(U5wrQ|CrME7XvLY=2PQ@Wl8aIwF zHEK1eE|e5Q>Y8il@F%|C2mN{e!mR{dMcmn%gr2s5Metadata Object Description + Copyright (c) 2012 Daniel J. Bernstein + + To the extent possible under law, the author(s) have dedicated all copyright + and related and neighboring rights to this software to the public domain + worldwide. This software is distributed without any warranty. + + You should have received a copy of the CC0 Public Domain Dedication along with + this software. If not, see . + */ +#include #include #include +typedef uint64_t u64; +typedef uint32_t u32; +typedef uint8_t u8; -int ck_str_n_hash_insert(const char *key, size_t keylen, const void *value, ck_hash_table_t *table); -const void *ck_str_n_hash_lookup(const char *key, size_t keylen, ck_hash_table_t *table); -static inline void ck_float2str(float key, char keystr[6]); -static inline void ck_double2str(double key, char keystr[11]); -inline uint64_t ck_hash_str(const char *str) -{ - uint64_t hash = 5381; - int c; - - while ((c = *str++)) - hash = ((hash << 5) + hash) + c; - - return hash; -} +#define ROTL(x,b) (u64)( ((x) << (b)) | ( (x) >> (64 - (b))) ) -static inline void ck_float2str(float key, char keystr[6]) { - memcpy(keystr, &key, 4); - keystr[4] = (0xF0 | (keystr[0] & 0x01) | (keystr[1] & 0x02) | (keystr[2] & 0x04) | (keystr[3] & 0x08)); - keystr[0] |= 0x01; - keystr[1] |= 0x02; - keystr[2] |= 0x04; - keystr[3] |= 0x08; +#define U32TO8_LE(p, v) \ +(p)[0] = (u8)((v) ); (p)[1] = (u8)((v) >> 8); \ +(p)[2] = (u8)((v) >> 16); (p)[3] = (u8)((v) >> 24); + +#define U64TO8_LE(p, v) \ +U32TO8_LE((p), (u32)((v) )); \ +U32TO8_LE((p) + 4, (u32)((v) >> 32)); + +#define U8TO64_LE(p) \ +(((u64)((p)[0]) ) | \ +((u64)((p)[1]) << 8) | \ +((u64)((p)[2]) << 16) | \ +((u64)((p)[3]) << 24) | \ +((u64)((p)[4]) << 32) | \ +((u64)((p)[5]) << 40) | \ +((u64)((p)[6]) << 48) | \ +((u64)((p)[7]) << 56)) + +#define SIPROUND \ +do { \ +v0 += v1; v1=ROTL(v1,13); v1 ^= v0; v0=ROTL(v0,32); \ +v2 += v3; v3=ROTL(v3,16); v3 ^= v2; \ +v0 += v3; v3=ROTL(v3,21); v3 ^= v0; \ +v2 += v1; v1=ROTL(v1,17); v1 ^= v2; v2=ROTL(v2,32); \ +} while(0) + +/* SipHash-1-2 */ +static int siphash( unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *k ) +{ + /* "somepseudorandomlygeneratedbytes" */ + u64 v0 = 0x736f6d6570736575ULL; + u64 v1 = 0x646f72616e646f6dULL; + u64 v2 = 0x6c7967656e657261ULL; + u64 v3 = 0x7465646279746573ULL; + u64 b; + u64 k0 = U8TO64_LE( k ); + u64 k1 = U8TO64_LE( k + 8 ); + u64 m; + const u8 *end = in + inlen - ( inlen % sizeof( u64 ) ); + const int left = inlen & 7; + b = ( ( u64 )inlen ) << 56; + v3 ^= k1; + v2 ^= k0; + v1 ^= k1; + v0 ^= k0; - keystr[5] = 0x00; -} + for ( ; in != end; in += 8 ) + { + m = U8TO64_LE( in ); + + v3 ^= m; + + SIPROUND; + + v0 ^= m; + } + + switch( left ) + { + case 7: b |= ( ( u64 )in[ 6] ) << 48; + + case 6: b |= ( ( u64 )in[ 5] ) << 40; + + case 5: b |= ( ( u64 )in[ 4] ) << 32; + + case 4: b |= ( ( u64 )in[ 3] ) << 24; + + case 3: b |= ( ( u64 )in[ 2] ) << 16; + + case 2: b |= ( ( u64 )in[ 1] ) << 8; + + case 1: b |= ( ( u64 )in[ 0] ); break; + + case 0: break; + } -static inline void ck_double2str(double key, char keystr[11]) { - memcpy(keystr, &key, 8); - keystr[8] = (0xF0 | (keystr[0] & 0x01) | (keystr[1] & 0x02) | (keystr[2] & 0x04) | (keystr[3] & 0x08)); - keystr[0] |= 0x01; - keystr[1] |= 0x02; - keystr[2] |= 0x04; - keystr[3] |= 0x08; + v3 ^= b; + + SIPROUND; - keystr[9] = (0xF0 | (keystr[4] & 0x01) | (keystr[5] & 0x02) | (keystr[6] & 0x04) | (keystr[7] & 0x08)); - keystr[4] |= 0x01; - keystr[5] |= 0x02; - keystr[6] |= 0x04; - keystr[7] |= 0x08; + v0 ^= b; + v2 ^= 0xff; - keystr[10] = 0x00; + SIPROUND; + SIPROUND; + + b = v0 ^ v1 ^ v2 ^ v3; + U64TO8_LE( out, b ); + return 0; +} + +static uint64_t ck_hash_str(const char *str, size_t keylen) +{ + uint64_t hash; + unsigned char k[16] = { 0 }; + siphash((unsigned char *)&hash, (const unsigned char *)str, keylen, k); + return hash; } const void *ck_float_hash_lookup(float key, ck_hash_table_t *table) { - char keystr[6]; - ck_float2str(key, keystr); - return ck_str_n_hash_lookup(keystr, 5, table); + return ck_str_n_hash_lookup((const char *)&key, sizeof(float), table); } int ck_float_hash_insert(float key, const void *value, ck_hash_table_t *table) { - char keystr[6]; - ck_float2str(key, keystr); - return ck_str_n_hash_insert(keystr, 5, value, table); + return ck_str_n_hash_insert((const char *)&key, sizeof(float), value, table); } const void *ck_double_hash_lookup(double key, ck_hash_table_t *table) { - char keystr[11]; - ck_double2str(key, keystr); - return ck_str_n_hash_lookup(keystr, 10, table); + return ck_str_n_hash_lookup((const char *)&key, sizeof(double), table); } int ck_double_hash_insert(double key, const void *value, ck_hash_table_t *table) { - char keystr[11]; - ck_double2str(key, keystr); - return ck_str_n_hash_insert(keystr, 10, value, table); + return ck_str_n_hash_insert((const char *)&key, sizeof(double), value, table); } const void *ck_str_hash_lookup(const char *key, ck_hash_table_t *table) { size_t keylen = strlen(key); - if (keylen >= CK_HASH_KEY_SIZE) - keylen = CK_HASH_KEY_SIZE-1; return ck_str_n_hash_lookup(key, keylen, table); } @@ -87,36 +153,65 @@ const void *ck_str_n_hash_lookup(const char *key, size_t keylen, ck_hash_table_t if (table->count == 0) return NULL; - if (keylen == 0 || keylen >= CK_HASH_KEY_SIZE) + if (keylen == 0) return NULL; - uint64_t hash_key = ck_hash_str(key); + uint64_t hash_key = ck_hash_str(key, keylen); hash_key %= table->capacity; - uint64_t end = (hash_key - 1) % table->capacity; - while (hash_key != end && table->entries[hash_key].key[0] != '\0') { - if (strncmp(table->entries[hash_key].key, key, keylen + 1) == 0) { + uint64_t end = hash_key; + do { + char *this_key = &table->keys[table->entries[hash_key].key_offset]; + size_t this_keylen = table->entries[hash_key].key_length; + if (this_keylen == 0) + return NULL; + if (this_keylen == keylen && memcmp(this_key, key, keylen) == 0) { return table->entries[hash_key].value; } hash_key++; hash_key %= table->capacity; - } + } while (hash_key != end); return NULL; } int ck_str_hash_insert(const char *key, const void *value, ck_hash_table_t *table) { size_t keylen = strlen(key); - if (keylen >= CK_HASH_KEY_SIZE) - keylen = CK_HASH_KEY_SIZE-1; return ck_str_n_hash_insert(key, keylen, value, table); } +static int ck_hash_insert_nocopy(off_t key_offset, size_t keylen, uint64_t hash_key, + const void *value, ck_hash_table_t *table) +{ + if (table->capacity == 0) + return 0; + + hash_key %= table->capacity; + uint64_t end = (hash_key + table->capacity - 1) % table->capacity; + while (hash_key != end) { + ck_hash_entry_t *entry = &table->entries[hash_key]; + if (table->entries[hash_key].key_length == 0) { + table->count++; + entry->key_offset = key_offset; + entry->key_length = keylen; + entry->value = value; + return 1; + } else if (entry->key_length == keylen && + entry->key_offset == key_offset) { + entry->value = value; + return 1; + } + hash_key++; + hash_key %= table->capacity; + } + return 0; +} + int ck_str_n_hash_insert(const char *key, size_t keylen, const void *value, ck_hash_table_t *table) { if (table->capacity == 0) return 0; - if (keylen == 0 || keylen >= CK_HASH_KEY_SIZE) + if (keylen == 0) return 0; if (table->count >= 0.75 * table->capacity) { @@ -125,48 +220,69 @@ int ck_str_n_hash_insert(const char *key, size_t keylen, const void *value, ck_h } } - uint64_t hash_key = ck_hash_str(key); + uint64_t hash_key = ck_hash_str(key, keylen); hash_key %= table->capacity; - uint64_t end = hash_key ? ((hash_key - 1) % table->capacity) : (table->capacity -1); - while (hash_key != end) { - if (table->entries[hash_key].key[0] == '\0') { + uint64_t end = hash_key; + do { + ck_hash_entry_t *entry = &table->entries[hash_key]; + char *this_key = &table->keys[entry->key_offset]; + if (entry->key_length == 0) { table->count++; - } - if (table->entries[hash_key].key[0] == '\0' || - strncmp(table->entries[hash_key].key, key, keylen + 1) == 0) { - memcpy(table->entries[hash_key].key, key, keylen); - memset(table->entries[hash_key].key + keylen, 0, 1); + while (table->keys_used + keylen > table->keys_capacity) { + table->keys_capacity *= 2; + table->keys = realloc(table->keys, table->keys_capacity); + } + memcpy(table->keys + table->keys_used, key, keylen); + entry->key_offset = table->keys_used; + entry->key_length = keylen; + table->keys_used += keylen; + entry->value = value; + return 1; + } else if (entry->key_length == keylen && + memcmp(this_key, key, keylen) == 0) { table->entries[hash_key].value = value; return 1; } hash_key++; hash_key %= table->capacity; - } + } while (hash_key != end); return 0; } -ck_hash_table_t *ck_hash_table_init(size_t size) +ck_hash_table_t *ck_hash_table_init(size_t num_entries, size_t mean_key_length) { ck_hash_table_t *table; if ((table = malloc(sizeof(ck_hash_table_t))) == NULL) return NULL; - size *= 2; - if ((table->entries = malloc(size * sizeof(ck_hash_entry_t))) == NULL) { + + if ((table->keys = malloc(num_entries * mean_key_length)) == NULL) { free(table); return NULL; } - table->capacity = size; - table->count = 0; + table->keys_capacity = num_entries * mean_key_length; + + num_entries *= 2; + + if ((table->entries = malloc(num_entries * sizeof(ck_hash_entry_t))) == NULL) { + free(table->keys); + free(table); + return NULL; + } + table->capacity = num_entries; ck_hash_table_wipe(table); return table; } void ck_hash_table_free(ck_hash_table_t *table) { free(table->entries); + if (table->keys) + free(table->keys); free(table); } void ck_hash_table_wipe(ck_hash_table_t *table) { + table->keys_used = 0; + table->count = 0; memset(table->entries, 0, table->capacity * sizeof(ck_hash_entry_t)); } @@ -174,15 +290,17 @@ int ck_hash_table_grow(ck_hash_table_t *table) { ck_hash_entry_t *old_entries = table->entries; uint64_t old_capacity = table->capacity; uint64_t new_capacity = 2 * table->capacity; - int i; if ((table->entries = calloc(new_capacity, sizeof(ck_hash_entry_t))) == NULL) { return -1; } table->capacity = new_capacity; table->count = 0; - for (i=0; ikeys[old_entries[i].key_offset]; + uint64_t hash_key = ck_hash_str(this_key, old_entries[i].key_length); + if (!ck_hash_insert_nocopy(old_entries[i].key_offset, old_entries[i].key_length, + hash_key, old_entries[i].value, table)) return -1; } } diff --git a/src/CKHashTable.h b/src/CKHashTable.h index 81ea714..337f678 100644 --- a/src/CKHashTable.h +++ b/src/CKHashTable.h @@ -1,33 +1,37 @@ // CKHashTable - A simple hash table -// Copyright 2010 Evan Miller (see LICENSE) +// Copyright 2010-2020 Evan Miller (see LICENSE) -#include #include - -#define CK_HASH_KEY_SIZE 128 +#include typedef struct ck_hash_entry_s { - char key[CK_HASH_KEY_SIZE]; + off_t key_offset; + size_t key_length; const void *value; } ck_hash_entry_t; typedef struct ck_hash_table_s { - uint64_t capacity; - uint64_t count; + size_t capacity; + size_t count; ck_hash_entry_t *entries; + char *keys; + size_t keys_used; + size_t keys_capacity; } ck_hash_table_t; int ck_str_hash_insert(const char *key, const void *value, ck_hash_table_t *table); const void *ck_str_hash_lookup(const char *key, ck_hash_table_t *table); +int ck_str_n_hash_insert(const char *key, size_t keylen, const void *value, ck_hash_table_t *table); +const void *ck_str_n_hash_lookup(const char *key, size_t keylen, ck_hash_table_t *table); + int ck_float_hash_insert(float key, const void *value, ck_hash_table_t *table); const void *ck_float_hash_lookup(float key, ck_hash_table_t *table); int ck_double_hash_insert(double key, const void *value, ck_hash_table_t *table); const void *ck_double_hash_lookup(double key, ck_hash_table_t *table); -ck_hash_table_t *ck_hash_table_init(size_t size); +ck_hash_table_t *ck_hash_table_init(size_t num_entries, size_t mean_key_length); void ck_hash_table_wipe(ck_hash_table_t *table); int ck_hash_table_grow(ck_hash_table_t *table); void ck_hash_table_free(ck_hash_table_t *table); -uint64_t ck_hash_str(const char *str); diff --git a/src/spss/readstat_por.c b/src/spss/readstat_por.c index e922358..9c04702 100644 --- a/src/spss/readstat_por.c +++ b/src/spss/readstat_por.c @@ -69,7 +69,7 @@ por_ctx_t *por_ctx_init() { ctx->space = ' '; ctx->base30_precision = 20; - ctx->var_dict = ck_hash_table_init(1024); + ctx->var_dict = ck_hash_table_init(1024, 8); return ctx; } diff --git a/src/spss/readstat_sav_write.c b/src/spss/readstat_sav_write.c index 1888da0..af088b5 100644 --- a/src/spss/readstat_sav_write.c +++ b/src/spss/readstat_sav_write.c @@ -1292,7 +1292,7 @@ static readstat_error_t sav_variable_ok(const readstat_variable_t *variable) { static sav_varnames_t *sav_varnames_init(readstat_writer_t *writer) { sav_varnames_t *varnames = calloc(writer->variables_count, sizeof(sav_varnames_t)); - ck_hash_table_t *table = ck_hash_table_init(writer->variables_count); + ck_hash_table_t *table = ck_hash_table_init(writer->variables_count, 8); int i, k; for (i=0; ivariables_count; i++) { readstat_variable_t *r_variable = readstat_get_variable(writer, i);